browser/base/content/test/general/offlineByDefault.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/test/general/offlineByDefault.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,17 @@
     1.4 +var offlineByDefault = {
     1.5 +  defaultValue: false,
     1.6 +  prefBranch: SpecialPowers.Cc["@mozilla.org/preferences-service;1"].getService(SpecialPowers.Ci.nsIPrefBranch),
     1.7 +  set: function(allow) {
     1.8 +    try {
     1.9 +      this.defaultValue = this.prefBranch.getBoolPref("offline-apps.allow_by_default");
    1.10 +    } catch (e) {
    1.11 +      this.defaultValue = false
    1.12 +    }
    1.13 +    this.prefBranch.setBoolPref("offline-apps.allow_by_default", allow);
    1.14 +  },
    1.15 +  reset: function() {
    1.16 +    this.prefBranch.setBoolPref("offline-apps.allow_by_default", this.defaultValue);
    1.17 +  }
    1.18 +}
    1.19 +
    1.20 +offlineByDefault.set(false);

mercurial