javascript - 以编程方式打开 Chrome 插件的 options.html 页面?

标签 javascript google-chrome google-chrome-extension

有没有办法通过 background.html 中的 Javascript 打开 Google Chrome 插件的 options.html 页面?

最佳答案

有一个新的方法被启用beginning with Chrome 42 :

chrome.runtime.openOptionsPage(function callback)

Open your Extension's options page, if possible.

The precise behavior may depend on your manifest's options_ui or options_page key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload.

If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set lastError.

关于javascript - 以编程方式打开 Chrome 插件的 options.html 页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6782391/

相关文章:

css - Chrome 中带有 css 缩放 iframe 的模糊文本

javascript - 尝试 fadeToggle() 单个 div 中的图像数组不起作用

php - JS <---> PHP 通讯

javascript - 需要帮助使 JS 函数更加动态

javascript - 在javascript中获取总秒数

javascript - chrome 调试器对象数据不一致

google-chrome - CSS3多重背景?

javascript - 使用 javascript 加载页面后,如何删除以前的历史状态?

javascript - 通过 chrome 扩展在外部网页上填写表格

javascript - Chrome 扩展程序阻止 <select> 元素展开