[Pkg-mozext-commits] [tabmixplus] 05/22: Hinting modules folder

David Prévot taffit at moszumanska.debian.org
Sun Jan 4 16:46:35 UTC 2015


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 7cc18600d81bc916a4d2429c4ab24e5e77f4dfdd
Author: onemen <tabmix.onemen at gmail.com>
Date:   Thu Dec 4 16:08:27 2014 +0200

    Hinting modules folder
---
 modules/AutoReload.jsm                    | 17 +++++----
 modules/ContentClick.jsm                  | 61 +++++++++++++++++--------------
 modules/ContextMenu.jsm                   |  6 +--
 modules/Decode.jsm                        |  8 ++--
 modules/DocShellCapabilities.jsm          |  4 +-
 modules/DownloadLastDir.jsm               | 14 ++++---
 modules/DynamicRules.jsm                  | 25 +++++++------
 modules/LinkNodeUtils.jsm                 | 12 +++---
 modules/MergeWindows.jsm                  | 18 ++++-----
 modules/Places.jsm                        | 21 +++++------
 modules/RenameTab.jsm                     |  6 +--
 modules/Services.jsm                      | 44 +++++++++++-----------
 modules/Shortcuts.jsm                     | 46 ++++++++++++-----------
 modules/SingleWindowModeUtils.jsm         | 20 +++++-----
 modules/Slideshow.jsm                     |  2 +-
 modules/extensions/AddonManager.jsm       | 16 ++++----
 modules/extensions/CompatibilityCheck.jsm | 36 +++++++++---------
 modules/extensions/TabGroupsManager.jsm   | 11 ++++--
 modules/log.jsm                           | 23 ++++++------
 19 files changed, 203 insertions(+), 187 deletions(-)

diff --git a/modules/AutoReload.jsm b/modules/AutoReload.jsm
index 262caea..7f9a0b5 100644
--- a/modules/AutoReload.jsm
+++ b/modules/AutoReload.jsm
@@ -2,7 +2,7 @@
 
 var EXPORTED_SYMBOLS = ["AutoReload"];
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const {interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://tabmixplus/Services.jsm");
@@ -28,7 +28,8 @@ let AutoReload = {
     let popup = win.document.getElementById("autoreload_popup");
     let parent = aPopup.parentNode;
     aPopup.setAttribute("onpopuphidden", "this._tab = null;");
-    aPopup.setAttribute("oncommand", "Tabmix.autoReload.setTime(this._tab, event.originalTarget.value);event.stopPropagation();");
+    aPopup.setAttribute("oncommand",
+                        "Tabmix.autoReload.setTime(this._tab, event.originalTarget.value);event.stopPropagation();");
     for (let i=0; i<popup.childNodes.length; i++)
       aPopup.appendChild(popup.childNodes[i].cloneNode(true));
     if (parent.id != "reload-button") {
@@ -58,7 +59,7 @@ let AutoReload = {
         minute:  enableItem.getAttribute("minute"),
         minutes: enableItem.getAttribute("minutes"),
         seconds: enableItem.getAttribute("seconds")
-      }
+      };
     }
     enableItem.setAttribute("checked", aPopup._tab.autoReloadEnabled);
     this.setLabel(enableItem, aPopup._tab.autoReloadTime);
@@ -95,7 +96,7 @@ let AutoReload = {
           newList.push(val);
         if (newList.length > 6 )
           newList.shift();
-      })
+      });
       prefs.setCharPref(pref, newList);
       return newList;
     }
@@ -107,7 +108,7 @@ let AutoReload = {
       mi.setAttribute("type", "radio");
       mi.setAttribute("value", val);
       aPopup.insertBefore(mi, end);
-    }, this)
+    }, this);
   },
 
   setLabel: function(aItem, aSeconds) {
@@ -244,7 +245,7 @@ let AutoReload = {
       aTab.autoReloadEnabled = false;
     _setItem(aTab, "_reload", aTab.autoReloadEnabled || null);
   }
-}
+};
 
 function _setItem () {}
 
@@ -252,7 +253,7 @@ function _reloadTab(aTab) {
   if (aTab == null || !aTab.parentNode)
     return;
 
-  if (aTab.autoReloadEnabled == false ) {
+  if (aTab.autoReloadEnabled === false ) {
     aTab.postDataAcceptedByUser = false;
     return;
   }
@@ -319,7 +320,7 @@ function _reloadTab(aTab) {
         handlingUserInput: windowUtils.isHandlingUserInput });
 }
 
