有没有办法通过 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
oroptions_page
key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, withinchrome://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/