toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/bootstrap.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 Components.utils.import("resource://gre/modules/Services.jsm");
     3 // Test steps chain from pref observers on *_reason,
     4 // so always set that last
     5 function install(data, reason) {
     6   Components.utils.import(data.resourceURI.spec + "version.jsm");
     7   Services.prefs.setIntPref("bootstraptest.installed_version", VERSION);
     8   Services.prefs.setIntPref("bootstraptest.install_oldversion", data.oldVersion);
     9   Components.utils.unload(data.resourceURI.spec + "version.jsm");
    10   Services.prefs.setIntPref("bootstraptest.install_reason", reason);
    11 }
    13 function startup(data, reason) {
    14   Components.utils.reportError("bootstrap startup");
    15   Components.utils.import(data.resourceURI.spec + "version.jsm");
    16   Services.prefs.setIntPref("bootstraptest.active_version", VERSION);
    17   Services.prefs.setIntPref("bootstraptest.startup_oldversion", data.oldVersion);
    18   Components.utils.unload(data.resourceURI.spec + "version.jsm");
    19   Services.prefs.setIntPref("bootstraptest.startup_reason", reason);
    20 }
    22 function shutdown(data, reason) {
    23   Services.prefs.setIntPref("bootstraptest.active_version", 0);
    24   Services.prefs.setIntPref("bootstraptest.shutdown_newversion", data.newVersion);
    25   Services.prefs.setIntPref("bootstraptest.shutdown_reason", reason);
    26 }
    28 function uninstall(data, reason) {
    29   Services.prefs.setIntPref("bootstraptest.installed_version", 0);
    30   Services.prefs.setIntPref("bootstraptest.uninstall_newversion", data.newVersion);
    31   Services.prefs.setIntPref("bootstraptest.uninstall_reason", reason);
    32 }

mercurial