Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open new incognito window with Javascript? (Google Chrome)

I want to help my friend open a website in a new incognito window when he performs some mouse gestures (custom stroke in Mouse Stroke - Chrome Extension).

like image 996
Dois Avatar asked Feb 09 '10 09:02

Dois


People also ask

How do I open a new incognito window in Chrome?

New Incognito Window. Windows, Linux, or Chrome OS: Press Ctrl + Shift + n. Mac: Press ⌘ + Shift + n.

Can you set Chrome to automatically open incognito?

Right-click on your Google Chrome shortcut and select Properties. Then locate the Target box, and add -incognito to its end. Save the changes and restart Chrome.

How do I open an incognito page in HTML?

The easiest way to open an Incognito window is with the keyboard shortcut combination Ctrl-Shift-N (Windows) or Command-Shift-N (macOS).


1 Answers

Chrome extensions with the tabs permission can use the chrome.windows.create method:

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

However, to access it, you'll either need to write your own extension or find an existing one which provides a suitable hook (I don't know whether this can be done with "Mouse Stroke"—I'm too scared to look).

like image 187
eggyal Avatar answered Oct 06 '22 06:10

eggyal