Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable extension developer setting in Chrome automatically in dev mode #137

Closed
aklinker1 opened this issue Sep 30, 2023 · 3 comments · Fixed by #384
Closed

Enable extension developer setting in Chrome automatically in dev mode #137

aklinker1 opened this issue Sep 30, 2023 · 3 comments · Fixed by #384
Assignees
Labels
feature upstream Issue related to an upstream library

Comments

@aklinker1
Copy link
Collaborator

Feature Request

When running wxt to develop and extension, it's really annoying to have to enable developer mode every time to inspect the different JS contexts of your extension. We should be able to enable it automatically via CLI flags? I assume the switch is just a preference that we can control via CLI flags.

Is your feature request related to a bug?

#135

What are the alternatives?

N/A

Additional context

Also a problem with Edge, so we should add the setting to edge and other chromium browsers as well. Hopefully they're all the same internal preference...

@aklinker1
Copy link
Collaborator Author

This doesn't seem possible. But you can enable it for all profiles, including new ones that WXT creates during dev mode:

https://stackoverflow.com/questions/32280949/enable-developer-mode-extension-for-chrome-browser-using-cmd#answer-32284345

@aklinker1
Copy link
Collaborator Author

aklinker1 commented Sep 30, 2023

I kept looking into this, and it is possible, but it's blocked by GoogleChrome/chrome-launcher#323.

web-ext allows passing a custom chromeLaunch option, which I can use to apply custom prefs.

runner = await webExt.default.cmd.run(finalConfig, options);

https://github.com/mozilla/web-ext/blob/a83f4c55a8fe0d2323d2d17ffbfa1754ec32f49c/src/extension-runners/chromium.js#L43

import { launch } from 'chrome-launcher';

await webExt.default.cmd.run({
  ...finalConfig,
  chromiumLaunch: (options) => launch({ ...options, prefs: { ... } }),
}, options); 

@aklinker1 aklinker1 reopened this Sep 30, 2023
@aklinker1 aklinker1 self-assigned this Sep 30, 2023
@aklinker1 aklinker1 added this to the DX Improvements milestone Oct 2, 2023
@aklinker1
Copy link
Collaborator Author

Can't pass the custom chromiumLaunch into the JS API... Need to wait for web-ext to add support, or add the feature to my fork. I'd rather contribute this to web-ext though.

mozilla/web-ext#2899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature upstream Issue related to an upstream library
Projects
None yet
1 participant