Files
roytam1 7391af2bb4 import changes from tenfourfox:
- closes #624: update Readability to tip (92be8e3be)
- closes #626: M1440677 (81acd2b99)
- moar adblock hosts (f8a60dfea)
- add javascript on-off menuitem in tools (191db31e6)
- #612: M253143 M1643126 (9d3a83602)
- #612: M1224669 (819a49413)
- #628: M1663642 M1663439 (bc184b4c4)
- #628: update TLDs, pins, HSTS (16c85bb33)
2020-10-08 21:34:34 +08:00

37 lines
970 B
JavaScript

// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var jsToggle = {
get _prefBranch() {
delete this._prefBranch;
return this._prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
},
get executeJs() {
return this._prefBranch.getBoolPref("javascript.enabled");
},
set executeJs(aVal) {
this._prefBranch.setBoolPref("javascript.enabled", aVal);
return aVal;
},
updateMenu: function jsToggle_updateMenu() {
var menuItem = document.getElementById("toggle_javascript");
menuItem.setAttribute("checked", this.executeJs);
},
toggle: function jsToggle_toggle() {
this.executeJs = !this.executeJs;
}
};