[英]Open Firefox extension preferences dialog from Add-ons dialog
我想要的很簡單——我想要一個能夠打開正常的“首選項”對話框並突出顯示我的擴展的首選項窗格。 我本來以為
<em:optionsURL>javascript:openPreferences("my_pref_pane");</em:optionsURL>
會做到的,但事實並非如此。 我也想過
<em:optionsURL>chrome://myapp/browser/options.xul</em:optionsURL>
, options.xul 具有 <script>javascript:openPreferences("my_pref_pane"); window.close(); </script>,會這樣做,但 Firefox 只是在結果彈出窗口 window 中顯示腳本並拒絕執行它。 如何強制 Firefox 不假設我想彈出一些自定義配置對話框而只使用我已經編寫的主要首選項?
(為什么不存在任何有用的文檔?</rhetoricalQuestion>)
這將導致 Firefox 打開插件管理器到您的 OWN 插件的插件頁面。
var am = require("sdk/preferences/utils");
var self = require("sdk/self");
// Open the add-on manager with the preference page for this add-on.
am.open(self);
// Returns a promise that resolves once the tab is open.
歸功於freaktechnic和他的要點。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.