Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 #filter substitution | 1 #filter substitution |
2 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2- skip-preprocessor-directives: t; -*- | 2 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2- skip-preprocessor-directives: t; -*- |
3 /* This Source Code Form is subject to the terms of the Mozilla Public | 3 /* This Source Code Form is subject to the terms of the Mozilla Public |
4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 let Cc = Components.classes; | 8 let Cc = Components.classes; |
9 let Ci = Components.interfaces; | 9 let Ci = Components.interfaces; |
10 let Cu = Components.utils; | 10 let Cu = Components.utils; |
(...skipping 6063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6074 let host = null; | 6074 let host = null; |
6075 if (installInfo.originatingURI) { | 6075 if (installInfo.originatingURI) { |
6076 host = installInfo.originatingURI.host; | 6076 host = installInfo.originatingURI.host; |
6077 } | 6077 } |
6078 | 6078 |
6079 let brandShortName = Strings.brand.GetStringFromName("brandShortName"); | 6079 let brandShortName = Strings.brand.GetStringFromName("brandShortName"); |
6080 let notificationName, buttons, message; | 6080 let notificationName, buttons, message; |
6081 let strings = Strings.browser; | 6081 let strings = Strings.browser; |
6082 let enabled = true; | 6082 let enabled = true; |
6083 | 6083 |
6084 // We force xpinstall.enabled to false here because of | 6084 // We always set xpinstall.enabled to false here because of |
Felix Dahlke
2015/05/22 15:03:31
s/force/always set/?
René Jeschke
2015/05/22 15:49:12
Done.
| |
6085 // https://issues.adblockplus.org/ticket/2561 | 6085 // https://issues.adblockplus.org/ticket/2561 |
6086 Services.prefs.setBoolPref("xpinstall.enabled", false); | 6086 Services.prefs.setBoolPref("xpinstall.enabled", false); |
6087 | 6087 |
6088 try { | 6088 try { |
6089 enabled = Services.prefs.getBoolPref("xpinstall.enabled"); | 6089 enabled = Services.prefs.getBoolPref("xpinstall.enabled"); |
6090 } | 6090 } |
6091 catch (e) {} | 6091 catch (e) {} |
6092 | 6092 |
6093 if (!enabled) { | 6093 if (!enabled) { |
6094 notificationName = "xpinstall-disabled"; | 6094 notificationName = "xpinstall-disabled"; |
6095 // We force xpinstall.enabled to be a locked pref here because of | 6095 // We always consider xpinstall.enabled to be a locked pref here becau se of |
Felix Dahlke
2015/05/22 15:03:31
s/force/always consider/?
René Jeschke
2015/05/22 15:49:12
Done.
| |
6096 // https://issues.adblockplus.org/ticket/2561 | 6096 // https://issues.adblockplus.org/ticket/2561 |
6097 // if (Services.prefs.prefIsLocked("xpinstall.enabled")) { | 6097 // if (Services.prefs.prefIsLocked("xpinstall.enabled")) { |
6098 if (true) { | 6098 if (true) { |
6099 message = strings.GetStringFromName("xpinstallDisabledMessageLocked" ); | 6099 message = strings.GetStringFromName("xpinstallDisabledMessageLocked" ); |
6100 buttons = []; | 6100 buttons = []; |
6101 } else { | 6101 } else { |
6102 message = strings.formatStringFromName("xpinstallDisabledMessage2", [brandShortName, host], 2); | 6102 message = strings.formatStringFromName("xpinstallDisabledMessage2", [brandShortName, host], 2); |
6103 buttons = [{ | 6103 buttons = [{ |
6104 label: strings.GetStringFromName("xpinstallDisabledButton"), | 6104 label: strings.GetStringFromName("xpinstallDisabledButton"), |
6105 callback: function editPrefs() { | 6105 callback: function editPrefs() { |
(...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7950 disabled: elt.disabled, | 7950 disabled: elt.disabled, |
7951 menu: elt instanceof Ci.nsIDOMHTMLMenuElement | 7951 menu: elt instanceof Ci.nsIDOMHTMLMenuElement |
7952 }; | 7952 }; |
7953 } | 7953 } |
7954 }, | 7954 }, |
7955 }); | 7955 }); |
7956 | 7956 |
7957 let {AdblockPlusApi} = Cu.import("chrome://adblockplus/content/Api.jsm"); | 7957 let {AdblockPlusApi} = Cu.import("chrome://adblockplus/content/Api.jsm"); |
7958 AdblockPlusApi.initCommunication(); | 7958 AdblockPlusApi.initCommunication(); |
7959 | 7959 |
LEFT | RIGHT |