开发者

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

开发者 https://www.devze.com 2022-12-19 09:56 出处:网络
I want to help my friend open a website in a new incognito windo开发者_如何学Cw when he performs some mouse gestures (custom stroke in Mouse Stroke - Chrome Extension).Chrome extensions with the tabs

I want to help my friend open a website in a new incognito windo开发者_如何学Cw when he performs some mouse gestures (custom stroke in Mouse Stroke - Chrome Extension).


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).


windows.create still works for me given I use it from the background script.

0

精彩评论

暂无评论...
验证码 换一张
取 消