在Firefox中,我可以寫一段JavaScript代碼(並將其分配給書籤)來更改about:config參數嗎?在Firefox中修改about:config參數
0
A
回答
1
不,你不能。使用您在單擊書籤時查看的網頁的特權運行Bookmarklets,並且網頁無法更改用戶首選項...
0
您不能因上下文而使書籤欄和菜單處於,但也許你想看看'自定義按鈕:'https://addons.mozilla.org/en-US/firefox/addon/custom-buttons/
它運行在'鉻'上下文作爲一個XUL覆蓋,因此可以訪問about:config設置。
下面是一個例子腳本我作出改變「回退字符編碼」時在HTML頭部中指定爲「SHIFT_JIS」的日本沒有編碼:
(主代碼標籤)
/* toggle between SHIFT_JIS and 'default for locale' character encoding. */
var prefsManager = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var defaultCharEncoding = prefsManager.getCharPref("intl.charset.fallback.override");
if (defaultCharEncoding !== "Shift_JIS") {
/* change button icon to the hiragana 'あ'. Originally I had a base64 encoded PNG here. */
document.querySelector('toolbarbutton#custombuttons-button1.toolbarbutton-1.chromeclass-toolbar-additional').image="file:///path/to/icon/a-jp1.svg";
prefsManager.setCharPref("intl.charset.fallback.override","Shift_JIS");
} else {
/* can't use clearUserPref() on the default branch */
prefs = prefsManager.getBranch("intl.charset.fallback.");
/* set button icon to the letter 'a'. Originally I had a base64 encoded PNG here. */
document.querySelector('toolbarbutton#custombuttons-button1.toolbarbutton-1.chromeclass-toolbar-additional').image="file:///path/to/icon/a-en1.svg";
/* reset the 'intl.charset.fallback.override' entry to it's default (blank) */
prefs.clearUserPref("override");
}
請注意,我爲seamonkey做了這個,因此查詢選擇器可能會有所不同。這裏的一切都絕對適用於Firefox。該插件與seamonkey,firefox和thunderbird一起使用。
相關問題
- 1. Firefox擴展修改about:config首選項
- 2. 使用Javascript修改about:config中的用戶Firefox
- 3. Firefox的about:config for Safari
- 4. 使imacros使用about:config的Firefox
- 5. 如何以編程方式更改Firefox中的about:config dom.max_script_run_time值?
- 6. 修改Servlet參數
- 7. 修改參數不參考
- 8. 修改Firefox擴展
- 9. 在Kohana中修改url參數3.3
- 10. 在Rails中修改參數哈希值
- 11. 在Firefox中修改HTTP響應標頭
- 12. 正在Firefox中修改foreignObject Spinner
- 13. sed:修改函數參數
- 14. 覆蓋Firefox的不安全的警告與about:config中
- 15. 空吸來修改參數
- 16. DataTable.Net修改stateSave參數?
- 17. 修改Sling請求參數
- 18. 非法修改的參數
- 19. scanf後修改參數
- 20. 無法修改url參數
- 21. Perl如何修改參數
- 22. C#修改某個參數
- 23. 修改參數的值
- 24. 修改功能參數
- 25. C#+ COM,修改參數
- 26. Firefox的基本修改
- 27. 修改參照
- 28. 修改多個參數中狄奧
- 29. 修改ggmcmc圖中的家族參數
- 30. 修改r筆記本中的參數