extension.js icon indicating copy to clipboard operation
extension.js copied to clipboard

Pass command line arguments to browser

Open jonocodes opened this issue 7 months ago • 2 comments

For example I would like to pass a start/opening url to firefox.

When I try to pass an argument it looks like this:

npx extension dev --browser=firefox -- "https://en.wikipedia.org/" ►►► Downloading extension... URL https://en.wikipedia.org/ ►►► Unpackaging browser extension... PATH /home/jono/src/savr/ff-two/David_Bowie ERROR in Extension.js ✖︎✖︎✖︎ Failed to download or extract ZIP file. Error: ADM-ZIP: Invalid or unsupported zip format. No END header found at Object.INVALID_FORMAT (/home/jono/src/savr/ff-two/node_modules/adm-zip/util/errors.js:56:16) ...

jonocodes avatar Apr 22 '25 16:04 jonocodes

you can try

npx extension dev --browser=firefox --starting-url="https://en.wikipedia.org/"

or via extension.config.js

/** @type {import('extension').FileConfig} */
module.exports = {
  browser: {
    chrome: {
      startingUrl: 'https://en.wikipedia.org/'
    }
  }
}

cezaraugusto avatar Apr 24 '25 02:04 cezaraugusto

you can try

npx extension dev --browser=firefox --starting-url="https://en.wikipedia.org/"

Interestingly this printed

npx extension dev --browser=firefox --starting-url="https://en.wikipedia.org/"

 🧩 Extension.js 2.0.0-rc.23
    Extension Name         JJ Proxy Extension
    Extension Version      1.0
    Extension ID           jj-proxy-extension@extension-js

►►► Using own starting URL https://en.wikipedia.org/.

but it then opened firefox without that url. just the blank start page.

jonocodes avatar Apr 29 '25 17:04 jonocodes