Skip to content

Instantly share code, notes, and snippets.

@hail2u
Created April 24, 2009 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hail2u/101322 to your computer and use it in GitHub Desktop.
Save hail2u/101322 to your computer and use it in GitHub Desktop.
// Firefoxの拡張での設定の読み書き
// <script type="application/x-javascript" src="chrome://global/content/nsUserSettings.js"/>
var stringPref = nsPreferences.copyUnicharPref("extensions.example.string", "test");
nsPreferences.setUnicharPref("extensions.example.string", stringPref);
var booleanPref = getBoolPref("extensions.example.boolean", true);
setBoolPref("extensions.example.boolean", booleanPref);
var integerPerf = getIntPref("extensions.example.integer", 123);
setIntPref("extensions.example.integer", integerPerf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment