如何用Javascript打开新的隐身窗口? (谷歌浏览器) [英] How to open new incognito window with Javascript? (Google Chrome)

查看:1174
本文介绍了如何用Javascript打开新的隐身窗口? (谷歌浏览器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想帮助我的朋友在执行一些鼠标手势(鼠标笔画 - Chrome扩展程序中的自定义笔划)时在新的隐身窗口中打开网站。 解决方案

使用标签权限的Chrome扩展程序可以使用 chrome.windows.create 方法:

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

然而,要访问它,您需要编写自己的扩展或找到现有的扩展它提供了一个合适的钩子(我不知道这是否可以用鼠标笔画完成 - 我太害怕看)。

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

解决方案

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

这篇关于如何用Javascript打开新的隐身窗口? (谷歌浏览器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