-function  _observe(aSubject, aTopic, aData) {
+function  _observe(aSubject, aTopic) {
   if (aTopic == "common-dialog-loaded") {
     Services.obs.removeObserver(_observe, "common-dialog-loaded");
     let icon = aSubject.document.getElementById("info.icon");
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 87a0489..fc168cb 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -55,12 +55,12 @@ this.TabmixContentClick = {
   selectExistingTab: function(window, href, targetAttr) {
     ContentClickInternal.selectExistingTab(window, href, targetAttr);
   }
-}
+};
 Object.freeze(TabmixContentClick);
 
-let Tabmix = { }
+let Tabmix = { };
 
-let ContentClickInternal = {
+var ContentClickInternal = {
   _timer: null,
   _initialized: false,
 
@@ -94,7 +94,7 @@ let ContentClickInternal = {
   functions: ["contentAreaClick"],
   initContentAreaClick: function TMP_initContentAreaClick() {
     try {
-      let test = ContentClick.contentAreaClick.toString();
+      ContentClick.contentAreaClick.toString();
     } catch (ex) { return; }
 
     this.functions.forEach(function(aFn) {
@@ -161,7 +161,7 @@ let ContentClickInternal = {
       let handler = TabmixSvc.syncHandlers.get(browser.permanentKey);
       linkNode = handler.wrapNode(linkNode);
     }
-    let wrappedNode = this.getWrappedNode(linkNode, focusedWindow, event.button == 0);
+    let wrappedNode = this.getWrappedNode(linkNode, focusedWindow, event.button === 0);
     return this._getParamsForLink(event, wrappedNode, href, browser);
   },
 
@@ -301,7 +301,7 @@ let ContentClickInternal = {
       let target = event.target;
       if (target instanceof HTMLButtonElement ||
           target instanceof HTMLInputElement) {
-        if (SubmitToTab.contentAreaClick(event) == false) {
+        if (SubmitToTab.contentAreaClick(event) === false) {
           return ["default at 1"];
         }
       }
@@ -317,7 +317,7 @@ let ContentClickInternal = {
     eventWhere = this._window.whereToOpenLink(event);
     if (/^save|window/.test(eventWhere)) {
       // make sure to trigger hrefFromOnClick getter
-      this._data.hrefFromOnClick;
+      this._data.hrefFromOnClick; // jshint ignore:line
       return [eventWhere + "@2.1"];
     }
 
@@ -366,7 +366,7 @@ let ContentClickInternal = {
      */
     if (this.divertMiddleClick()) {
       // make sure to trigger hrefFromOnClick getter
-      this._data.hrefFromOnClick;
+      this._data.hrefFromOnClick; // jshint ignore:line
       return [onClickInFrame ? "current.frame at 10" : "current at 10"];
     }
 
@@ -374,9 +374,9 @@ let ContentClickInternal = {
       return ["default at 11"];
 
     // catch other middle & right click
-    if (event.button != 0) {
+    if (event.button !== 0) {
       return event.button == 1 && this._data.hrefFromOnClick ?
-              [TMP_tabshifted(event) + "@12"] : ["default at 12"]
+              [TMP_tabshifted(event) + "@12"] : ["default at 12"];
     }
 
     // the rest of the code if for left-click only
@@ -440,13 +440,13 @@ let ContentClickInternal = {
     let [href, linkNode] = win.hrefAndLinkNodeForClickEvent(aEvent);
     if (!href) {
       let node = LinkNodeUtils.getNodeWithOnClick(aEvent.target);
-      let wrappedOnClickNode = this.getWrappedNode(node, aFocusedWindow, aEvent.button == 0);
+      let wrappedOnClickNode = this.getWrappedNode(node, aFocusedWindow, aEvent.button === 0);
       if (this.getHrefFromNodeOnClick(aEvent, aBrowser, wrappedOnClickNode))
         aEvent.preventDefault();
       return "2.1";
     }
 
-    if (aEvent.button != 0 || aEvent.shiftKey || aEvent.ctrlKey || aEvent.altKey || aEvent.metaKey) {
+    if (aEvent.button !== 0 || aEvent.shiftKey || aEvent.ctrlKey || aEvent.altKey || aEvent.metaKey) {
       if (/^save|window|tab/.test(win.whereToOpenLink(aEvent)))
         this.getHrefFromOnClick(aEvent, href, linkNode, linkNode.getAttribute("onclick"));
       return "3";
@@ -456,7 +456,7 @@ let ContentClickInternal = {
     this._window = win;
 
     this.getPref();
-    if (!this.currentTabLocked && this.targetPref == 0)
+    if (!this.currentTabLocked && this.targetPref === 0)
       return "4";
 
     if (!linkNode)
@@ -467,7 +467,8 @@ let ContentClickInternal = {
 
     var currentHref = this._data.currentURL;
     // don't do anything on mail.google or google.com/reader
-    var isGmail = /^(http|https):\/\/mail.google.com/.test(currentHref) || /^(http|https):\/\/\w*.google.com\/reader/.test(currentHref);
+    var isGmail = /^(http|https):\/\/mail.google.com/.test(currentHref) ||
+                  /^(http|https):\/\/\w*.google.com\/reader/.test(currentHref);
     if (isGmail)
       return "6";
 
@@ -532,10 +533,11 @@ let ContentClickInternal = {
       openNewTab = true;
 
     if (openNewTab) {
+      let blocked;
       try {
         // for the moment just do it for Google and Yahoo....
         // and tvguide.com - added 2013-07-20
-        var blocked = /tvguide.com|google|yahoo.com\/search|my.yahoo.com/.test(currentHref);
+        blocked = /tvguide.com|google|yahoo.com\/search|my.yahoo.com/.test(currentHref);
         // youtube.com - added 2013-11-15
         if (!blocked && /youtube.com/.test(currentHref) &&
            (!this.isGMEnabled() || decodeURI(href).indexOf("return false;") == -1))
@@ -634,7 +636,7 @@ let ContentClickInternal = {
     if (!TabmixSvc.prefBranch.getBoolPref("enablefiletype"))
       return false;
 
-    if (event.button != 0 || event.ctrlKey || event.metaKey)
+    if (event.button !== 0 || event.ctrlKey || event.metaKey)
       return false;
 
     // prevent links in tinderbox.mozilla.org with linkHref to *.gz from open in this function
@@ -646,7 +648,8 @@ let ContentClickInternal = {
     if (onclick) {
       if (this.checkAttr(onclick, "return install") ||
           this.checkAttr(onclick, "return installTheme") ||
-          this.checkAttr(onclick, "return note") || this.checkAttr(onclick, "return log")) // click on link in http://tinderbox.mozilla.org/showbuilds.cgi
+          // click on link in http://tinderbox.mozilla.org/showbuilds.cgi
+          this.checkAttr(onclick, "return note") || this.checkAttr(onclick, "return log"))
         return true;
     }
 
@@ -684,7 +687,7 @@ let ContentClickInternal = {
         hrefExt = linkHrefExt;
         try {
           // prevent filetype catch if it is in the middle of a word
-          testExt = new RegExp(testString + "[a-z0-9?\.]+", 'i');
+          testExt = new RegExp(testString + "[a-z0-9?.]+", 'i');
           if (testExt.test(hrefExt))
             continue;
         } catch (ex) {}
@@ -725,7 +728,7 @@ let ContentClickInternal = {
       return false;
 
     let {event} = this._data;
-    if (event.button == 1 || event.button == 0 && (event.ctrlKey || event.metaKey))
+    if (event.button == 1 || event.button === 0 && (event.ctrlKey || event.metaKey))
       return true;
 
     return false;
@@ -882,7 +885,7 @@ let ContentClickInternal = {
    *        and its frames for content with matching name and href
    */
   selectExistingTab: function TMP_selectExistingTab(window, href, targetFrame) {
-    if (TabmixSvc.prefBranch.getIntPref("opentabforLinks") != 0 ||
+    if (TabmixSvc.prefBranch.getIntPref("opentabforLinks") !== 0 ||
         Services.prefs.getBoolPref("browser.tabs.loadInBackground"))
       return;
 
@@ -898,7 +901,7 @@ let ContentClickInternal = {
         }
       }
       return LinkNodeUtils.isFrameInContent(browser[TabmixSvc.contentWindowAsCPOW], href, targetFrame);
-    }
+    };
 
     let switchIfURIInWindow = function switchIfURIInWindow(aWindow) {
       // Only switch to the tab if both source and desination are
@@ -921,7 +924,7 @@ let ContentClickInternal = {
         }
       }
       return false;
-    }
+    };
 
     let isBrowserWindow = !!window.gBrowser;
     if (isBrowserWindow && switchIfURIInWindow(window))
@@ -953,7 +956,7 @@ let ContentClickInternal = {
 
   get uriFixup() {
     delete this.uriFixup;
-    return this.uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup);
+    return (this.uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup));
   },
 
  /**
@@ -976,8 +979,9 @@ let ContentClickInternal = {
       if (url.match(/^file:/))
         return "local_file";
 
+      let fixedURI;
       try {
-        var fixedURI = self.uriFixup.createFixupURI(url, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
+        fixedURI = self.uriFixup.createFixupURI(url, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
         url = fixedURI.spec;
       } catch (ex) { }
 
@@ -994,9 +998,10 @@ let ContentClickInternal = {
         host.shift();
       return host.join(".");
     */
+        let level;
         try {
           var publicSuffix = Services.eTLD.getPublicSuffixFromHost(url.hostPort);
-          var level = (publicSuffix.indexOf(".") == -1) ? 2 : 3;
+          level = (publicSuffix.indexOf(".") == -1) ? 2 : 3;
         } catch(e) {
           level = 2;
         }
@@ -1006,7 +1011,7 @@ let ContentClickInternal = {
         return host.join(".");
       }
       return null;
-    }
+    };
 
     let targetDomain = getDomain(target);
     return targetDomain && targetDomain != getDomain(curpage);
@@ -1049,7 +1054,7 @@ let ContentClickInternal = {
         this._hrefFromOnClick(href, parent, parent.getAttribute("onclick"), result);
     }
 
-    return event.__hrefFromOnClick = result.__hrefFromOnClick;
+    return (event.__hrefFromOnClick = result.__hrefFromOnClick);
   },
 
   _hrefFromOnClick: function(href, node, onclick, result) {
@@ -1084,7 +1089,7 @@ let ContentClickInternal = {
 
     result.__hrefFromOnClick = newHref;
   }
-}
+};
 
 function makeURI(aURL, aOriginCharset, aBaseURI) {
   return Services.io.newURI(aURL, aOriginCharset, aBaseURI);
diff --git a/modules/ContextMenu.jsm b/modules/ContextMenu.jsm
index 5425b54..a567e33 100644
--- a/modules/ContextMenu.jsm
+++ b/modules/ContextMenu.jsm
@@ -15,7 +15,7 @@ this.ContextMenu = {
     // get focused window selection
     let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
     let focusedWindow = {};
-    let elt = fm.getFocusedElementForWindow(content, true, focusedWindow);
+    fm.getFocusedElementForWindow(content, true, focusedWindow);
     let selectionObject = focusedWindow.value.getSelection();
     if (selectionObject.isCollapsed) // nothing selected
       return [];
@@ -48,7 +48,7 @@ this.ContextMenu = {
         return false;
       }
       return true;
-    }
+    };
 
     let range = selectionObject.getRangeAt(0).cloneContents();
     let treeWalker = doc.createTreeWalker(range,
@@ -73,4 +73,4 @@ this.ContextMenu = {
     }
     return urls;
   }
-}
+};
diff --git a/modules/Decode.jsm b/modules/Decode.jsm
index 4516c75..c27c575 100644
--- a/modules/Decode.jsm
+++ b/modules/Decode.jsm
@@ -9,7 +9,7 @@ var EXPORTED_SYMBOLS = ["Decode"];
 
     use unescape if exist, if removed from firefox we use our own function
 */
-let Decode = {
+this.Decode = {
   escape: function(str) {
     // we always use encodeURI
     return encodeURI(str);
@@ -25,9 +25,9 @@ let Decode = {
    //    return str.replace(/%(u[\da-f]{4}|[\da-f]{2})/gi, function(seq) {return self._(seq);});
     return str.replace(/%(u[\da-f]{4}|[\da-f]{2})/gi, getReturnValue);
   }
-}
+};
 
-let escapeHash = {}
+let escapeHash = {};
 
 function getReturnValue (input) {
   var ret = escapeHash[input];
@@ -62,4 +62,4 @@ function fixedFromCharCode(codePt) {
   else {
     return String.fromCharCode(codePt);
   }
-}
\ No newline at end of file
+}
diff --git a/modules/DocShellCapabilities.jsm b/modules/DocShellCapabilities.jsm
index df55ccf..3feec43 100644
--- a/modules/DocShellCapabilities.jsm
+++ b/modules/DocShellCapabilities.jsm
@@ -2,7 +2,7 @@
 
 this.EXPORTED_SYMBOLS = ["DocShellCapabilities"];
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
@@ -93,4 +93,4 @@ this.DocShellCapabilities = {
     }
     this.restore(tab, disallow, true);
   }
-}
+};
diff --git a/modules/DownloadLastDir.jsm b/modules/DownloadLastDir.jsm
index 190dee6..411b29b 100644
--- a/modules/DownloadLastDir.jsm
+++ b/modules/DownloadLastDir.jsm
@@ -1,8 +1,10 @@
 ///"use strict";
 
+/* jshint strict: false */
+
 this.EXPORTED_SYMBOLS = ["TabmixDownloadLastDir"];
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const {interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
@@ -14,7 +16,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
 
 this.TabmixDownloadLastDir = {
   _initialized: false,
-  init: function(aWindow) {
+  init: function() {
     if (this._initialized)
       return;
     this._initialized = true;
@@ -26,7 +28,7 @@ this.TabmixDownloadLastDir = {
       get: function() {
         if (this._window) {
           try {
-            let loadContext = this._window.QueryInterface(Ci.nsIInterfaceRequestor);
+            this._window.QueryInterface(Ci.nsIInterfaceRequestor);
           } catch (ex) {
             let win = Services.wm.getMostRecentWindow("navigator:browser");
             return win ? win.gBrowser.selectedTab.ownerDocument.defaultView : null;
@@ -39,7 +41,7 @@ this.TabmixDownloadLastDir = {
         return val;
       },
       configurable: true, enumerable: true
-    }
+    };
 
     let downloadModule = {};
     Cu.import("resource://gre/modules/DownloadLastDir.jsm", downloadModule);
@@ -47,6 +49,6 @@ this.TabmixDownloadLastDir = {
     Object.defineProperty(obj, "window", descriptor);
     obj._window = null;
   }
-}
+};
 
-TabmixDownloadLastDir.init();
+this.TabmixDownloadLastDir.init();
diff --git a/modules/DynamicRules.jsm b/modules/DynamicRules.jsm
index 66f0bd4..0c696c6 100644
--- a/modules/DynamicRules.jsm
+++ b/modules/DynamicRules.jsm
@@ -16,6 +16,7 @@ XPCOMUtils.defineLazyGetter(this, "Prefs", function () {
   return Services.prefs.getBranch("extensions.tabmix.styles.");
 });
 
+let TYPE;
 XPCOMUtils.defineLazyGetter(this, "SSS", function () {
     let sss = Cc['@mozilla.org/content/style-sheet-service;1']
                         .getService(Ci.nsIStyleSheetService);
@@ -23,7 +24,6 @@ XPCOMUtils.defineLazyGetter(this, "SSS", function () {
     return sss;
 });
 
-let TYPE;
 const NAMESPACE = '@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");\n';
 const STYLENAMES = ["currentTab", "unloadedTab", "unreadTab", "otherTab", "progressMeter"];
 
@@ -123,7 +123,7 @@ this.DynamicRules = {
                        bg:    '.tabbrowser-tab[tabmix_tabStyle~="unread-bg"]' + backgroundRule},
       otherTab:      { text:  '.tabbrowser-tab[tabmix_tabStyle~="other-text"]' + tabTextRule,
                        bg:    '.tabbrowser-tab[tabmix_tabStyle~="other-bg"]' + backgroundRule},
-    }
+    };
 
     if (TabmixSvc.isMac) {
       backgroundRule = '.tabbrowser-tab[tabmix_tabStyle~="#RULE-bg"] > .tab-stack > .tab-background >\n' +
@@ -168,9 +168,10 @@ this.DynamicRules = {
       }
     }
     styleRules.progressMeter = {
-      bg: '#tabbrowser-tabs[tabmix_progressMeter="userColor"] > .tabbrowser-tab > .tab-stack > .tab-progress-container > .tab-progress' +
-          ' > .progress-bar {\n  background-color: #bottomColor !important;\n}\n'
-    }
+      bg: '#tabbrowser-tabs[tabmix_progressMeter="userColor"] > .tabbrowser-tab > ' +
+          '.tab-stack > .tab-progress-container > .tab-progress > ' +
+          '.progress-bar {\n  background-color: #bottomColor !important;\n}\n'
+    };
 
     this.cssTemplates = styleRules;
   },
@@ -198,7 +199,7 @@ this.DynamicRules = {
                     val.bgColor != prefObj.bgColor ||           // bgColor changed
                     val.bgTopColor != prefObj.bgTopColor) ||    // bgTopColor changed
                   prefObj.text && (!val.text ||                 // textColor enabled
-                    val.textColor != prefObj.textColor)         // textColor changed
+                    val.textColor != prefObj.textColor);        // textColor changed
 
     if (changed)
       this.updateStyles(ruleName, prefObj);
@@ -268,7 +269,7 @@ this.DynamicRules = {
     STYLENAMES.forEach(function(pref){
       defaults[pref] = getDefaultBranch.getCharPref(pref);
     }, this);
-    return this.defaultPrefs = defaults;
+    return (this.defaultPrefs = defaults);
   },
 
   validatePrefValue: function (ruleName) {
@@ -280,12 +281,12 @@ this.DynamicRules = {
     if (!Prefs.prefHasUserValue(ruleName))
       return defaultPrefValues;
 
-    var prefValues = {};
+    var currentPrefValues, prefValues = {};
     let prefString = Prefs.getCharPref(ruleName);
     try {
-      var currentPrefValues = TabmixSvc.JSON.parse(prefString);
+      currentPrefValues = TabmixSvc.JSON.parse(prefString);
       if (currentPrefValues == null)
-        throw Error(ruleName + " value is invalid\n" + prefString)
+        throw Error(ruleName + " value is invalid\n" + prefString);
     }
     catch (ex) {
       TabmixSvc.console.log(ex);
@@ -295,7 +296,7 @@ this.DynamicRules = {
         currentPrefValues = Components.utils.evalInSandbox("({" + prefString  + "})",
                             new Components.utils.Sandbox("about:blank"));
         Prefs.setCharPref(ruleName, TabmixSvc.JSON.stringify(currentPrefValues));
-      } catch (ex) {
+      } catch (er) {
           TabmixSvc.console.log('Error in preference "' + ruleName + '", value was reset to default');
           Prefs.clearUserPref(ruleName);
           // set prev value to default so we can continue with this function
@@ -331,7 +332,7 @@ this.DynamicRules = {
     return prefValues;
   }
 
-}
+};
 
 // Converts a color string in the format "#RRGGBB" to rgba(r,g,b,a).
 function getRGBcolor(aColorCode, aOpacity) {
diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index dd07d49..6727fc7 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -2,7 +2,7 @@
 
 var EXPORTED_SYMBOLS = ["LinkNodeUtils"];
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
@@ -58,7 +58,7 @@ this.LinkNodeUtils = {
       },
       _focusedWindowHref: focusedWindow.top.location.href,
       _attributes: getAttributes(node, attribs)
-    }
+    };
     if (getTargetIsFrame)
       wrapper.targetIsFrame = targetIsFrame(wrapper.target, focusedWindow);
     return wrapper;
@@ -75,13 +75,13 @@ this.LinkNodeUtils = {
       return node;
     return null;
   }
-}
+};
 
 function getAttributes(node, attribs) {
   let wrapper = {};
-  for (let name of attribs) {
-    if (node.hasAttribute(name)) {
-      wrapper[name] = node.getAttribute(name);
+  for (let att of attribs) {
+    if (node.hasAttribute(att)) {
+      wrapper[att] = node.getAttribute(att);
     }
   }
   return wrapper;
diff --git a/modules/MergeWindows.jsm b/modules/MergeWindows.jsm
index 6046085..5b2cb5c 100644
--- a/modules/MergeWindows.jsm
+++ b/modules/MergeWindows.jsm
@@ -2,7 +2,7 @@
 
 var EXPORTED_SYMBOLS = ["MergeWindows"];
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://tabmixplus/Services.jsm");
@@ -17,10 +17,10 @@ Cu.import("resource://tabmixplus/Services.jsm");
 // Convert to module and modfied by onemen                          //
 //                                                                  //
 */////////////////////////////////////////////////////////////////////
-let MergeWindows = {
+this.MergeWindows = {
   get prefs() {
     delete this.prefs;
-    return this.prefs = Services.prefs.getBranch("extensions.tabmix.");
+    return (this.prefs = Services.prefs.getBranch("extensions.tabmix."));
   },
 
   // merge several windows to one window, or only selected tabs to previous focussed window,
@@ -104,7 +104,7 @@ let MergeWindows = {
         features += aPrivate ? ",private" : ",non-private";
     var newWindow = aWindows[0].openDialog("chrome://browser/content/browser.xul",
         "_blank", features, null);
-    let mergePopUps = function _mergePopUps(aEvent) {
+    let mergePopUps = function _mergePopUps() {
       newWindow.removeEventListener("SSWindowStateReady", _mergePopUps, false);
       this.concatTabsAndMerge(newWindow, aWindows);
     }.bind(this);
@@ -161,7 +161,7 @@ let MergeWindows = {
       let newTab = tabbrowser.addTab("about:blank", {dontMove: isPopup});
       let newBrowser = newTab.linkedBrowser;
       newBrowser.stop();
-      newBrowser.docShell;
+      newBrowser.docShell; // jshint ignore:line
       if (tab.hasAttribute("_TMP_selectAfterMerege")) {
         tab.removeAttribute("_TMP_selectAfterMerege");
         tabToSelect = newTab;
@@ -188,7 +188,7 @@ let MergeWindows = {
 
   // we use it only for Fireofx 20+, before that always return false
   isWindowPrivate: function() {
-    delete this.isWindowPrivate
+    delete this.isWindowPrivate;
     if (TabmixSvc.version(200)) {
       Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
       this.isWindowPrivate = function(aWindow) PrivateBrowsingUtils.isWindowPrivate(aWindow);
@@ -237,7 +237,7 @@ let MergeWindows = {
 
     let windows = [], popUps = [];
     let isWINNT = Services.appinfo.OS == "WINNT";
-    let more = function() !isWINNT || aOptions.multiple || windows.length == 0;
+    let more = function() !isWINNT || aOptions.multiple || windows.length === 0;
     // getEnumerator return windows from oldest to newest, so we use unshift.
     // when OS is WINNT and option is not multiple the loop stops when we find the most
     // recent suitable window
@@ -293,7 +293,7 @@ let MergeWindows = {
       return true;
 
     var promptAgain = { value:true };
-    var canClose = Services.prompt.confirmCheck(aWindow,
+    canClose = Services.prompt.confirmCheck(aWindow,
                    TabmixSvc.getString('tmp.merge.warning.title'),
                    TabmixSvc.getString('tmp.merge.warning.message'),
                    TabmixSvc.getString('tmp.merge.warning.checkboxLabel'),
@@ -304,4 +304,4 @@ let MergeWindows = {
 
     return canClose;
   }
-}
+};
diff --git a/modules/Places.jsm b/modules/Places.jsm
index 6b15387..d6fa7a4 100644
--- a/modules/Places.jsm
+++ b/modules/Places.jsm
@@ -26,7 +26,7 @@ XPCOMUtils.defineLazyGetter(this, "PlacesUtils", function() {
 XPCOMUtils.defineLazyModuleGetter(this,
   "TabmixSvc", "resource://tabmixplus/Services.jsm");
 
-this.TabmixPlacesUtils = {
+this.TabmixPlacesUtils = Object.freeze({
   init: function(aWindow) {
     PlacesUtilsInternal.init(aWindow);
   },
@@ -34,12 +34,11 @@ this.TabmixPlacesUtils = {
   onQuitApplication: function() {
     PlacesUtilsInternal.onQuitApplication();
   }
-}
-Object.freeze(TabmixPlacesUtils);
+});
 
-let Tabmix = { }
+let Tabmix = { };
 
-let PlacesUtilsInternal = {
+var PlacesUtilsInternal = {
   _timer: null,
   _initialized: false,
 
@@ -68,11 +67,11 @@ let PlacesUtilsInternal = {
   functions: ["_openTabset", "openURINodesInTabs", "openContainerNodeInTabs", "openNodeWithEvent", "_openNodeIn"],
   initPlacesUIUtils: function TMP_PC_initPlacesUIUtils(aWindow) {
     try {
-      let test = PlacesUIUtils._openTabset.toString();
+      PlacesUIUtils._openTabset.toString();
     } catch (ex) {
       if (aWindow.document.documentElement.getAttribute("windowtype") == "navigator:browser") {
-        TabmixSvc.console.log("Starting with Firefox 21 Imacros 8.3.0 break toString on PlacesUIUtils functions."
-          + "\nTabmix can't update PlacesUIUtils to work according to Tabmix preferences, use Imacros 8.3.1 and up.");
+        TabmixSvc.console.log("Starting with Firefox 21 Imacros 8.3.0 break toString on PlacesUIUtils functions." +
+          "\nTabmix can't update PlacesUIUtils to work according to Tabmix preferences, use Imacros 8.3.1 and up.");
       }
       return;
     }
@@ -83,7 +82,7 @@ let PlacesUtilsInternal = {
 
     var treeStyleTab = "TreeStyleTabBookmarksService" in aWindow;
     function updateOpenTabset() {
-      let openGroup = "    browserWindow.TMP_Places.openGroup(urls, ids, where$1);"
+      let openGroup = "    browserWindow.TMP_Places.openGroup(urls, ids, where$1);";
       Tabmix.changeCode(PlacesUIUtils, "PlacesUIUtils._openTabset")._replace(
         'urls = []',
         'behavior, $&', {check: treeStyleTab}
@@ -108,7 +107,7 @@ let PlacesUtilsInternal = {
         '      where = "current";\n' +
         openGroup.replace("$1", treeStyleTab ? ", behavior" : "")
       ).toCode();
-    };
+    }
     if (treeStyleTab) {
       // wait until TreeStyleTab changed PlacesUIUtils._openTabset
       let timer = this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
@@ -175,4 +174,4 @@ let PlacesUtilsInternal = {
       '        $&'
     ).toCode();
   }
-}
+};
diff --git a/modules/RenameTab.jsm b/modules/RenameTab.jsm
index 8a705ff..7ca7f65 100644
--- a/modules/RenameTab.jsm
+++ b/modules/RenameTab.jsm
@@ -4,7 +4,7 @@ var EXPORTED_SYMBOLS = ["RenameTab"];
 
 Components.utils.import("resource://tabmixplus/Services.jsm");
 
-let RenameTab = {
+this.RenameTab = {
   window: null,
   panel: null,
   data: {},
@@ -58,7 +58,7 @@ let RenameTab = {
     );
   },
 
-  observe: function(aSubject, aTopic, aData) {
+  observe: function(aSubject, aTopic) {
     if (aTopic != "xul-overlay-merged")
       return;
 
@@ -163,4 +163,4 @@ let RenameTab = {
   hidePopup: function() {
     this.panel.hidePopup();
   }
-}
\ No newline at end of file
+};
diff --git a/modules/Services.jsm b/modules/Services.jsm
index 23e40e1..567d952 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -20,10 +20,10 @@ function isVersion(aVersionNo) {
     return _versions[aVersionNo];
 
   let v = Services.appinfo.version;
-  return _versions[aVersionNo] = Services.vc.compare(v, aVersionNo/10 + ".0a1") >= 0;
+  return (_versions[aVersionNo] = Services.vc.compare(v, aVersionNo/10 + ".0a1") >= 0);
 }
 
-let TabmixSvc = {
+this.TabmixSvc = {
   debugMode: function() {
     return this.prefBranch.prefHasUserValue("enableDebug") &&
       this.prefBranch.getBoolPref("enableDebug");
@@ -84,9 +84,9 @@ let TabmixSvc = {
     delete this.direct2dDisabled;
     try {
       // this pref exist only in windows
-      return this.direct2dDisabled = Services.prefs.getBoolPref("gfx.direct2d.disabled");
+      return (this.direct2dDisabled = Services.prefs.getBoolPref("gfx.direct2d.disabled"));
     } catch(ex) {}
-    return this.direct2dDisabled = false;
+    return (this.direct2dDisabled = false);
   },
 
   /**
@@ -114,7 +114,7 @@ let TabmixSvc = {
       } catch(ex) {
         try {
           return "decode" in this.nsIJSON ? this.nsIJSON.decode(str) : null;
-        } catch(ex) {return null}
+        } catch(er) {return null}
       }
     },
     stringify: function TMP_stringify(obj) {
@@ -123,7 +123,7 @@ let TabmixSvc = {
       } catch(ex) {
         try {
           return "encode" in this.nsIJSON ? this.nsIJSON.encode(obj) : null;
-        } catch(ex) {return null}
+        } catch(er) {return null}
       }
     }
   },
@@ -164,7 +164,7 @@ let TabmixSvc = {
       tmp.DynamicRules.init(aWindow);
     },
 
-    observe: function(aSubject, aTopic, aData) {
+    observe: function(aSubject, aTopic) {
       switch (aTopic) {
         case "quit-application":
           TabmixPlacesUtils.onQuitApplication();
@@ -183,18 +183,18 @@ let TabmixSvc = {
   },
 
   saveTabAttributes: function(tab, attrib) {
-    TabStateCache.saveTabAttributes(tab, attrib);
+    tabStateCache.saveTabAttributes(tab, attrib);
   },
 
   get ss() {
     delete this.ss;
     if (isVersion(250, 250)) {
-      let tmp = {}
+      let tmp = {};
       Cu.import("resource:///modules/sessionstore/SessionStore.jsm", tmp);
-      return this.ss = tmp.SessionStore;
+      return (this.ss = tmp.SessionStore);
     }
-    return this.ss = Cc["@mozilla.org/browser/sessionstore;1"].
-                     getService(Ci.nsISessionStore);
+    return (this.ss = Cc["@mozilla.org/browser/sessionstore;1"].
+                     getService(Ci.nsISessionStore));
   },
 
   sm: {
@@ -204,18 +204,18 @@ let TabmixSvc = {
     crashed: false,
     get sanitized() {
       delete this.sanitized;
-      return this.sanitized = TabmixSvc.prefBranch.prefHasUserValue("sessions.sanitized");
+      return (this.sanitized = TabmixSvc.prefBranch.prefHasUserValue("sessions.sanitized"));
     },
     set sanitized(val) {
       delete this.sanitized;
-      return this.sanitized = val;
+      return (this.sanitized = val);
     },
     private: true,
     settingPreference: false,
   },
 
   blockedClickingOptions: []
-}
+};
 
 XPCOMUtils.defineLazyGetter(TabmixSvc.JSON, "nsIJSON", function() {
   return Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON);
@@ -230,13 +230,15 @@ XPCOMUtils.defineLazyGetter(TabmixSvc, "australis", function() {
 XPCOMUtils.defineLazyGetter(TabmixSvc, "prefs", function() {
   let svc = isVersion(230) ? "resource://gre/modules/Preferences.jsm" :
                              "resource://services-common/preferences.js";
-  let tmp = {}
+  let tmp = {};
   Cu.import(svc, tmp);
   return new tmp.Preferences("");
 });
 
 // Tabmix preference branch
-XPCOMUtils.defineLazyGetter(TabmixSvc, "prefBranch", function () {return Services.prefs.getBranch("extensions.tabmix.")});
+XPCOMUtils.defineLazyGetter(TabmixSvc, "prefBranch", function () {
+  return Services.prefs.getBranch("extensions.tabmix.");
+});
 // string bundle
 XPCOMUtils.defineLazyGetter(TabmixSvc, "_strings", function () {
   let properties = "chrome://tabmixplus/locale/tabmix.properties";
@@ -283,10 +285,10 @@ XPCOMUtils.defineLazyModuleGetter(TabmixSvc, "FileUtils",
 XPCOMUtils.defineLazyModuleGetter(TabmixSvc, "console",
   "resource://tabmixplus/log.jsm");
 
-let TabStateCache = {
+var tabStateCache = {
   get _update() {
     delete this._update;
-    return this._update = isVersion(260) ? "updateField" : "update";
+    return (this._update = isVersion(260) ? "updateField" : "update");
   },
 
   get TabStateCache() {
@@ -309,7 +311,7 @@ let TabStateCache = {
           attributes[key] = tab.getAttribute(key);
         else if (key in attributes)
           delete attributes[key];
-      })
+      });
     }
 
     let browser = tab.linkedBrowser;
@@ -331,4 +333,4 @@ let TabStateCache = {
       this.TabStateCache[this._update](browser, "attributes", attributes);
     }
   }
-}
+};
diff --git a/modules/Shortcuts.jsm b/modules/Shortcuts.jsm
index 95464b3..abcd47d 100644
--- a/modules/Shortcuts.jsm
+++ b/modules/Shortcuts.jsm
@@ -49,7 +49,7 @@ let Shortcuts = {
 
   get prefs() {
     delete this.prefs;
-    return this.prefs = Services.prefs.getBranch("extensions.tabmix.");
+    return (this.prefs = Services.prefs.getBranch("extensions.tabmix."));
   },
 
   prefsChangedByTabmix: false,
@@ -65,7 +65,7 @@ let Shortcuts = {
     this.initialized = true;
 
     if (TabmixSvc.version(200)) {
-      let tmp = {}
+      let tmp = {};
       Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", tmp);
       this.permanentPrivateBrowsing = tmp.PrivateBrowsingUtils.permanentPrivateBrowsing;
     }
@@ -106,7 +106,7 @@ let Shortcuts = {
         this.prefs.removeObserver("sessions.manager", this);
         Services.obs.removeObserver(this, "quit-application");
         if (this.keyConfigInstalled)
-          Keyconfig.deinit();
+          KeyConfig.deinit();
         break;
     }
   },
@@ -162,11 +162,11 @@ let Shortcuts = {
 
   onUnload: function TMP_SC_onUnload(aWindow) {
     aWindow.removeEventListener("unload", this, false);
-    let document = aWindow.document;
+    let doc = aWindow.document;
     for (let key of Object.keys(this.keys)) {
       let keyData = this.keys[key];
       if (keyData.command && keyData.value) {
-        let keyItem = document.getElementById(keyData.id || "key_tm_" + key);
+        let keyItem = doc.getElementById(keyData.id || "key_tm_" + key);
         if (keyItem)
           keyItem.removeEventListener("command", this, true);
       }
@@ -294,7 +294,7 @@ let Shortcuts = {
       // if key in preference is not valid key or its value is not valid
       // or its value equal to default, remove it from the preference
       let keyData = this.keys[key] || null;
-      if (!keyData || typeof val != "string" || val == keyData.default || val == "" ||
+      if (!keyData || typeof val != "string" || val == keyData.default || val === "" ||
           (val == "d&" && (!keyData.default || /^d&/.test(keyData.default)))) {
         delete shortcuts[key];
         updatePreference = true;
@@ -383,7 +383,7 @@ let Shortcuts = {
   },
 
   getFormattedKeyForID: function(id) {
-    let key = this.keyParse(this.keys[id].value)
+    let key = this.keyParse(this.keys[id].value);
     return getFormattedKey(key);
   },
 
@@ -412,13 +412,13 @@ let Shortcuts = {
     }, this);
   }
 
-}
+};
 
-let KeyConfig = {
+var KeyConfig = {
   prefsChangedByTabmix: false,
   // when keyConfig extension installed sync the preference
   // user may change shortcuts in both extensions
-  init: function(aWindow) {
+  init: function() {
     this.keyIdsMap = {};
     // keyConfig use index number for its ids
     let oldReloadId = "xxx_key29_Browser:Reload";
@@ -517,7 +517,7 @@ let KeyConfig = {
     this.prefs.clearUserPref(prefName);
   }
 
-}
+};
 
 function getPref(name) {
   return Services.prefs.getComplexValue(name, Ci.nsISupportsString).data;
@@ -539,7 +539,7 @@ function getFormattedKey(key) {
     key.modifiers.replace(/^[\s,]+|[\s,]+$/g,"").split(/[\s,]+/g).forEach(function(mod){
       if (/alt|shift|control|meta|accel/.test(mod))
         val += getPlatformKeys("VK_" + mod.toUpperCase()) + sep;
-    })
+    });
   }
 
   if (key.key) {
@@ -549,11 +549,13 @@ function getFormattedKey(key) {
     else
       val += key.key.toUpperCase();
   }
-  if (key.keycode) try {
-    let localeKeys = Services.strings.createBundle("chrome://global/locale/keys.properties");
-    val += localeKeys.GetStringFromName(key.keycode);
-  } catch (ex) {
-    val += "<" + key.keycode + ">";
+  if (key.keycode) {
+    try {
+      let localeKeys = Services.strings.createBundle("chrome://global/locale/keys.properties");
+      val += localeKeys.GetStringFromName(key.keycode);
+    } catch (ex) {
+      val += "<" + key.keycode + ">";
+    }
   }
   return val;
 }
@@ -572,14 +574,14 @@ function getPlatformKeys(key) {
   else
     val = getPlatformKeys("VK_" + getPlatformAccel().toUpperCase());
 
-  return gPlatformKeys[key] = val;
+  return (gPlatformKeys[key] = val);
 }
 
 function getPlatformAccel() {
   switch (Services.prefs.getIntPref("ui.key.accelKey")) {
-    case 17:  return "control"; break;
-    case 18:  return "alt"; break;
-    case 224: return "meta"; break;
+    case 17:  return "control";
+    case 18:  return "alt";
+    case 224: return "meta";
   }
-  return Services.appinfo.OS == "Darwin" ? "meta" : "control"
+  return (Services.appinfo.OS == "Darwin" ? "meta" : "control");
 }
diff --git a/modules/SingleWindowModeUtils.jsm b/modules/SingleWindowModeUtils.jsm
index 829e582..dc65248 100644
--- a/modules/SingleWindowModeUtils.jsm
+++ b/modules/SingleWindowModeUtils.jsm
@@ -2,14 +2,14 @@
 
 var EXPORTED_SYMBOLS = ["SingleWindowModeUtils"];
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const {interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://tabmixplus/Services.jsm");
 
-let SingleWindowModeUtils = {
+this.SingleWindowModeUtils = {
   initialized: false,
-  initService: function(aWindow) {
+  initService: function() {
     if (this.initialized)
       return;
     this.initialized = true;
@@ -42,7 +42,7 @@ let SingleWindowModeUtils = {
 
     var windows = Services.wm.getEnumerator("navigator:browser");
     while (windows.hasMoreElements()) {
-      let win = windows.getNext()
+      let win = windows.getNext();
       if (isSuitableBrowserWindow(win))
         return win;
     }
@@ -53,7 +53,7 @@ let SingleWindowModeUtils = {
     if (!aWindow.Tabmix.singleWindowMode)
       return;
 
-    if (!aWindow.arguments || aWindow.arguments.length == 0)
+    if (!aWindow.arguments || aWindow.arguments.length === 0)
       return;
 
     this.initService();
@@ -82,7 +82,7 @@ let SingleWindowModeUtils = {
       height: win.getAttribute("height"),
       screenX: win.getAttribute("screenX"),
       screenY: win.getAttribute("screenY")
-    }
+    };
     // hide the new window
     aWindow.resizeTo(10, 10);
     aWindow.moveTo(-50, -50);
@@ -101,7 +101,7 @@ let SingleWindowModeUtils = {
     if (!existingWindow)
       return;
 
-    if (!newWindow.arguments || newWindow.arguments.length == 0)
+    if (!newWindow.arguments || newWindow.arguments.length === 0)
       return;
     var args = newWindow.arguments;
 
@@ -112,7 +112,7 @@ let SingleWindowModeUtils = {
     var [referrerURI, postData, allowThirdPartyFixup] = [null, null, false];
     if (uriToLoad instanceof Ci.nsISupportsArray) {
       let count = uriToLoad.Count();
-      for (var i = 0; i < count; i++) {
+      for (let i = 0; i < count; i++) {
         let urisstring = uriToLoad.GetElementAt(i).QueryInterface(Ci.nsISupportsString);
         urls.push(urisstring.data);
       }
@@ -171,7 +171,7 @@ let SingleWindowModeUtils = {
           existingBrowser.selectedTab = firstTabAdded;
         // for the case the window is minimized or not in focus
         existingWindow.focus();
-      },0)
+      },0);
     }  catch(ex) {existingWindow.Tabmix.obj(ex);}
   }
-}
+};
diff --git a/modules/Slideshow.jsm b/modules/Slideshow.jsm
index afad778..51d367c 100644
--- a/modules/Slideshow.jsm
+++ b/modules/Slideshow.jsm
@@ -73,4 +73,4 @@ flst.prototype = {
     }
     return false;
   }
-}
+};
diff --git a/modules/extensions/AddonManager.jsm b/modules/extensions/AddonManager.jsm
index 29aa72a..e68a60a 100644
--- a/modules/extensions/AddonManager.jsm
+++ b/modules/extensions/AddonManager.jsm
@@ -6,12 +6,12 @@
 
 var EXPORTED_SYMBOLS = ["TabmixAddonManager"];
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/AddonManager.jsm");
 Cu.import("resource://tabmixplus/Services.jsm");
 
-function log(msg) {
+function log(msg) { // jshint ignore:line
   TabmixSvc.console.log(msg);
 }
 
@@ -29,14 +29,14 @@ let PrivateTab = {
       aWindow.TMP_eventListener.updateMultiRow(true);
     });
   }
-}
+};
 
 let SessionManager = {
   id: "{1280606b-2510-4fe0-97ef-9b5a22eafe30}",
   init: function() {
     this._saveTabmixPrefs();
     try {
-      let tmp = {}
+      let tmp = {};
       Cu.import("chrome://sessionmanager/content/modules/session_manager.jsm", tmp);
       TabmixSvc.sessionManagerAddonInstalled = true;
     }
@@ -73,11 +73,11 @@ let SessionManager = {
     TabmixSvc.prefBranch.setBoolPref(pref, isActive);
     TabmixSvc.prefBranch.clearUserPref(pref);
   }
-}
+};
 
 let TabmixListener = {
   onChange: function(aAddon, aAction) {
-    let id = aAddon.id
+    let id = aAddon.id;
     if (id == SessionManager.id)
       SessionManager[aAction]();
     else if (id == PrivateTab.id) {
@@ -95,7 +95,7 @@ let TabmixListener = {
       return;
     this.onEnabled(aAddon);
   }
-}
+};
 
 let TabmixAddonManager = {
   initialized: false,
@@ -107,6 +107,6 @@ let TabmixAddonManager = {
     SessionManager.init();
     AddonManager.addAddonListener(TabmixListener);
   }
-}
+};
 
 TabmixAddonManager.init();
diff --git a/modules/extensions/CompatibilityCheck.jsm b/modules/extensions/CompatibilityCheck.jsm
index 888e754..6bcd96e 100644
--- a/modules/extensions/CompatibilityCheck.jsm
+++ b/modules/extensions/CompatibilityCheck.jsm
@@ -14,21 +14,12 @@ var EXPORTED_SYMBOLS = ["CompatibilityCheck"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-const TMP_BUTTON_OK = 0;
 const TMP_BUTTON_CANCEL = 1;
 const TMP_BUTTON_EXTRA1 = 2;
-const TMP_SHOW_MENULIST = 1;
-const TMP_SHOW_TEXTBOX = 0;
 const TMP_HIDE_MENUANDTEXT = 2;
 const TMP_CHECKBOX_UNCHECKED = 0;
 const TMP_CHECKBOX_CHECKED = 1;
 const TMP_HIDE_CHECKBOX = 2;
-const TMP_SELECT_DEFAULT = 0;
-const TMP_SELECT_LASTSESSION = 1;
-const TMP_SELECT_CRASH = 2;
-const TMP_SHOW_CLOSED_WINDOW_LIST = 3;
-const TMP_DLG_SAVE = 0;
-const TMP_DLG_RENAME = 1;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/AddonManager.jsm");
@@ -65,16 +56,25 @@ CompatibilityCheck.prototype = {
       return !!(aAddon.pendingOperations & action);
     }
 
+    function AddOn(addon) {
+      this.name = addon.name;
+      this.id =  addon.id;
+      this._version = addon.version;
+    }
+    AddOn.prototype = {
+      toString: function() {return this._name.toLowerCase();}
+    };
+
     var guid_list = this.getList();
     var self = this;
     AddonManager.getAddonsByTypes(["extension"], function(aAddonsList) {
       for (let i = 0; i < aAddonsList.length; i++) {
         let addon = aAddonsList[i];
-        if (addon.id.toLowerCase() in  guid_list) {
+        if (addon.id.toLowerCase() in guid_list) {
           let disabled = addon.userDisabled;
           if ((!disabled && !isPending(addon, "disable") && !isPending(addon, "uninstall")) ||
                   (disabled && isPending(addon, "enable"))) {
-            self.list.push({_name: addon.name, id: addon.id, _version: addon.version, toString:function() {return this._name.toLowerCase();}});
+            self.list.push(new AddOn(addon));
             if (!self.showList)
               break;
           }
@@ -85,7 +85,7 @@ CompatibilityCheck.prototype = {
   },
 
   showResult: function TMP_EX_showResult() {
-    let emptyList = this.list.length == 0;
+    let emptyList = this.list.length === 0;
     if (this.showList && !emptyList)
       this.warnAboutIncompatible();
     else
@@ -105,12 +105,12 @@ CompatibilityCheck.prototype = {
       outStr += " - " + name + " " + list[i]._version + "\n";
     }
 
-    var showatStart = TabmixSvc.prefBranch.getBoolPref("disableIncompatible")
+    var showatStart = TabmixSvc.prefBranch.getBoolPref("disableIncompatible");
     var chkBoxState = showatStart ? TMP_CHECKBOX_CHECKED : TMP_CHECKBOX_UNCHECKED;
 
     var title = TabmixSvc.getString("incompatible.title");
-    var msg = TabmixSvc.getString("incompatible.msg0") + "\n"
-            + TabmixSvc.getString("incompatible.msg1") + "\n\n" + outStr + "\n\n";
+    var msg = TabmixSvc.getString("incompatible.msg0") + "\n" +
+              TabmixSvc.getString("incompatible.msg1") + "\n\n" + outStr + "\n\n";
     var chkBoxLabel = TabmixSvc.getString("incompatible.chkbox.label");
     var buttons = [TabmixSvc.setLabel("incompatible.button0"),
             TabmixSvc.setLabel("incompatible.button1")];
@@ -148,7 +148,7 @@ CompatibilityCheck.prototype = {
     list.forEach(function(aAddonToDisable) {
       AddonManager.getAddonByID(aAddonToDisable.id, function(aAddon) {
         aAddon.userDisabled = true;
-      })
+      });
     });
   },
 
@@ -161,7 +161,7 @@ CompatibilityCheck.prototype = {
     else {
       let title = TabmixSvc.getString("incompatible.title");
       let msg = TabmixSvc.getString("incompatible.msg2");
-      let button = TabmixSvc.setLabel("sm.button.continue")
+      let button = TabmixSvc.setLabel("sm.button.continue");
       let buttons = ["", button].join("\n");
       // make it not modal on startup
       let callBack = this.callbackDialog ? null : function () {/* nothing to do */};
@@ -229,4 +229,4 @@ CompatibilityCheck.prototype = {
     guid_list['tab-width at design-noir.de'] = true;                 //   Custom Tab Width
     return guid_list;
   }
-}
+};
diff --git a/modules/extensions/TabGroupsManager.jsm b/modules/extensions/TabGroupsManager.jsm
index 4d2f24c..63a5f3e 100644
--- a/modules/extensions/TabGroupsManager.jsm
+++ b/modules/extensions/TabGroupsManager.jsm
@@ -5,12 +5,15 @@
  */
 var EXPORTED_SYMBOLS = ["TMP_TabGroupsManager"];
 
-let TMP_TabGroupsManager = {
-  init: function TMP_TGM_init(aWindow, tabBar) {
+this.TMP_TabGroupsManager = {
+  init: function TMP_TGM_init(aWindow) {
     this.changeCode(aWindow.TMP_eventListener, "TMP_eventListener.onTabOpen")._replace(
       /(\})(\)?)$/,
-      'try {if (TabGroupsManager.apiEnabled) TabGroupsManager.eventListener.onTabOpen(aEvent);} catch(e) {Tabmix.log(e);}\
-       $1$2'
+      '    try {\n' +
+      '      if (TabGroupsManager.apiEnabled)\n' +
+      '        TabGroupsManager.eventListener.onTabOpen(aEvent);\n' +
+      '    } catch(e) {Tabmix.log(e);}\n' +
+      '    $1$2'
     ).toCode();
 
     // in Firefox 4.0 we call TabGroupsManager.eventListener.onTabClose regardless of browser.tabs.animate
diff --git a/modules/log.jsm b/modules/log.jsm
index 3bdf73f..533e8bb 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -9,7 +9,7 @@ Cu.import("resource://tabmixplus/Services.jsm");
 
 let gNextID = 1;
 
-let console = {
+this.console = {
   getObject: function(aWindow, aMethod) {
     let msg = "";
     if (!aWindow)
@@ -27,8 +27,9 @@ let console = {
       methodsList.shift();
       rootID = methodsList.shift().replace(/getElementById\(|\)|'|"/g , "");
     }
+    var obj;
     try {
-      var obj = aWindow;
+      obj = aWindow;
       if (rootID)
         obj = obj.document.getElementById(rootID);
       methodsList.forEach(function(aFn) {
@@ -49,7 +50,7 @@ let console = {
         if (typeof aMethod != "function") {
           result = isObj ? aMethod.obj[aMethod.name] :
                 this.getObject(aWindow, aMethod);
-          result = " = " + result.toString()
+          result = " = " + result.toString();
         }
         this.clog((isObj ? aMethod.fullName : aMethod) + result);
       }.bind(this);
@@ -136,13 +137,13 @@ let console = {
 
   _char: "@",
   _name: function(fn) {
-    let name = fn.substr(0, fn.indexOf(this._char))
-    if (fn && !name) {
+    let fnName = fn.substr(0, fn.indexOf(this._char));
+    if (fn && !fnName) {
       // get file name and line number
       let lastIndexOf = fn.lastIndexOf("/");
-      name = lastIndexOf > -1 ? fn.substr(lastIndexOf+1) : "?";
+      fnName = lastIndexOf > -1 ? fn.substr(lastIndexOf+1) : "?";
     }
-    return name;
+    return fnName;
   },
 
 /*
@@ -200,7 +201,7 @@ options = {
     var offset = typeof level == "string" ? "  " : "";
     aMessage = aMessage ? offset + aMessage + "\n" : "";
     var objS = aObj ? offset + aObj.toString() : offset + "aObj is " + typeof(aObj);
-    objS +=  ":\n"
+    objS +=  ":\n";
 
     for (let prop in aObj) {
       try {
@@ -211,7 +212,7 @@ options = {
         if (type == "function" && typeof level == "string") {
           val = val.toString();
           let code = val.toString().indexOf("native code") > -1 ?
-            "[native code]" : "[code]"
+            "[native code]" : "[code]";
           val = val.substr(0, val.indexOf("(")) + "() { " + code + " }";
         }
         objS += offset + prop + "[" + type + "]" + " =  " + val + "\n";
@@ -233,7 +234,7 @@ options = {
     delete this._pathRegExp;
     let folder = TabmixSvc.FileUtils.getDir("ProfD", ["extensions"]);
     let path = folder.path.replace("\\", "/", "g") + "/";
-    return this._pathRegExp = new RegExp("jar:|file:///|" + path, "g");
+    return (this._pathRegExp = new RegExp("jar:|file:///|" + path, "g"));
   },
 
   _formatStack: function(stack) {
@@ -284,4 +285,4 @@ options = {
     let stack = this._formatStack(this._getStackExcludingInternal());
     this.logStringMessage("Tabmix Trace: " + (aMsg || "") + '\n' + stack);
   }
-}
+};

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



More information about the Pkg-mozext-commits mailing list