[Pkg-mozext-commits] [nosquint] 25/47: Import of 2.0 release into git

David Prévot taffit at moszumanska.debian.org
Tue Apr 28 01:41:18 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 37d1041939b9d42c524d7a9d209bf85ed44b78f4
Author: Jason Tackaberry <tack at urandom.ca>
Date:   Fri Jan 13 19:41:14 2012 -0500

    Import of 2.0 release into git
---
 src/content/browser.js               | 117 +++++++++++-------------------
 src/content/cmd.js                   |   4 +-
 src/content/dlg-site.js              |   6 +-
 src/content/init.js                  | 101 +++++++++++---------------
 src/content/interfaces.js            | 125 ++++++--------------------------
 src/content/lib.js                   |  14 ++--
 src/content/overlay.xul              |  40 ++++++-----
 src/content/overlay_sanitize.xul     |   7 +-
 src/content/prefs.js                 |  44 +++---------
 src/content/sanitize.js              | 136 +++++++++++++++++++----------------
 src/defaults/preferences/nosquint.js |   1 +
 src/install.rdf                      |   8 +--
 src/locale/en-US/help.html           |  66 +++++++++--------
 src/locale/en-US/overlay.properties  |   2 +
 src/skin/icon-enlarge-16.png         | Bin 841 -> 3316 bytes
 src/skin/icon-enlarge-24.png         | Bin 1332 -> 3794 bytes
 src/skin/icon-reduce-16.png          | Bin 823 -> 3313 bytes
 src/skin/icon-reduce-24.png          | Bin 1266 -> 3736 bytes
 src/skin/icon-reset-16.png           | Bin 842 -> 3335 bytes
 src/skin/icon-reset-24.png           | Bin 1315 -> 3758 bytes
 src/skin/toolbar.css                 |   4 +-
 21 files changed, 268 insertions(+), 407 deletions(-)

diff --git a/src/content/browser.js b/src/content/browser.js
index c98dc47..5574395 100644
--- a/src/content/browser.js
+++ b/src/content/browser.js
@@ -10,7 +10,6 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
     var zoomAllTimer = null;             // Timer for queueZoomAll()
     var styleAllTimer = null;            // Timer for queueStyleAll()
     var updateStatusTimer = null;        // Timer for queueUpdateStatus()
-    var tooltipDirty = false;            // True if tooltip needs updating on hover
 
     this.init = function() {
         this.gBrowser = gBrowser;
@@ -54,17 +53,9 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
         gBrowser.tabContainer.addEventListener('TabClose', this.handleTabClose, false);
 
         this.zoomAll(null, true);
-        this.styleAll(null);
     };
 
     this.destroy = function() {
-        if (NSQ.storage.dialogs.site)
-            NSQ.storage.dialogs.site.die();
-
-        gBrowser.tabContainer.removeEventListener('TabOpen', this.handleTabOpen, false);
-        gBrowser.tabContainer.removeEventListener('TabSelect', this.handleTabSelect, false);
-        gBrowser.tabContainer.removeEventListener('TabClose', this.handleTabClose, false);
-        window.removeEventListener('DOMMouseScroll', this.handleMouseScroll, false); 
     };
 
 
@@ -78,7 +69,8 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
             var browser = gBrowser.selectedBrowser;
             var text = full = false;
             var increment = NSQ.prefs.zoomIncrement * (event.detail < 0 ? 1 : -1);
-            var img = isImage(browser);
+            //var img = isImage(browser);
+            var img = false;
                 
             if (NSQ.prefs.wheelZoomInvert)
                 increment *= -1;
@@ -88,8 +80,11 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
             else
                 text = Math.round((browser.markupDocumentViewer.textZoom * 100) + increment);
 
-            NSQ.browser.zoom(browser, text, full);
-            NSQ.browser.saveCurrentZoom();
+            //if (!img || !browser.getUserData('nosquint').site) {
+            if (!img) {
+                NSQ.browser.zoom(browser, text, full);
+                NSQ.browser.saveCurrentZoom();
+            }
         }
         event.stopPropagation();
         event.preventDefault();
@@ -167,53 +162,10 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
     };
 
 
-    this.updateStatusTooltip = function() {
-        if (!tooltipDirty)
-            return;
-        tooltipDirty = false;
-
-        // Get cached sitename for current browser.
-        var browser = gBrowser.selectedBrowser;
-        var site = browser.getUserData('nosquint').site;
-        var text = Math.round(browser.markupDocumentViewer.textZoom * 100);
-        var full = Math.round(browser.markupDocumentViewer.fullZoom * 100);
-
-        var e = $('nosquint-status');
-        // updateStatusTooltip() won't be called unless site is not null.
-        $('nosquint-status-tooltip-site').value = site.replace(/%20/g, ' ');
-        $('nosquint-status-tooltip-full').value = full + '%';
-        $('nosquint-status-tooltip-text').value = text + '%';
-
-        var style = this.getStyleForBrowser(browser);
-        var label = $('nosquint-status-tooltip-textcolor');
-        label.style.color = style.colorText || 'inherit';
-        label.style.backgroundColor = style.colorBackground || 'inherit';
-        label.value = (style.colorText || style.colorBackground) ? 'Sample' : 'Site Controlled';
-
-        var vis = $('nosquint-status-tooltip-vis-link');
-        var unvis = $('nosquint-status-tooltip-unvis-link');
-        unvis.value = vis.value = '';
-        vis.style.color = vis.style.textDecoration = 'inherit';
-        unvis.style.color = unvis.style.textDecoration = 'inherit';
-
-        if (!style.linksUnvisited && !style.linksVisited)
-            unvis.value = 'Site Controlled';
-        else {
-            for (let [attr, elem] in items({'linksUnvisited': unvis, 'linksVisited': vis})) {
-                if (style[attr]) {
-                    elem.value = attr.replace('links', '');
-                    elem.style.color = style[attr];
-                    elem.style.textDecoration = style.linksUnderline ? 'underline' : 'inherit';
-                }
-            }
-        }
-    };
-
     /* Updates the status panel and tooltip to reflect current site name
      * and zoom levels.
      */
     this.updateStatus = function() {
-        // Get cached sitename for current browser.
         var browser = gBrowser.selectedBrowser;
         var site = browser.getUserData('nosquint').site;
         // Disable/enable context menu item.
@@ -228,20 +180,45 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
             // Pref indicates we're hiding status panel, no sense in updating.
             return;
 
+        var text = Math.round(browser.markupDocumentViewer.textZoom * 100);
+        var full = Math.round(browser.markupDocumentViewer.fullZoom * 100);
+        var [text_default, full_default] = NSQ.prefs.getZoomDefaults();
+
         var e = $('nosquint-status');
         if (site) {
-            var text = Math.round(browser.markupDocumentViewer.textZoom * 100);
-            var full = Math.round(browser.markupDocumentViewer.fullZoom * 100);
-            var [text_default, full_default] = NSQ.prefs.getZoomDefaults();
-
             if (NSQ.prefs.fullZoomPrimary)
-                e.label = full + '%' + (text == text_default ? '' : (' / ' + text + '%'));
+                e.label = full + '%' + (text == 100 ? '' : (' / ' + text + '%'));
             else
-                e.label = text + '%' + (full == full_default ? '' : (' / ' + full + '%'));
-
+                e.label = text + '%' + (full == 100 ? '' : (' / ' + full + '%'));
+            $('nosquint-status-tooltip-site').value = site.replace(/%20/g, ' ');
+            $('nosquint-status-tooltip-full').value = full + '%';
+            $('nosquint-status-tooltip-text').value = text + '%';
+
+            var style = this.getStyleForBrowser(browser);
+            var label = $('nosquint-status-tooltip-textcolor');
+            label.style.color = style.colorText || 'inherit';
+            label.style.backgroundColor = style.colorBackground || 'inherit';
+            label.value = (style.colorText || style.colorBackground) ? 'Sample' : 'Site Controlled';
+
+            var vis = $('nosquint-status-tooltip-vis-link');
+            var unvis = $('nosquint-status-tooltip-unvis-link');
+            unvis.value = vis.value = '';
+            vis.style.color = vis.style.textDecoration = 'inherit';
+            unvis.style.color = unvis.style.textDecoration = 'inherit';
+
+            if (!style.linksUnvisited && !style.linksVisited)
+                unvis.value = 'Site Controlled';
+            else {
+                for (let [attr, elem] in items({'linksUnvisited': unvis, 'linksVisited': vis})) {
+                    if (style[attr]) {
+                        elem.value = attr.replace('links', '');
+                        elem.style.color = style[attr];
+                        elem.style.textDecoration = style.linksUnderline ? 'underline' : 'inherit';
+                    }
+                }
+            }
             $('nosquint-status-tooltip').style.display = '';
             e.style.fontStyle = e.style.opacity = 'inherit';
-            tooltipDirty = true;
         } else {
             $('nosquint-status-tooltip').style.display = 'none';
             e.label = 'N/A';
@@ -251,7 +228,6 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
              */
             e.style.opacity = 0.5;
             e.style.fontStyle = 'italic';
-            tooltipDirty = false;
         }
     };
 
