13

As a sysadmin, I frequently want to open internal web apps in incognito mode, for a variety of reasons that have nothing to do with privacy. To use a different set of credentials, perhaps. Or to prevent cross-contamination between two sessions with the same app. Or ... well, you get it, we're all running complex systems.

I would love to be able to make a link open in an incognito tab or window (ideally in all browsers, but primarily in Opera). Something like:

<a target="_incognito" href="https://were.hunting.wabbits.com">Qwiet</a>

Or:

<a href="javascript:OpenInIncognito('https://were.hunting.wabbits.com');">Qwiet</a>

Or, worst case, make a bookmark do that.

Every discussion I can find of this boils down to "You shouldn't want to do that because ... privacy!". But, of course, this isn't a privacy use case, and I really couldn't care less if a forensic investigator can find out I've been accessing these web apps. It's part of my job, after all. I just want some isolation, and I'd like to do it without opening a variety of different browsers or using multiple machines or VMs.

Ross Patterson
  • 256
  • 1
  • 2
  • 8

3 Answers3

9

You may achieve that with the JavaScript function windows.create(), it accepts an optional incognito parameter, see MDN web docs:

incognito
Whether the new window should be an incognito (private) window. Note that if you specify incognito and tabId, the ID must refer to a private tab — that is, you can't move a non-private tab to a private window.

Example: windows.create({"url": url, "incognito": true});

Check Browser compatibility.

Edit:

Sorry, but above Solution won't work in a web page, as the windows object is not available there. It may only work for browser extensions.

LarS
  • 235
  • 1
  • 3
  • 9
  • 1
    Does this work from a web page? – Rahatur Mar 28 '18 at 03:16
  • The Webpage needs to implement above code, i.e. for the click event on a link. Ne normal link behavior needs to be disabled in that cases. – LarS Mar 28 '18 at 05:48
  • 1
    An extension/add-on is required to run the above code right? Because I think content pages has got no permission to execute the windows API directly? – Rahatur Mar 28 '18 at 08:12
  • @Rahatur You are right, I was not aware that the windows object is not accessible/available on a web page. When I posted the answer I haven't had time to test it. Now I wanted to implement it (i.e. `Test`), but found that it don't work – as you said. I get the error "ReferenceError: windows is not defined". – LarS Apr 01 '18 at 16:47
3

According to this stackoverflow answer it is impossible

https://stackoverflow.com/a/16148152/6820123

And because you don't want it because of privacy reasons, this is the reason why browsers have no such function. Browsers are made for the masses and there is a bit security and privacy way more important than a insecure function for a very special use case.

Quanten
  • 125
  • 6
  • 4
    Meh. Until browsers automatically use Tor for incognito mode, the "privacy" offered is just an illusion. We're so far past "_don't store cookies and history_" it isn't funny. Facebook, Amazon, Home Depot, _et al._ track you by IP address. – Ross Patterson Nov 21 '16 at 16:24
  • @RossPatterson Ironically, a tab can erase your back button history and entirely replace it. – Dragas Aug 10 '23 at 15:01
  • @quanten To be fair, the answer had been provided in 2013. Given the speed of web's evolution it's only natural to keep asking "can we do x yet". – Dragas Aug 10 '23 at 15:03
3

You could create a desktop shortcut and use the -incognito flag and the web address to get it done, as per the following page:

https://www.tekrevue.com/tip/incognito-mode-shortcut/

This is a bit worse than the "worst case" you outlined, but if you'll be testing the same pages repeatedly, it might not be so bad.

thegrapesoda
  • 116
  • 3