summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/general/offlineByDefault.js
blob: 72f7e52a01bcc8c9225c331f80d53fc9c39a651a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var offlineByDefault = {
  defaultValue: false,
  prefBranch: SpecialPowers.Cc["@mozilla.org/preferences-service;1"].getService(SpecialPowers.Ci.nsIPrefBranch),
  set: function(allow) {
    try {
      this.defaultValue = this.prefBranch.getBoolPref("offline-apps.allow_by_default");
    } catch (e) {
      this.defaultValue = false
    }
    this.prefBranch.setBoolPref("offline-apps.allow_by_default", allow);
  },
  reset: function() {
    this.prefBranch.setBoolPref("offline-apps.allow_by_default", this.defaultValue);
  }
}

offlineByDefault.set(false);