mozilla / web-ext

A command line tool to help build, run, and test web extensions
Mozilla Public License 2.0
2.64k stars 335 forks source link

Develop in two Chromium browsers simultaneously (e.g. Chrome and Brave) #1723

Open kumar303 opened 4 years ago

kumar303 commented 4 years ago

Is this a feature request or a bug?

feature

What is the current behavior?

A command like this ends in an error:

web-ext --verbose run \
  -t chromium \
  --chromium-binary /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  -t chromium \
  --chromium-binary /Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser

...
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
    at validateString (internal/validators.js:125:11)
    at normalizeSpawnArguments (child_process.js:399:3)
    at Launcher.spawn (child_process.js:532:38)
    at Launcher.<anonymous> (/Users/kumar/dev/web-ext/node_modules/chrome-launcher/src/chrome-launcher.ts:242:27)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/kumar/dev/web-ext/node_modules/chrome-launcher/dist/chrome-launcher.js:9:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)

[program.js][error] Error code: ERR_INVALID_ARG_TYPE

What is the expected or desired behavior?

This command should launch both Chrome and Brave and support auto-reloading in both.

Version information (for bug reports)

node --version && npm --version && web-ext --version
v10.15.3
6.11.3
master-e315c932777b09ed992003f384ec90abe649a0d6 (near the 3.2.0 release)

The log has this in it:

[extension-runners/chromium.js][debug] Starting Chromium instance...
[extension-runners/chromium.js][debug] (chromiumBinary: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome,/Applications/Brave Browser.app/Contents/MacOS/Brave Browser)

...so maybe the launching part won't be too hard.

Also see https://github.com/mozilla/web-ext/issues/1269 for running multiple versions of Firefox.

Rob--W commented 4 years ago

We could support this (at the CLI) by supporting multiple --chromium-binary (and also --firefox-binary flags). It could be by using an "array" type. but we should be careful to not repeat the same mistake as--start-url and its friends (#1707), i.e. the flag should take exactly one argument, and any repetitions need an explicit flag before the value.

kopach commented 4 years ago

take a look on this tool https://github.com/kimmobrunfeldt/concurrently.

vintprox commented 2 years ago

I think it's going quite over the scope of the web-ext. Really, try concurrently (or split terminals, as a resort).