@@ -276,11 +252,9 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
      */
     this.getZoomForBrowser = function(browser) {
         var site = browser.getUserData('nosquint').site;
-        debug('getZoomForBrowser(): site=' + site);
-        if (site === undefined) {
+        if (site === null) {
             site = this.getSiteFromBrowser(browser);
             browser.getUserData('nosquint').site = site;
-            debug('getZoomForBrowser(): after getSiteFromBrowser(), site=' + site);
         }
 
         var [text, full] = NSQ.prefs.getZoomForSite(site);
@@ -307,8 +281,6 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
     this.attach = function(browser) {
         var listener = new NSQ.interfaces.ProgressListener(browser);
         browser.addProgressListener(listener, CI.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
-        debug('attach(): attached browser URI=' + browser.docShell.document.URL);
-
         var userData = {
             listener: listener,
             stylers: []
@@ -316,8 +288,6 @@ 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);
@@ -332,7 +302,7 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
      */
     this.zoom = function(browser, text, full) {
         if (!browser || (text == false && full == false))
-            return false;
+            return;
 
         var t0 = new Date().getTime();
         if (text == null || full == null) {
@@ -355,7 +325,6 @@ NoSquint.browser = NoSquint.ns(function() { with (NoSquint) {
             this.queueUpdateStatus();
         var t1 = new Date().getTime();
         debug('zoom(): took ' + (t1-t0));
-        return true;
     };
 
     /* Updates the zoom levels for all tabs; each tab is set to the levels
@@ -402,7 +371,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,font,ul,li,center,blockquote,h1,h2,h3,h4,h5,table,tr,th,td,iframe,a,b,i {';
+            css += 'body,p,div,span,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/cmd.js b/src/content/cmd.js
index ec41b28..eba119a 100644
--- a/src/content/cmd.js
+++ b/src/content/cmd.js
@@ -161,7 +161,7 @@ NoSquint.cmd = NoSquint.ns(function() { with (NoSquint) {
         var dlg = NSQ.storage.dialogs.site;
         if (dlg)
             return dlg.setBrowser(NSQ.browser, browser);
-        window.openDialog('chrome://nosquint/content/dlg-site.xul', 'nsqSite', 'chrome', NSQ.browser, browser);
+        window.openDialog('chrome://nosquint/content/dlg-site.xul', null, 'chrome', NSQ.browser, browser);
     };
 
 
@@ -178,7 +178,7 @@ NoSquint.cmd = NoSquint.ns(function() { with (NoSquint) {
                 host += ':' + browser.currentURI.port;
         } catch (err) {};
         var url = host + browser.currentURI.path;
-        window.openDialog('chrome://nosquint/content/dlg-global.xul', 'nsqGlobal', 'chrome', url);
+        window.openDialog('chrome://nosquint/content/dlg-global.xul', null, 'chrome', url);
     };
 
 }});
diff --git a/src/content/dlg-site.js b/src/content/dlg-site.js
index 59796c0..b314cc1 100644
--- a/src/content/dlg-site.js
+++ b/src/content/dlg-site.js
@@ -69,11 +69,9 @@ NoSquint.dialogs.site = NoSquint.ns(function() { with (NoSquint) {
 
         for (let [id, defcolor] in items(NSQ.prefs.defaultColors)) {
             $(id).parentNode.childNodes[1].color = (!style || style[id] == '0' ? defcolor : style[id]);
-            $(id).checked = Boolean(style && style[id] && style[id] != '0');
+            $(id).checked = (!style || style[id] == '0' ? false : true);
             this.colorChecked.apply($(id));
         }
-        for (let attr in iter(['colorBackgroundImages', 'linksUnderline']))
-            $(attr).checked = Boolean(style && style[attr] && style[attr] != '0');
         window.focus();
         window.sizeToContent();
     };
@@ -162,7 +160,7 @@ NoSquint.dialogs.site = NoSquint.ns(function() { with (NoSquint) {
                 style.enabled = style.enabled || Boolean(style[attr]);
             }
             for (let attr in iter(['colorBackgroundImages', 'linksUnderline'])) {
-                style[attr] = Boolean($(attr).checked);
+                style[attr] = $(attr).checked;
                 style.enabled = style.enabled || Boolean(style[attr]);
             }
         }
diff --git a/src/content/init.js b/src/content/init.js
index b339e8d..c571967 100644
--- a/src/content/init.js
+++ b/src/content/init.js
@@ -1,61 +1,44 @@
-window.addEventListener("load", NoSquint.init, false); 
-window.addEventListener("unload", NoSquint.destroy, false); 
-
-/* NoSquint hooks the ZoomManager, overriding its default functionality.
- *
- * The logic below should be well-behaved when the user uses exclusively
- * full page or text-only zooms.
- *
- * If both zooms are in use (i.e. full and text != 100%), things can get
- * a little dubious.  In general, if full zoom is not 100%, then we pretend
- * as if full zoom is the primary method, regardless of whether it actually
- * is.  The rationale is that full page zoom is more likely to affect logic
- * used by people interfacing with ZoomManager.
- *
- * More details in ZoomManager.useFullZoom getter.
- */
-
-// ZoomManager._nosquintOrigZoomGetter = ZoomManager.__lookupGetter__('zoom');
-// ZoomManager._nosquintOrigZoomSetter = ZoomManager.__lookupSetter__('zoom');
-
-ZoomManager.__defineSetter__('zoom', function(value) {
-    var viewer = getBrowser().mCurrentBrowser.markupDocumentViewer;
-    var updated = false;
-
-    if (ZoomManager.useFullZoom && viewer.fullZoom != value)
-        updated = viewer.fullZoom = value;
-    else if (!ZoomManager.useFullZoom && viewer.textZoom != value)
-        updated = viewer.textZoom = value;
-
-    if (updated != false) {
-        NoSquint.saveCurrentZoom();
-        NoSquint.updateStatus();
+// Global object for NoSquint.  'NoSquint' is the only name added to the global
+// namespace by this addon.
+NoSquint = {
+    id: 'NoSquint',
+    namespaces: [],
+    _initialized: false,
+    dialogs: {},            // dialogs namespace
+
+    ns: function(fn) {
+        var scope = {
+            extend: function(o) {
+                for (var key in o)
+                    this[key] = o[key];
+                }
+        };
+        scope = fn.apply(scope) || scope;
+        NoSquint.namespaces.push(scope);
+        return scope;
+    },
+
+    init: function() {
+        if (NoSquint._initialized)
+            return;
+        NoSquint._initialized = true;
+
+        for (let i = 0; i < NoSquint.namespaces.length; i++) {
+            var scope = NoSquint.namespaces[i];
+            if (scope.init !== undefined)
+                scope.init();
+        }
+    },
+
+    destroy: function() {
+        // Invoke destroy functions in all registered namespaces
+        for (let i = 0; i < NoSquint.namespaces.length; i++) {
+            var scope = NoSquint.namespaces[i];
+            if (scope.destroy !== undefined)
+                scope.destroy();
+        }
     }
-});
-
-ZoomManager.__defineGetter__('zoom', function() {
-    var viewer = getBrowser().mCurrentBrowser.markupDocumentViewer;
-    return ZoomManager.useFullZoom ? viewer.fullZoom : viewer.textZoom;
-});
+};
 
-ZoomManager.__defineGetter__('useFullZoom', function() {
-    /* Extensions (like all-in-one gestures) assume that zoom is either all
-     * full page or all text-only, which is of course quite reasonable given
-     * the ZoomManager interface assumes this too.
-     *
-     * So, regardless of what the primary zoom method is set to, if the
-     * current page has a full zoom level != 100%, then we always return
-     * true here.
-     * 
-     * This is to handle the uncommon case where the user has modified
-     * both text and full page zoom.  Extensions like AIO need to base
-     * decisions on whether or not the page is full-zoomed, not whether
-     * or not the user prefers full or text zoom.
-     */
-    var viewer = getBrowser().mCurrentBrowser.markupDocumentViewer;
-    return viewer.fullZoom != 1.0 ? true : NoSquint.fullZoomPrimary;
-});
-
-ZoomManager.enlarge = NoSquint.cmdEnlargePrimary;
-ZoomManager.reduce = NoSquint.cmdReducePrimary;
-ZoomManager.reset = NoSquint.cmdReset;
+window.addEventListener("load", NoSquint.init, false); 
+window.addEventListener("unload", NoSquint.destroy, false);
diff --git a/src/content/interfaces.js b/src/content/interfaces.js
index 49c7c5d..5a9fdbe 100644
--- a/src/content/interfaces.js
+++ b/src/content/interfaces.js
@@ -6,16 +6,11 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
     /* Specifies at which state we will try to zoom and style the page.  With
      * 3.5+, we can style early with STATE_TRANSFERRING.  With 3.0, we seem to
      * have style later at STATE_STOP in order to get reliable results. (In 3.0
-     * using STATE_TRANSFERRING, on e.g. youtube.com the search bar is
-     * improperly rendered.  [And this, quite perplexingly, is caused by
-     * accessing doc.documentElement in NSQ.browser.style()])
+     * using STATE_TRANSFERRING, on e.g. youtube.com the search bar is improperly
+     * rendered.
      */
     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.
      * TODO: when support for Firefox 3.0 is dropped, use:
@@ -54,7 +49,7 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
                 // New document on the same site.
                 return;
 
-            debug("onLocationChange(): old=" + userData.site + ", new=" + site + ", uri=" + uri.spec);
+            debug("onLocationChange(): old=" + userData.site + "new=" + site + ", uri=" + uri.spec);
             /* Update timestamp for site.  This isn't _quite_ perfect because
              * the timestamp is only updated for the first page load on that site
              * rather than the last.  But it should be good enough in practice, and
@@ -71,8 +66,6 @@ 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);
 
@@ -93,33 +86,14 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
             var contentType = this.browser.docShell.document.contentType;
             if (this.contentType != contentType) {
                 this.contentType = contentType;
-                var userData = this.browser.getUserData('nosquint');
                 if (isChrome(this.browser)) {
-                    // Content type is changed and it's now chrome.  Unzoom (or
-                    // zoom to 100%)
-                    userData.site = null;
+                    this.browser.getUserData('nosquint').site = null;
                     NSQ.browser.zoom(this.browser, 100, 100);
-                } else if (userData.site === null) {
-                    // Was considered chrome, but now isn't.  Rezoom/style.
-                    delete userData.site;
-                    NSQ.browser.zoom(this.browser);
-                    this.styleApplied = NSQ.browser.style(this.browser);
                 }
             } else if (state & stateFlag) {
                 if (!this.zoomApplied) {
                     this.zoomApplied = true;
-                    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);
+                    NSQ.browser.zoom(this.browser);
                 }
                 if (!this.styleApplied) {
                     if (!isChrome(this.browser) || isImage(this.browser))
@@ -127,46 +101,7 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
                     else
                         this.styleApplied = true;
                 }
-            } else if (state & Components.interfaces.nsIWebProgressListener.STATE_IS_DOCUMENT &&
-                       this.browser.getUserData('nosquint').site == null && !is30()) {
-                /* Kludge: when moving a tab from one window to another, the
-                 * listener previously created and attached in
-                 * NSQ.browser.attach() seems to either stop working or gets
-                 * implicitly detached somewhere afterward.  The tab gets
-                 * created initially as about:blank, so NoSquint thinks it's
-                 * chrome.  The tab gets updated for the proper site, but since
-                 * the listener isn't working, NoSquint doesn't hear about it.
-                 *
-                 * The specific magical incantation to deal with this seems to
-                 * be handling STATE_IS_DOCUMENT when site=null.  After a 0ms
-                 * timer, we try to re-add this listener ('this').  If it
-                 * fails, we assume the listener from attach() is still there
-                 * and everything is cool after all.  Otherwise, regenerate the
-                 * site name and rezooms/style.
-                 *
-                 * This seems to solve the problem, but feels like a nasty volatile
-                 * hack to work around what is probably a firefox bug, and will
-                 * likely break in the future.  It doesn't seem to be necessary
-                 * with 3.0, but is with 3.5+.
-                 */
-                var browser = this.browser;
-                var listener = this;
-                setTimeout(function() {
-                    try {
-                        browser.addProgressListener(listener, CI.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
-                    } catch (err) {
-                        // Assume ProgressListener was already attached after all, so
-                        // we don't need to do anything.
-                        return;
-                    }
-                    browser.getUserData('nosquint').listener = listener;
-                    // Forces getZoomForBrowser() (via zoom()) to redetermine site name.
-                    delete browser.getUserData('nosquint').site;
-                    NSQ.browser.zoom(browser);
-                    NSQ.browser.style(browser);
-                }, 0);
             }
-
         },
 
         onProgressChange: function() 0,
@@ -202,13 +137,7 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
         _hook: function() {
             this._os.addObserver(this, "private-browsing", false);  
             this._os.addObserver(this, "quit-application-granted", false);  
-            if (is30() || is36())
-                this._os.addObserver(this, "em-action-requested", false);  
-            else {
-                Components.utils.import("resource://gre/modules/AddonManager.jsm");
-                AddonManager.addAddonListener(this);
-            }
-
+            this._os.addObserver(this, "em-action-requested", false);  
             try {  
                 var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]  
                                   .getService(Components.interfaces.nsIPrivateBrowsingService);  
@@ -216,7 +145,6 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
             } catch(ex) {  
                 // ignore exceptions in older versions of Firefox  
             }
-
             this._hooked = true;
         },
 
@@ -226,28 +154,6 @@ 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":
@@ -275,14 +181,23 @@ NoSquint.interfaces = NoSquint.ns(function() { with (NoSquint) {
                     switch (data) {
                         case "item-disabled":
                         case "item-uninstalled":
-                            var addon = subject.QueryInterface(Components.interfaces.nsIUpdateItem);
-                            this.onDisabling(addon, true);
+                            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);
                             break;
                         
                         case "item-cancel-action":
-                            var addon = subject.QueryInterface(Components.interfaces.nsIUpdateItem);
-                            this.onOperationCancelled(addon);
-                            break;
+                            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;
                     }
                     break;
             }
diff --git a/src/content/lib.js b/src/content/lib.js
index 127f283..1163140 100644
--- a/src/content/lib.js
+++ b/src/content/lib.js
@@ -6,7 +6,8 @@
      * exists once, and is referenced for each window.  (In contrast, doing
      * Application.storage.set('foo', [1,2]) will store a copy of the list.)
      */
-    this.storage = Application.storage.get('nosquint-global', null);
+    var extstorage = Application.extensions.get('nosquint at urandom.ca').storage;
+    this.storage = extstorage.get('global', null);
     if (this.storage === null) {
         // Initialize global defaults.
         this.storage = {
@@ -15,19 +16,16 @@
             origSiteSpecific: null,
             dialogs: {}
         };
-        Application.storage.set('nosquint-global', this.storage);
+        extstorage.set('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.';
-    };
-
-    this.is40 = function() {
-        return Application.version.substr(0, 4) >= '4.0.';
+        return Application.version.substr(0, 4) >=  '3.6.';
     };
 
     this.$ = function(id, doc) {
@@ -108,7 +106,6 @@
     this.isChrome = function(browser) {
         var document = browser.docShell.document;
         
-        //this.debug('isChrome(): URL=' + document.URL + ', spec=' + browser.currentURI.spec + ', contentType=' + document.contentType);
         if (document.URL == undefined)
             return true;
 
@@ -132,7 +129,6 @@
 
         // Less common cases that we'll cover with the more expensive regexp.
         return document.contentType.search(/^text\/(plain|css|xml|javascript)/) != 0;
-        //return document.contentType.search(/^text\/(plain|css|xml|javascript)|image\//) != 0;
     };
 
     this.isImage = function(browser) {
diff --git a/src/content/overlay.xul b/src/content/overlay.xul
index 638f4be..cc12c52 100644
--- a/src/content/overlay.xul
+++ b/src/content/overlay.xul
@@ -4,9 +4,13 @@
 
 <overlay id="nosquint-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml">
-    <script type="application/x-javascript" src="chrome://nosquint/content/utils.js" />
-    <script type="application/x-javascript" src="chrome://nosquint/content/nosquint.js" />
     <script type="application/x-javascript" src="chrome://nosquint/content/init.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/lib.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/interfaces.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/prefs.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/browser.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/cmd.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/zoommanager.js" />
 
     <stringbundleset id="stringbundleset">
         <stringbundle id="nosquint-overlay-bundle" src="chrome://nosquint/locale/overlay.properties" />
@@ -15,13 +19,13 @@
     <toolbarpalette id="BrowserToolbarPalette">
         <toolbarbutton id="nosquint-button-reduce" class="toolbarbutton-1"
                        label="Zoom Out" tooltiptext="Zoom out"
-                       oncommand="NoSquint.buttonReduce(event);" />
+                       oncommand="NoSquint.cmd.buttonReduce(event);" />
         <toolbarbutton id="nosquint-button-enlarge" class="toolbarbutton-1"
                        label="Zoom In" tooltiptext="Zoom in"
-                       oncommand="NoSquint.buttonEnlarge(event);" />
+                       oncommand="NoSquint.cmd.buttonEnlarge(event);" />
         <toolbarbutton id="nosquint-button-reset" class="toolbarbutton-1"
                        label="Reset Zoom" tooltiptext="Reset Zoom"
-                       oncommand="NoSquint.buttonReset(event);" />
+                       oncommand="NoSquint.cmd.buttonReset(event);" />
     </toolbarpalette>
 
     <keyset id="mainKeyset">
@@ -32,17 +36,17 @@
     </keyset>
 
     <commandset id="mainCommandSet">
-        <command id="cmd_noSquintPrefs" oncommand="NoSquint.openGlobalPrefsDialog()" />
-        <command id="cmd_fullZoomEnlarge" oncommand="NoSquint.cmdEnlargePrimary()" />
-        <command id="cmd_fullZoomReduce" oncommand="NoSquint.cmdReducePrimary()" />
-        <command id="cmd_fullZoomReset" oncommand="NoSquint.cmdReset()" />
-        <command id="cmd_noSquintEnlargeSecondary" oncommand="NoSquint.cmdEnlargeSecondary()" />
-        <command id="cmd_noSquintReduceSecondary" oncommand="NoSquint.cmdReduceSecondary()" />
+        <command id="cmd_noSquintPrefs" oncommand="NoSquint.cmd.openGlobalSettings()" />
+        <command id="cmd_fullZoomEnlarge" oncommand="NoSquint.cmd.enlargePrimary()" />
+        <command id="cmd_fullZoomReduce" oncommand="NoSquint.cmd.reducePrimary()" />
+        <command id="cmd_fullZoomReset" oncommand="NoSquint.cmd.reset()" />
+        <command id="cmd_noSquintEnlargeSecondary" oncommand="NoSquint.cmd.enlargeSecondary()" />
+        <command id="cmd_noSquintReduceSecondary" oncommand="NoSquint.cmd.reduceSecondary()" />
     </commandset>
 
     <popup id="contentAreaContextMenu">
       <menuitem id="nosquint-menu-settings" label="&ns.menu.context.label;"
-                accesskey="&ns.menu.context.accesskey;" oncommand="NoSquint.openSitePrefsDialog();"/>
+                accesskey="&ns.menu.context.accesskey;" oncommand="NoSquint.cmd.openSiteSettings();"/>
     </popup>
 
     <statusbar id="status-bar">
@@ -103,7 +107,7 @@
             </grid>
         </tooltip>
 
-        <menupopup id="nosquint-status-popup" oncommand="NoSquint.popupItemSelect(event)">
+        <menupopup id="nosquint-status-popup" oncommand="NoSquint.cmd.popupItemSelect(event)">
             <menuitem id="nosquint-popup-site" label="Site" disabled="true" style="font-style: italic" />
             <menu label="&ns.menu.fullZoom.label;">
                 <menupopup id="nosquint-status-popup-full">
@@ -127,15 +131,15 @@
                     <menuitem type="radio" name="text" label="150%" />
                 </menupopup>
             </menu>
-            <menuitem id="nosquint-status-reset" label="&ns.menu.reset.label;" onclick="NoSquint.cmdReset()" />
-            <menuitem label="&ns.menu.siteSettings.label;" onclick="NoSquint.openSitePrefsDialog()" />
+            <menuitem id="nosquint-status-reset" label="&ns.menu.reset.label;" onclick="NoSquint.cmd.reset()" />
+            <menuitem label="&ns.menu.siteSettings.label;" onclick="NoSquint.cmd.openSiteSettings()" />
             <menuseparator />
-            <menuitem label="&ns.menu.globalSettings.label;" onclick="NoSquint.openGlobalPrefsDialog()" />
+            <menuitem label="&ns.menu.globalSettings.label;" onclick="NoSquint.cmd.openGlobalSettings()" />
         </menupopup>
 
         <statusbarpanel class="statusbarpanel-iconic-text" id="nosquint-status" label="100%" 
-                        onclick="NoSquint.statusPanelClick(event)" 
-                        src="chrome://nosquint/skin/icon-enlarge-16.png" 
+                        onclick="NoSquint.cmd.statusPanelClick(event)" 
+                        src="chrome://nosquint/skin/icon-statusbar-16.png" 
                         tooltip="nosquint-status-tooltip" />
     </statusbar>
 </overlay> 
diff --git a/src/content/overlay_sanitize.xul b/src/content/overlay_sanitize.xul
index 4796764..9615a56 100644
--- a/src/content/overlay_sanitize.xul
+++ b/src/content/overlay_sanitize.xul
@@ -1,9 +1,8 @@
 <?xml version="1.0"?>
 <!DOCTYPE overlay SYSTEM "chrome://nosquint/locale/overlay.dtd">
 <overlay id="nosquint-sanitize" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-    <script type="application/x-javascript" src="chrome://nosquint/content/utils.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/init.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/lib.js" />
+    <script type="application/x-javascript" src="chrome://nosquint/content/prefs.js" />
     <script type="application/x-javascript" src="chrome://nosquint/content/sanitize.js" />
-    <script type="application/x-javascript">
-        attach("&ns.sanitize.label;");
-    </script>
 </overlay>
diff --git a/src/content/prefs.js b/src/content/prefs.js
index dec1d15..5f6c003 100644
--- a/src/content/prefs.js
+++ b/src/content/prefs.js
@@ -22,15 +22,6 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
         linksVisited: '#551a8b'
     };
 
-    /* Active window we can use for window methods (e.g. setTimeout).  Because
-     * NSQ.prefs is a singleton, it could be that the window we initialized
-     * with has been closed.  In that case, setTimeout will fail with 
-     * NS_ERROR_NOT_INITIALIZED.  So we keep a reference to an available
-     * window here we can call window.* methods with, and if the window
-     * goes away, we find a new one using foreachNSQ().
-     */
-    this.window = window;
-
     // Pref service.
     var svc = Components.classes["@mozilla.org/preferences-service;1"].getService(
                           Components.interfaces.nsIPrefService);
@@ -103,11 +94,6 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
     };
 
     this.destroy = function() {
-        if (this.rememberSites)
-            // In case the window shutting down is the one whose saveTimer is
-            // associated with, we should finish any pending save now.
-            this.finishPendingSaveSiteList();
-
         if (!NSQ.storage.quitting)
             // NSQ.prefs is a singleton so we only ever truly destroy on app
             // shutdown.
@@ -116,29 +102,15 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
         branchNS.removeObserver('', this);
         branchBZ.removeObserver('', this);
 
-        if (!this.rememberSites)
+        if (this.rememberSites)
+            this.finishPendingSaveSiteList();
+        else
             // Per-site setting storage disabled.
             branchNS.setCharPref('sites', '');
 
         this.setSiteSpecific(origSiteSpecific);
     };
 
-
-    /* Invoke a window method, such as setTimeout.  We need to do this indirectly
-     * because NSQ.prefs is a singleton, and the window NSQ.prefs initialized with
-     * may not actually still be alive.
-     */
-    this.winFunc = function(func) {
-        var args = Array.prototype.slice.call(arguments, 1); 
-        try {
-            return this.window[func].apply(this.window, args);
-        } catch (e) {
-            // Presumably NS_ERROR_NOT_INITIALIZED.  TODO: verify.
-            this.window = foreachNSQ(function() false);
-            return this.window[func].apply(this.window, args);
-        }
-    };
-
     this.setSiteSpecific = function(value) {
         branchBZ.setBoolPref('siteSpecific', value);
         this.save();
@@ -164,7 +136,6 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
             // Not a pref change.
             return;
 
-        debug('observe(): data=' + data);
         switch (data) {
             case 'siteSpecific':
                 if (branchBZ.getBoolPref('siteSpecific') == false || NSQ.storage.disabled || NSQ.storage.quitting)
@@ -453,6 +424,7 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
         var remove = [];
         var now = new Date();
         for (let [site, settings] in items(this.sites)) {
+        //for (let [site, settings] in Iterator(this.sites)) {
             if (!settings)
                 continue
             var [text, timestamp, counter, full] = settings;
@@ -470,7 +442,7 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
 
         // Fire timer once a day.
         if (pruneTimer == null)
-            pruneTimer = this.winFunc('setTimeout', function() { pruneTimer = null; NSQ.prefs.pruneSites(); }, 24*60*60*1000);
+            pruneTimer = setTimeout(function() { pruneTimer = null; NSQ.prefs.pruneSites(); }, 24*60*60*1000);
     };
 
 
@@ -551,7 +523,7 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
          * needlessly iterating over the sites array.
          */
         debug("queueSaveSiteList(): delay=" + this.saveDelay);
-        saveTimer = this.winFunc('setTimeout', function() NSQ.prefs.saveSiteList(), this.saveDelay);
+        saveTimer = setTimeout(function() NSQ.prefs.saveSiteList(), this.saveDelay);
     };
 
 
@@ -579,7 +551,7 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
         branchNS.setCharPref('sites', sites.join(' '));
         this.save();
         debug("saveSiteList(): took: " + (new Date().getTime() - t0) + "ms");
-        this.winFunc('clearTimeout', saveTimer);
+        clearTimeout(saveTimer);
         saveTimer = null;
     };
 
@@ -591,7 +563,7 @@ NoSquint.prefs = NoSquint.ns(function() { with(NoSquint) {
         if (saveTimer === null)
             return false;
 
-        this.winFunc('clearTimeout', saveTimer);
+        clearTimeout(saveTimer);
         saveTimer = null;
         return true;
     };
diff --git a/src/content/sanitize.js b/src/content/sanitize.js
index 88173d3..cb375c5 100644
--- a/src/content/sanitize.js
+++ b/src/content/sanitize.js
@@ -1,67 +1,81 @@
 // chrome://browser/content/sanitize.xul 
-function hookSanitizer() {
-    window.removeEventListener('load', hookSanitizer, true);
-    Sanitizer.prototype.items['extensions-nosquint'] = {
-        clear: function() {
-            /* Find all NoSquint instances and force a site list save if dirty.
-             */
-            var last = null;
-            foreach_window(function(win) {
-                if (win._noSquint) {
-                    if (win._noSquint.sitesDirty)
-                        win._noSquint._realSaveSiteList();
-                    last = win._noSquint;
-                }
-            });
-            if (last)
-                last.sanitize(this.range);
-        },
-        get canClear() {
-            return true;
-        }
+// chrome://browser/content/preferences/sanitize.xul 
+
+NoSquint.sanitizer = NoSquint.ns(function() { with (NoSquint) {
+    this.init = function() {
+        // Adds nosquint option to sanitizer UI
+        this.attachOption(NSQ.strings.sanitizeLabel)
+        if (typeof Sanitizer != 'undefined')
+            // Installs NoSquint hooks into the sanitizer
+            this.hookSanitizer();
     };
-}
 
-function attach(label) {
-    window.addEventListener('load', hookSanitizer, true);
-    var prefService = Components.classes["@mozilla.org/preferences-service;1"]
-                        .getService(Components.interfaces.nsIPrefBranch);
+    this.attachOption = function(label) {
+        var inSanitizeDialog = typeof(gSanitizePromptDialog) == 'object';
+        // TODO: put this into a convenience function in lib.js
+        var prefService = Components.classes["@mozilla.org/preferences-service;1"]
+                            .getService(Components.interfaces.nsIPrefBranch);
 
-    // pref domain is privacy.cpd. for Firefox 3.1+, and privacy.item. for 3.0
-    // and earlier.
-    var domain = 'privacy.cpd.';
-    if (document.getElementById('privacy.item.cache'))
-        domain = 'privacy.item.';
-    var prefs = document.getElementsByTagName('preferences')[0];
-    var pref = document.createElement('preference');
-    pref.setAttribute('id', domain + 'extensions-nosquint');
-    pref.setAttribute('name', domain + 'extensions-nosquint');
-    pref.setAttribute('type', 'bool');
-    var value = prefService.getBoolPref('privacy.item.extensions-nosquint');
-    pref.setAttribute('value', value);
-    prefService.setBoolPref('privacy.cpd.extensions-nosquint', value);
-    prefs.appendChild(pref);
+        // pref domain is privacy.cpd. for Firefox 3.1+, and privacy.item. for 3.0
+        // and earlier.
+        var domain = 'privacy.cpd.';
+        if ($('privacy.item.cache'))
+            domain = 'privacy.item.';
+        var prefs = document.getElementsByTagName('preferences')[0];
+        var pref = document.createElement('preference');
+        pref.setAttribute('id', domain + 'extensions-nosquint');
+        pref.setAttribute('name', domain + 'extensions-nosquint');
+        pref.setAttribute('type', 'bool');
+        var value = prefService.getBoolPref(domain + 'extensions-nosquint');
+        pref.setAttribute('value', value);
+        prefService.setBoolPref(domain + 'extensions-nosquint', value);
+        prefs.appendChild(pref);
 
-    if (document.getElementById('itemList')) {
-        // Firefox 3.5
-        var check = document.getElementById('itemList').appendItem(label);
-        check.setAttribute('type', 'checkbox');
-    } else {
-        // Firefox 3.0
-        var check = document.createElement('checkbox');
-        check.setAttribute('label', label);
-        document.getElementsByTagName('checkbox')[0].parentNode.appendChild(check);
-    }    
-    check.setAttribute('preference', domain + 'extensions-nosquint');
-    if (prefService.getCharPref('extensions.nosquint.sites') == '')
-        // FIXME: a minor race condition: if user made first zoom change
-        // and immediately opened sanitizer (before 5s timeout to store sites)
-        // we will disable the checkbox when we shouldn't.
-        check.setAttribute('disabled', true);
+        if ($('itemList')) {
+            // In Clear Recent History dialog in Firefox 3.0
+            var check = $('itemList').appendItem(label);
+            check.setAttribute('type', 'checkbox');
+        } else {
+            // Firefox 3.0, or Firefox 3.5 in Settings, where the user sets which to enable/disable.
+            var check = document.createElement('checkbox');
+            check.setAttribute('label', label);
+            var rows = document.getElementsByTagName('rows');
+            if (rows.length) {
+                // Firefox 3.5
+                // Add new row to to rows.  TODO: append to last row if only has one column
+                var row = document.createElement('row');
+                row.appendChild(check);
+                rows[0].appendChild(row);
+            } else
+                // Firefox 3.0
+                document.getElementsByTagName('checkbox')[0].parentNode.appendChild(check);
+        }    
+        check.setAttribute('preference', domain + 'extensions-nosquint');
+        check.setAttribute('checked', value);
+
+        if (inSanitizeDialog) {
+            pref.setAttribute('readonly', 'true');
+            check.setAttribute('onsyncfrompreference', 'return gSanitizePromptDialog.onReadGeneric();');
+            if (prefService.getCharPref('extensions.nosquint.sites') == '') {
+                /* FIXME: a minor race condition: if user made first zoom change
+                 * and immediately opened sanitizer (before 5s timeout to store sites)
+                 * we will disable the checkbox when we shouldn't.
+                 */
+                check.setAttribute('disabled', true);
+                check.setAttribute('checked', false);
+            }
+        }
+    };
+
+    this.hookSanitizer = function() {
+        Sanitizer.prototype.items['extensions-nosquint'] = {
+            clear: function() {
+                NSQ.prefs.sanitize(this.range);
+            },
+            get canClear() {
+                return true;
+            }
+        };
+    };
 
-     if (typeof(gSanitizePromptDialog) == 'object')
-     {  
-        pref.setAttribute('readonly', 'true');
-        check.setAttribute('onsyncfrompreference', 'return gSanitizePromptDialog.onReadGeneric();');
-     }
-}
+}});
diff --git a/src/defaults/preferences/nosquint.js b/src/defaults/preferences/nosquint.js
index ef3790a..a67cf00 100644
--- a/src/defaults/preferences/nosquint.js
+++ b/src/defaults/preferences/nosquint.js
@@ -18,4 +18,5 @@ pref("extensions.nosquint.colorBackgroundImages", false);
 pref("extensions.nosquint.linksUnvisited", '0');
 pref("extensions.nosquint.linksVisited", '0');
 pref("extensions.nosquint.linksUnderline", false);
+pref("privacy.cpd.extensions-nosquint", true);
 pref("privacy.item.extensions-nosquint", true);
diff --git a/src/install.rdf b/src/install.rdf
index 58c7258..d156ee1 100644
--- a/src/install.rdf
+++ b/src/install.rdf
@@ -6,13 +6,13 @@
     
         <em:id>nosquint at urandom.ca</em:id>
         <em:name>NoSquint</em:name>
-        <em:version>2.0b6</em:version>
+        <em:version>2.0</em:version>
         <em:description>Manage site-specific zoom levels and color settings</em:description>
         <em:creator>Jason Tackaberry</em:creator>
         <!-- optional items -->
         <em:homepageURL>http://urandom.ca/nosquint/</em:homepageURL>
-        <em:optionsURL>chrome://nosquint/content/globalprefs.xul</em:optionsURL>
-        <em:iconURL>chrome://nosquint/content/icon-32.png</em:iconURL>
+        <em:optionsURL>chrome://nosquint/content/dlg-global.xul</em:optionsURL>
+        <em:iconURL>chrome://nosquint/skin/logo-32.png</em:iconURL>
         <em:type>2</em:type> <!-- type=extension --> 
 
         <!-- Firefox -->
@@ -20,7 +20,7 @@
             <Description>
                 <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                 <em:minVersion>3.0b4pre</em:minVersion>
-                <em:maxVersion>3.5.*</em:maxVersion>
+                <em:maxVersion>3.7a1pre</em:maxVersion>
             </Description>
         </em:targetApplication>
     </Description>
diff --git a/src/locale/en-US/help.html b/src/locale/en-US/help.html
index 9d7fe31..7db3377 100644
--- a/src/locale/en-US/help.html
+++ b/src/locale/en-US/help.html
@@ -52,7 +52,7 @@
 </style>
 
 <body>
-<h2>General Tab</h2>
+<h2 id='general'>General Tab</h2>
 
 <p>To NoSquint, a site is a web location where all pages have the same zoom
 level and color settings, and the site name is derived from the page's URL.</p>
@@ -65,25 +65,28 @@ second-level domains.  For example, if you're visiting
 <code>bbc.co.uk</code>.</p>
 
 <p>The default behaviour should work almost all the time.  When it doesn't, you
-can control how NoSquint determines site names in the Exceptions Tab.</p>
+can control how NoSquint determines site names in the 
+<a href='#exceptions'>Exceptions Tab</a>.</p>
 
-<h3>Persistence</h3>
+<h3>Per-site settings (color and zoom)</h3>
 <ul>
     <li>
-        <b>Remember zoom and color settings per site</b>
+        <b>Remember per-site settings between Firefox restarts</b>
             <p>With this option selected, NoSquint will remember any changes
-            you make to the zoom levels and color choices for a given site.
-            Both full page zoom and text zoom levels are remembered
+            you make to the zoom levels and color choices for a given site, and
+            the changes are stored on disk so they can be applied even if you
+            restart Firefox.</p>
+            <p>Both full page zoom and text zoom levels are remembered
             independently.  Next time you visit that site, NoSquint will use
             the zoom and colors previously used on that site.</p>
     </li>
     <li>
         <b>Forget settings for sites not visited in the last ...</b>
-            <p>With the "Remember zoom and color settings per site" option
-            enabled, NoSquint keeps track of all zoom level and color changes
-            for sites, even sites you only visit once.  This option is house
-            cleaning: if you haven't visited a site (for which you've set a
-            non-default zoom or color setting) for the specified number of
+            <p>With the "Remember per-site settings between Firefox restarts"
+            option enabled, NoSquint keeps track of all zoom level and color
+            changes for sites, even sites you only visit once.  This option is
+            house cleaning: if you haven't visited a site (for which you've set
+            a non-default zoom or color setting) for the specified number of
             months, NoSquint will forget the setting.</p>
     </li>
     <li>
@@ -99,16 +102,20 @@ can control how NoSquint determines site names in the Exceptions Tab.</p>
             not cleared.</p>
     </li>
     <li>
-        <b>Use the global zoom and color settings for all sites</b>
-            <p>One of NoSquint's features is the ability to remember custom
-            zoom levels and color choices for individual sites.  If you're not
-            interested this and want to use the same settings (specified in the
-            Zooming and Color tabs) for all sites, or you just don't want
-            NoSquint to remember any manual changes, select this option.</p>
+        <b>Forget all per-site settings when Firefox closes</b>
+            <p>Per-site settings will be retained only for the current Firefox
+            session.  They are never written to disk, and will therefore not
+            be remembered if you restart Firefox.</p>
+            <p>An alternative would be to use Firefox's Private Browsing mode
+            (Firefox 3.5 and later), which NoSquint supports.  When Private
+            Browsing is activated, even if "Remember per-site settings between
+            Firefox restarts" is selected instead of this option, NoSquint will
+            never store any per-site settings to disk which have changed while
+            in that mode.</p>
     </li>
 </ul>
 
-<h2>Zooming Tab</h2>
+<h2 id='zooming'>Zooming Tab</h2>
 
 <p>The options in this tab let you control the default zooming behavior as they
 apply to all sites.  You can override the zoom levels for individual sites using
@@ -177,7 +184,7 @@ icon, or selecting NoSquint Site Settings from the page's context menu.</p>
     </li>
 </ul>
 
-<h2>Colors Tab</h2>
+<h2 id='colors'>Colors Tab</h2>
 <p>Sometimes website creators choose to use rather questionable color choices
 which can significantly hinder readability.  NoSquint lets you override the
 standard text colors for <i>all</i> sites here.  Or (probably more usefully),
@@ -225,8 +232,8 @@ Settings from the page's context menu.</p>
 
 <p>Because not all web sites are structured the same, sometimes the default
 logic NoSquint uses to determine the site name doesn't work the way you want it
-to.  By way of exceptions, you can control how NoSquint determines what
-constitutes a separate site.</p>
+to.  Using exceptions, you can control how NoSquint determines what constitutes
+a separate site.</p>
 
 <h3>Use Cases</h3>
 <p>Exceptions are powerful and expressive, and unfortunately can be confusing.
@@ -298,7 +305,7 @@ case.</p>
         <code>example.com/[*]/apps/*</code>
     </li>
     <li>
-        <b>Problem:</b> same scenario the previous one, but sometimes the
+        <b>Problem:</b> same scenario as the previous one, but sometimes the
         server isn't in the URL, so <code>example.com/apps/app1</code> is
         the same site as <code>example.com/server1/apps/app1</code>.<br/>
 
@@ -332,8 +339,9 @@ computed by NoSquint based on the current page's URL and the user-defined list
 of exceptions.  For instance, both <code>foo.example.com</code> and
 <code>myapp.*.example.com</code> could be site names, depending on the
 exceptions defined.  NoSquint looks up zoom levels based on the site name.  The
-site name, as determined by NoSquint, is by default displayed in the status bar
-beside the current zoom level.</p>
+site name, as determined by NoSquint, can be viewed in the tooltip by hovering
+over the magnifying glass in the status bar, or by opening the Site Settings
+dialog by left clicking the magnifying glass in the status bar.</p>
 
 <p>When a wildcard is enclosed in square brackets (i.e. <code>[*]</code> or
 <code>[**]</code>), the literal wildcard (<code>*</code> or <code>**</code>)
@@ -369,10 +377,10 @@ exception begins with a <code>/</code> (front slash) – is applied only to
 <code>/C:/Users/*</code> for Windows Vista causes all home directories to be
 treated distinctly from one another.</p>
 
-<p>When multiple exceptions match a page's URL, NoSquint will use the exception
-that matches the most non-wildcard characters in the host name.  If there are
-still multiple exceptions in that narrowed list, the exception that matches the
-most non-wildcard characters in the path is then chosen.  If still there are
-multiple exceptions, the first one that matched is chosen.</p>
+<p>When multiple exception patterns match a page's URL, NoSquint will use the
+exception that matches the most non-wildcard characters in the host name.  If
+there are still multiple exceptions in that narrowed list, the exception that
+matches the most non-wildcard characters in the path is then chosen.  If still
+there are multiple exceptions, the first one that matched is chosen.</p>
 </body>
 </html>
diff --git a/src/locale/en-US/overlay.properties b/src/locale/en-US/overlay.properties
index 1b4fa31..98fa412 100644
--- a/src/locale/en-US/overlay.properties
+++ b/src/locale/en-US/overlay.properties
@@ -11,3 +11,5 @@ siteSpecificBrokenPrompt=NoSquint will now no longer work correctly until the br
 
 disableTitle=Restore Native Firefox Behavior?
 disablePrompt=Firefox natively provides less sophisticated per-site zooming, which NoSquint replaces.  Having disabled NoSquint, would you now like to restore Firefox's native behavior?
+
+sanitizeLabel=NoSquint Site History
diff --git a/src/skin/icon-enlarge-16.png b/src/skin/icon-enlarge-16.png
index 31ac736..9a48f6b 100644
Binary files a/src/skin/icon-enlarge-16.png and b/src/skin/icon-enlarge-16.png differ
diff --git a/src/skin/icon-enlarge-24.png b/src/skin/icon-enlarge-24.png
index 4421fe0..4a7bad6 100644
Binary files a/src/skin/icon-enlarge-24.png and b/src/skin/icon-enlarge-24.png differ
diff --git a/src/skin/icon-reduce-16.png b/src/skin/icon-reduce-16.png
index df5be3c..34a14c7 100644
Binary files a/src/skin/icon-reduce-16.png and b/src/skin/icon-reduce-16.png differ
diff --git a/src/skin/icon-reduce-24.png b/src/skin/icon-reduce-24.png
index 8864e76..5b92e15 100644
Binary files a/src/skin/icon-reduce-24.png and b/src/skin/icon-reduce-24.png differ
diff --git a/src/skin/icon-reset-16.png b/src/skin/icon-reset-16.png
index 8e35414..34eff11 100644
Binary files a/src/skin/icon-reset-16.png and b/src/skin/icon-reset-16.png differ
diff --git a/src/skin/icon-reset-24.png b/src/skin/icon-reset-24.png
index a5ba6ea..8cfc2a1 100644
Binary files a/src/skin/icon-reset-24.png and b/src/skin/icon-reset-24.png differ
diff --git a/src/skin/toolbar.css b/src/skin/toolbar.css
index c06b485..c1a8337 100644
--- a/src/skin/toolbar.css
+++ b/src/skin/toolbar.css
@@ -22,8 +22,8 @@ toolbar[iconsize="small"] #nosquint-button-reset {
       list-style-image: url("chrome://nosquint/skin/icon-reset-16.png");
 }
 
-#nosquint-menu-settings {
-      list-style-image: url("chrome://nosquint/skin/icon-enlarge-16.png");
+#nosquint-menu-settings, #nosquint-view-menu-settings {
+      list-style-image: url("chrome://nosquint/skin/icon-statusbar-16.png");
 }
 
 #nosquint-status-reset {

-- 
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