firefox拡張メモ
構造
◆hogehoge.xpi ┣━□install.rdf ┗━◇chrome ┗━◆hogehoge.jar ┗━◇content ┗━◇hogehoge ┣━□contents.rdf ┣━□overlay.js ┗━□overlay.xul
設定 (preferences)
Firefox機能拡張 — 設定項目を使う
http://www.kibug.org/?page=/devnotes/firefox-ext&n...
var pref = null; try { pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); } catch (ex) { // 何か } // Boolean (getBoolPref、setBoolPref) csa = pref.getBoolPref("browser.urlbar.clickSelectsAll"); pref.setBoolPref("browser.tabs.forceHide", false); // Integer (getIntPref、setIntPref) onw = pref.getIntPref("browser.link.open_newwindow"); pref.setIntPref("network.cookie.lifetimePolicy", 2); // String (getCharPref、setCharPref) dse = pref.getCharPref("browser.search.defaultengine"); pref.setCharPref("browser.search.defaultengine", "Google"); // String (非ASCII可) str1 = pref.getComplexValue("general.useragent.extra.firefox", Components.interfaces.nsISupportsString).data; // 非ASCII & ロケールデフォルト str2 = pref.getComplexValue("intl.charset.detector", Components.interfaces.nsIPrefLocalizedString).data; // デフォルトから変更されたか pref.prefHasUserValue("foo.bar"); // 設定の消去 pref.clearUserPref("general.useragent.override");
2007年04月06日(金) 23:57:36 Modified by aqualung