[Pkg-mozext-commits] [nosquint] 20/47: Import of 2.0.5 release into git

David Prévot taffit at moszumanska.debian.org
Tue Apr 28 01:41:17 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 2.1.6
in repository nosquint.

commit 03e35aac0a44e2af3be1b26e264a528d5f2ebacf
Author: Jason Tackaberry <tack at urandom.ca>
Date:   Fri Jan 13 19:41:14 2012 -0500

    Import of 2.0.5 release into git
---
 src/content/browser.js               |  4 ++-
 src/content/interfaces.js            | 68 +++++++++++++++++++++++++++---------
 src/content/lib.js                   | 12 ++++---
 src/defaults/preferences/nosquint.js |  2 +-
 src/install.rdf                      |  4 +--
 5 files changed, 65 insertions(+), 25 deletions(-)

diff --git a/src/content/browser.js b/src/content/browser.js
index a1a52fc..c98dc47 100644
--- a/src/content/browser.js
+++ b/src/content/browser.js
@@ -316,6 +316,8 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
         browser.setUserData('nosquint', userData, null);
 
         browser.addEventListener('DOMFrameContentLoaded', function(event) {
+            if (!event.target.contentWindow)
+                return;
             var styler = NSQ.browser.getDocumentStyler(browser, event.target.contentWindow.document);
             styler();
             browser.getUserData('nosquint').stylers.push(styler);
@@ -400,7 +402,7 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
     this.getCSSFromStyle = function(style) {
         var css = '';
         if (style.colorText || style.colorBackground || style.colorBackgroundImages) {
-            css += 'body,p,div,span,center,blockquote,h1,h2,h3,h4,h5,table,tr,th,td,iframe,a,b,i {';
+            css += 'body,p,div,span,font,ul,li,center,blockquote,h1,h2,h3,h4,h5,table,tr,th,td,iframe,a,b,i {';
             if (style.colorText)
                 css += 'color: ' + style.colorText + ' !important;';
             if (style.colorBackground)
diff --git a/src/content/interfaces.js b/src/content/interfaces.js
index 4f0900f..49c7c5d 100644
--- a/src/content/interfaces.js
+++ b/src/content/interfaces.js
@@ -12,6 +12,9 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
      */
     var stateFlag = is30() ? Components.interfaces.nsIWebProgressListener.STATE_STOP
                            : Components.interfaces.nsIWebProgressListener.STATE_TRANSFERRING;
+    /* XXX: if we use STATE_STOP, the move-tab-between-windows kludge below stops
+     * working.
+     */
     //var stateFlag = Components.interfaces.nsIWebProgressListener.STATE_STOP;
 
     /* Listener used to receive notifications when a new URI is about to be loaded.
@@ -68,6 +71,8 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
              * onStateChange the way styling is currently hooked.
              * XXX: 3.6 private browsing mode exhibits some problems, so zooming
              * is back in onStateChange.
+             * https://support.mozilla.com/en-US/forum/1/563849
+             * https://bugzilla.mozilla.org/show_bug.cgi?id=526828
              */
             NSQ.browser.zoom(this.browser);
 
@@ -103,7 +108,18 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
             } else if (state & stateFlag) {
                 if (!this.zoomApplied) {
                     this.zoomApplied = true;
-                    NSQ.browser.zoom(this.browser);
+                    if (NSQ.browser.observer.inPrivateBrowsing) {
+                        /* In private browsing mode, Firefox does not honor
+                         * siteSpecific=false and resets the zoom level back to
+                         * 100% after every page load (bug #526828).  So we
+                         * must resort to this retarded hack, queuing a zoom in
+                         * 100ms.  This seems to work ok empirically, but a race
+                         * is theoretically possible. *grmbl*
+                         */
+                        var b = this.browser;
+                        setTimeout(function() NSQ.browser.zoom(b), 100);
+                    } else
+                        NSQ.browser.zoom(this.browser);
                 }
                 if (!this.styleApplied) {
                     if (!isChrome(this.browser) || isImage(this.browser))
@@ -186,7 +202,13 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
         _hook: function() {
             this._os.addObserver(this, "private-browsing", false);  
             this._os.addObserver(this, "quit-application-granted", false);  
-            this._os.addObserver(this, "em-action-requested", false);  
+            if (is30() || is36())
+                this._os.addObserver(this, "em-action-requested", false);  
+            else {
+                Components.utils.import("resource://gre/modules/AddonManager.jsm");
+                AddonManager.addAddonListener(this);
+            }
+
             try {  
                 var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]  
                                   .getService(Components.interfaces.nsIPrivateBrowsingService);  
@@ -194,6 +216,7 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
             } catch(ex) {  
                 // ignore exceptions in older versions of Firefox  
             }
+
             this._hooked = true;
         },
 
@@ -203,6 +226,28 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
             this._hooked = false;
         },
 
+        onDisabling: function(addon, needsRestart) {
+            if (addon.id != 'nosquint at urandom.ca' || NSQ.storage.disabled)
+                return;
+
+            NSQ.storage.disabled = true;
+            if (popup('confirm', NSQ.strings.disableTitle, NSQ.strings.disablePrompt) == 1) {
+                // Clicked no
+            } else
+                NSQ.prefs.setSiteSpecific(true);
+        },
+
+        onUninstalling: function(addon, needsRestart) {
+            return this.onDisabling(addon, needsRestart);
+        },
+
+        onOperationCancelled: function(addon) {
+            if (addon.id != 'nosquint at urandom.ca' || NSQ.storage.disabled != true)
+                return;
+            NSQ.prefs.setSiteSpecific(false);
+            NSQ.storage.disabled = false;
+        },
+
         observe: function (subject, topic, data) {  
             switch (topic) {
                 case "private-browsing":
@@ -230,23 +275,14 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
                     switch (data) {
                         case "item-disabled":
                         case "item-uninstalled":
-                            var item = subject.QueryInterface(Components.interfaces.nsIUpdateItem);
-                            if (item.id != 'nosquint at urandom.ca' || NSQ.storage.disabled)
-                                break;
-
-                            NSQ.storage.disabled = true;
-                            if (popup('confirm', NSQ.strings.disableTitle, NSQ.strings.disablePrompt) == 1) {
-                                // Clicked no
-                            } else
-                                NSQ.prefs.setSiteSpecific(true);
+                            var addon = subject.QueryInterface(Components.interfaces.nsIUpdateItem);
+                            this.onDisabling(addon, true);
                             break;
                         
                         case "item-cancel-action":
-                            var item = subject.QueryInterface(Components.interfaces.nsIUpdateItem);
-                            if (item.id != 'nosquint at urandom.ca' || NSQ.storage.disabled != true)
-                                break;
-                            NSQ.prefs.setSiteSpecific(false);
-                            NSQ.storage.disabled = false;
+                            var addon = subject.QueryInterface(Components.interfaces.nsIUpdateItem);
+                            this.onOperationCancelled(addon);
+                            break;
                     }
                     break;
             }
diff --git a/src/content/lib.js b/src/content/lib.js
index d577b02..127f283 100644
--- a/src/content/lib.js
+++ b/src/content/lib.js
@@ -6,8 +6,7 @@
      * exists once, and is referenced for each window.  (In contrast, doing
      * Application.storage.set('foo', [1,2]) will store a copy of the list.)
      */
-    var extstorage = Application.extensions.get('nosquint at urandom.ca').storage;
-    this.storage = extstorage.get('global', null);
+    this.storage = Application.storage.get('nosquint-global', null);
     if (this.storage === null) {
         // Initialize global defaults.
         this.storage = {
@@ -16,16 +15,19 @@
             origSiteSpecific: null,
             dialogs: {}
         };
-        extstorage.set('global', this.storage);
+        Application.storage.set('nosquint-global', this.storage);
     }
 
-
     this.is30 = function() {
         return Application.version.substr(0, 4) == '3.0.';
     };
 
     this.is36 = function() {
-        return Application.version.substr(0, 4) >=  '3.6.';
+        return Application.version.substr(0, 4) == '3.6.';
+    };
+
+    this.is40 = function() {
+        return Application.version.substr(0, 4) >= '4.0.';
     };
 
     this.$ = function(id, doc) {
diff --git a/src/defaults/preferences/nosquint.js b/src/defaults/preferences/nosquint.js
index a67cf00..2ff5105 100644
--- a/src/defaults/preferences/nosquint.js
+++ b/src/defaults/preferences/nosquint.js
@@ -5,7 +5,7 @@ pref("extensions.nosquint.rememberSites", true);
 pref("extensions.nosquint.sites", "");
 pref("extensions.nosquint.sitesSaveDelay", 5000);
 pref("extensions.nosquint.exceptions", "*/~* *.sourceforge.net *.google.[*]");
-pref("extensions.nosquint.zoomImages", true);
+pref("extensions.nosquint.zoomImages", false);
 pref("extensions.nosquint.wheelZoomEnabled", true);
 pref("extensions.nosquint.wheelZoomInvert", false);
 pref("extensions.nosquint.hideStatus", false);
diff --git a/src/install.rdf b/src/install.rdf
index a98ab84..e01c311 100644
--- a/src/install.rdf
+++ b/src/install.rdf
@@ -6,7 +6,7 @@
     
         <em:id>nosquint at urandom.ca</em:id>
         <em:name>NoSquint</em:name>
-        <em:version>2.0.4</em:version>
+        <em:version>2.0.5</em:version>
         <em:description>Manage site-specific zoom levels and color settings</em:description>
         <em:creator>Jason Tackaberry</em:creator>
         <!-- optional items -->
@@ -20,7 +20,7 @@
             <Description>
                 <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                 <em:minVersion>3.0b4pre</em:minVersion>
-                <em:maxVersion>3.7a1pre</em:maxVersion>
+                <em:maxVersion>4.0b1</em:maxVersion>
             </Description>
         </em:targetApplication>
     </Description>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nosquint.git



More information about the Pkg-mozext-commits mailing list