以编程方式打开Chrome插件的options.html页面? [英] Programmatically open a Chrome plugin's options.html page?
本文介绍了以编程方式打开Chrome插件的options.html页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法通过background.html中的Javascript打开Google Chrome浏览器插件的options.html页面?
解决方案
chrome.tabs.create({url:options.html});
更新
从版本40开始,Chrome现在使用扩展管理页面中的新弹出选项对话框,而不是专用选项页面(已弃用)。您可以通过修改网址来达到同样的效果。
chrome.tabs.create({'url':' chrome:// extensions /?options ='+ chrome.runtime.id});
Is there a way to open a Google Chrome plugin's options.html page via Javascript in background.html?
解决方案
chrome.tabs.create({ url: "options.html" });
Update
Starting with version 40, Chrome now uses a new popup options dialog from the extension management page instead of dedicated options pages (which are being deprecated). You can still achieve the same effect with a modification to the URL.
chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id });
这篇关于以编程方式打开Chrome插件的options.html页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文