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

Firefox opened in private mode or with new instance (or both) does not execute url #275

Open
artjomkruglenkov opened this issue Jan 28, 2022 · 1 comment

Comments

@artjomkruglenkov
Copy link

Firefox launched with any combination of private / new instance arguments just opens an empty window in a correct mode, but without any url in the address bar.

MacOs Big Sur.

@fuweichin
Copy link

fuweichin commented Sep 7, 2022

The command line below, generated by await open(url, {app:{name:'firefox',arguments:['-private-window']}}), cannot open url in Private Mode with Firefox.

"C:\Program Files\Mozilla Firefox\firefox.exe" https://github.com -private-window

While this command line can

"C:\Program Files\Mozilla Firefox\firefox.exe" -private-window https://github.com

see also https://wiki.mozilla.org/Firefox/CommandLineOptions#-private-window_URL

So before the issue gets fixed, use open.openApp() instead of open() to open url in Private Mode with Firefox, but not necessary for Chrome and Edge.

let apps = [
  {
    "name": "chrome",
    "arguments": ["--incognito"]
  },
  {
    "name": "edge",
    "arguments": ["--inprivate"]
  },
  {
    name: 'firefox',
    arguments: ['-private-window']
  }
];

function openUrl(url, app){
  let pos;
  if (app.name === 'firefox' && Array.isArray(app.arguments) && (pos = app.arguments.indexOf('-private-window')) > -1) {
    let args = app.arguments.slice();
    args.splice(pos + 1, 0, url);
    return open.openApp(open.apps.firefox, {arguments: args});
  }
  return open(url, {app: app});
}

openUrl('https://github.com', apps[2]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants