DX for Chrome (devtools and browser console)
Is this a feature request or a bug?
Not completely sure but most likely a feature request as there are some limitations in Chrome which explain the differences between Firefox and Chrome mentioned below.
What is the current behavior?
When using the command web-ext run --target=chromium --browser-console --devtools --watch-files worker.js ... the DX is not ideal because the browser console and—more importantly—devtools do not open.
So, every time the extension reloads, devtools needs to be opened manually (the previously opened console is disconnected and doesn't work any longer).
What is the expected or desired behavior?
The devtools (and/or browser) console stays open or is opened every time the extension reloads (similar to how it works in Firefox).
Version information
- Chrome version: 108.0.5359.124
- Your OS and version: macOS 11.4
- Node version: 18.11.0
- web-ext version: 7.4.0
I don't know if there's a better way to do this since this issue was opened, but web-ext run can take extra arguments to pass to the binary, and chrome has a flag to open a console on tab load, so the following;
web ext run -t chromium --arg="--auto-open-devtools-for-tabs"
//background/service-worker.js browser.tabs.create({url : extension.url + 'path/to/options.html})
will give you a console mirroring the one you open from the chrome://extensions page
web ext run -t chromium --arg="--auto-open-devtools-for-tabs"
//background/service-worker.js browser.tabs.create({url : extension.url + 'path/to/options.html})
great thought. thanks for the tip!