[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 93/483: Make sure "no adblock plus installed" warning displays correctly
David Prévot
taffit at moszumanska.debian.org
Thu Jan 22 21:41:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.
commit a521cfeaf2f772138487465b73fa82886e8bfd3c
Author: Wladimir Palant <trev at gtchat.de>
Date: Fri Sep 14 10:40:52 2007 +0000
Make sure "no adblock plus installed" warning displays correctly
--HG--
extra : convert_revision : svn%3Ad8bf93c1-8190-44a8-bb31-1ea94378a4df/trunk%40799
---
chrome.manifest | 4 +++
chrome/content/contents.rdf | 6 +++-
chrome/content/overlay.js | 68 ++-------------------------------------------
3 files changed, 12 insertions(+), 66 deletions(-)
diff --git a/chrome.manifest b/chrome.manifest
index 6119a41..89f04c4 100644
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -1,4 +1,8 @@
overlay chrome://adblockplus/content/overlayGeneral.xul chrome://elemhidehelper/content/overlay.xul
+overlay chrome://browser/content/browser.xul chrome://elemhidehelper/content/overlayBasic.xul
+overlay chrome://navigator/content/navigator.xul chrome://elemhidehelper/content/overlayBasic.xul
+overlay chrome://messenger/content/mailWindowOverlay.xul chrome://elemhidehelper/content/overlayBasic.xul
+overlay chrome://rubberducky/content/xul/mainwin.xul chrome://elemhidehelper/content/overlayBasic.xul
content elemhidehelper jar:chrome/elemhidehelper.jar!/content/
skin elemhidehelper classic/1.0 jar:chrome/elemhidehelper.jar!/skin/classic/
locale elemhidehelper {{LOCALE}} jar:chrome/elemhidehelper.jar!/locale/{{LOCALE}}/
diff --git a/chrome/content/contents.rdf b/chrome/content/contents.rdf
index b9251b3..9b04657 100644
--- a/chrome/content/contents.rdf
+++ b/chrome/content/contents.rdf
@@ -23,13 +23,17 @@
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://navigator/content/navigator.xul"/>
<RDF:li resource="chrome://messenger/content/mailWindowOverlay.xul"/>
+ <RDF:li resource="chrome://adblockplus/content/overlayGeneral.xul"/>
</RDF:Seq>
<!-- overlay children -->
<RDF:Seq about="chrome://navigator/content/navigator.xul">
- <RDF:li>chrome://elemhidehelper/content/overlay.xul</RDF:li>
+ <RDF:li>chrome://elemhidehelper/content/overlayBasic.xul</RDF:li>
</RDF:Seq>
<RDF:Seq about="chrome://messenger/content/mailWindowOverlay.xul">
+ <RDF:li>chrome://elemhidehelper/content/overlayBasic.xul</RDF:li>
+ </RDF:Seq>
+ <RDF:Seq about="chrome://adblockplus/content/overlayGeneral.xul">
<RDF:li>chrome://elemhidehelper/content/overlay.xul</RDF:li>
</RDF:Seq>
</RDF:RDF>
diff --git a/chrome/content/overlay.js b/chrome/content/overlay.js
index 0101128..d0d2b79 100644
--- a/chrome/content/overlay.js
+++ b/chrome/content/overlay.js
@@ -22,75 +22,13 @@
*
* ***** END LICENSE BLOCK ***** */
-window.addEventListener("load", ehhInit, false);
-
-function ehhInit() {
+// This will be called from overlayBasic - only if Adblock Plus is installed
+// and the version is correct
+function ehhInit2() {
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var branch = prefService.getBranch("extensions.adblockplus.");
- // Check whether ABP is installed and has at least the required version
- var requiredVersion = "0.7.5";
- var installedVersion = "0";
- try {
- var abp = Components.classes["@mozilla.org/adblockplus;1"]
- .createInstance().wrappedJSObject;
- installedVersion = abp.getInstalledVersion();
- } catch(e) {}
-
- var parts1 = requiredVersion.split(".");
- var parts2 = installedVersion.split(".");
- var mustUpdate = false;
- for (var i = 0; i < parts1.length; i++) {
- if (parts2.length <= i || parseInt(parts1[i]) > parseInt(parts2[i])) {
- mustUpdate = true;
- break;
- }
- if (parseInt(parts1[i]) < parseInt(parts2[i]))
- break;
- }
-
- // Show warning about required ABP update if necessary
- if (mustUpdate) {
- var noWarning = {value: false};
- try {
- noWarning.value = branch.getBoolPref("ehh.norequirementswarning");
- } catch(e) {}
-
- if (!noWarning.value) {
- // Make sure we don't show the warning twice
- var hiddenWnd = Components.classes["@mozilla.org/appshell/appShellService;1"]
- .getService(Components.interfaces.nsIAppShellService)
- .hiddenDOMWindow;
- if ("ehhNoRequirementsWarning" in hiddenWnd)
- noWarning.value = true;
- else
- hiddenWnd.ehhNoRequirementsWarning = true;
- }
-
- if (!noWarning.value) {
- setTimeout(function() {
- var stringService = Components.classes["@mozilla.org/intl/stringbundle;1"]
- .getService(Components.interfaces.nsIStringBundleService);
- var strings = stringService.createBundle("chrome://elemhidehelper/locale/global.properties");
- var promptService = Components.classes['@mozilla.org/embedcomp/prompt-service;1']
- .getService(Components.interfaces.nsIPromptService);
- promptService.alertCheck(window,
- strings.GetStringFromName("noabp_warning_title"),
- strings.formatStringFromName("noabp_warning_text", [requiredVersion], 1),
- strings.GetStringFromName("noabp_warning_disable"),
- noWarning);
-
- if (noWarning.value) {
- try {
- branch.setBoolPref("ehh.norequirementswarning", true);
- } catch(e) {}
- }
- }, 0);
- }
- return;
- }
-
if (document.getElementById("abp-status-popup"))
document.getElementById("abp-status-popup").addEventListener("popupshowing", ehhFillPopup, false);
if (document.getElementById("abp-toolbar-popup"))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git
More information about the Pkg-mozext-commits
mailing list