カテゴリー
Wiki内検索
*
最近更新したページ
最新コメント
win32/guitest by stunning seo guys
FrontPage by stunning seo guys
SWIG by awesome things!
Win32/Console by stunning seo guys
FrontPage by awesome things!
Win32SDK_ICM by stunning seo guys
Win32SDK_MM by check it out
Win32SDK_process by stunning seo guys
VisualuRuby by stunning seo guys

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




スマートフォン版で見る