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

前端 未结 1 1858
时光取名叫无心
时光取名叫无心 2020-11-29 05:01

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

相关标签:
1条回答
  • 2020-11-29 05:54

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

    0 讨论(0)
提交回复
热议问题