[Pkg-mozext-commits] [tabmixplus] 04/22: Hinting chrome/content/* folders

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 a6df04646308df44189bcd0b955f59446c748fbd
Author: onemen <tabmix.onemen at gmail.com>
Date:   Tue Dec 23 12:07:17 2014 +0200

    Hinting chrome/content/* folders
---
 chrome/content/click/click.js           | 156 ++++++++++-------
 chrome/content/extensions/extensions.js |  45 ++---
 chrome/content/extensions/sage.js       |   2 +-
 chrome/content/flst/lasttab.js          |   6 +-
 chrome/content/links/contentLinks.js    |   2 +-
 chrome/content/links/newTab.js          |   4 +-
 chrome/content/links/removeBlankTab.js  |  14 +-
 chrome/content/links/setup.js           |  39 ++---
 chrome/content/links/userInterface.js   |  33 ++--
 chrome/content/minit/autoReload.js      |  86 +++++-----
 chrome/content/minit/minit.js           | 140 +++++++++-------
 chrome/content/minit/tabView.js         |  58 +++----
 chrome/content/minit/tablib.js          | 183 ++++++++++----------
 chrome/content/places/places.js         |  42 +++--
 chrome/content/session/promptservice.js |  11 +-
 chrome/content/session/session.js       | 286 ++++++++++++++++++--------------
 chrome/content/session/sessionStore.js  |  63 +++----
 chrome/content/tab/tab.js               | 219 ++++++++++++++----------
 18 files changed, 769 insertions(+), 620 deletions(-)

diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index 053eb2e..ee5fae9 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -14,7 +14,7 @@ var TabmixTabClickOptions = {
     if (aEvent.button == 2)
       return; // right click
 
-    if (aEvent.button == 0 && aEvent.detail > 1) {
+    if (aEvent.button === 0 && aEvent.detail > 1) {
       if (this._blockDblClick)
         setTimeout(function(self) {self._blockDblClick = false;}, 0, this);
       return; // double click (with left button)
@@ -22,29 +22,35 @@ var TabmixTabClickOptions = {
 
     var target = aEvent.originalTarget;
     var anonid = target.getAttribute("anonid");
-    this._blockDblClick = aEvent.button == 0 && anonid == "tmp-close-button" ||
+    this._blockDblClick = aEvent.button === 0 && anonid == "tmp-close-button" ||
                               target.classList.contains("tabs-newtab-button");
 
-    // don't do anything if user left click on close tab button , or on any other button on tab or tabbar
-    if (aEvent.button == 0 && (anonid == "tmp-close-button" || target.localName == "toolbarbutton"))
+    // don't do anything if user left click on close tab button, or on any
+    // other button on tab or tabbar
+    if (aEvent.button === 0 && (anonid == "tmp-close-button" ||
+                                target.localName == "toolbarbutton")) {
       return;
+    }
 
-    // only allow middle-click on close tab button on tab to go throw as middle-click on the tab
-    if (aEvent.button == 1 && target.localName == "toolbarbutton" && anonid != "tmp-close-button")
+    // only allow middle-click on close tab button on tab to go throw as
+    // middle-click on the tab
+    if (aEvent.button == 1 && target.localName == "toolbarbutton" &&
+        anonid != "tmp-close-button") {
       return;
+    }
 
     this.onDoubleClick = false;
     var clickOutTabs = aEvent.target.localName == "tabs";
     var tab = clickOutTabs ? gBrowser.mCurrentTab : aEvent.target;
 
-    // we replace click handler from tab binding with this
-    // to make sure that we always call onMouseCommand (if we need to) before we call tab flip
-    // in Firefox 4.0+ tabcontainer click handler run before tab click handler
-    if (aEvent.button == 0 && !clickOutTabs &&  !tab.mouseDownSelect)
+    // we replace click handler from tab binding with this to make sure that we
+    // always call onMouseCommand (if we need to) before we call tab flip.
+    // tabcontainer click handler run before tab click handler.
+    if (aEvent.button === 0 && !clickOutTabs &&  !tab.mouseDownSelect)
       tab.onMouseCommand(aEvent);
 
     // for tab flip
-    if (!clickOutTabs && aEvent.button == 0 && tab.hasAttribute("clickOnCurrent")) {
+    if (!clickOutTabs && aEvent.button === 0 && tab.hasAttribute("clickOnCurrent")) {
       tab.removeAttribute("clickOnCurrent");
       let tabFlip = Tabmix.prefs.getBoolPref("tabFlip");
       if (tabFlip && !aEvent.shiftKey && !aEvent.ctrlKey && !aEvent.altKey && !aEvent.metaKey){
@@ -55,22 +61,25 @@ var TabmixTabClickOptions = {
             gBrowser.stopMouseHoverSelect(aTab);
             gBrowser.selectedBrowser.focus();
           }
-        }
+        };
         let tabFlipDelay = Tabmix.prefs.getIntPref("tabFlipDelay");
         setTimeout(function (aTab) {selectPreviousTab(aTab);}, tabFlipDelay, tab);
         return;
       }
     }
 
-    var prefName
+    var prefName;
     /* middle click*/
     if (aEvent.button == 1)
       prefName = "middle";
     /* shift click*/
-    else if (aEvent.button == 0 && aEvent.shiftKey && !aEvent.ctrlKey && !aEvent.altKey && !aEvent.metaKey)
+    else if (aEvent.button === 0 && aEvent.shiftKey && !aEvent.ctrlKey &&
+        !aEvent.altKey && !aEvent.metaKey) {
       prefName = "shift";
+    }
     /* alt click*/
-    else if (aEvent.button == 0 && aEvent.altKey && !aEvent.ctrlKey && !aEvent.shiftKey && !aEvent.metaKey) {
+    else if (aEvent.button === 0 && aEvent.altKey && !aEvent.ctrlKey &&
+        !aEvent.shiftKey && !aEvent.metaKey) {
       prefName = "alt";
       window.addEventListener("keyup", function TMP_onKeyup_onTabClick(aEvent) {
         aEvent.currentTarget.removeEventListener("keyup", TMP_onKeyup_onTabClick, true);
@@ -78,8 +87,10 @@ var TabmixTabClickOptions = {
       }, true);
     }
     /* ctrl click*/
-    else if (aEvent.button == 0 && (aEvent.ctrlKey && !aEvent.metaKey || !aEvent.ctrlKey && aEvent.metaKey) && !aEvent.shiftKey && !aEvent.altKey)
+    else if (aEvent.button === 0 && (aEvent.ctrlKey && !aEvent.metaKey ||
+        !aEvent.ctrlKey && aEvent.metaKey) && !aEvent.shiftKey && !aEvent.altKey) {
       prefName = "ctrl";
+    }
 
     if (prefName)
       this.clickAction(prefName, clickOutTabs, tab, aEvent);
@@ -87,14 +98,18 @@ var TabmixTabClickOptions = {
 
   // Double click on tab/tabbar
   onTabBarDblClick: function TMP_onTabBarDblClick(aEvent) {
-    if ( !aEvent || aEvent.button != 0 || aEvent.ctrlKey || aEvent.shiftKey || aEvent.altKey || aEvent.metaKey )
+    if (!aEvent || aEvent.button !== 0 || aEvent.ctrlKey || aEvent.shiftKey ||
+        aEvent.altKey || aEvent.metaKey) {
       return;
+    }
     this.onDoubleClick = true;
 
     // don't do anything if user click on close tab button , or on any other button on tab or tabbar
     var target = aEvent.originalTarget;
-    if (target.getAttribute("anonid") == "tmp-close-button" || target.localName == "toolbarbutton")
+    if (target.getAttribute("anonid") == "tmp-close-button" ||
+        target.localName == "toolbarbutton") {
       return;
+    }
 
     // See hack note in the tabbrowser-close-tab-button binding
     // if we are here the target is not closeTabButton or newtabButton
@@ -120,6 +135,8 @@ var TabmixTabClickOptions = {
     }
   },
 
+///add option to open new tab after current one
+/// convert this switch to object
   doCommand: function TMP_doCommand(command, aTab, clickOutTabs) {
     gBrowser.selectedBrowser.focus();
     switch (command) {
@@ -244,7 +261,7 @@ var TabmixTabClickOptions = {
         }
         break;
       case 30: // enable/disable AutoReload
-        if (aTab.autoReloadEnabled == null)
+        if (aTab.autoReloadEnabled === null)
           Tabmix.autoReload.initTab(aTab);
         Tabmix.autoReload.toggle(aTab);
         break;
@@ -270,14 +287,14 @@ var TabmixTabClickOptions = {
    * and tabbar.click_dragwindow is true
    */
   blockDblclick: function(aEvent) {
-    if (aEvent.button != 0 || aEvent.target.localName == "tabs" ||
+    if (aEvent.button !== 0 || aEvent.target.localName == "tabs" ||
         Tabmix.prefs.getBoolPref("tabbar.dblclick_changesize") ||
         !Tabmix.prefs.getBoolPref("tabbar.click_dragwindow"))
       return;
 
     aEvent.preventDefault();
   }
-}
+};
 
 var TabmixContext = {
   _closeRightTabs: "tm-closeRightTabs",
@@ -319,12 +336,12 @@ var TabmixContext = {
     if (Tabmix.isVersion(240)) {
       tabContextMenu.insertBefore($id("context_closeTabsToTheEnd"), $id("tm-closeRightTabs"));
       $id("context_closeTabsToTheEnd").setAttribute("oncommand","gBrowser._closeRightTabs(TabContextMenu.contextTab);");
-      tabContextMenu.removeChild($id("tm-closeRightTabs"))
+      tabContextMenu.removeChild($id("tm-closeRightTabs"));
       this._closeRightTabs = "context_closeTabsToTheEnd";
     }
 
     if (Tabmix._restoreMultipleTabs) {
-      let multipletablabel = $id("context_undoCloseTab").getAttribute("multipletablabel")
+      let multipletablabel = $id("context_undoCloseTab").getAttribute("multipletablabel");
       let undoCloseTabMenu = $id("tm-content-undoCloseTab");
       undoCloseTabMenu.setAttribute("singletablabel", undoCloseTabMenu.label);
       undoCloseTabMenu.setAttribute("multipletablabel", multipletablabel);
@@ -409,14 +426,20 @@ var TabmixContext = {
     Tabmix.showItem("tm-duplicateTab", Tabmix.prefs.getBoolPref("duplicateMenu"));
     Tabmix.showItem("tm-duplicateinWin", Tabmix.prefs.getBoolPref("duplicateinWinMenu") && !Tabmix.singleWindowMode);
     Tabmix.showItem("context_openTabInWindow", Tabmix.prefs.getBoolPref("detachTabMenu") && !Tabmix.singleWindowMode);
-    if (Tabmix.isVersion(320))
-      Tabmix.showItem("context_openNonRemoteWindow", Tabmix.prefs.getBoolPref("tabcontext.openNonRemoteWindow") && !Tabmix.singleWindowMode && gMultiProcessBrowser);
+    if (Tabmix.isVersion(320)) {
+      Tabmix.showItem("context_openNonRemoteWindow",
+                      Tabmix.prefs.getBoolPref("tabcontext.openNonRemoteWindow") &&
+                      !Tabmix.singleWindowMode && gMultiProcessBrowser);
+    }
 
     var show = Tabmix.prefs.getBoolPref("pinTabMenu");
     Tabmix.showItem("context_pinTab", show && !aTab.pinned);
     Tabmix.showItem("context_unpinTab", show && aTab.pinned);
     Tabmix.showItem("context_tabViewMenu", Tabmix.prefs.getBoolPref("moveToGroup") && !aTab.pinned);
-    Tabmix.showItem("tm-mergeWindowsTab", Tabmix.prefs.getBoolPref("showMergeWindow") && (!Tabmix.singleWindowMode || (Tabmix.singleWindowMode && !isOneWindow)));
+    Tabmix.showItem("tm-mergeWindowsTab",
+                    Tabmix.prefs.getBoolPref("showMergeWindow") &&
+                    (!Tabmix.singleWindowMode ||
+                    (Tabmix.singleWindowMode && !isOneWindow)));
     var showRenameTabMenu = Tabmix.prefs.getBoolPref("renameTabMenu");
     Tabmix.showItem("tm-renameTab", showRenameTabMenu);
     Tabmix.showItem("tm-copyTabUrl", Tabmix.prefs.getBoolPref("copyTabUrlMenu"));
@@ -489,7 +512,7 @@ var TabmixContext = {
     Tabmix.setItem("tm-closeAllTabs", "disabled", keepLastTab || unpinnedTabs <= 1);
     Tabmix.setItem("context_closeOtherTabs", "disabled", unpinnedTabs <= 1);
     Tabmix.setItem(this._closeRightTabs, "disabled", cIndex == tabsCount - 1 || unpinnedTabs <= 1);
-    Tabmix.setItem("tm-closeLeftTabs", "disabled", cIndex == 0 || unpinnedTabs <= 1);
+    Tabmix.setItem("tm-closeLeftTabs", "disabled", cIndex === 0 || unpinnedTabs <= 1);
 
     var closeTabsEmpty = TMP_ClosedTabs.count < 1;
     Tabmix.setItem("context_undoCloseTab", "disabled", closeTabsEmpty);
@@ -499,7 +522,7 @@ var TabmixContext = {
     Tabmix.setItem("tm-mergeWindowsTab", "disabled", isOneWindow);
 
     Tabmix.setItem("tm-reloadRight", "disabled", tabsCount == 1 || cIndex == tabsCount - 1);
-    Tabmix.setItem("tm-reloadLeft", "disabled", tabsCount == 1 || cIndex == 0);
+    Tabmix.setItem("tm-reloadLeft", "disabled", tabsCount == 1 || cIndex === 0);
     Tabmix.setItem("tm-reloadOther", "disabled", tabsCount == 1);
     Tabmix.setItem("context_reloadAllTabs", "disabled", tabsCount == 1);
 
@@ -611,23 +634,27 @@ var TabmixContext = {
       Tabmix.setItem(protectTabMenu, "checked", protectedTab);
 
       var duplicateTabMenu = document.getElementById("tm-duplicateTabContext");
-      Tabmix.showItem(duplicateTabMenu, !contentClick && !gContextMenu.isTextSelected &&
-                     Tabmix.prefs.getBoolPref("duplicateTabContent"));
+      Tabmix.showItem(duplicateTabMenu, !contentClick &&
+          !gContextMenu.isTextSelected &&
+          Tabmix.prefs.getBoolPref("duplicateTabContent"));
 
-      Tabmix.showItem("tm-detachTabContext", !contentClick && !gContextMenu.isTextSelected && !Tabmix.singleWindowMode &&
-                     Tabmix.prefs.getBoolPref("detachTabContent"));
+      Tabmix.showItem("tm-detachTabContext", !contentClick &&
+          !gContextMenu.isTextSelected && !Tabmix.singleWindowMode &&
+          Tabmix.prefs.getBoolPref("detachTabContent"));
 
       var duplicateWinMenu = document.getElementById("tm-duplicateinWinContext");
-      Tabmix.showItem(duplicateWinMenu, !contentClick && !gContextMenu.isTextSelected && !Tabmix.singleWindowMode &&
-                     Tabmix.prefs.getBoolPref("duplicateWinContent"));
+      Tabmix.showItem(duplicateWinMenu, !contentClick &&
+          !gContextMenu.isTextSelected && !Tabmix.singleWindowMode &&
+          Tabmix.prefs.getBoolPref("duplicateWinContent"));
 
       var tabsListMenu = document.getElementById("tm-tabsList");
       Tabmix.showItem(tabsListMenu, !contentClick && Tabmix.prefs.getBoolPref("tabsList"));
 
       var undoCloseTabMenu = document.getElementById("tm-content-undoCloseTab");
       var undoClose = Tabmix.prefs.getBoolPref("undoClose");
-      Tabmix.showItem(undoCloseTabMenu, !contentClick && !gContextMenu.isTextSelected && undoClose && !closeTabsEmpty &&
-                     Tabmix.prefs.getBoolPref("undoCloseTabContent"));
+      Tabmix.showItem(undoCloseTabMenu, !contentClick &&
+          !gContextMenu.isTextSelected && undoClose && !closeTabsEmpty &&
+          Tabmix.prefs.getBoolPref("undoCloseTabContent"));
       if (Tabmix._restoreMultipleTabs) {
         let closedTabCount = TabmixSvc.ss.getNumberOfTabsClosedLast(window);
         let visibleLabel = closedTabCount <= 1 ? "singletablabel" : "multipletablabel";
@@ -635,24 +662,35 @@ var TabmixContext = {
       }
 
       var undoCloseListMenu = document.getElementById("tm-content-undoCloseList");
-      Tabmix.showItem(undoCloseListMenu, !contentClick && !gContextMenu.isTextSelected && undoClose && !closeTabsEmpty &&
-                     Tabmix.prefs.getBoolPref("undoCloseListContent"));
+      Tabmix.showItem(undoCloseListMenu, !contentClick &&
+          !gContextMenu.isTextSelected && undoClose && !closeTabsEmpty &&
+          Tabmix.prefs.getBoolPref("undoCloseListContent"));
 
       var isOneWindow = Tabmix.numberOfWindows() == 1;
       var mergeMenu = document.getElementById("tm-mergeWindows");
       Tabmix.showItem(mergeMenu, !contentClick && !isOneWindow && Tabmix.prefs.getBoolPref("mergeWindowContent"));
 
-      this._showAutoReloadMenu("tm-autoreload_menu", "autoReloadContent", !contentClick && !gContextMenu.isTextSelected);
+      this._showAutoReloadMenu("tm-autoreload_menu", "autoReloadContent",
+                               !contentClick && !gContextMenu.isTextSelected);
 
-      Tabmix.showItem("tm-openAllLinks", Tabmix.prefs.getBoolPref("openAllLinks") && !TabmixContext.openMultipleLinks(true));
+      Tabmix.showItem("tm-openAllLinks",
+                      Tabmix.prefs.getBoolPref("openAllLinks") &&
+                      !TabmixContext.openMultipleLinks(true));
 
       // show/hide menuseparator
       var undoCloseSep = document.getElementById("tm-content-undoCloseSep");
       var miscSep = document.getElementById("tm-content-miscSep");
       var textSep = document.getElementById("tm-content-textSep");
-      undoCloseSep.hidden = undoCloseTabMenu.hidden && undoCloseListMenu.hidden || gContextMenu.isTextSelected && closeTabMenu.hidden && lockTabMenu.hidden && protectTabMenu.hidden && tabsListMenu.hidden  && freezeTabMenu.hidden;
-      miscSep.hidden = mergeMenu.hidden && closeTabMenu.hidden && duplicateTabMenu.hidden && duplicateWinMenu.hidden && lockTabMenu.hidden && protectTabMenu.hidden && tabsListMenu.hidden  && freezeTabMenu.hidden || gContextMenu.isTextSelected;
-      textSep.hidden = !gContextMenu.isTextSelected || mergeMenu.hidden && duplicateTabMenu.hidden && duplicateWinMenu.hidden && closeTabMenu.hidden && lockTabMenu.hidden && protectTabMenu.hidden && tabsListMenu.hidden  && freezeTabMenu.hidden && undoCloseTabMenu.hidden && undoCloseListMenu.hidden;
+      undoCloseSep.hidden = undoCloseTabMenu.hidden && undoCloseListMenu.hidden ||
+          gContextMenu.isTextSelected && closeTabMenu.hidden && lockTabMenu.hidden &&
+          protectTabMenu.hidden && tabsListMenu.hidden  && freezeTabMenu.hidden;
+      miscSep.hidden = mergeMenu.hidden && closeTabMenu.hidden && duplicateTabMenu.hidden &&
+          duplicateWinMenu.hidden && lockTabMenu.hidden && protectTabMenu.hidden &&
+          tabsListMenu.hidden  && freezeTabMenu.hidden || gContextMenu.isTextSelected;
+      textSep.hidden = !gContextMenu.isTextSelected || mergeMenu.hidden &&
+          duplicateTabMenu.hidden && duplicateWinMenu.hidden && closeTabMenu.hidden &&
+          lockTabMenu.hidden && protectTabMenu.hidden && tabsListMenu.hidden &&
+          freezeTabMenu.hidden && undoCloseTabMenu.hidden && undoCloseListMenu.hidden;
 
     } catch (ex) {Tabmix.assert(ex);}
     return true;
@@ -687,9 +725,9 @@ var TabmixContext = {
     if (!check && urls.length) {
       Tabmix.loadTabs(urls, false);
     }
-    return urls.length == 0;
+    return urls.length === 0;
   }
-}
+};
 
 // for all tabs popup lists
 var TabmixAllTabs = {
@@ -713,6 +751,7 @@ var TabmixAllTabs = {
         break;
       case "DOMMouseScroll":
         TMP_eventListener.onTabBarScroll(aEvent);
+        /* falls through */
       case "scroll":
         this._popup._updateTabsVisibilityStatus();
         break;
@@ -728,7 +767,6 @@ var TabmixAllTabs = {
     if (tabContainer.getAttribute("overflow") != "true")
       return;
 
-    var tabstripBO = tabContainer.mTabstrip.scrollBoxObject;
     for (var i = 0; i < this.childNodes.length; i++) {
       let curTab = this.childNodes[i].tab;
       if (!curTab) // "Tab Groups" menuitem and its menuseparator
@@ -745,7 +783,7 @@ var TabmixAllTabs = {
 
   checkForCtrlClick: function TMP_checkForCtrlClick(aEvent) {
     var aButton = aEvent.target;
-    if (!aButton.disabled && aEvent.button == 0 && (aEvent.ctrlKey || aEvent.metaKey)) {
+    if (!aButton.disabled && aEvent.button === 0 && (aEvent.ctrlKey || aEvent.metaKey)) {
       if (aButton.id == "btn_undoclose")
         TMP_ClosedTabs.undoCloseTab();
       else
@@ -870,18 +908,20 @@ var TabmixAllTabs = {
 
     switch(aType) {
       case 1:
-        let _tabSorting = function __tabSorting(tab, index) {
+        let TabSorting = function _tabSorting(tab, index) {
           this.Tab = tab;
           this.Index = index;
-        }
-        _tabSorting.prototype.toString = function() { return this.Tab.label.toLowerCase(); }
+        };
+        TabSorting.prototype.toString = function() {
+          return this.Tab.label.toLowerCase();
+        };
         let visibleTabs = gBrowser.visibleTabs;
         tabs = new Array(visibleTabs.length);
         for (i = 0; i < visibleTabs.length; i++)
-          tabs[i] = new _tabSorting(visibleTabs[i], i);
+          tabs[i] = new TabSorting(visibleTabs[i], i);
         tabs = tabs.sort();
         for (i = 0; i < tabs.length; i++)
-          this.createMenuItems(popup, tabs[i].Tab, tabs[i].Index, aType);
+          this.createMenuItems(popup, tabs[i].Tab, tabs[i].Index);
         break;
       case 2:
         tabs = gBrowser.visibleTabs;
@@ -898,7 +938,7 @@ var TabmixAllTabs = {
             continue;
           }
           if (addToMenu)
-            this.createMenuItems(popup, tab, t, aType);
+            this.createMenuItems(popup, tab, t);
         }
         break;
       case 3:
@@ -906,7 +946,7 @@ var TabmixAllTabs = {
           let tab = TMP_LastTab.tabs[i];
           if (tab.hidden)
             continue;
-          this.createMenuItems(popup, tab, i, aType);
+          this.createMenuItems(popup, tab, i);
         }
         break;
     }
@@ -925,7 +965,7 @@ var TabmixAllTabs = {
     scrollBox.ensureElementIsVisible(this._selectedItem);
   },
 
-  createMenuItems: function TMP_createMenuItems(popup, tab, value, aType) {
+  createMenuItems: function TMP_createMenuItems(popup, tab, value) {
     let mi = document.createElement("menuitem");
     mi.setAttribute("class", "menuitem-iconic bookmark-item alltabs-item");
     let url = gBrowser.getBrowserForTab(tab).currentURI.spec;
@@ -964,7 +1004,7 @@ var TabmixAllTabs = {
 
   _setMenuitemAttributes: function TMP__setMenuitemAttributes(aMenuitem, aTab) {
     if (!aMenuitem)
-      return
+      return;
 
     aMenuitem.setAttribute("label", aMenuitem.getAttribute("count") + aTab.label);
     aMenuitem.setAttribute("crop", aTab.getAttribute("crop"));
@@ -1047,11 +1087,11 @@ var TabmixAllTabs = {
     this.updateStatusText(tab.getAttribute("statustext"));
   },
 
-  updateMenuItemInactive: function TMP_updateMenuItemInactive(event) {
+  updateMenuItemInactive: function TMP_updateMenuItemInactive() {
     this.updateStatusText("");
   },
 
   updateStatusText: function TMP_updateStatusText(itemText) {
     XULBrowserWindow.setOverLink(itemText);
   }
-}
+};
diff --git a/chrome/content/extensions/extensions.js b/chrome/content/extensions/extensions.js
index 506a118..b4695ae 100644
--- a/chrome/content/extensions/extensions.js
+++ b/chrome/content/extensions/extensions.js
@@ -35,7 +35,7 @@ var TMP_extensionsCompatibility = {
     Tabmix.extensions.__defineGetter__("sessionManager", function() {
       return TabmixSvc.sessionManagerAddonInstalled ||
         "com" in window && com.morac &&
-        typeof com.morac.SessionManagerAddon == "object"
+        typeof com.morac.SessionManagerAddon == "object";
     });
 
     try {
@@ -59,9 +59,11 @@ var TMP_extensionsCompatibility = {
       func.forEach(function(aFn) {
         if (aFn in GlaxChrome) {
           Tabmix.changeCode(GlaxChrome, "GlaxChrome.CLT.DragDropManager." + aFn)._replace(
-            '{', '{var TabDNDObserver = TMP_tabDNDObserver;', {check: GlaxChrome[aFn].toString().indexOf("TabDNDObserver") != -1}
+            '{', '{var TabDNDObserver = TMP_tabDNDObserver;',
+            {check: GlaxChrome[aFn].toString().indexOf("TabDNDObserver") != -1}
           )._replace(
-            'TM_init', 'Tabmix.startup', {check: GlaxChrome[aFn].toString().indexOf("TM_init") != -1, flags: "g"}
+            'TM_init', 'Tabmix.startup',
+            {check: GlaxChrome[aFn].toString().indexOf("TM_init") != -1, flags: "g"}
           ).toCode();
         }
       });
@@ -105,7 +107,7 @@ var TMP_extensionsCompatibility = {
           catch(e) {}
         }
         return def;
-      }
+      };
     }
 
     /*  we don't use this code - leave it here as a reminder.
@@ -150,7 +152,7 @@ var TMP_extensionsCompatibility = {
         'if (!loadNewInBackground) {' +
         '  f.gBrowser.TMP_selectNewForegroundTab(newTab, false);' +
         '  TMP_LastTab.PushSelectedTab();' +
-        '}'
+        '}';
       if (typeof(foxTab.openNewTab) == "function") {
         Tabmix.changeCode(foxTab, "foxTab.openNewTab")._replace(
           '{', loadNewInBackground
@@ -181,7 +183,7 @@ var TMP_extensionsCompatibility = {
     // https://addons.mozilla.org/en-US/firefox/addon/ie-tab-2-ff-36/
     // for version IE Tab V2 4.12.6.1
     if (typeof window.IeTab2 == "function" &&
-          Services.vc.compare(window.gIeTab2Version, "4.12.6.1") == 0) {
+          Services.vc.compare(window.gIeTab2Version, "4.12.6.1") === 0) {
       Tabmix.extensions.ieTab2 = true;
       Tabmix.changeCode(IeTab2.prototype, "IeTab2.prototype.hookCodeAll")._replace(
         /(var )?oldAddTab/g, 'Tabmix.originalFunctions.oldAddTab'
@@ -337,7 +339,7 @@ var TMP_extensionsCompatibility = {
       // unable to close surce tab after duplicate with FireGestures esextension
       // problem fix in FireGestures 1.5.7 keep this here for users with older versions
       let performAction = FireGestures._performAction.toString();
-      let codeToReplace = "gBrowser.moveTabTo(newTab, ++orgTab._tPos);"
+      let codeToReplace = "gBrowser.moveTabTo(newTab, ++orgTab._tPos);";
       if (performAction.indexOf(codeToReplace) != -1) {
         Tabmix.changeCode(FireGestures, "FireGestures._performAction")._replace(
           codeToReplace, 'gBrowser.moveTabTo(newTab, orgTab._tPos + 1);'
@@ -349,11 +351,12 @@ var TMP_extensionsCompatibility = {
           gBrowser._closeLeftTabs(gBrowser.mCurrentTab);
         else
           gBrowser._closeRightTabs(gBrowser.mCurrentTab);
-      }
+      };
     }
 
     // fix bug in new tab button on right extension when we use multi row
     if ("newTabButtons" in window) {
+      let tabBar = gBrowser.tabContainer;
       let newbuttonRight = document.getAnonymousElementByAttribute(tabBar, "id", "tabs-newbutton-right");
       let newbuttonEnd = document.getAnonymousElementByAttribute(tabBar, "id", "tabs-newbutton-end");
       if (newbuttonRight && newbuttonEnd)
@@ -371,15 +374,15 @@ var TMP_extensionsCompatibility = {
     // override some of All-in-One Gestures function
     // override the duplicate tab function
     if (typeof aioDupTab == 'function')
-      aioDupTab = function() { gBrowser.duplicateTab(gBrowser.mCurrentTab); };
+      window.aioDupTab = function() { gBrowser.duplicateTab(gBrowser.mCurrentTab); };
 
     // override the duplicate in new window function
     if (typeof aioDupWindow == 'function')
-      aioDupWindow = function() { gBrowser.duplicateTabToWindow(gBrowser.mCurrentTab); };
+      window.aioDupWindow = function() { gBrowser.duplicateTabToWindow(gBrowser.mCurrentTab); };
 
     // override the aioCloseWindow function
     if (typeof aioCloseWindow == 'function')
-      aioCloseWindow = BrowserTryToCloseWindow;
+      window.aioCloseWindow = BrowserTryToCloseWindow;
 
     // Tile Tabs 11.12
     // https://addons.mozilla.org/en-US/firefox/addon/tile-tabs/
@@ -394,7 +397,7 @@ var TMP_extensionsCompatibility = {
         onTabAttrModified: /if\s+\(tab\.hasAttribute\("tiletabs-assigned"\)\)/,
         showTabList: /menuItem\.setAttribute\("label",\s*title\);/,
         showTabListCurrent: /menuItem\.setAttribute\("label",\s*title\);/
-      }
+      };
 
       for (let fnName of Object.keys(func)) {
         if (typeof tileTabs[fnName] == "function") {
@@ -450,7 +453,7 @@ var TMP_extensionsCompatibility = {
     }
   }
 
-}
+};
 
 TMP_extensionsCompatibility.RSSTICKER = {
    init : function ()  {
@@ -497,7 +500,7 @@ TMP_extensionsCompatibility.RSSTICKER = {
 
      this.markAsRead();
    }
-}
+};
 
 // prevent Wizz RSS from load pages in locked tabs
 TMP_extensionsCompatibility.wizzrss = {
@@ -530,7 +533,7 @@ TMP_extensionsCompatibility.wizzrss = {
     else
       tabBrowser.loadURI(uri);
   }
-}
+};
 
 // prevent Newsfox from load pages in locked tabs
 TMP_extensionsCompatibility.newsfox = {
@@ -541,7 +544,7 @@ TMP_extensionsCompatibility.newsfox = {
          $&'
       ).toCode();
    }
-}
+};
 
 /**
  * fix incompatibilities with treeStyleTab
@@ -562,7 +565,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
           var newTab = null
           gBrowser.restoreTab = return newTab;
          */
-      }
+      };
     }
   },
 
@@ -585,7 +588,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
       }
       obj.getTabClosebox = function(aTab) {
         return this.document.getAnonymousElementByAttribute(aTab, 'class', 'tab-close-button close-icon');
-      }
+      };
 
       fn = obj.initTabContentsOrderInternal;
       if (fn.toString().indexOf("closebuttons-side") == -1) {
@@ -618,7 +621,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
           TabmixSvc.forEachBrowserWindow(function(aWindow) {
             aWindow.gBrowser.treeStyleTab.updateInvertedTabContentsOrder(true);
           });
-        }
+        };
         TabmixSvc.prefs.observe("extensions.tabmix.tabs.closeButtons", callback);
         TabmixSvc.prefs.observe("extensions.tabmix.tabs.closeButtons.onLeft", callback);
       }
@@ -632,7 +635,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
                   event.detail && event.detail.previousTab;
         if (tab)
           gBrowser.treeStyleTab.initTabContentsOrder(tab);
-      }
+      };
       gBrowser.tabContainer.addEventListener("TabSelect", ontabselect, true);
       window.addEventListener("unload", function onunload() {
         window.removeEventListener("unload", onunload, false);
@@ -717,4 +720,4 @@ TMP_extensionsCompatibility.treeStyleTab = {
       'gBrowser.treeStyleTab.onBeforeNewTabCommand();\n   $&'
     ).toCode();
   }
-}
+};
diff --git a/chrome/content/extensions/sage.js b/chrome/content/extensions/sage.js
index 07b7a1b..baa85db 100644
--- a/chrome/content/extensions/sage.js
+++ b/chrome/content/extensions/sage.js
@@ -62,4 +62,4 @@ var TMP_Sage = {
          return TMP_Places.prefBookmark;
    }
 
-}
+};
diff --git a/chrome/content/flst/lasttab.js b/chrome/content/flst/lasttab.js
index 259816c..2e51c9d 100644
--- a/chrome/content/flst/lasttab.js
+++ b/chrome/content/flst/lasttab.js
@@ -164,7 +164,7 @@ var TMP_LastTab = {
    },
 
    set tabs (val) {
-     if (val != null)
+     if (val !== null)
        return;
 
      this._tabs = null;
@@ -264,7 +264,7 @@ var TMP_LastTab = {
          }
 
          TabmixAllTabs.updateMenuItemInactive(null);
-         TabmixAllTabs.backupLabel=="";
+         TabmixAllTabs.backupLabel = "";
 
          this.TabList.hidePopup();
          if (tabToSelect)
@@ -359,4 +359,4 @@ var TMP_LastTab = {
       return this.handleCtrlTab ? index : this.tabs.length - 1 - index;
    }
 
-}
+};
diff --git a/chrome/content/links/contentLinks.js b/chrome/content/links/contentLinks.js
index ea30d19..f91a51d 100644
--- a/chrome/content/links/contentLinks.js
+++ b/chrome/content/links/contentLinks.js
@@ -76,4 +76,4 @@ Tabmix.contentAreaClick = {
     Tabmix.ContentClick.contentLinkClick(event,
         gBrowser.selectedBrowser, document.commandDispatcher.focusedWindow);
   }
-}
+};
diff --git a/chrome/content/links/newTab.js b/chrome/content/links/newTab.js
index 7b34232..f1c148a 100644
--- a/chrome/content/links/newTab.js
+++ b/chrome/content/links/newTab.js
@@ -21,7 +21,7 @@
     });
   }
 
-  let win = Tabmix.getTopWin()
+  let win = Tabmix.getTopWin();
   if (win && win.Tabmix && win.Tabmix.initialization.onWindowOpen.initialized) {
     Services.prefs.addObserver("extensions.tabmix.titlefrombookmark", updateTitle, false);
     window.addEventListener("unload", function TMP_removeObserver(aEvent) {
@@ -32,4 +32,4 @@
       updateTitle();
   }
 
-})()
+})();
diff --git a/chrome/content/links/removeBlankTab.js b/chrome/content/links/removeBlankTab.js
index 86827ac..0b4dd94 100644
--- a/chrome/content/links/removeBlankTab.js
+++ b/chrome/content/links/removeBlankTab.js
@@ -52,7 +52,7 @@ let TabmixRemoveBlankTab = {
   },
 
   getWindowAndBrowser: function(aContext) {
-    let result = {win: null, b: null}
+    let result = {win: null, b: null};
     if (aContext) {
       let nav = aContext.QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIWebNavigation);
@@ -70,12 +70,14 @@ let TabmixRemoveBlankTab = {
   removeTab: function(win, tab) {
     window.addEventListener("unload", function _unload(aEvent) {
       aEvent.currentTarget.removeEventListener("unload", _unload, false);
-      win && !win.closed && win.setTimeout(function() {
-        if (win && win.gBrowser && tab && tab.parentNode)
-          win.gBrowser.removeTab(tab, {animate: false});
-      }, 250);
+      if (win && !win.close) {
+        win.setTimeout(function() {
+          if (win && win.gBrowser && tab && tab.parentNode)
+            win.gBrowser.removeTab(tab, {animate: false});
+        }, 250);
+      }
     }, false);
   }
-}
+};
 
 TabmixRemoveBlankTab.initialize();
diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index f41f4b6..a6f5540 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -17,7 +17,7 @@
 Tabmix.linkHandling_init = function TMP_TBP_init(aWindowType) {
   if (aWindowType == "Extension:Manager") {
       // we're in the EM
-      openURL = this.openURL;
+      window.openURL = this.openURL;
   }
 
   // for normal click this function calls urlbar.handleCommand
@@ -44,7 +44,7 @@ Tabmix.linkHandling_init = function TMP_TBP_init(aWindowType) {
   window.BrowserOpenTab = TMP_BrowserOpenTab;
 
   this.openUILink_init();
-}
+};
 
 Tabmix.beforeBrowserInitOnLoad = function() {
   try {
@@ -74,7 +74,7 @@ Tabmix.beforeBrowserInitOnLoad = function() {
       let pbs = Cc["@mozilla.org/privatebrowsing;1"].
                 getService(Ci.nsIPrivateBrowsingService);
       SM.globalPrivateBrowsing = pbs.privateBrowsingEnabled;
-      SM.isWindowPrivate = function SM_isWindowPrivate(aWindow) SM.globalPrivateBrowsing;
+      SM.isWindowPrivate = function SM_isWindowPrivate() SM.globalPrivateBrowsing;
       SM.__defineGetter__("isPrivateWindow", function() this.globalPrivateBrowsing);
       SM.__defineGetter__("isPrivateSession", function() this.globalPrivateBrowsing);
     }
@@ -100,13 +100,13 @@ Tabmix.beforeBrowserInitOnLoad = function() {
       '   let url = remoteBrowser.getBrowserForTab(uriToLoad).currentURI.spec;' +
       '   gBrowser.tabContainer.adjustTabstrip(true, url);' +
       '   $&' +
-      ' }'
+      ' }';
     if (!this.isVersion(190))
       bowserStartup = bowserStartup._replace(swapOldCode, swapNewCode);
 
     var firstWindow = this.firstWindowInSession || SM.firstNonPrivateWindow;
     var disabled = TMP_SessionStore.isSessionStoreEnabled() ||
-                      this.extensions.sessionManager
+                      this.extensions.sessionManager;
     var sessionManager = this.prefs.getBoolPref("sessions.manager");
     var willRestore = firstWindow && !disabled && (sessionManager &&
                       this.prefs.getIntPref("sessions.onStart") <= 1 ||
@@ -125,12 +125,12 @@ Tabmix.beforeBrowserInitOnLoad = function() {
     if (setStateRunning) {
       let RunState = SM.SessionStoreGlobal.RunState || {
         get isStopped() {
-          return SM.SessionStore._loadState == 0; // STATE_STOPPED
+          return SM.SessionStore._loadState === 0; // STATE_STOPPED
         },
         setRunning: function() {
           SM.SessionStore._loadState = 1; // STATE_RUNNING
         }
-      }
+      };
       if (RunState.isStopped) {
         RunState.setRunning();
         SM.notifyObservers = true;
@@ -163,7 +163,7 @@ Tabmix.beforeBrowserInitOnLoad = function() {
         '  if (uriToLoad == "about:blank" || "tabmixdata" in window) {' +
         '    gBrowser.selectedBrowser.stop();' +
         '  }\n' +
-        '    $&'
+        '    $&';
 
       if (!this.isVersion(190)) {
         bowserStartup = bowserStartup._replace(
@@ -214,7 +214,7 @@ Tabmix.beforeBrowserInitOnLoad = function() {
       setTimeout(function checkCompatibility(aWindow) {
         let tmp = { };
         Components.utils.import("resource://tabmixplus/extensions/CompatibilityCheck.jsm", tmp);
-        new tmp.CompatibilityCheck(aWindow, true);
+        tmp = new tmp.CompatibilityCheck(aWindow, true);
       }, 0, window);
     }
 
@@ -224,7 +224,7 @@ Tabmix.beforeBrowserInitOnLoad = function() {
     fnContainer[TMP_BrowserStartup].bind(fnContainer);
 
   } catch (ex) {this.assert(ex);}
-}
+};
 
 // this must run before all
 Tabmix.beforeStartup = function TMP_beforeStartup(tabBrowser, aTabContainer) {
@@ -238,11 +238,11 @@ Tabmix.beforeStartup = function TMP_beforeStartup(tabBrowser, aTabContainer) {
              return false;
        }
        return true;
-    }
+    };
 
     tabBrowser.isBlankTab = function(aTab) {
       return this.isBlankBrowser(this.getBrowserForTab(aTab));
-    }
+    };
 
     //XXX isTabEmpty exist in Firefox 4.0 - same as isBlankNotBusyTab
     // isTabEmpty don't check for Tabmix.isNewTabUrls
@@ -251,7 +251,7 @@ Tabmix.beforeStartup = function TMP_beforeStartup(tabBrowser, aTabContainer) {
         return false;
 
       return this.isBlankBrowser(this.getBrowserForTab(aTab), aboutBlank);
-    }
+    };
 
     tabBrowser.isBlankBrowser = function TMP_isBlankBrowser(aBrowser, aboutBlank) {
        try{
@@ -260,10 +260,11 @@ Tabmix.beforeStartup = function TMP_beforeStartup(tabBrowser, aTabContainer) {
           return (!aBrowser.sessionHistory || aBrowser.sessionHistory.index < 0 ||
                   (aBrowser.sessionHistory.count < 2 &&
                   (!aBrowser.currentURI ||
-                  (aboutBlank ? aBrowser.currentURI.spec == "about:blank" : Tabmix.isNewTabUrls(aBrowser.currentURI.spec))
+                  (aboutBlank ? aBrowser.currentURI.spec == "about:blank" :
+                                Tabmix.isNewTabUrls(aBrowser.currentURI.spec))
           )));
        } catch (ex) {Tabmix.assert(ex); return true;}
-    }
+    };
 
     /**
      * add gBrowser.getTabForBrowser if it is not exist
@@ -278,7 +279,7 @@ Tabmix.beforeStartup = function TMP_beforeStartup(tabBrowser, aTabContainer) {
               return this.tabs[i];
           }
           return null;
-       }
+       };
     }
 
     tabBrowser.getTabForLastPanel = function () {
@@ -286,7 +287,7 @@ Tabmix.beforeStartup = function TMP_beforeStartup(tabBrowser, aTabContainer) {
       let attrName = Tabmix.isVersion(180) ? "class" : "anonid"; // changed by Bug 768442
       let browser = document.getAnonymousElementByAttribute(notificationbox, attrName, "browserStack").firstChild;
       return this.getTabForBrowser(browser);
-    }
+    };
 
     var tabContainer = aTabContainer || tabBrowser.tabContainer ||
                        document.getAnonymousElementByAttribute(tabBrowser, "anonid", "tabcontainer");
@@ -324,7 +325,7 @@ Tabmix.beforeStartup = function TMP_beforeStartup(tabBrowser, aTabContainer) {
       TMP_SessionStore.afterSwitchThemes = true;
 
     TMP_extensionsCompatibility.preInit();
-}
+};
 
 Tabmix.adjustTabstrip = function tabContainer_adjustTabstrip(skipUpdateScrollStatus, aUrl) {
   // modes for close button on tabs - extensions.tabmix.tabs.closeButtons
@@ -397,7 +398,7 @@ Tabmix.adjustTabstrip = function tabContainer_adjustTabstrip(skipUpdateScrollSta
     TabmixTabbar.updateScrollStatus();
     TabmixTabbar.updateBeforeAndAfter();
   }
-}
+};
 
 /**
  bug 887515 - add ability to restore multiple tabs
diff --git a/chrome/content/links/userInterface.js b/chrome/content/links/userInterface.js
index 23f28ea..cbf7f55 100644
--- a/chrome/content/links/userInterface.js
+++ b/chrome/content/links/userInterface.js
@@ -30,7 +30,7 @@ Tabmix.openOptionsDialog = function TMP_openDialog(panel) {
     window.openDialog("chrome://tabmixplus/content/preferences/preferences.xul", "Tab Mix Plus",
         "chrome,titlebar,toolbar,close,dialog=no,centerscreen", panel || null);
   }
-}
+};
 
 /**
  * @brief Load URLs from the Extension/Theme Managers, and item with text-link class
@@ -44,7 +44,7 @@ Tabmix.openOptionsDialog = function TMP_openDialog(panel) {
  *
  */
 Tabmix.openURL = function TMP_openURL(aURL, event) {
-   var linkTarget, loadInBackground;
+   var linkTarget;
    try {
             linkTarget = Services.prefs.getIntPref("browser.link.open_newwindow");
    }
@@ -52,7 +52,7 @@ Tabmix.openURL = function TMP_openURL(aURL, event) {
       linkTarget = 1;
    }
 
-   if (aURL == null) aURL = "about:blank";
+   if (aURL === null) aURL = "about:blank";
 
    // check for an existing window and focus it; it's not application modal
    var browserWindow = this.getTopWin();
@@ -94,7 +94,7 @@ Tabmix.openURL = function TMP_openURL(aURL, event) {
       event.stopPropagation();
    }
    return true;
-}
+};
 
 // Don't change this function name other extensions using it
 // Speed-Dial, Fast-Dial, TabGroupManager
@@ -120,7 +120,6 @@ function TMP_BrowserOpenTab(aTab, replaceLastTab) {
          let newTab = gBrowser.duplicateTab(selectedTab, null, null, null, true);
          Tabmix.clearUrlBar(newTab, currentUrl, true);
          return newTab;
-         break;
       case 4 : // user url
          let prefName = replaceLastTab ? "extensions.tabmix.replaceLastTabWith.newtab.url" :
                                          "browser.newtab.url";
@@ -152,7 +151,7 @@ function TMP_BrowserOpenTab(aTab, replaceLastTab) {
    var loadBlank = isBlankPageURL(url);
    if (!TabmixSessionManager.isPrivateWindow && replaceLastTab && !loadBlank &&
         typeof privateTab == "object" && privateTab.isTabPrivate(selectedTab) &&
-        TabmixSvc.prefs.get("extensions.privateTab.makeNewEmptyTabsPrivate", 0) == 0) {
+        TabmixSvc.prefs.get("extensions.privateTab.makeNewEmptyTabsPrivate", 0) === 0) {
       privateTab.readyToOpenTab(false);
    }
    var newTab = gBrowser.addTab(url, {
@@ -218,7 +217,7 @@ Tabmix.clearUrlBar = function TMP_clearUrlBar(aTab, aUrl, aTimeOut) {
     else
       focusAndSelectUrlBar();
   }
-}
+};
 
 /**
  * @brief In TMP_BrowserOpenTab we empty and focus the urlbar
@@ -246,8 +245,8 @@ Tabmix.urlBarOnBlur = function TMP_urlBarOnBlur() {
     return;
   }
 
-  this.updateUrlBarValue()
-}
+  this.updateUrlBarValue();
+};
 
 Tabmix.updateUrlBarValue = function TMP_updateUrlBarValue() {
   this.selectedTab = null;
@@ -257,7 +256,7 @@ Tabmix.updateUrlBarValue = function TMP_updateUrlBarValue() {
   if (url != gURLBar.value && !isBlankPageURL(url)) {
     URLBarSetURI();
   }
-}
+};
 
 /**
  * @brief openUILink handles clicks on UI elements that cause URLs to load
@@ -308,7 +307,7 @@ Tabmix.openUILink_init = function TMP_openUILink_init() {
       'window.Omnibar.handleSearchQuery', {silent: true}
     ).toCode();
   }
-}
+};
 
 Tabmix.checkCurrent = function TMP_checkCurrent(url) {
   var opentabforLinks = Tabmix.prefs.getIntPref("opentabforLinks");
@@ -324,7 +323,7 @@ Tabmix.checkCurrent = function TMP_checkCurrent(url) {
       return "tab";
   }
   return "current";
-}
+};
 
 /**
  * @brief copy Tabmix data from old tab to new tab.
@@ -339,7 +338,7 @@ Tabmix.copyTabData = function TMP_copyTabData(newTab, oldTab) {
   });
 
   this.restoreTabState(newTab);
-}
+};
 
 Tabmix.restoreTabState = function TMP_restoreTabState(aTab) {
   if (aTab.hasAttribute("_locked")) {
@@ -377,9 +376,9 @@ Tabmix.restoreTabState = function TMP_restoreTabState(aTab) {
   // make sure other extensions don't set minwidth maxwidth
   aTab.removeAttribute("minwidth");
   aTab.removeAttribute("maxwidth");
-}
+};
 
-Tabmix.tabStyles = {}
+Tabmix.tabStyles = {};
 Tabmix.setTabStyle = function(aTab, boldChanged) {
   if (!aTab)
     return;
@@ -404,6 +403,6 @@ Tabmix.setTabStyle = function(aTab, boldChanged) {
   let isBold = function(attrib) {
     attrib = attrib.split(" ");
     return attrib.length > 1 && attrib.indexOf("not-bold") == -1;
-  }
+  };
   boldChanged.value = isBold(newAttrib) != isBold(currentAttrib);
-}
+};
diff --git a/chrome/content/minit/autoReload.js b/chrome/content/minit/autoReload.js
index fd5667f..3f868e7 100644
--- a/chrome/content/minit/autoReload.js
+++ b/chrome/content/minit/autoReload.js
@@ -1,48 +1,48 @@
 "use strict";
 
-var gPref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-
-function load(){
-  var customReloadTime = gPref.getIntPref("extensions.tabmix.reload_time");
-  document.getElementById("autoreload_minutes").value = Math.floor(customReloadTime / 60);
-  document.getElementById("autoreload_seconds").value = customReloadTime % 60;
-  disable_OK();
-}
-
-function accept() {
-  var customReloadTime = getCustomReloadTime();
-  gPref.setIntPref("extensions.tabmix.reload_time", customReloadTime);
-  var list = gPref.getCharPref("extensions.tabmix.custom_reload_list");
-  list = list ? list.split(",") : [];
-  let defaultList = [60,120,300,900,1800];
-  if (list.concat(defaultList).indexOf(customReloadTime) == -1) {
-    list.push(customReloadTime);
-    if (list.length > 6 )
-      list.shift();
-    gPref.setCharPref("extensions.tabmix.custom_reload_list", list.join(","));
-  }
-
-  window.arguments[0].ok = true;
-}
-
-function getCustomReloadTime() {
-  var minutes;
-  if (document.getElementById("autoreload_minutes").value != '')
-    minutes = parseInt(document.getElementById("autoreload_minutes").value);
-  else
-    minutes = 0;
-
-  var seconds;
-  if (document.getElementById("autoreload_seconds").value != '')
-    seconds = parseInt(document.getElementById("autoreload_seconds").value);
-  else
-    seconds = 0;
-  return minutes*60 + seconds;
-}
-
-function disable_OK() {
-  document.documentElement.getButton("accept").disabled = getCustomReloadTime() == 0;
-}
+var gPref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
+
+function load(){
+  var customReloadTime = gPref.getIntPref("extensions.tabmix.reload_time");
+  document.getElementById("autoreload_minutes").value = Math.floor(customReloadTime / 60);
+  document.getElementById("autoreload_seconds").value = customReloadTime % 60;
+  disable_OK();
+}
+
+function accept() {
+  var customReloadTime = getCustomReloadTime();
+  gPref.setIntPref("extensions.tabmix.reload_time", customReloadTime);
+  var list = gPref.getCharPref("extensions.tabmix.custom_reload_list");
+  list = list ? list.split(",") : [];
+  let defaultList = [60,120,300,900,1800];
+  if (list.concat(defaultList).indexOf(customReloadTime) == -1) {
+    list.push(customReloadTime);
+    if (list.length > 6 )
+      list.shift();
+    gPref.setCharPref("extensions.tabmix.custom_reload_list", list.join(","));
+  }
+
+  window.arguments[0].ok = true;
+}
+
+function getCustomReloadTime() {
+  var minutes;
+  if (document.getElementById("autoreload_minutes").value !== '')
+    minutes = parseInt(document.getElementById("autoreload_minutes").value);
+  else
+    minutes = 0;
+
+  var seconds;
+  if (document.getElementById("autoreload_seconds").value !== '')
+    seconds = parseInt(document.getElementById("autoreload_seconds").value);
+  else
+    seconds = 0;
+  return minutes*60 + seconds;
+}
+
+function disable_OK() {
+  document.documentElement.getButton("accept").disabled = getCustomReloadTime() === 0;
+}
 
 function onInput(item) {
   item.value = parseInt(item.value);
diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index b279e51..889047c 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -77,7 +77,7 @@ var TMP_tabDNDObserver = {
       return this.orient == "horizontal" &&
         (!this.moveTabOnDragging || this.hasAttribute("multibar") ||
         aEvent.altKey);
-    }
+    };
     tabBar.useTabmixDnD = function(aEvent) {
       function checkTab(dt) {
         let tab = TMP_tabDNDObserver.getSourceNode(dt);
@@ -87,7 +87,7 @@ var TMP_tabDNDObserver = {
       return this.orient == "horizontal" &&
         (!this.moveTabOnDragging || this.hasAttribute("multibar") ||
         checkTab(aEvent.dataTransfer));
-    }
+    };
 
     this._dragOverDelay = tabBar._dragOverDelay;
     this.draglink = TabmixSvc.getString("droplink.label");
@@ -139,7 +139,7 @@ var TMP_tabDNDObserver = {
     dt.mozCursor = "default";
 
     let canvas = tabPreviews.capture(tab, false);
-    let offset = TabmixTabbar.position == 1 ? canvas.height + 10 : -37
+    let offset = TabmixTabbar.position == 1 ? canvas.height + 10 : -37;
     dt.setDragImage(canvas, 0, offset);
 
     // _dragData.offsetX/Y give the coordinates that the mouse should be
@@ -171,8 +171,9 @@ var TMP_tabDNDObserver = {
     if (newIndex < gBrowser.tabs.length)
       left_right = this.getLeft_Right(event, newIndex, oldIndex, draggeType);
     else {
-      newIndex = draggeType != this.DRAG_TAB_IN_SAME_WINDOW && Tabmix.getOpenTabNextPref(draggeType == this.DRAG_LINK) ? tabBar.selectedIndex :
-                  gBrowser.tabs.length - 1;
+      newIndex = draggeType != this.DRAG_TAB_IN_SAME_WINDOW &&
+                 Tabmix.getOpenTabNextPref(draggeType == this.DRAG_LINK) ?
+                     tabBar.selectedIndex : gBrowser.tabs.length - 1;
       left_right = 1;
     }
 
@@ -188,7 +189,7 @@ var TMP_tabDNDObserver = {
      *     or    - we drop link that start download
      */
     if (replaceTab && !isCopy) {
-      var targetTab = gBrowser.tabs[newIndex];
+      let disAllowDrop, targetTab = gBrowser.tabs[newIndex];
       if (targetTab.getAttribute("locked") && !gBrowser.isBlankNotBusyTab(targetTab)) {
         try {
           var url = browserDragAndDrop.drop(event, { });
@@ -196,7 +197,7 @@ var TMP_tabDNDObserver = {
               /^\s*(javascript|data):/.test(url))
             url = null;
 
-          var disAllowDrop = url ? !Tabmix.ContentClick.isUrlForDownload(url) : true;
+          disAllowDrop = url ? !Tabmix.ContentClick.isUrlForDownload(url) : true;
         } catch (ex) { Tabmix.assert(ex);}
 
         if (disAllowDrop)
@@ -206,7 +207,7 @@ var TMP_tabDNDObserver = {
 
     var canDrop;
     var hideIndicator = false;
-    if (effects == "" || effects == "none" && this._isCustomizing) {
+    if (effects === "" || effects == "none" && this._isCustomizing) {
       this.clearDragmark();
       return;
     }
@@ -234,7 +235,7 @@ var TMP_tabDNDObserver = {
         this.gMsg = this.gBackupLabel;
       var statusTextFld = document.getElementById("statusbar-display");
       if (statusTextFld && statusTextFld.getAttribute("label") != this.gMsg) {
-        if (this.gBackupLabel == "")
+        if (this.gBackupLabel === "")
           this.gBackupLabel = statusTextFld.getAttribute("label");
         statusTextFld.label = this.gMsg;
         this.statusFieldChanged = true;
@@ -272,7 +273,8 @@ var TMP_tabDNDObserver = {
             break;
       }
       if (_scroll) {
-        let scrollIncrement = TabmixTabbar.isMultiRow ? Math.round(tabStrip._singleRowHeight / 6) : tabStrip.scrollIncrement;
+        let scrollIncrement = TabmixTabbar.isMultiRow ?
+            Math.round(tabStrip._singleRowHeight / 6) : tabStrip.scrollIncrement;
         tabStrip.scrollByPixels((ltr ? _scroll : -_scroll) * scrollIncrement, true);
         hideIndicator = true;
       }
@@ -314,8 +316,10 @@ var TMP_tabDNDObserver = {
     event.stopPropagation();
 
     document.getElementById("tabmix-tooltip").hidePopup();
+    /* jshint ignore:start */
     // old TreeStyleTab extension version look for isTabReorder in our code
-    var isTabReorder = draggeType == this.DRAG_TAB_IN_SAME_WINDOW
+    var isTabReorder = draggeType == this.DRAG_TAB_IN_SAME_WINDOW;
+    /* jshint ignore:end */
     var newIndex = this._getDNDIndex(event);
     var oldIndex = draggedTab ? draggedTab._tPos : -1;
     var left_right;
@@ -323,15 +327,16 @@ var TMP_tabDNDObserver = {
     if (newIndex < gBrowser.tabs.length)
       left_right = this.getLeft_Right(event, newIndex, oldIndex, draggeType);
     else {
-      newIndex = draggeType != this.DRAG_TAB_IN_SAME_WINDOW && Tabmix.getOpenTabNextPref(draggeType == this.DRAG_LINK) ? gBrowser.tabContainer.selectedIndex :
-                 gBrowser.tabs.length - 1;
+      newIndex = draggeType != this.DRAG_TAB_IN_SAME_WINDOW &&
+                 Tabmix.getOpenTabNextPref(draggeType == this.DRAG_LINK) ?
+                     gBrowser.tabContainer.selectedIndex : gBrowser.tabs.length - 1;
       left_right = 1;
     }
 
     if (draggedTab && (isCopy || draggeType == this.DRAG_TAB_IN_SAME_WINDOW)) {
       if (isCopy) {
         // copy the dropped tab (wherever it's from)
-        var newTab = gBrowser.duplicateTab(draggedTab);
+        let newTab = gBrowser.duplicateTab(draggedTab);
         gBrowser.moveTabTo(newTab, newIndex + left_right);
 
         if (draggeType == this.DRAG_TAB_TO_NEW_WINDOW || event.shiftKey)
@@ -363,12 +368,12 @@ var TMP_tabDNDObserver = {
       // swap the dropped tab with a new one we create and then close
       // it in the other window (making it seem to have moved between
       // windows)
-      newTab = gBrowser.addTab("about:blank");
+      let newTab = gBrowser.addTab("about:blank");
       var newBrowser = gBrowser.getBrowserForTab(newTab);
       // Stop the about:blank load
       newBrowser.stop();
       // make sure it has a docshell
-      newBrowser.docShell;
+      newBrowser.docShell; // jshint ignore:line
 
       gBrowser.moveTabTo(newTab, newIndex + left_right);
       gBrowser.selectedTab = newTab;
@@ -460,7 +465,7 @@ var TMP_tabDNDObserver = {
       var bo = tabBar.mTabstrip.scrollBoxObject;
       var rowHeight = TabmixTabbar.singleRowHeight;
       var endScreenY = bo.screenY + bo.height + 0.5 * rowHeight;
-      if (TabmixTabbar.position == 0) {// tabbar on the top
+      if (TabmixTabbar.position === 0) {// tabbar on the top
         if (eY < endScreenY && eY > window.screenY) {
           aEvent.stopPropagation();
           return;
@@ -553,7 +558,7 @@ var TMP_tabDNDObserver = {
   },
 
   getNewIndex: function (event) {
-    function getTabRowNumber(tab, top) tab.pinned ? 1 : gBrowser.tabContainer.getTabRowNumber(tab, top);
+    function getTabRowNumber(tab, top) tab.pinned ? 1 : gBrowser.tabContainer.getTabRowNumber(tab, top)
     // if mX is less then the first tab return 0
     // check if mY is below the tab.... if yes go to next row
     // in the row find the closest tab by mX,
@@ -563,24 +568,26 @@ var TMP_tabDNDObserver = {
     var tabs = gBrowser.visibleTabs;
     var numTabs = tabs.length;
     if (!tabBar.hasAttribute("multibar")) {
-      for (let i = event.target.localName == "tab" ? TMP_TabView.getIndexInVisibleTabsFromTab(event.target) : 0; i < numTabs; i++) {
+      let i = event.target.localName == "tab" ?
+          TMP_TabView.getIndexInVisibleTabsFromTab(event.target) : 0;
+      for (; i < numTabs; i++) {
         let tab = tabs[i];
         if (Tabmix.compare(mX, Tabmix.itemEnd(tab, Tabmix.ltr), Tabmix.ltr))
           return i;
       }
     }
     else {
-      let top = tabBar.topTabY;
+      let topY = tabBar.topTabY;
       for (let i = 0; i < numTabs; i++) {
         let tab = tabs[i];
-        let thisRow = getTabRowNumber(tab, top);
+        let thisRow = getTabRowNumber(tab, topY);
         if (mY >= tab.boxObject.screenY + tab.boxObject.height) {
-          while (i < numTabs - 1 && getTabRowNumber(tabs[i+1], top) == thisRow)
+          while (i < numTabs - 1 && getTabRowNumber(tabs[i+1], topY) == thisRow)
             i++;
         }
         else if (Tabmix.compare(mX, Tabmix.itemEnd(tab, Tabmix.ltr), Tabmix.ltr))
           return i;
-        else if (i == numTabs - 1 || getTabRowNumber(tabs[i+1], top) != thisRow)
+        else if (i == numTabs - 1 || getTabRowNumber(tabs[i+1], topY) != thisRow)
           return i;
       }
     }
@@ -636,22 +643,21 @@ var TMP_tabDNDObserver = {
    this.clearDragmark();// clear old dragmark if one exist
 
    if (!Tabmix.prefs.getBoolPref("useFirefoxDragmark")) {
-      var sameRow = newIndex != 0 && newIndex != gBrowser.tabs.length &&
+      var sameRow = newIndex !== 0 && newIndex != gBrowser.tabs.length &&
             TabmixTabbar.inSameRow(gBrowser.tabs[newIndex-1], gBrowser.tabs[newIndex]);
-      if (sameRow || left_right==0)
+      if (sameRow || left_right === 0)
          this.setDragmarkAttribute(gBrowser.tabs[newIndex], "atLeft");
-      if (sameRow || left_right==1)
+      if (sameRow || left_right == 1)
          this.setDragmarkAttribute(gBrowser.tabs[newIndex-1], "atRight");
    }
    else {
       // code for firefox indicator
       var ind = gBrowser.tabContainer._tabDropIndicator;
       var minMargin, maxMargin, newMargin;
-      var tabBoxObject, tabRect;
+      var tabRect;
       var ltr = Tabmix.ltr;
       let scrollRect = gBrowser.tabContainer.mTabstrip.scrollClientRect;
       let rect = gBrowser.tabContainer.getBoundingClientRect();
-      let scrollMode = TabmixTabbar.scrollButtonsMode;
       minMargin = scrollRect.left - rect.left - this.paddingLeft;
       maxMargin = Math.min(minMargin + scrollRect.width, scrollRect.right);
       if (!ltr)
@@ -659,22 +665,27 @@ var TMP_tabDNDObserver = {
 
       tabRect = gBrowser.tabs[index].getBoundingClientRect();
       if (ltr)
-         newMargin = tabRect.left - rect.left  + (left_right == 1 ? tabRect.width + this.LinuxMarginEnd: 0) - this.paddingLeft;
+         newMargin = tabRect.left - rect.left  +
+                     (left_right == 1 ? tabRect.width + this.LinuxMarginEnd: 0) -
+                     this.paddingLeft;
       else
-         newMargin = rect.right - tabRect.left - (left_right == 0 ? tabRect.width + this.LinuxMarginEnd : 0) - this.paddingLeft;
+         newMargin = rect.right - tabRect.left -
+                     (left_right === 0 ? tabRect.width + this.LinuxMarginEnd : 0) -
+                     this.paddingLeft;
 
-      ///XXX fix min/max x margin when in one row the drag mark is visible after the arrow when the last tab is partly visible
+      ///XXX fix min/max x margin when in one row the drag mark is visible after
+      ///XXX the arrow when the last tab is partly visible
       ///XXX look like the same is happen with Firefox
       var newMarginY, fixMargin;
       if (TabmixTabbar.position == 1) {
         newMarginY = tabRect.bottom - ind.parentNode.getBoundingClientRect().bottom;
         let addOnBar = document.getElementById("addon-bar");
-        fixMargin = newMarginY == 0 &&
+        fixMargin = newMarginY === 0 &&
               (Tabmix.isVersion(280) || addOnBar && addOnBar.collapsed);
       }
       else {
         newMarginY = tabRect.bottom - rect.bottom;
-        fixMargin = newMarginY == 0 && this.onLastToolbar;
+        fixMargin = newMarginY === 0 && this.onLastToolbar;
       }
       // make indicator visible
       if (fixMargin)
@@ -695,14 +706,14 @@ var TMP_tabDNDObserver = {
   },
 
   clearDragmark: function minit_clearDragmark() {
-    if (this.dragmarkindex == null)
+    if (this.dragmarkindex === null)
       return;
 
     if (!Tabmix.prefs.getBoolPref("useFirefoxDragmark")) {
       var index = this.dragmarkindex.newIndex;
       if (index != gBrowser.tabs.length && gBrowser.tabs[index].hasAttribute("dragmark"))
          this.removetDragmarkAttribute(gBrowser.tabs[index]);
-      if (index != 0 && gBrowser.tabs[index-1].hasAttribute("dragmark"))
+      if (index !== 0 && gBrowser.tabs[index-1].hasAttribute("dragmark"))
          this.removetDragmarkAttribute(gBrowser.tabs[index-1]);
     }
     else
@@ -730,7 +741,7 @@ var TMP_tabDNDObserver = {
     var dt = aEvent.dataTransfer;
     // Disallow dropping multiple items
     if (dt.mozItemCount > 1)
-      return dt.effectAllowed = "none";
+      return (dt.effectAllowed = "none");
 
     var types = dt.mozTypesAt(0);
     // move or copy tab
@@ -741,20 +752,20 @@ var TMP_tabDNDObserver = {
         // and vice versa.
         (Tabmix.isVersion(200) && PrivateBrowsingUtils.isWindowPrivate(window) !=
             PrivateBrowsingUtils.isWindowPrivate(sourceNode.ownerDocument.defaultView))){
-        return dt.effectAllowed = "none";
+        return (dt.effectAllowed = "none");
       }
 
       if (Tabmix.isVersion(310) && window.gMultiProcessBrowser !=
           sourceNode.ownerDocument.defaultView.gMultiProcessBrowser)
-        return dt.effectAllowed = "none";
+        return (dt.effectAllowed = "none");
 
-      return dt.effectAllowed = "copyMove";
+      return (dt.effectAllowed = "copyMove");
     }
 
     if (browserDragAndDrop.canDropLink(aEvent)) {
-      return dt.effectAllowed = dt.dropEffect = "link";
+      return (dt.effectAllowed = dt.dropEffect = "link");
     }
-    return dt.effectAllowed = "none";
+    return (dt.effectAllowed = "none");
   },
 
   getSourceNode: function TMP_getSourceNode(aDataTransfer) {
@@ -764,10 +775,10 @@ var TMP_tabDNDObserver = {
     return null;
   }
 
-} // TMP_tabDNDObserver end
+}; // TMP_tabDNDObserver end
 
 var TMP_undocloseTabButtonObserver = {
-  onDragOver: function (aEvent, aFlavour, aDragSession) {
+  onDragOver: function (aEvent) {
     var dt = aEvent.dataTransfer;
     var sourceNode = TMP_tabDNDObserver.getSourceNode(dt) || this.NEW_getSourceNode(dt);
     if (!sourceNode || sourceNode.localName != "tab") {
@@ -792,7 +803,7 @@ var TMP_undocloseTabButtonObserver = {
     return true;
   },
 
-  onDragExit: function (aEvent, aDragSession) {
+  onDragExit: function (aEvent) {
     if (aEvent.target.hasAttribute("dragover")) {
       var statusTextFld = document.getElementById("statusbar-display");
       if (statusTextFld)
@@ -804,7 +815,7 @@ var TMP_undocloseTabButtonObserver = {
     }
   },
 
-  onDrop: function (aEvent, aXferData, aDragSession) {
+  onDrop: function (aEvent) {
     var dt = aEvent.dataTransfer;
     var sourceNode = TMP_tabDNDObserver.getSourceNode(dt) || this.NEW_getSourceNode(dt);
     if (sourceNode && sourceNode.localName == "tab")
@@ -822,7 +833,7 @@ var TMP_undocloseTabButtonObserver = {
       node = node.parentNode;
     return node && node.localName == "tab" ? node : null;
   }
-}
+};
 
 /* ::::::::::     miscellaneous     :::::::::: */
 
@@ -831,14 +842,14 @@ Tabmix.goButtonClick = function TMP_goButtonClick(aEvent) {
     gBrowser.duplicateTab(gBrowser.mCurrentTab);
   else if (aEvent.button != 2)
     gURLBar.handleCommand(aEvent);
-}
+};
 
 Tabmix.loadTabs = function TMP_loadTabs(aURIs, aReplace) {
   let bgLoad = Services.prefs.getBoolPref("browser.tabs.loadInBackground");
   try {
     gBrowser.loadTabs(aURIs, bgLoad, aReplace);
   } catch (ex) { }
-}
+};
 
 Tabmix.whereToOpen = function TMP_whereToOpen(pref, altKey) {
    var aTab = gBrowser.mCurrentTab;
@@ -857,14 +868,14 @@ Tabmix.whereToOpen = function TMP_whereToOpen(pref, altKey) {
       openTabPref = (altKey ^ openTabPref) == 1;
    }
    return { inNew: !isBlankTab && (isLockTab || openTabPref), lock: isLockTab };
-}
+};
 
 Tabmix.getStyle = function TMP_getStyle(aObj, aStyle) {
   try {
     return parseInt(window.getComputedStyle(aObj, null)[aStyle]) || 0;
   } catch (ex) {this.assert(ex);}
   return 0;
-}
+};
 
 // sometimes context popup stay "open", we hide it manually.
 Tabmix.hidePopup = function TMP_hidePopup(aPopupMenu) {
@@ -876,9 +887,9 @@ Tabmix.hidePopup = function TMP_hidePopup(aPopupMenu) {
       }
       node = node.parentNode;
    }
-}
+};
 
-var TMP_TabView = {
+var TMP_TabView = { /* jshint ignore: line */
   __noSuchMethod__: function(id, args) {
     if (!this.installed)
       return;
@@ -893,7 +904,7 @@ var TMP_TabView = {
     let installed = typeof TabView == "object";
     if (installed)
       Services.scriptloader.loadSubScript("chrome://tabmixplus/content/minit/tabView.js", window);
-    return this.installed = installed;
+    return (this.installed = installed);
   },
 
   checkTabs: function (tabs) {
@@ -947,7 +958,7 @@ var TMP_TabView = {
   getIndexInVisibleTabsFrom_tPos: function (aIndex) {
     return this.getIndexInVisibleTabsFromTab(gBrowser.tabs.item(aIndex));
   }
-}
+};
 
 Tabmix.navToolbox = {
   customizeStarted: false,
@@ -978,7 +989,7 @@ Tabmix.navToolbox = {
             gTMPprefObserver.showReloadEveryOnReloadButton();
         }
       }.bind(this)
-    }
+    };
     CustomizableUI.addListener(this.listener);
   },
 
@@ -1082,7 +1093,7 @@ Tabmix.navToolbox = {
     // onblur attribut reset each time we exit ToolboxCustomize
     var blur = gURLBar.getAttribute("onblur") || "";
     if (blur.indexOf("Tabmix.urlBarOnBlur") == -1)
-      gURLBar.setAttribute("onblur", blur + "Tabmix.urlBarOnBlur();")
+      gURLBar.setAttribute("onblur", blur + "Tabmix.urlBarOnBlur();");
 
     let obj = gURLBar, fn;
     // Fix incompatibility with Omnibar (O is not defined)
@@ -1098,11 +1109,10 @@ Tabmix.navToolbox = {
     else if ("urlDot" in window && "handleCommand2" in gURLBar)
       fn = "handleCommand2";
     else
-      fn = "handleCommand"
+      fn = "handleCommand";
 
     // Fix incompatibility with https://addons.mozilla.org/en-US/firefox/addon/url-fixer/
     if ("urlfixerOldHandler" in gURLBar.handleCommand) {
-      _handleCommand = gURLBar.handleCommand.urlfixerOldHandler.toString();
       obj = gURLBar.handleCommand;
       fn = "urlfixerOldHandler";
     }
@@ -1129,7 +1139,8 @@ Tabmix.navToolbox = {
        }'
     )._replace(
       'if (isMouseEvent || altEnter) {',
-      'let loadNewTab = Tabmix.whereToOpen("extensions.tabmix.opentabfor.urlbar", altEnter).inNew && !(/^ *javascript:/.test(url));\
+      'let loadNewTab = Tabmix.whereToOpen("extensions.tabmix.opentabfor.urlbar", altEnter).inNew &&\
+           !(/^ *javascript:/.test(url));\
        if (isMouseEvent || altEnter || loadNewTab) {', {check: !instantFox}
     )._replace(
       // always check whereToOpenLink except for alt to catch also ctrl/meta
@@ -1156,7 +1167,8 @@ Tabmix.navToolbox = {
          let tabEmpty = !isTabEmpty(gBrowser.selectedTab);\
          let altEnter = !isMouseEvent && aTriggeringEvent && aTriggeringEvent.altKey && !tabEmpty;\
          let loadNewTab = InstantFoxModule.currentQuery && InstantFoxModule.openSearchInNewTab && !tabEmpty ||\
-                          Tabmix.whereToOpen("extensions.tabmix.opentabfor.urlbar", altEnter).inNew && !(/^ *javascript:/.test(url));\
+                          Tabmix.whereToOpen("extensions.tabmix.opentabfor.urlbar", altEnter).inNew &&\
+                          !(/^ *javascript:/.test(url));\
          let inBackground = Tabmix.prefs.getBoolPref("loadUrlInBackground");\
          $&'
       )._replace(
@@ -1168,7 +1180,7 @@ Tabmix.navToolbox = {
       )._replace(
         'inBackground: false',
         'inBackground: inBackground'
-      )
+      );
     }
     _handleCommand.toCode();
 
@@ -1272,7 +1284,7 @@ Tabmix.navToolbox = {
       alltabsPopup.__ensureElementIsVisible = function () {
         let scrollBox = document.getAnonymousElementByAttribute(this, "class", "popup-internal-box");
         scrollBox.ensureElementIsVisible(gBrowser.mCurrentTab.mCorrespondingMenuitem);
-      }
+      };
       alltabsPopup.addEventListener("popupshown", alltabsPopup.__ensureElementIsVisible, false);
 
       // alltabs-popup fix visibility for multi-row
@@ -1354,9 +1366,9 @@ Tabmix.navToolbox = {
     }
   }
 
-}
+};
 
 Tabmix.getPlacement = function(id) {
   let placement = CustomizableUI.getPlacementOfWidget(id);
   return placement ? placement.position : null;
-}
+};
diff --git a/chrome/content/minit/tabView.js b/chrome/content/minit/tabView.js
index e237e8e..1394b1c 100644
--- a/chrome/content/minit/tabView.js
+++ b/chrome/content/minit/tabView.js
@@ -31,7 +31,7 @@
         }
         break;
     }
-  }
+  };
 
   /* ............... TabView Code Fix  ............... */
 
@@ -73,7 +73,7 @@
       callback();
     else
       TabView._initFrameCallbacks.push(callback);
-  },
+  };
 
   TMP_TabView._patchInitialized = false;
   TMP_TabView._patchTabviewFrame = function SM__patchTabviewFrame() {
@@ -163,8 +163,8 @@
         if (!item._reconnected)
           item._reconnect();
       });
-    }
-  },
+    };
+  };
 
   TMP_TabView._resetTabviewFrame = function SM__resetTabviewFrame(){
     var tabView = document.getElementById("tab-view-deck");
@@ -183,7 +183,7 @@
       delete TabView._window.UI._original_reset;
       delete TabView._window.TabItems._original_resumeReconnecting;
     }
-  }
+  };
 
   /* ............... TabmixSessionManager TabView Data ............... */
 
@@ -197,7 +197,7 @@
     var parsedData = TabmixSessionData.getWindowValue(window, "tabview-groups", true);
     this._groupCount = parsedData.totalNumber || 1;
     this._updateUIpageBounds = false;
-  }
+  };
 
   TabmixSessionManager._aftertWindowStateReady =
         function SM__aftertWindowStateReady(aOverwriteTabs, showNotification) {
@@ -225,7 +225,7 @@
 
     this.groupUpdates = {};
     this._tabviewData = {};
-  }
+  };
 
   TabmixSessionManager.groupUpdates = {};
   TabmixSessionManager._tabviewData = {};
@@ -250,13 +250,13 @@
 
     this._tabviewData["tabview-ui"] = _fixData("tabview-ui", false, TabmixSvc.JSON.stringify({}));
     this._tabviewData["tabview-visibility"] = _fixData("tabview-visibility", false, "false");
-  }
+  };
 
   TabmixSessionManager._saveTabviewData = function SM__saveTabviewData() {
-    for (let id in this._tabviewData) {
+    for (let id of Object.keys(this._tabviewData)) {
       this._setTabviewData(id, this._tabviewData[id]);
     }
-  }
+  };
 
   TabmixSessionManager._setTabviewData = function SM__setTabviewData(id, data) {
     if (typeof(data) != "string")
@@ -264,11 +264,11 @@
     TabmixSvc.ss.setWindowValue(window, id, data);
     if (!this.enableBackup)
       return;
-    if (data != "" && data != "{}")
+    if (data !== "" && data != "{}")
       this.setLiteral(this.gThisWin, id, data);
     else
       this.removeAttribute(this.gThisWin, id);
-  }
+  };
 
   TabmixSessionManager._setTabviewTab = function SM__setTabviewTab(aTab, tabdata, activeGroupId){
     if (tabdata.pinned)
@@ -325,7 +325,7 @@
       tabdata.extData["tabview-tab"] = tabviewData;
       // we did not saved hidden attribute when we use TGM
       // hide all tabs that are not in the active group
-      if (!Tabmix.extensions.tabGroupManager && activeGroupId != null) {
+      if (!Tabmix.extensions.tabGroupManager && activeGroupId !== null) {
         if (!parsedData)
           parsedData = TabmixSvc.JSON.parse(tabviewData);
         if (parsedData.groupID != activeGroupId)
@@ -334,11 +334,11 @@
     }
     else if (tabdata.extData)
       delete tabdata.extData["tabview-tab"];
-  }
+  };
 
   TabmixSessionManager.isEmptyObject = function SM_isEmptyObject(obj) {
-    return Object.keys(obj).length == 0;
-  }
+    return Object.keys(obj).length === 0;
+  };
 
   // return true if there are no visible tabs that are not in the exclude array
   TabmixSessionManager._noNormalTabs = function SM__noNormalTabs(excludeTabs) {
@@ -351,7 +351,7 @@
       }
       return false;
     });
-  }
+  };
 
   TabmixSessionManager._addGroupItem = function SM__addGroupItem(aGroupItems, aGroupsData, setAsActive) {
     let groupID = aGroupsData.nextID++;
@@ -364,16 +364,16 @@
     aGroupsData.totalNumber = Object.keys(aGroupItems).length;
     this._tabviewData["tabview-group"] = aGroupItems;
     this._tabviewData["tabview-groups"] = aGroupsData;
-  }
+  };
 
    // Remove current active group only when it's empty and have no title
   TabmixSessionManager._deleteActiveGroup = function SM__deleteActiveGroup(aGroupItems, activeGroupId) {
     let activeGroup = aGroupItems[activeGroupId];
-    if (activeGroup && activeGroup.title == "") {
+    if (activeGroup && activeGroup.title === "") {
       delete aGroupItems[activeGroupId];
       this._tabviewData["tabview-group"] = aGroupItems;
     }
-  }
+  };
 
   // just in case.... and add totalNumber to firefox 4.0 - 5.0.x
   TabmixSessionManager._validateGroupsData = function SM__validateGroupsData(aGroupItems, aGroupsData) {
@@ -387,14 +387,14 @@
       let nextID = 0;
       keys.forEach(function (key) {
         nextID = Math.max(aGroupItems[key].id, nextID);
-      })
+      });
       aGroupsData.nextID = nextID++;
     }
     if (!aGroupsData.activeGroupId)
       aGroupsData.activeGroupId = aGroupItems[keys[0]].id;
     if (!aGroupsData.totalNumber)
       aGroupsData.totalNumber = keys.length;
-  }
+  };
 
  /**
   * when we append tab to this window we merge group data from the session into the curent group data
@@ -458,7 +458,7 @@
         // if active group is empty without title reuse it for
         // the tabs from the session.
         let activeGroup = groupItems[groupsData.activeGroupId];
-        if (activeGroup && activeGroup.title == "") {
+        if (activeGroup && activeGroup.title === "") {
           createNewGroup = false;
           this.groupUpdates.newGroupID = groupsData.activeGroupId;
           this._tabviewData["tabview-group"] = groupItems;
@@ -481,7 +481,7 @@
     // both current window and the session that we are restoring have group data
 
     let IDs = {};
-    for (let id in newGroupItems) {
+    for (let id of Object.keys(newGroupItems)) {
       newGroupItems[id].newItem = true;
       // change group id if already used in this window
       if (id in groupItems) {
@@ -519,15 +519,15 @@
     // save data
     this._tabviewData["tabview-group"] = groupItems;
     this._tabviewData["tabview-groups"] = groupsData;
-  }
+  };
 
   TabmixSessionManager.showNotification = function SM_showNotification() {
-    var msg = TabmixSvc.getSMString("sm.tabview.hiddengroups")
+    var msg = TabmixSvc.getSMString("sm.tabview.hiddengroups");
     try {
       let alerts = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
       alerts.showAlertNotification("chrome://tabmixplus/skin/tmp.png", "Tab Mix Plus", msg, false, "", null);
     } catch (e) { }
-  }
+  };
 
   /* ............... TabView Code Fix  ............... */
 
@@ -542,7 +542,7 @@
       if (data && data.pageBounds)
         TabView._window.UI._pageBounds = data.pageBounds;
     }
-  }
+  };
 
   // when not overwriting tabs try to rearrange the groupItems
   TabmixSessionManager._groupItemPushAway = function SM__groupItemPushAway() {
@@ -559,4 +559,4 @@
       }
     }
     this._groupItems = null;
-  }
+  };
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index a5d3d10..e798541 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -52,7 +52,7 @@ var tablib = {
   },
 
   _loadURIWithFlags: function(browser, uri, flags, referrer, charset, postdata) {
-    var allowLoad = browser.tabmix_allowLoad != false || uri.match(/^javascript:/);
+    var allowLoad = browser.tabmix_allowLoad !== false || uri.match(/^javascript:/);
     if (!allowLoad) {
       try {
         let newURI = Services.io.newURI(uri, null, null);
@@ -76,7 +76,7 @@ var tablib = {
         allowThirdPartyFixup: isFlaged("LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP"),
         fromExternal: isFlaged("LOAD_FLAGS_FROM_EXTERNAL"),
         allowMixedContent: isFlaged("LOAD_FLAGS_ALLOW_MIXED_CONTENT")
-      }
+      };
       return gBrowser.loadOneTab(uri, params);
     }
     browser.tabmix_allowLoad = uri == "about:blank" || !isLockedTab;
@@ -91,7 +91,6 @@ var tablib = {
       [obj, fnName] = [Tabmix.originalFunctions, "oldAddTab"];
     // NRA-ILA toolbar extension raplce the original addTab function
     else if ("origAddTab7c3de167ed6f494aa652f11a71ecb40c" in gBrowser) {
-      let newName = "origAddTab7c3de167ed6f494aa652f11a71ecb40c";
       [obj, fnName] = [gBrowser, "origAddTab7c3de167ed6f494aa652f11a71ecb40c"];
     }
     else
@@ -108,7 +107,8 @@ var tablib = {
       '              isPending             = params.isPending;'
     )._replace(
       't.setAttribute("label", aURI);',
-      't.setAttribute("label", TabmixTabbar.widthFitTitle && aURI.indexOf("about") != 0 ? this.mStringBundle.getString("tabs.connecting") : aURI);',
+      't.setAttribute("label", TabmixTabbar.widthFitTitle && aURI.indexOf("about") != 0 ?\n' +
+      '                              this.mStringBundle.getString("tabs.connecting") : aURI);',
       {check: !Tabmix.isVersion(280)}
     )._replace(
       't.className = "tabbrowser-tab";',
@@ -373,7 +373,7 @@ var tablib = {
         // one tab before the last is in the first row and we are closing one tab
         var tabs = visibleTabs || this.tabbrowser.visibleTabs;
         return this.getTabRowNumber(tabs[tabs.length-2], this.topTabY) == 1;
-      }
+      };
 
       Tabmix.changeCode(tabBar, "gBrowser.tabContainer._lockTabSizing")._replace(
         '{',
@@ -412,8 +412,9 @@ var tablib = {
       ).toCode();
 
       Tabmix.changeCode(tabBar, "gBrowser.tabContainer._unlockTabSizing")._replace(
-        '{', '{' +
-        'var updateScrollStatus = this.hasAttribute("using-closing-tabs-spacer") || this._hasTabTempMaxWidth || this._hasTabTempWidth;'
+        '{', '{\n' +
+        '          var updateScrollStatus = this.hasAttribute("using-closing-tabs-spacer") ||\n' +
+        '                                   this._hasTabTempMaxWidth || this._hasTabTempWidth;'
       )._replace(
         /(\})(\)?)$/,
         '  if (this._hasTabTempWidth) {' +
@@ -511,7 +512,8 @@ var tablib = {
       Tabmix.changeCode(nsContextMenu.prototype, "nsContextMenu.prototype.initOpenItems")._replace(
         /context-openlink",/, '$& !Tabmix.singleWindowMode &&'
       )._replace(
-        /context-openlinkprivate",/, '$& (!Tabmix.singleWindowMode || !isWindowPrivate) &&', {check: Tabmix.isVersion(200)}
+        /context-openlinkprivate",/, '$& (!Tabmix.singleWindowMode || !isWindowPrivate) &&',
+        {check: Tabmix.isVersion(200)}
       ).toCode();
 
       if (Tabmix.isVersion(200)) {
@@ -627,7 +629,8 @@ var tablib = {
       let fnName = loader ? "FdTabLoader.BrowserGoHome" : "window.BrowserGoHome";
       Tabmix.changeCode(obj, fnName)._replace(
         'var where = whereToOpenLink(aEvent, false, true);',
-        '$& \ if (where == "current" && Tabmix.whereToOpen(false).inNew) where = "tab";'
+        '$&' +
+        'if (where == "current" && Tabmix.whereToOpen(false).inNew) where = "tab";'
       )._replace(
        'loadOneOrMoreURIs(homePage);',
        '$& \
@@ -711,13 +714,13 @@ var tablib = {
       if (!undoPopup.hasAttribute("context"))
         undoPopup.setAttribute("context", "tm_undocloseContextMenu");
       TMP_ClosedTabs.populateUndoSubmenu(undoPopup);
-    }
+    };
 
     // history menu open in new tab if the curren tab is locked
     // open in current tab if it blank or if middle click and setting is on
     HistoryMenu.prototype._onCommand = function HM__onCommand(aEvent) {
       TMP_Places.historyMenu(aEvent);
-    }
+    };
 
     Tabmix.changeCode(HistoryMenu.prototype, "HistoryMenu.prototype._onPopupShowing")._replace(
       'this.toggleRecentlyClosedWindows();',
@@ -736,7 +739,8 @@ var tablib = {
       'TabmixSvc.ss', {check: !Tabmix.isVersion(260), flags: "g"}
     )._replace(
       'this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0];',
-      'this._rootElt ? this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0] : document.getElementById(arguments[0]);'
+      'this._rootElt ? this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0] :\n' +
+      '                                   document.getElementById(arguments[0]);'
     )._replace(
       /(\})(\)?)$/,
       '  tablib.populateUndoWindowSubmenu(undoPopup);\n'+
@@ -765,13 +769,13 @@ var tablib = {
     }
 
     Tabmix.originalFunctions.URLBarSetURI = URLBarSetURI;
-    let _URLBarSetURI = function tabmix_URLBarSetURI(aURI) {
+    let _URLBarSetURI = function tabmix_URLBarSetURI() {
       if (Tabmix.selectedTab == gBrowser.selectedTab &&
-          Tabmix.userTypedValue && gBrowser.userTypedValue != "") {
+          Tabmix.userTypedValue && gBrowser.userTypedValue !== "") {
         gBrowser.userTypedValue = "";
       }
       Tabmix.originalFunctions.URLBarSetURI.apply(window, arguments);
-    }
+    };
     Tabmix.setNewFunction(window, "URLBarSetURI", _URLBarSetURI);
   },
 
@@ -782,12 +786,13 @@ var tablib = {
     let menuLabelString = gNavigatorBundle.getString("menuUndoCloseWindowLabel");
     let menuLabelStringSingleTab =
       gNavigatorBundle.getString("menuUndoCloseWindowSingleTabLabel");
+    let checkForMiddleClick = function(e) {this.checkForMiddleClick(e);}.bind(TabmixSessionManager);
     for (let i = 0; i < undoPopup.childNodes.length; i++) {
       let m = undoPopup.childNodes[i];
       let undoItem = undoItems[i];
       if (undoItem && m.hasAttribute("targetURI")) {
         let otherTabsCount = undoItem.tabs.length - 1;
-        let label = (otherTabsCount == 0) ? menuLabelStringSingleTab
+        let label = (otherTabsCount === 0) ? menuLabelStringSingleTab
                                           : PluralForm.get(otherTabsCount, menuLabelString);
         TMP_SessionStore.getTitleForClosedWindow(undoItem);
         let menuLabel = label.replace("#1", undoItem.title)
@@ -795,7 +800,6 @@ var tablib = {
         m.setAttribute("label", menuLabel);
         m.setAttribute("value", i);
         m.fileName = "closedwindow";
-        let checkForMiddleClick = function(e) {this.checkForMiddleClick(e);}.bind(TabmixSessionManager);
         m.addEventListener("click", checkForMiddleClick, false);
       }
     }
@@ -818,7 +822,7 @@ var tablib = {
         loadURI(uri, aReferrer, aPostData, aAllowThirdPartyFixup);
         gBrowser.ensureTabIsVisible(gBrowser.selectedTab);
       }
-    }
+    };
 
     let duplicateTab = function tabbrowser_duplicateTab(aTab, aHref, aTabData, disallowSelect, dontFocusUrlBar) {
       if (aTab.localName != "tab")
@@ -857,11 +861,11 @@ var tablib = {
       }
 
       return newTab;
-    }
+    };
     Tabmix.setNewFunction(gBrowser, "duplicateTab", duplicateTab);
 
     gBrowser.SSS_duplicateTab = function tabbrowser_SSS_duplicateTab(aTab, aHref, aTabData) {
-      var newTab = null;
+      var newTab = null, tabState;
       // add new history entry after current index
       function addNewHistoryEntry() {
         try {
@@ -873,8 +877,8 @@ var tablib = {
         } catch (ex) {Tabmix.assert(ex);}
       }
       // we need to update history title after the new page loaded for use in back/forword button
-      var self = this;
       function updateNewHistoryTitle() {
+        /* jshint validthis: true */
         try {
           this.removeEventListener("SSTabRestored", updateNewHistoryTitle, true);
           let browser = this.linkedBrowser;
@@ -884,6 +888,7 @@ var tablib = {
         } catch (ex) {Tabmix.assert(ex);}
       }
       function urlForDownload() {
+        /* jshint validthis: true */
         try {
           this.removeEventListener("SSTabRestored", urlForDownload, true);
           let browser = this.linkedBrowser;
@@ -892,7 +897,6 @@ var tablib = {
         } catch (ex) {Tabmix.assert(ex);}
       }
       try {
-        var newTab, tabState;
         tabState = aTabData ? aTabData.state : TabmixSvc.JSON.parse(TabmixSvc.ss.getTabState(aTab));
         newTab = this.addTab("about:blank", {dontMove: true});
         newTab.linkedBrowser.stop();
@@ -909,7 +913,7 @@ var tablib = {
       } catch (ex) {Tabmix.assert(ex);}
 
       return newTab;
-    }
+    };
 
     gBrowser.duplicateTabToWindow = function (aTab, aMoveTab, aTabData) {
       if (aTab.localName != "tab")
@@ -928,7 +932,7 @@ var tablib = {
         window.openDialog("chrome://browser/content/browser.xul",
             "_blank", "chrome,dialog=no,all", aTab);
       }
-    }
+    };
 
     gBrowser.openLinkWithHistory = function (aTab) {
       var {target, linkURL} = gContextMenu;
@@ -943,7 +947,7 @@ var tablib = {
         urlSecurityCheck(url, doc.nodePrincipal);
 
       this.duplicateTab(aTab, url);
-    }
+    };
 
     Tabmix.changeCode(nsContextMenu.prototype, "nsContextMenu.prototype.openLinkInTab")._replace(
       /allowMixedContent:|charset:/,
@@ -959,13 +963,15 @@ var tablib = {
 
       // the next line is insertion point for treeStyleTab extension look in
       // treeStyleTab hacks.js
+      /* jshint ignore:start */
       var newTab = null;
+      /* jshint ignore:end */
 
       gContextMenu.linkURL = url;
       // originalFunctions.openInverseLink is a copy of original
       // nsContextMenu.prototype.openLinkInTab
       Tabmix.originalFunctions.openInverseLink.apply(gContextMenu);
-    }
+    };
 
     tablib.openLinkInCurrent = function() {
       var {target, linkURL} = gContextMenu;
@@ -976,7 +982,7 @@ var tablib = {
       gContextMenu.linkURL = url;
       gBrowser.selectedBrowser.tabmix_allowLoad = true;
       gContextMenu.openLinkInCurrent();
-    }
+    };
 
     tablib.getValidUrl = function(tab, url, target) {
       // valid urls don't contain spaces ' '; if we have a space it isn't a valid url.
@@ -986,7 +992,7 @@ var tablib = {
              /^\s*(javascript|data):/.test(aUrl))
           return false;
         return true;
-      }
+      };
 
       if (!isValid(url)) {
         let json = {button: 0, shiftKey: false, ctrlKey: false, metaKey: false,
@@ -998,12 +1004,12 @@ var tablib = {
         return result._href && isValid(result._href) ? result._href : null;
       }
       return url;
-    }
+    };
 
     gBrowser.closeAllTabs = function TMP_closeAllTabs() {
       if (this.warnAboutClosingTabs(this.closingTabsEnum.ALL)) {
         if (TabmixTabbar.visibleRows > 1)
-          this.tabContainer.updateVerticalTabStrip(true)
+          this.tabContainer.updateVerticalTabStrip(true);
         let tabs = this.visibleTabs.slice();
         // remove current tab last
         if (!this.mCurrentTab.pinned)
@@ -1016,7 +1022,7 @@ var tablib = {
         Tabmix.setNumberOfTabsClosedLast();
         // _handleTabSelect will call mTabstrip.ensureElementIsVisible
       }
-    }
+    };
 
     gBrowser.closeGroupTabs = function TMP_closeGroupTabs(aTab) {
       if (aTab.localName != "tab")
@@ -1040,21 +1046,21 @@ var tablib = {
         }
         Tabmix.setNumberOfTabsClosedLast();
       }
-    }
+    };
 
     gBrowser._closeLeftTabs = function (aTab) {
       if (Tabmix.ltr)
         this.closeLeftTabs(aTab);
       else
         this.closeRightTabs(aTab);
-    }
+    };
 
     gBrowser._closeRightTabs = function (aTab) {
       if (Tabmix.ltr)
         this.closeRightTabs(aTab);
       else
         this.closeLeftTabs(aTab);
-    }
+    };
 
     gBrowser.closeRightTabs = function (aTab) {
       if (aTab.localName != "tab")
@@ -1073,7 +1079,7 @@ var tablib = {
         }
         Tabmix.setNumberOfTabsClosedLast();
       }
-    }
+    };
 
     gBrowser.closeLeftTabs = function TMP_closeLeftTabs(aTab) {
       if (aTab.localName != "tab")
@@ -1094,7 +1100,7 @@ var tablib = {
         }
         Tabmix.setNumberOfTabsClosedLast();
       }
-    }
+    };
 
     Tabmix.setNewFunction(gBrowser, "removeAllTabsBut", function TMP_removeAllTabsBut(aTab) {
       if (aTab.localName != "tab")
@@ -1106,7 +1112,7 @@ var tablib = {
         this.ensureTabIsVisible(this.selectedTab);
         var childNodes = this.visibleTabs;
         if (TabmixTabbar.visibleRows > 1)
-          this.tabContainer.updateVerticalTabStrip(true)
+          this.tabContainer.updateVerticalTabStrip(true);
         Tabmix.startCountingClosedTabs();
         for (var i = childNodes.length - 1; i >= 0; --i) {
           if (childNodes[i] != aTab && !childNodes[i].pinned)
@@ -1121,14 +1127,14 @@ var tablib = {
         this.reloadLeftTabs(aTab);
       else
         this.reloadRightTabs(aTab);
-    }
+    };
 
     gBrowser._reloadRightTabs = function (aTab) {
       if (Tabmix.ltr)
         this.reloadRightTabs(aTab);
       else
         this.reloadLeftTabs(aTab);
-    }
+    };
 
     gBrowser.reloadLeftTabs = function (aTab) {
       if (aTab.localName != "tab")
@@ -1138,7 +1144,7 @@ var tablib = {
         this.selectedTab = aTab;
       let tabPos = childNodes.indexOf(aTab);
       tablib.reloadTabs(childNodes.slice(0, tabPos).reverse());
-    }
+    };
 
     gBrowser.reloadRightTabs = function (aTab) {
       if (aTab.localName != "tab")
@@ -1148,7 +1154,7 @@ var tablib = {
         this.selectedTab = aTab;
       let tabPos = childNodes.indexOf(aTab);
       tablib.reloadTabs(childNodes.slice(tabPos + 1));
-    }
+    };
 
     gBrowser.reloadAllTabsBut = function (aTab) {
       if (aTab.localName != "tab")
@@ -1156,7 +1162,7 @@ var tablib = {
       else
         this.selectedTab = aTab;
       tablib.reloadTabs(this.visibleTabs, aTab);
-    }
+    };
 
     gBrowser.lockTab = function (aTab) {
       if (aTab.localName != "tab")
@@ -1173,7 +1179,7 @@ var tablib = {
       aTab.linkedBrowser.tabmix_allowLoad = !aTab.hasAttribute("locked");
       TabmixSvc.saveTabAttributes(aTab, "_locked");
       TabmixSessionManager.updateTabProp(aTab);
-    }
+    };
 
     gBrowser.protectTab = function (aTab) {
       if (aTab.localName != "tab")
@@ -1188,7 +1194,7 @@ var tablib = {
         TabmixTabbar.updateScrollStatus();
         TabmixTabbar.updateBeforeAndAfter();
       }
-    }
+    };
 
     gBrowser.freezeTab = function (aTab) {
       if (aTab.localName != "tab")
@@ -1211,7 +1217,7 @@ var tablib = {
         TabmixTabbar.updateScrollStatus();
         TabmixTabbar.updateBeforeAndAfter();
       }
-    }
+    };
 
     gBrowser.SelectToMerge = function(aTab) {
       if (Tabmix.singleWindowMode && Tabmix.numberOfWindows() == 1) return;
@@ -1221,7 +1227,7 @@ var tablib = {
         aTab.removeAttribute("mergeselected");
         aTab.label = aTab.label.substr(4);
       } else {
-        aTab.setAttribute("mergeselected", "true")
+        aTab.setAttribute("mergeselected", "true");
         aTab.label = "(*) " + aTab.label;
       }
       this._tabAttrModified(aTab);
@@ -1229,7 +1235,7 @@ var tablib = {
         TabmixTabbar.updateScrollStatus();
         TabmixTabbar.updateBeforeAndAfter();
       }
-    }
+    };
 
     gBrowser.copyTabUrl = function (aTab) {
       if (aTab.localName != "tab")
@@ -1238,7 +1244,7 @@ var tablib = {
                    .getService(Components.interfaces.nsIClipboardHelper);
 
       clipboard.copyString(this.getBrowserForTab(aTab).currentURI.spec);
-    }
+    };
 
   /** XXX need to fix this functions:
     previousTabIndex
@@ -1265,7 +1271,7 @@ var tablib = {
       }
 
       return tempIndex;
-    }
+    };
 
     gBrowser.previousTab = function (aTab) {
       var tabs = this.visibleTabs;
@@ -1281,7 +1287,7 @@ var tablib = {
         this.selectedTab = tabs[tempIndex];
 
       this.selectedBrowser.focus();
-    }
+    };
 
     gBrowser.selectIndexAfterRemove = function (oldTab) {
       var tabs = TMP_TabView.currentGroup();
@@ -1294,14 +1300,11 @@ var tablib = {
       var mode = Tabmix.prefs.getIntPref("focusTab");
       switch ( mode ) {
         case 0: // first tab
-          return currentIndex == 0 ? 1 : 0;
-          break;
+          return currentIndex === 0 ? 1 : 0;
         case 1: // left tab
-          return currentIndex == 0 ? 1 : currentIndex-1 ;
-          break;
+          return currentIndex === 0 ? 1 : currentIndex-1 ;
         case 3: // last tab
           return currentIndex == l - 1 ? currentIndex - 1 : l - 1;
-          break;
         case 6: // last opened
           let lastTabIndex, maxID = -1;
           tabs.forEach(function(tab, index) {
@@ -1322,8 +1325,10 @@ var tablib = {
           // if we don't find last selected we fall back to default
           if (tempIndex > -1)
             return tempIndex;
+          /* falls through */
         case 2: // opener / right  (default )
         case 5: // right tab
+          /* falls through */
         default:
           if (mode != 5 && Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") && "owner" in oldTab) {
             var owner = oldTab.owner;
@@ -1336,7 +1341,7 @@ var tablib = {
           }
       }
       return currentIndex == l - 1 ? currentIndex - 1 : currentIndex + 1;
-    }
+    };
 
     gBrowser.stopMouseHoverSelect = function(aTab) {
        // add extra delay after tab removed or after tab flip before we select by hover
@@ -1348,7 +1353,7 @@ var tablib = {
             browser.removeAttribute("preventMouseHoverSelect");
           }, delay, this);
        }
-    }
+    };
 
     Object.defineProperty(gBrowser, "closingTabsEnum",
       {value: { ALL: 0, OTHER: 1, TO_END: 2, ALL_ONEXIT: 3, TO_START: 4, GROUP: 5 }, writable: false});
@@ -1406,15 +1411,15 @@ var tablib = {
             Services.prefs.getBoolPref(prefs[2])) {
           if (whatToClose == closing.GROUP)
             shouldPrompt = -1;
-          else if (whatToClose == closing.ALL && numProtected == 0 &&
+          else if (whatToClose == closing.ALL && numProtected === 0 &&
               numTabs == this.tabs.length) {
-            whatToClose = closing.ALL_ONEXIT
+            whatToClose = closing.ALL_ONEXIT;
             shouldPrompt = 3;
           }
         }
       }
 
-      if (shouldPrompt == 0)
+      if (shouldPrompt === 0)
         return true;
 
       var i, tabPos, tabsToClose = 0;
@@ -1486,7 +1491,7 @@ var tablib = {
       var bundle = this.mStringBundle;
 
       var message, chkBoxLabel;
-      if (shouldPrompt == 1 || numProtected == 0) {
+      if (shouldPrompt == 1 || numProtected === 0) {
         if (Tabmix.isVersion(290))
           message = PluralForm.get(tabsToClose, bundle.getString("tabs.closeWarningMultiple"))
                       .replace("#1", tabsToClose);
@@ -1511,35 +1516,35 @@ var tablib = {
       var buttonPressed = promptService.confirmEx(window,
                                                   bundle.getString("tabs.closeWarningTitle"),
                                                   message,
-                                                  (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0)
-                                                  + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1),
+                                                  (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) +
+                                                  (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1),
                                                   buttonLabel,
                                                   null, null,
                                                   chkBoxLabel,
                                                   warnOnClose);
-      var reallyClose = (buttonPressed == 0);
+      var reallyClose = (buttonPressed === 0);
       // don't set the pref unless they press OK and it's false
       if (reallyClose && !warnOnClose.value) {
         Services.prefs.setBoolPref(prefs[shouldPrompt - 1], false);
       }
 
       return reallyClose;
-    }
+    };
     Tabmix.setNewFunction(gBrowser, "warnAboutClosingTabs", warnAboutClosingTabs);
 
     gBrowser.TMP_selectNewForegroundTab = function (aTab, aLoadInBackground, aUrl, addOwner) {
-       var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
+       var bgLoad = (aLoadInBackground !== null) ? aLoadInBackground :
                       Services.prefs.getBoolPref("browser.tabs.loadInBackground");
        if (!bgLoad) {
           // set new tab owner
-          addOwner = addOwner != null ? addOwner : true;
+          addOwner = addOwner !== null ? addOwner : true;
           if (addOwner)
              aTab.owner = this.selectedTab;
           this.selectedTab = aTab;
           if (aUrl && Tabmix.isNewTabUrls(aUrl))
             tablib.setURLBarFocus();
        }
-    }
+    };
 
     Tabmix.originalFunctions.swapBrowsersAndCloseOther = gBrowser.swapBrowsersAndCloseOther;
     let swapTab = function tabmix_swapBrowsersAndCloseOther(aOurTab, aOtherTab) {
@@ -1569,7 +1574,7 @@ var tablib = {
       }
 
       Tabmix.originalFunctions.swapBrowsersAndCloseOther.apply(this, arguments);
-    }
+    };
     Tabmix.setNewFunction(gBrowser, "swapBrowsersAndCloseOther", swapTab);
 
     // Bug 752376 - Avoid calling scrollbox.ensureElementIsVisible()
@@ -1577,7 +1582,7 @@ var tablib = {
     gBrowser.ensureTabIsVisible = function tabmix_ensureTabIsVisible(aTab, aSmoothScroll) {
       if (this.tabContainer.overflow)
         this.tabContainer.mTabstrip.ensureElementIsVisible(aTab, aSmoothScroll);
-    }
+    };
 
     // Follow up bug 887515 - add ability to restore multiple tabs
     // bug 914258 backout 887515 changes from Firefox 25
@@ -1585,15 +1590,15 @@ var tablib = {
       Tabmix.startCountingClosedTabs = function() {
         this.shouldCountClosedTabs = true;
         this.numberOfTabsClosedLast = 0;
-      }
+      };
       Tabmix.setNumberOfTabsClosedLast = function(aNum) {
         TabmixSvc.ss.setNumberOfTabsClosedLast(window, aNum || this.numberOfTabsClosedLast);
         this.shouldCountClosedTabs = false;
         this.numberOfTabsClosedLast = 0;
-      }
+      };
       Tabmix.countClosedTabs = function(aTab) {
         if (!this.shouldCountClosedTabs ||
-            Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo") == 0)
+            Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo") === 0)
           return;
         var tabState = TabmixSvc.JSON.parse(TabmixSvc.ss.getTabState(aTab));
         if (!tabState.entries || tabState.entries.length == 1 &&
@@ -1602,23 +1607,23 @@ var tablib = {
             !tabState.userTypedValue)
           return;
         this.numberOfTabsClosedLast++;
-      }
+      };
     }
     else {
-      Tabmix.startCountingClosedTabs = function() { }
-      Tabmix.setNumberOfTabsClosedLast = function() { }
-      Tabmix.countClosedTabs = function() { }
+      Tabmix.startCountingClosedTabs = function() { };
+      Tabmix.setNumberOfTabsClosedLast = function() { };
+      Tabmix.countClosedTabs = function() { };
     }
 
     /** DEPRECATED **/
     // we keep this function to saty compatible with other extensions that use it
-    gBrowser.undoRemoveTab = function () {TMP_ClosedTabs.undoCloseTab();}
+    gBrowser.undoRemoveTab = function () {TMP_ClosedTabs.undoCloseTab();};
     // Tabmix don't use this function anymore
     // but treeStyleTab extension look for it
-    gBrowser.restoreTab = function() { }
-    gBrowser.closeTab = function(aTab) {this.removeTab(aTab);}
+    gBrowser.restoreTab = function() { };
+    gBrowser.closeTab = function(aTab) {this.removeTab(aTab);};
     gBrowser.TMmoveTabTo = gBrowser.moveTabTo;
-    gBrowser.renameTab = function(aTab) {Tabmix.renameTab.editTitle(aTab);}
+    gBrowser.renameTab = function(aTab) {Tabmix.renameTab.editTitle(aTab);};
   },
 
   // prevent 'ReferenceError: reference to undefined property params'
@@ -1631,7 +1636,7 @@ var tablib = {
     this.props.forEach(function(prop){
       if (typeof params[prop] == "undefined")
         params[prop] = null;
-    })
+    });
     return params;
   },
 
@@ -1772,7 +1777,6 @@ var tablib = {
       // to show warnAboutClosingTabs dialog but we block it in order to call warnAboutClosingTabs
       // from here and catch dispaly time here.
       return getSavedPref("browser.showQuitWarning").value;
-      return true;
     }
 
     // we always show our prompt on Mac
@@ -1804,9 +1808,12 @@ var tablib = {
     var browser = gBrowser.selectedBrowser;
     if (aUri != browser.currentURI.spec) {
       let tab = gBrowser.mCurrentTab;
-      let isCopy = "dataTransfer" in aEvent ? (aEvent.dataTransfer.dropEffect == "copy") : (aEvent.ctrlKey || aEvent.metaKey);
+      let isCopy = "dataTransfer" in aEvent ?
+                   (aEvent.dataTransfer.dropEffect == "copy") :
+                   (aEvent.ctrlKey || aEvent.metaKey);
       if (!isCopy && tab.getAttribute("locked") &&
-                    !gBrowser.isBlankNotBusyTab(tab) && !Tabmix.ContentClick.isUrlForDownload(aUri)) {
+          !gBrowser.isBlankNotBusyTab(tab) &&
+          !Tabmix.ContentClick.isUrlForDownload(aUri)) {
         where = "tab";
       }
       else
@@ -1841,11 +1848,11 @@ var tablib = {
     }
   }
 
-} // end tablib
+}; // end tablib
 
 Tabmix.isNewTabUrls = function Tabmix_isNewTabUrls(aUrl) {
   return this.newTabUrls.indexOf(aUrl) > -1;
-}
+};
 
 Tabmix.newTabUrls = [
    "about:newtab", "about:blank",
@@ -1861,4 +1868,4 @@ Tabmix.getOpenTabNextPref = function TMP_getOpenTabNextPref(aRelatedToCurrent) {
     return true;
 
   return false;
-}
+};
diff --git a/chrome/content/places/places.js b/chrome/content/places/places.js
index 068da93..8b1ebaf 100644
--- a/chrome/content/places/places.js
+++ b/chrome/content/places/places.js
@@ -92,8 +92,9 @@ var TMP_Places = {
         '$& && !params.suppressTabsOnFileDownload'
       )._replace(
         'var w = getTopWin();',
-        '$& \
-         if (w && where == "window" && !Tabmix.isNewWindowAllow(Tabmix.isVersion(200) ? aIsPrivate : false)) where = "tab";'
+        '$&\n' +
+        '  if (w && where == "window" && !Tabmix.isNewWindowAllow(Tabmix.isVersion(200) ?\n' +
+        '                                 aIsPrivate : false)) where = "tab";'
       )._replace(
         /Services.ww.openWindow[^;]*;/,
         'let newWin = $&\n    if (newWin && bookMarkId)\n        newWin.bookMarkIds = bookMarkId;'
@@ -210,7 +211,7 @@ var TMP_Places = {
       if ((_pref.getBoolPref(aPref) || aTab.hasAttribute("locked"))) {
          if (aEvent && _pref.getBoolPref("extensions.tabmix.middlecurrent") &&
                ((aEvent instanceof MouseEvent &&
-                (aEvent.button == 1 || aEvent.button == 0 && (aEvent.ctrlKey || aEvent.metaKey))) ||
+                (aEvent.button == 1 || aEvent.button === 0 && (aEvent.ctrlKey || aEvent.metaKey))) ||
                 (aEvent instanceof XULCommandEvent &&
                  typeof aEvent.target._placesNode == "object" && (aEvent.ctrlKey || aEvent.metaKey))))
             aWhere = "current";
@@ -225,11 +226,13 @@ var TMP_Places = {
      switch (aWindow.document.documentURI) {
        case "chrome://browser/content/places/places.xul":
          if (PlacesOrganizer._places.selectedNode.itemId != PlacesUIUtils.leftPaneQueries["History"])
-           break;
+           return this.prefBookmark;
+         /* falls through */
        case "chrome://browser/content/history/history-panel.xul":
          return this.prefHistory;
        case "chrome://browser/content/browser.xul":
        case "chrome://browser/content/bookmarks/bookmarksPanel.xul":
+         /* falls through */
        default:
          break;
      }
@@ -237,7 +240,8 @@ var TMP_Places = {
    },
 
   // fixed: reuse all blank tab not just in the end
-  // fixed: if "extensions.tabmix.loadFolderAndReplace" is true don't reuse locked and protected tabs open bookmark after those tabs
+  // fixed: if "extensions.tabmix.loadFolderAndReplace" is true don't reuse
+  //        locked and protected tabs open bookmark after those tabs
   // fixed: focus the first tab if "extensions.tabmix.openTabNext" is true
   // fixed: remove "selected" and "tabmix_selectedID" from reuse tab
   //
@@ -260,10 +264,13 @@ var TMP_Places = {
        aTab = tabs[i];
        tabIsBlank = gBrowser.isBlankNotBusyTab(aTab);
        // don't reuse collapsed tab if width fitTitle is set
-       canReplace = (doReplace && !aTab.hasAttribute("locked") && !aTab.hasAttribute("pinned")) || tabIsBlank;
+       canReplace = (doReplace && !aTab.hasAttribute("locked") &&
+                    !aTab.hasAttribute("pinned")) || tabIsBlank;
        if (reuseTabs.length < bmGroup.length && canReplace)
           reuseTabs.push(aTab);
-       else if ((doReplace && !aTab.hasAttribute("locked") && !aTab.hasAttribute("protected") && !aTab.hasAttribute("pinned")) || tabIsBlank) {
+       else if ((doReplace && !aTab.hasAttribute("locked") &&
+                 !aTab.hasAttribute("protected") &&
+                 !aTab.hasAttribute("pinned")) || tabIsBlank) {
           aTab.collapsed = true;
           removeTabs.push(aTab);
        }
@@ -388,7 +395,7 @@ var TMP_Places = {
 
   get _titlefrombookmark() {
     delete this._titlefrombookmark;
-    return this._titlefrombookmark = Tabmix.prefs.getBoolPref("titlefrombookmark");
+    return (this._titlefrombookmark = Tabmix.prefs.getBoolPref("titlefrombookmark"));
   },
 
   applyCallBackOnUrl: function (aUrl, aCallBack) {
@@ -399,7 +406,7 @@ var TMP_Places = {
     // when IE Tab is installed try to find url with or without the prefix
     let ietab = Tabmix.extensions.gIeTab;
     if (!result && ietab) {
-      let prefix = "chrome://" + ietab.folder + "/content/reloaded.html?url="
+      let prefix = "chrome://" + ietab.folder + "/content/reloaded.html?url=";
       if (aUrl != prefix) {
         let url = aUrl.startsWith(prefix) ?
             aUrl.replace(prefix, "") : prefix + aUrl;
@@ -540,7 +547,7 @@ var TMP_Places = {
     this.afterTabTitleChanged();
   },
 
-  updateTitleonTabs: function TMP_PC_updateTitleonTabs(aItemId, aRemoved) {
+  updateTitleonTabs: function TMP_PC_updateTitleonTabs(aItemId) {
     if (this.inUpdateBatch) {
       this._batchData.updateIDs.push(aItemId);
       return;
@@ -575,18 +582,19 @@ var TMP_Places = {
   onItemRemoved: function TMP_PC_onItemRemoved(aItemId, aFolder, aIndex, aItemType) {
     if (aItemId == -1 || aItemType != Ci.nsINavBookmarksService.TYPE_BOOKMARK)
       return;
-    this.updateTitleonTabs(aItemId, true);
+    this.updateTitleonTabs(aItemId);
   },
 
   // onItemChanged also fired when page is loaded (visited count changed ?)
-  onItemChanged: function TMP_PC_onItemChanged(aItemId, aProperty, aIsAnnotationProperty, aNewValue, aLastModified, aItemType) {
+  onItemChanged: function TMP_PC_onItemChanged(aItemId, aProperty, aIsAnnotationProperty,
+                                               aNewValue, aLastModified, aItemType) {
     if (aItemId == -1 || aItemType != Ci.nsINavBookmarksService.TYPE_BOOKMARK ||
         (aProperty != "uri" && aProperty != "title"))
       return;
 
     if (aProperty == "uri" && aNewValue && !isBlankPageURL(aNewValue))
       this.addItemIdtoTabsWithUrl(aItemId, aNewValue);
-    this.updateTitleonTabs(aItemId, aProperty == "uri");
+    this.updateTitleonTabs(aItemId);
   },
 
   onBeginUpdateBatch: function TMP_PC_onBeginUpdateBatch() {
@@ -603,7 +611,7 @@ var TMP_Places = {
     this.inUpdateBatch = false;
     var [updateIDs, addIDs, addURLs] = [data.updateIDs, data.add.ids, data.add.urls];
     if (addIDs.length)
-      this.addItemIdtoTabsWithUrl(addIDs, addURLs)
+      this.addItemIdtoTabsWithUrl(addIDs, addURLs);
     if (updateIDs.length)
       this.updateTitleonTabs(updateIDs);
 
@@ -615,7 +623,7 @@ var TMP_Places = {
 
   onItemVisited: function () {},
   onItemMoved: function () {}
-}
+};
 
 TMP_Places.contextMenu = {
   toggleEventListener: function(enable) {
@@ -672,10 +680,10 @@ TMP_Places.contextMenu = {
       openInWindow.setAttribute("default", true);
     }
   }
-}
+};
 
 /** DEPRECATED **/
 TMP_Places.getTabFixedTitle = function(aBrowser, aUri) {
   let win = aBrowser.ownerDocument.defaultView;
   return win.TMP_Places.getTabTitle(win.gBrowser.getTabForBrowser(aBrowser), aUri.spec);
-}
+};
diff --git a/chrome/content/session/promptservice.js b/chrome/content/session/promptservice.js
index 8f55aec..88e20eb 100644
--- a/chrome/content/session/promptservice.js
+++ b/chrome/content/session/promptservice.js
@@ -89,10 +89,9 @@
       // display the command buttons
       var aButtons, buttons = ["accept", "cancel", "extra1"];
       var btnLabels = dialogParams.GetString(4).split("\n");
-      var maxWidth = 0;
       for (i = 0; i < buttons.length; ++i) {
          aButtons = document.documentElement.getButton(buttons[i]);
-         if (i < btnLabels.length && btnLabels[i] != "") {
+         if (i < btnLabels.length && btnLabels[i] !== "") {
             setLabelForNode(aButtons, btnLabels[i]);
          }
          else aButtons.hidden = true; // hide extra button
@@ -194,11 +193,11 @@
       var description = document.getElementById("tm_info").lastChild.firstChild;
       textBox.value = textBox.value.replace(/^[\s]+/g,"");
       var name = textBox.value.toLowerCase();
-      var msgReplace, validName = 0;
-      if (name == "") validName = 1;
-      if (validName==0) {
+      var validName = 0;
+      if (name === "") validName = 1;
+      if (validName === 0) {
          for (var i = 0; i < gSavedName.length; i++) {
-            if (name == gSavedName[i].toLowerCase() && gSavedName[i] != "" ) {
+            if (name == gSavedName[i].toLowerCase() && gSavedName[i] !== "" ) {
                if (dialogParams.GetInt(3) == TMP_DLG_RENAME) {
                   if (gOrigName != name) validName = 2;
                   continue;
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index a46b1d3..f2eafa6 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -28,13 +28,13 @@ Tabmix.Sanitizer = {
       *   - about:privatebrowsing clearing your recent history  - Always show the UI
       *   - clear private data on exit - NEVER show the UI
       */
-      var promptOnSanitize = !aOnExit;
+      var sanitizeTabmix, promptOnSanitize = !aOnExit;
       // if promptOnSanitize is true we call Tabmix.Sanitizer.sanitize from Firefox Sanitizer
       if (promptOnSanitize)
          return false;
 
       try {
-         var sanitizeTabmix = Services.prefs.getBoolPref("privacy.clearOnShutdown.extensions-tabmix");
+         sanitizeTabmix = Services.prefs.getBoolPref("privacy.clearOnShutdown.extensions-tabmix");
       } catch (e) { sanitizeTabmix = false;}
 
       return sanitizeTabmix;
@@ -53,7 +53,7 @@ Tabmix.Sanitizer = {
       // get file references
       var sessionFile = TabmixSvc.FileUtils.getDir("ProfD", []);
       var sessionFileBackup = sessionFile.clone();
-      var sessionsBackupDir = sessionFile.clone()
+      var sessionsBackupDir = sessionFile.clone();
       sessionFile.append("session.rdf");
       sessionFileBackup.append("session.old");
       sessionsBackupDir.append("sessionbackups");
@@ -86,7 +86,8 @@ Tabmix.Sanitizer = {
          wnd.Tabmix.setItem("tmp_closedwindows", "disabled", true);
 
          // clear closed tabs and disable the button if we use TMP session manager and save close tabs
-         if ((TabmixSessionManager.enableManager || TabmixSessionManager.enableBackup) && TabmixSessionManager.saveClosedTabs) {
+         if ((TabmixSessionManager.enableManager || TabmixSessionManager.enableBackup) &&
+             TabmixSessionManager.saveClosedTabs) {
             wnd.TMP_ClosedTabs.restoreTab("original", -1);
             wnd.TMP_ClosedTabs.setButtonDisableState();
          }
@@ -108,9 +109,9 @@ Tabmix.Sanitizer = {
       }
    }
 
-}
+};
 
-var TabmixSessionData = {
+var TabmixSessionData = { // jshint ignore:line
    docShellItems: ["Images","Subframes","MetaRedirects","Plugins","Javascript"],
    tabAttribute:  ["protected","locked"],
 
@@ -176,7 +177,7 @@ var TabmixSessionData = {
     var existingData = parse ? null : "";
     try {
       var tabData = TabmixSvc.ss.getTabValue(tab, id);
-      if (tabData != "" && tabData != "{}" && tabData != "null") {
+      if (tabData !== "" && tabData != "{}" && tabData != "null") {
         if (parse)
           existingData = TabmixSvc.JSON.parse(tabData);
         else
@@ -206,9 +207,9 @@ var TabmixSessionData = {
 
   // treeStyleTab extension look for it
   setTabProperties: function() { }
-}
+};
 
-var TabmixSessionManager = {
+var TabmixSessionManager = { // jshint ignore:line
     _rdfRoot: "rdf://tabmix",
     HSitems: 3,
     NC_TM: {},
@@ -243,19 +244,19 @@ var TabmixSessionManager = {
 
    get prefBranch() {
       delete this.prefBranch;
-      return this.prefBranch = Services.prefs.getBranch("extensions.tabmix.sessions.");
+      return (this.prefBranch = Services.prefs.getBranch("extensions.tabmix.sessions."));
    },
 
   get SessionStoreGlobal() {
     delete this.SessionStoreGlobal;
-    let tmp = {}
+    let tmp = {};
     Cu.import("resource:///modules/sessionstore/SessionStore.jsm", tmp);
-    return this.SessionStoreGlobal = Cu.getGlobalForObject(tmp.SessionStore);
+    return (this.SessionStoreGlobal = Cu.getGlobalForObject(tmp.SessionStore));
   },
 
   get SessionStore() {
     delete this.SessionStore;
-    return this.SessionStore = this.SessionStoreGlobal.SessionStoreInternal;
+    return (this.SessionStore = this.SessionStoreGlobal.SessionStoreInternal);
   },
 
    // call by Tabmix.beforeSessionStoreInit
@@ -344,15 +345,15 @@ var TabmixSessionManager = {
       var crashed;
       if (Tabmix.firstWindowInSession && !this.globalPrivateBrowsing &&
             !sanitized && !Tabmix.isWindowAfterSessionRestore) {
-         let status;
+         let sm_status;
          if (this.enableBackup) {
             let path = this._rdfRoot + "/closedSession/thisSession";
-            status = TabmixSvc.sm.status = this.getLiteralValue(path, "status");
-            crashed = TabmixSvc.sm.crashed = status.indexOf("crash") != -1;
+            sm_status = TabmixSvc.sm.status = this.getLiteralValue(path, "status");
+            crashed = TabmixSvc.sm.crashed = sm_status.indexOf("crash") != -1;
          }
          if (this.enableManager || crashed) {
             if (crashed)
-               this.preparAfterCrash(status);
+               this.preparAfterCrash(sm_status);
             this.prepareSavedSessions();
          }
       }
@@ -364,8 +365,8 @@ var TabmixSessionManager = {
          this.setLiteral(this.gThisWin, "private", "true");
          this.enableBackup = false;
          // initialize closed window list broadcaster
-         var disabled = this.enableManager ? isFirstWindow || this.isPrivateSession || this.isClosedWindowsEmpty() :
-            TabmixSvc.ss.getClosedWindowCount() == 0;
+         let disabled = this.enableManager ? isFirstWindow || this.isPrivateSession || this.isClosedWindowsEmpty() :
+                                             TabmixSvc.ss.getClosedWindowCount() === 0;
          Tabmix.setItem("tmp_closedwindows", "disabled", disabled || null);
          return;
       }
@@ -401,7 +402,7 @@ var TabmixSessionManager = {
               this.openFirstWindow(TabmixSvc.sm.crashed);
          }
 
-         Tabmix.prefs.clearUserPref("warnAboutClosingTabs.timeout")
+         Tabmix.prefs.clearUserPref("warnAboutClosingTabs.timeout");
       }
       else if (this.enableManager && "tabmixdata" in window) {
          let path = window.tabmixdata.path;
@@ -420,7 +421,8 @@ var TabmixSessionManager = {
          this.copyClosedTabsToRDF(this.gThisWin);
       }
       // initialize closed window list broadcaster
-      var disabled = this.enableManager ? Tabmix.firstWindowInSession || this.isClosedWindowsEmpty() : TabmixSvc.ss.getClosedWindowCount() == 0;
+      var disabled = this.enableManager ? Tabmix.firstWindowInSession || this.isClosedWindowsEmpty() :
+                                          TabmixSvc.ss.getClosedWindowCount() === 0;
       Tabmix.setItem("tmp_closedwindows", "disabled", disabled || null);
 
       this.saveStateDelayed();
@@ -487,7 +489,8 @@ var TabmixSessionManager = {
 
       // we call Tabmix.Sanitizer.tryToSanitize from onWindowClose
       // we don't need to show warnBeforeSaveSession dialog if we sanitize TMP without prompet on exit
-      if (Services.prefs.getBoolPref("privacy.sanitize.sanitizeOnShutdown") && Tabmix.Sanitizer.isSanitizeTMPwithoutPrompet(true))
+      if (Services.prefs.getBoolPref("privacy.sanitize.sanitizeOnShutdown") &&
+          Tabmix.Sanitizer.isSanitizeTMPwithoutPrompet(true))
          return resultData;
 
       if ( this.enableManager ) {
@@ -534,9 +537,9 @@ var TabmixSessionManager = {
       var chkBoxState = this.saveClosedTabs ? Tabmix.CHECKBOX_CHECKED : Tabmix.HIDE_CHECKBOX;
 
       var stringBundle = Services.strings.createBundle("chrome://global/locale/commonDialogs.properties");
-      var buttons = TabmixSvc.setLabel("sm.askBeforSave.button0")
-                     + "\n" + stringBundle.GetStringFromName("Cancel")
-                     + "\n" + TabmixSvc.setLabel("sm.askBeforSave.button1");
+      var buttons = TabmixSvc.setLabel("sm.askBeforSave.button0") + "\n" +
+                    stringBundle.GetStringFromName("Cancel") + "\n" +
+                    TabmixSvc.setLabel("sm.askBeforSave.button1");
       return Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.HIDE_MENUANDTEXT, chkBoxState],
                               [title, msg, "", chkBoxLabel, buttons]);
    },
@@ -641,8 +644,9 @@ var TabmixSessionManager = {
 
    onWindowClose: function SM_onWindowClose(isLastWindow) {
     // check if we need to sanitize on exit without prompt to user
+    var tabmixSanitized;
     try {
-      var tabmixSanitized = isLastWindow &&
+      tabmixSanitized = isLastWindow &&
           Services.prefs.getBoolPref("privacy.sanitize.sanitizeOnShutdown") &&
           Tabmix.Sanitizer.tryToSanitize(true);
     }
@@ -699,7 +703,6 @@ var TabmixSessionManager = {
       var enableClosedtabs = Tabmix.prefs.getBoolPref("sessions.save.closedtabs");
       var enableSaveHistory = Tabmix.prefs.getBoolPref("sessions.save.history");
       var undoClose = Tabmix.prefs.getBoolPref("undoClose");
-      var maxTabsUndo = Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo");
 
        // hide or show session manager buttons & menus
       var showInMenu = !sessionManager || !Tabmix.prefs.getBoolPref("sessionToolsMenu");
@@ -786,7 +789,7 @@ var TabmixSessionManager = {
         let URIs = homePage.split("|");
         this.setStripVisibility(URIs.length);
         let browser = gBrowser.selectedBrowser;
-        if (homePage != "") {
+        if (homePage !== "") {
           // This function throws for certain malformed URIs, so use exception handling
           // so that we don't disrupt startup
           try {
@@ -822,8 +825,8 @@ var TabmixSessionManager = {
          this.DATASource = this.RDFService.GetDataSourceBlocking(uri);
       } catch (e) { // corrupted session.rdf
          var title = TabmixSvc.getSMString("sm.corrupted.title");
-         var msg = TabmixSvc.getSMString("sm.corrupted.msg0") + "\n"
-                  + TabmixSvc.getSMString("sm.corrupted.msg1");
+         var msg = TabmixSvc.getSMString("sm.corrupted.msg0") + "\n" +
+                   TabmixSvc.getSMString("sm.corrupted.msg1");
          var buttons = ["", TabmixSvc.setLabel("sm.button.continue")].join("\n");
          this.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, Tabmix.HIDE_CHECKBOX],
                [title, msg, "", "", buttons], window, function(){});
@@ -838,7 +841,7 @@ var TabmixSessionManager = {
       var sessionType = ["thisSession", "lastSession", "previoustolastSession", "crashedsession"];
       var closedSession = this.initContainer(path);
       var i, aEntry;
-      if (closedSession.GetCount()==0) { // create the list
+      if (closedSession.GetCount() === 0) { // create the list
          for (i = 0; i < sessionType.length; i++) {
             aEntry = this.RDFService.GetResource(path + sessionType[i]);
             this.setResource(aEntry, "session", this._rdfRoot + "/closed" + i + "/window");
@@ -879,7 +882,7 @@ var TabmixSessionManager = {
       if (arc in this.NC_TM)
          return this.NC_TM[arc];
       const NC_NS = "http://home.netscape.com/NC-rdf#";
-      return this.NC_TM[arc] = this.RDFService.GetResource(NC_NS + arc);
+      return (this.NC_TM[arc] = this.RDFService.GetResource(NC_NS + arc));
    },
 
    deleteNode: function(rdfNode) {
@@ -903,20 +906,18 @@ var TabmixSessionManager = {
    },
 
    initContainer: function(node) {
-     var pNode = node;
      try {
        if (typeof(node) == "string")
          node = this.RDFService.GetResource(node);
        return this.CONUtils.MakeSeq(this.DATASource, node);
      } catch (e) {
        Tabmix.assert(e);
-       return "error"
+       return "error";
      }
    },
 
     // return true if node is empty container or node is not container
    containerEmpty: function(node) {
-     var pNode = node;
      try {
        if (typeof(node) == "string")
          node = this.RDFService.GetResource(node);
@@ -925,7 +926,7 @@ var TabmixSessionManager = {
        return this.CONUtils.IsEmpty(this.DATASource, node);
      } catch (e) {
        Tabmix.assert(e);
-       return "error"
+       return "error";
      }
    },
 
@@ -938,7 +939,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          Container: container,
          Enum: container.GetElements(),
          Count: container.GetCount()
-      }
+      };
    },
 
    getValue: function(node, label, typeID, def) {
@@ -970,11 +971,11 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
        try {
          // we defined lazy gette for _decode to import from Decode.jsm module
          decodedString = this._decode.unescape(encodedString);
-       } catch (ex) {
-         let msg = "Tabmix is unable to decode " + key; + " from ";
+       } catch (er) {
+         let msg = "Tabmix is unable to decode " + key;
          if (node)
             msg += " from " + node.QueryInterface(Ci.nsIRDFResource).Value;
-         Components.utils.reportError(msg + "\n" + ex);
+         Components.utils.reportError(msg + "\n" + er);
          return "";
        }
        if (node && key) {
@@ -1100,6 +1101,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                 this.removeAttribute(this.gThisWin, "tabview-visibility");
               this.saveStateDelayed();
             }
+            /* falls through */
          case "browser-lastwindow-close-requested":
             this.savedPrefs["browser.startup.page"] = Services.prefs.getIntPref("browser.startup.page");
             this.savedPrefs["browser.tabs.warnOnClose"] = Services.prefs.getBoolPref("browser.tabs.warnOnClose");
@@ -1114,6 +1116,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
             // session restored update buttons state
             TMP_ClosedTabs.setButtonDisableState();
             gBrowser.ensureTabIsVisible(gBrowser.selectedTab, true);
+            /* falls through */
          case "browser-window-change-state":
             this.toggleRecentlyClosedWindowsButton();
             break;
@@ -1214,6 +1217,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
             this.forgetClosedWindow(aIndex);
             break;
          case "window":
+            /* falls through */
          default:
             undoCloseWindow(aIndex);
             this.notifyClosedWindowsChanged();
@@ -1266,7 +1270,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
    toggleRecentlyClosedWindowsButton: function SM_toggleRecentlyClosedWindowsButton() {
      if (this.enableManager || this.enableBackup)
        return;
-     Tabmix.setItem("tmp_closedwindows", "disabled", TabmixSvc.ss.getClosedWindowCount() == 0 || null);
+     Tabmix.setItem("tmp_closedwindows", "disabled", TabmixSvc.ss.getClosedWindowCount() === 0 || null);
    },
 
    saveState: function SM_saveState() {
@@ -1301,22 +1305,22 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          case "addWinToSession":
             title = TabmixSvc.getSMString("sm.addtoStartup.title");
             var msgType = caller=="addWinToSession" ? "windows" : "tabs";
-            msg = TabmixSvc.getSMString("sm.addtoStartup.msg." + msgType) + "\n" + label
-               +  "\n" + areYouSure + "\n\n" + chooseStartup;
+            msg = TabmixSvc.getSMString("sm.addtoStartup.msg." + msgType) + "\n" +
+                  label + "\n" + areYouSure + "\n\n" + chooseStartup;
             buttons = [TabmixSvc.setLabel("sm.addtoStartup.button0"),
                        TabmixSvc.setLabel("sm.addtoStartup.button1")].join("\n");
             break;
          case "replaceSession":
             title = TabmixSvc.getSMString("sm.replaceStartup.title");
-            msg = TabmixSvc.getSMString("sm.replaceStartup.msg") + "\n" + label
-               +  "\n" + areYouSure + "\n\n" + chooseStartup;
+            msg = TabmixSvc.getSMString("sm.replaceStartup.msg") + "\n" +
+                  label + "\n" + areYouSure + "\n\n" + chooseStartup;
             buttons = [TabmixSvc.setLabel("sm.replaceStartup.button0"),
                        TabmixSvc.setLabel("sm.replaceStartup.button1")].join("\n");
             break;
          case "removeSavedSession":
             title = TabmixSvc.getSMString("sm.removeStartup.title");
-            msg = TabmixSvc.getSMString("sm.removeStartup.msg0") + "\n" + label
-               +  "\n" + areYouSure + "\n\n" + TabmixSvc.getSMString("sm.removeStartup.msg1");
+            msg = TabmixSvc.getSMString("sm.removeStartup.msg0") + "\n" +
+                  label + "\n" + areYouSure + "\n\n" + TabmixSvc.getSMString("sm.removeStartup.msg1");
             buttons = [TabmixSvc.setLabel("sm.removeStartup.button0"),
                        TabmixSvc.setLabel("sm.removeStartup.button1")].join("\n");
             selectionFlag = Tabmix.SELECT_LASTSESSION;
@@ -1351,7 +1355,8 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
       var pathToReplace = "";
       var session = this.getSessionName("saveprevious", this.getDecodedLiteralValue(oldPath, "name"));
       if (session.button == Tabmix.BUTTON_CANCEL) return; // user cancel
-      else if (session.button == Tabmix.BUTTON_EXTRA1) { // we replace exist session, Tabmix.BUTTON_OK - save new session
+      else if (session.button == Tabmix.BUTTON_EXTRA1) {
+         // we replace exist session, Tabmix.BUTTON_OK - save new session
          var result = this.promptReplaceStartup("replaceSession", session.path);
          if (result.button == Tabmix.BUTTON_CANCEL) return; // user cancel
          else if (result.button == Tabmix.BUTTON_OK) { // we replace startup session
@@ -1359,8 +1364,8 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          }
          pathToReplace = session.path;
       }
-      container = this.initContainer(path)
-      var pathNode, container, extID = "";
+      container = this.initContainer(path);
+      var container, extID = "";
       var node = aTriggerNode.parentNode.parentNode;
       if (node.id.startsWith("tm-sm-closedwindows") || node.id == "btn_closedwindows")
          extID = "/" + id;
@@ -1439,7 +1444,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          name = this.getLiteralValue(oldPath, "name");
          saveClosedTabs = this.saveClosedtabs;
       }
-      if (oldPath != "") { // oldPath is "" if we save to a new name
+      if (oldPath !== "") { // oldPath is "" if we save to a new name
          // check if the user want to replace startup session
          var result = this.promptReplaceStartup("replaceSession", oldPath);
          if (result.button == Tabmix.BUTTON_CANCEL) return; // user cancel
@@ -1456,7 +1461,8 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          var title = TabmixSvc.getSMString("sm.title");
          var msg = TabmixSvc.getSMString("sm.dontSaveBlank.msg");
          var buttons = ["", TabmixSvc.setLabel("sm.button.continue")].join("\n");
-         Tabmix.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT, Tabmix.HIDE_CHECKBOX],[title, msg, "", "", buttons]);
+         Tabmix.promptService([Tabmix.BUTTON_CANCEL, Tabmix.HIDE_MENUANDTEXT,
+                               Tabmix.HIDE_CHECKBOX], [title, msg, "", "", buttons]);
          return false;
       }
       return true;
@@ -1493,10 +1499,10 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
    insertSession: function SM_insertSession(count, name, path, oldPath) {
       var container = this.initContainer(this._rdfRoot + "/windows");
       var index = 0;
-      if (oldPath != "") index = container.IndexOf(this.RDFService.GetResource(oldPath));
+      if (oldPath !== "") index = container.IndexOf(this.RDFService.GetResource(oldPath));
       var node = this.RDFService.GetResource(path);
       container.InsertElementAt(node, index+1, true);
-      if (oldPath != "") { // remove the session we replace
+      if (oldPath !== "") { // remove the session we replace
          container.RemoveElementAt(index, true);
          this.removeSession(oldPath, this._rdfRoot+'/windows');
       }
@@ -1529,13 +1535,15 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          actionFlag = Tabmix.DLG_SAVE;
       }
       label = label + "\n" + sessionList.list.join("\n");
-      var result = Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_TEXTBOX, showChebox, actionFlag],[title, msg, label, closedtabMsg, buttons]);
+      var result = Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_TEXTBOX, showChebox, actionFlag],
+                                        [title, msg, label, closedtabMsg, buttons]);
       switch (result.button) {
          case Tabmix.BUTTON_CANCEL: return {button: result.button};
          case Tabmix.BUTTON_OK:
          case Tabmix.BUTTON_EXTRA1 :
             var trimResult = result.label.replace(/^[\s]+/g,"").replace(/[\s]+$/g,"");
-            return {button: result.button, name: encodeURI(trimResult), path: sessionList.path[result.value], saveClosedTabs: result.checked};
+            return {button: result.button, name: encodeURI(trimResult),
+                    path: sessionList.path[result.value], saveClosedTabs: result.checked};
       }
       return {};
    },
@@ -1560,12 +1568,15 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
 
    getNameData: function(numWindows, numTabs) {
       var d = new Date();
-      var date = [d.getFullYear(), '/', d.getMonth()<9 ? "0":"", d.getMonth()+1, '/', d.getDate()<10 ? "0":"", d.getDate()].join('');
-      var time = [d.getHours()<10 ? "0":"", d.getHours(), ':', d.getMinutes()<10 ? "0":"", d.getMinutes(), ':', d.getSeconds()<10 ? "0":"", d.getSeconds()].join('');
+      var date = [d.getFullYear(), '/', d.getMonth()<9 ? "0":"",
+                  d.getMonth()+1, '/', d.getDate()<10 ? "0":"", d.getDate()].join('');
+      var time = [d.getHours()<10 ? "0":"", d.getHours(), ':',
+                  d.getMinutes()<10 ? "0":"", d.getMinutes(), ':',
+                  d.getSeconds()<10 ? "0":"", d.getSeconds()].join('');
       var empty = TabmixSvc.getSMString("sm.session.empty");
       var T = TabmixSvc.getSMString("sm.session.tabs");
       var W = TabmixSvc.getSMString("sm.session.windows");
-      if (numWindows == 0) return ", (" + empty + ") (" + date + " " + time + ")";
+      if (numWindows === 0) return ", (" + empty + ") (" + date + " " + time + ")";
       else if (numWindows < 2) return ", (" + numTabs + " "+ T + ") (" + date + " " + time + ")";
       return ", (" + numWindows + " " + W + ", " + numTabs + " " + T + ") (" + date + " " + time + ")";
    },
@@ -1610,11 +1621,11 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
       var obsThis = document.getElementById("tmp_contextmenu_ThisWindow");
       var mSave = document.getElementById("tm-sm-Save");
       if (node.id.startsWith("tm-sm-closedwindows") || node.id == "btn_closedwindows" || mValue <= -1) {
-         if (obsAll.hidden != true)
+         if (obsAll.hidden !== true)
             obsAll.hidden = true;
-         if (obsThis.hidden != true)
+         if (obsThis.hidden !== true)
             obsThis.hidden = true;
-         if (mSave.hidden != false)
+         if (mSave.hidden !== false)
             mSave.hidden = false;
          if (!this.isPrivateWindow) {
            if (triggerNode.hasAttribute("disabled"))
@@ -1626,9 +1637,9 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          let isOneWindow = Tabmix.isSingleBrowserWindow;
          if (obsAll.hidden != isOneWindow)
             obsAll.hidden = isOneWindow;
-         if (obsThis.hidden != false)
+         if (obsThis.hidden !== false)
             obsThis.hidden = false;
-         if (mSave.hidden != true)
+         if (mSave.hidden !== true)
             mSave.hidden = true;
       }
       return true;
@@ -1696,9 +1707,13 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          // and let the user cancel the delete or choose diffrent startup session
          var result = this.promptReplaceStartup("removeSavedSession", path);
          switch (result.button) {
-            case Tabmix.BUTTON_CANCEL: return;
-            case Tabmix.BUTTON_OK: this.replaceStartupPref(result, "");
-            case Tabmix.NO_NEED_TO_REPLACE : this.removeSession(path, this._rdfRoot+'/windows');
+            case Tabmix.BUTTON_CANCEL:
+              return;
+            case Tabmix.BUTTON_OK:
+              this.replaceStartupPref(result, "");
+              /* falls through */
+            case Tabmix.NO_NEED_TO_REPLACE:
+              this.removeSession(path, this._rdfRoot+'/windows');
          }
       } else if (node.id.startsWith("tm-sm-closedwindows") || node.id == "btn_closedwindows") {
          this.removeSession(path, this.gSessionPath[0]);
@@ -1907,7 +1922,8 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          // Ubuntu global menu prevents Session manager menu from working from Tools menu
          // this hack is only for left click, middle click and right click still not working
          if (TabmixSvc.isLinux && parentId == "tm-sessionmanager")
-            mi.setAttribute("oncommand", "TabmixSessionManager.restoreSession(event.originalTarget); event.stopPropagation();");
+            mi.setAttribute("oncommand", "TabmixSessionManager.restoreSession(event.originalTarget);" +
+                                         " event.stopPropagation();");
          mi.value = i;
          if (parentID != "onStart.loadsession") {
             index = closedWinList ? count - 1 - i : i;
@@ -1926,6 +1942,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
             var observer = document.getElementById("tmp_menu_AllWindows");
             var isOneWindow = Tabmix.isSingleBrowserWindow;
             if (observer.hidden != isOneWindow) observer.hidden = isOneWindow;
+            /* falls through */
          case "tm_prompt":
             endSeparator.hidden = endSeparator.previousSibling.localName == "menuseparator";
             var sessionLabel;
@@ -1953,7 +1970,8 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                if (showTooltip) menu.setAttribute("tooltiptext", sLabel + nameExt);
                menu.setAttribute("value", (-1 - i));
                if (TabmixSvc.isLinux && parentId == "tm-sessionmanager")
-                  menu.setAttribute("oncommand", "TabmixSessionManager.restoreSession(event.originalTarget); event.stopPropagation();");
+                  menu.setAttribute("oncommand", "TabmixSessionManager.restoreSession(event.originalTarget);" +
+                                                 " event.stopPropagation();");
                popup.appendChild (menu);
             }
             if (afterCrash && contents != 1) { // add separator before Crashed menu item
@@ -1975,10 +1993,10 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
       }
       var rename = popup.getElementsByAttribute("anonid", "rename")[0];
       if (rename)
-         Tabmix.setItem(rename, "disabled", count == 0 ? true : null);
+         Tabmix.setItem(rename, "disabled", count === 0 ? true : null);
       var deleteItem = popup.getElementsByAttribute("anonid", "delete")[0];
       if (deleteItem)
-         Tabmix.setItem(deleteItem, "disabled", allEmpty && count == 0 ? true : null);
+         Tabmix.setItem(deleteItem, "disabled", allEmpty && count === 0 ? true : null);
    },
 
    // set defaultIndex, sessionIndex and default Attribute
@@ -2050,7 +2068,9 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
                   }
                   this.deleteSubtree(subTree); // delete the crashed subtree
                   nodeToDelete.push(rdfNodeWindow);// remove the window from the crash session
-               } else this.setLiteral(rdfNodeWindow, "dontLoad", "true"); // we can see this session in the close window list
+               } else
+                 // we can see this session in the close window list
+                 this.setLiteral(rdfNodeWindow, "dontLoad", "true");
             }
             this.deleteArrayNodes(sessionContainer, nodeToDelete, false);
          } // if firefox was crashed in middle of crash Recovery try again to restore the same data
@@ -2074,14 +2094,14 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          var buttons;
          var chkBoxState = !this.enableManager ? Tabmix.CHECKBOX_UNCHECKED : Tabmix.HIDE_CHECKBOX;
          var closedWinList = this.initContainer(this.gSessionPath[0]).GetCount();
-         var lastSession = this.containerEmpty(this.gSessionPath[1]) // last session
-         var prevtoLast = this.containerEmpty(this.gSessionPath[2]) // previous to last
-         var savedSession = this.containerEmpty(this._rdfRoot+'/windows') // saved session
+         var lastSession = this.containerEmpty(this.gSessionPath[1]); // last session
+         var prevtoLast = this.containerEmpty(this.gSessionPath[2]); // previous to last
+         var savedSession = this.containerEmpty(this._rdfRoot+'/windows'); // saved session
          var isAllEmpty = lastSession && prevtoLast && savedSession;
          var callBack = function(aResult) {
             this.afterCrashPromptCallBack(aResult);
          }.bind(this);
-         this.callBackData = {label: null, whattoLoad: "session"}
+         this.callBackData = {label: null, whattoLoad: "session"};
          this.waitForCallBack = true;
          if (!this.containerEmpty(this.gSessionPath[3])) { // if Crashed Session is not empty
             let crashedContainer = this.initContainer(this.gSessionPath[3]);
@@ -2107,20 +2127,20 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
             }
          } else {
             if (this.enableManager && !isAllEmpty) {
-               msg += " " + TabmixSvc.getSMString("sm.afterCrash.msg5") + "\n\n"
-                          + TabmixSvc.getSMString("sm.afterCrash.msg1");
+               msg += " " + TabmixSvc.getSMString("sm.afterCrash.msg5") + "\n\n" +
+                            TabmixSvc.getSMString("sm.afterCrash.msg1");
                buttons = [TabmixSvc.setLabel("sm.afterCrash.button0"),
                           TabmixSvc.setLabel("sm.afterCrash.button1")].join("\n");
                this.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, Tabmix.HIDE_CHECKBOX, Tabmix.SELECT_DEFAULT],
                      [title, msg, "", "", buttons], window, callBack);
-            } else if (closedWinList != 0) {
+            } else if (closedWinList !== 0) {
                msg += " " + TabmixSvc.getSMString("sm.afterCrash.msg6");
                if (!this.enableManager)
-                  msg += "\n" + TabmixSvc.getSMString("sm.afterCrash.msg3") + "\n\n"
-                              + TabmixSvc.getSMString("sm.afterCrash.msg7") + ":";
+                  msg += "\n" + TabmixSvc.getSMString("sm.afterCrash.msg3") + "\n\n" +
+                                TabmixSvc.getSMString("sm.afterCrash.msg7") + ":";
                else
-                  msg += "\n\n" + TabmixSvc.getSMString("sm.afterCrash.msg7") + " "
-                                + TabmixSvc.getSMString("sm.afterCrash.msg8") + ":";
+                  msg += "\n\n" + TabmixSvc.getSMString("sm.afterCrash.msg7") + " " +
+                                  TabmixSvc.getSMString("sm.afterCrash.msg8") + ":";
                buttons = [TabmixSvc.setLabel("sm.afterCrash.button0"),
                           TabmixSvc.setLabel("sm.afterCrash.button1")].join("\n");
                this.promptService([Tabmix.BUTTON_OK, Tabmix.SHOW_MENULIST, chkBoxState, Tabmix.SHOW_CLOSED_WINDOW_LIST],
@@ -2183,12 +2203,12 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
          sessions.push(this.getResource(path + sessionType[i], "session"));
       }
       for (i = 0; i < sessionType.length-1; i++) {
-         if (i == 0) { // delete oldest session subtree
+         if (i === 0) { // delete oldest session subtree
             aSession = sessions[sessionType.length-2];
             subTree = aSession.QueryInterface(Ci.nsIRDFResource).Value;
             this.deleteSubtree(subTree);
          } else aSession = sessions[i-1];
-         this.setResource(path + sessionType[i], "session", aSession)
+         this.setResource(path + sessionType[i], "session", aSession);
       }
       for (i = 0; i < sessionType.length; i++) {
          this.gSessionPath[i] = this.getResourceValue(path + sessionType[i], "session");
@@ -2237,8 +2257,8 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
       var askifempty = restoreFlag > 1 ? false : this.prefBranch.getBoolPref("onStart.askifempty");
       if (sessionList == null) {
          if (((askifempty && afterCrash) || restoreFlag == 1) && !this.corruptedFile) {
-            msg = TabmixSvc.getSMString("sm.start.msg0") + "\n"
-                + TabmixSvc.getSMString("sm.afterCrash.msg10");
+            msg = TabmixSvc.getSMString("sm.start.msg0") + "\n" +
+                  TabmixSvc.getSMString("sm.afterCrash.msg10");
             if (afterCrash)
                msg += "\n\n" + TabmixSvc.getSMString("sm.start.msg1");
             buttons = ["", TabmixSvc.setLabel("sm.button.continue")].join("\n");
@@ -2281,6 +2301,7 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
             loadSession = -1;
             this.prefBranch.setIntPref("onStart.loadsession", -1);
             savePref = true;
+            /* falls through */
          case -2:
          case -1:
             var indx = -1 * loadSession;
@@ -2295,8 +2316,8 @@ if (container == "error") { Tabmix.log("wrapContainer error path " + path + "\n"
       if (restoreFlag > 0 || afterCrash || (startupEmpty && askifempty) || !loadSessionIsValid) {
 try{
          if (afterCrash)
-            msg += TabmixSvc.getSMString("sm.afterCrash.msg0") + " "
-                 + TabmixSvc.getSMString("sm.start.msg1");
+            msg += TabmixSvc.getSMString("sm.afterCrash.msg0") + " " +
+                   TabmixSvc.getSMString("sm.start.msg1");
          if (startupEmpty) msg += TabmixSvc.getSMString("sm.start.msg0");
          if (!loadSessionIsValid) msg += TabmixSvc.getSMString("sm.start.msg2");
          msg += "\n\n" + TabmixSvc.getSMString("sm.afterCrash.msg1");
@@ -2359,7 +2380,7 @@ try{
       return;
 
     let state = this.setLastSession();
-    let [iniState, remainingState] = this.SessionStore._prepDataForDeferredRestore(state);
+    let iniState = this.SessionStore._prepDataForDeferredRestore(state)[0];
     let pinnedExist = iniState.windows.length > 0;
     if (pinnedExist) {
       // move all tabs and closed tabs into one window
@@ -2443,7 +2464,7 @@ try{
          let empty = ", (" + TabmixSvc.getSMString("sm.session.empty") + ")";
          let empty1 = this.containerEmpty(this.gSessionPath[1]);
          let empty2 = this.containerEmpty(this.gSessionPath[2]);
-         if (empty1 && empty2 && sessionPath.length == 0)
+         if (empty1 && empty2 && sessionPath.length === 0)
             return null;
         if (flag != "onlyPath") {
            let msg = flag == "afterCrash" ? "sm.sessionMenu.lastgood" : "sm.sessionMenu.last";
@@ -2523,7 +2544,7 @@ try{
       let self = this;
       function updateTabviewData(id) {
         let data = TabmixSessionData.getWindowValue(window, id);
-        if (data != "" && data != "{}")
+        if (data !== "" && data != "{}")
           self.setLiteral(aWin, id, data);
         else
           self.removeAttribute(aWin, id);
@@ -2850,7 +2871,7 @@ try{
             this.isTabPrivate(aTab))
          return;
       let data = TabmixSessionData.getTabValue(aTab, "tabview-tab");
-      if (data != "" && data != "{}")
+      if (data !== "" && data != "{}")
         this.setLiteral(aNode, "tabview-tab", data);
       else
         this.removeAttribute(aNode, "tabview-tab");
@@ -2958,7 +2979,9 @@ try{
          concatenate = true;
 
       // if this window is blank use it when reload session
-      if (!Tabmix.singleWindowMode && concatenate && !overwriteWindows && !gBrowser.isBlankWindow() && caller != "firstwindowopen" && caller != "concatenatewindows") {
+      if (!Tabmix.singleWindowMode && concatenate && !overwriteWindows &&
+          !gBrowser.isBlankWindow() && caller != "firstwindowopen" &&
+          caller != "concatenatewindows") {
          this.openNewWindow(path, "concatenatewindows", this.isPrivateWindow);
          return;
       }
@@ -2980,8 +3003,9 @@ try{
       }
 
       // if we join all window to one window
-      // call the same window for all saved window with overwritewindows=false and overwritetabs=false if this not the first saved
-      // for first saved window overwritetabs determined by user pref
+      // call the same window for all saved window with overwritewindows=false
+      // and overwritetabs=false if this not the first saved for first saved
+      // window overwritetabs determined by user pref
       while (sessionEnum.hasMoreElements()) {
          sessionCount++;
          var rdfNodeSession = sessionEnum.getNext();
@@ -2989,9 +3013,10 @@ try{
             var windowPath = rdfNodeSession.QueryInterface(Ci.nsIRDFResource).Value;
             if (this.nodeHasArc(windowPath, "dontLoad")) continue;
             if (concatenate) {
-               if (caller != "concatenatewindows" && caller != "firstwindowopen" && sessionCount == 1
-                         && saveBeforOverwrite && overwriteTabs)
-                  this.saveOneWindow(this.gSessionPath[0], "", true);
+               if (caller != "concatenatewindows" && caller != "firstwindowopen" &&
+                   sessionCount == 1 && saveBeforOverwrite && overwriteTabs) {
+                 this.saveOneWindow(this.gSessionPath[0], "", true);
+               }
                var newCaller = (sessionCount != 1) ? caller+"-concatenate" : caller;
                this.loadOneWindow(windowPath, newCaller);
             } else {
@@ -3030,7 +3055,8 @@ try{
       // don't reopen same window again. the window removed from closed window list after it finish to load
       if (this.nodeHasArc(rdfNodeClosedWindow, "reOpened")) return;
       this.setLiteral(rdfNodeClosedWindow, "reOpened", "true");
-      if (typeof(overwriteWindows) == "undefined") overwriteWindows = this.prefBranch.getBoolPref("restore.overwritewindows");
+      if (typeof(overwriteWindows) == "undefined")
+         overwriteWindows = this.prefBranch.getBoolPref("restore.overwritewindows");
       var saveBeforOverwrite = this.prefBranch.getBoolPref("restore.saveoverwrite");
       var overwriteTabs = this.prefBranch.getBoolPref("restore.overwritetabs");
       if (overwriteWindows || gBrowser.isBlankWindow() || Tabmix.singleWindowMode) {
@@ -3082,13 +3108,15 @@ try{
          pages that are not the home page append the new tab to the end.
          simple solution is to set browser.startup.page = 0 , when we activate session manager, in this case if we
          have any tabs in the first window we don't overwrite.
-      2. when open window by session manager other than the first window (caller = "windowopenedbytabmix" and tabmix in the name) overwrite=true
+      2. when open window by session manager other than the first window
+         (caller = "windowopenedbytabmix" and tabmix in the name) overwrite=true
       3. when loadOneWindow call by openclosedwindow or loadSession we reuse window check user pref for overwrite.
       4. if we open all closed windows to one window append tab to the end and select the selected tab from first window
          in the session.
       */
       var cTab = gBrowser.mCurrentTab;
-      var concatenate = caller.indexOf("-concatenate") != -1 || (caller == "firstwindowopen" && gBrowser.tabs.length > 1);
+      var concatenate = caller.indexOf("-concatenate") != -1 ||
+                        (caller == "firstwindowopen" && gBrowser.tabs.length > 1);
       var rdfNodeWindow = this.RDFService.GetResource(path);
       var rdfNodeTabs = this.getResource(rdfNodeWindow, "tabs");
       if (!(rdfNodeTabs instanceof Ci.nsIRDFResource) || this.containerEmpty(rdfNodeTabs)) {
@@ -3102,7 +3130,7 @@ try{
       var lastSelectedIndex = restoreSelect ? this.getIntValue(rdfNodeWindow, "selectedIndex") : 0;
       if (lastSelectedIndex < 0 || lastSelectedIndex >= newtabsCount) lastSelectedIndex = 0;
 
-      let pending = Services.prefs.getBoolPref("browser.sessionstore.restore_on_demand")
+      let pending = Services.prefs.getBoolPref("browser.sessionstore.restore_on_demand");
       function TMP_addTab() {
         let newTab = gBrowser.addTab("about:blank", {skipAnimation: true, dontMove: true, isPending: pending});
         // flag. dont save tab that are in restore phase
@@ -3128,7 +3156,7 @@ try{
            this.resetTab(gBrowser.tabs[i]);
          }
          while (newtabsCount > gBrowser.tabs.length) {
-            let newTab = TMP_addTab();
+            TMP_addTab();
          }
          cTab.setAttribute("inrestore", "true");
          // move selected tab to place
@@ -3216,8 +3244,12 @@ try{
                gBrowser.moveTabTo(newTab, gBrowser.tabs.length - 1);
          }
 
-         if (tabsCount == blankTabsCount) newPos = 0;
-         else newPos = (openTabNext && cTab._tPos < gBrowser.tabs.length - 1 && !concatenate) ? cTab._tPos + 1 : tabsCount - blankTabsCount;
+         if (tabsCount == blankTabsCount)
+            newPos = 0;
+         else {
+            newPos = (openTabNext && cTab._tPos < gBrowser.tabs.length - 1 && !concatenate) ?
+                      cTab._tPos + 1 : tabsCount - blankTabsCount;
+         }
          if (!concatenate && restoreSelect) { // in concatenate mode we select tab only from first window
             if (currentTabIsBalnk) { // if the current tab is not blank select new tab
                if (openTabNext && newPos > 0)
@@ -3226,7 +3258,8 @@ try{
                gBrowser.moveTabTo(cTab, newPos + lastSelectedIndex);
             }
             else
-              this.updateSelected(newPos + lastSelectedIndex, caller=="firstwindowopen" || caller=="windowopenedbytabmix");
+              this.updateSelected(newPos + lastSelectedIndex, caller=="firstwindowopen" ||
+                                  caller=="windowopenedbytabmix");
          }
          newIndex = newPos;
       }
@@ -3243,7 +3276,7 @@ try{
       let activeGroupId = null, groups = this._tabviewData["tabview-groups"];
       if (groups && typeof groups.activeGroupId != "undefined")
         activeGroupId = groups.activeGroupId;
-      let tabs = [], numVisibleTabs = 0, firstVisibleTab = -1
+      let tabs = [], numVisibleTabs = 0, firstVisibleTab = -1;
       let needToReload = this.prefBranch.getBoolPref("restore.reloadall");
       for (let t = 0; t < tabsData.length ; t++) {
         let data = tabsData[t];
@@ -3338,7 +3371,7 @@ try{
       aTab.removeAttribute("inrestore");
 
       // check if we restore all tabs
-      if (typeof this.tabsToLoad == "number" && --this.tabsToLoad == 0) {
+      if (typeof this.tabsToLoad == "number" && --this.tabsToLoad === 0) {
          delete this.tabsToLoad;
          TabmixTabbar.updateBeforeAndAfter(); // just in case (we do it also in setTabTitle
          if (this.enableBackup){
@@ -3413,8 +3446,8 @@ try{
 
    setStripVisibility: function(tabCount) {
       // unhide the tab bar
-      if (tabCount > 1 && Tabmix.prefs.getIntPref("hideTabbar") != 2
-            && !gBrowser.tabContainer.visible) {
+      if (tabCount > 1 && Tabmix.prefs.getIntPref("hideTabbar") != 2 &&
+            !gBrowser.tabContainer.visible) {
         gBrowser.tabContainer.visible = true;
       }
    },
@@ -3438,11 +3471,14 @@ try{
          var rdfNodeSession = fromOld.Enum.getNext();
          if (!(rdfNodeSession instanceof Ci.nsIRDFResource)) continue;
          newIndex++;
-         if (isClosedTabs && (fromOld.Count - newIndex > Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo"))) continue;
+         if (isClosedTabs &&
+            (fromOld.Count - newIndex > Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo"))) {
+           continue;
+         }
          var uniqueId = "panel" + Date.now() + newIndex;
          var rdfLabelSession = rdfLabelTabs + "/" + uniqueId;
          var newNode = this.RDFService.GetResource(rdfLabelSession);
-         var data = {}
+         var data = {};
          data.pos = this.getIntValue(rdfNodeSession, "tabPos");
          data.image = this.getLiteralValue(rdfNodeSession, "image");
          data.properties = this.getLiteralValue(rdfNodeSession, "properties");
@@ -3486,8 +3522,8 @@ try{
       var ctabs = TMP_ClosedTabs.getClosedTabData;
       var tabCount = ctabs.length;
       var maxTabsUndo = Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo");
-      var tabData, uniqueId, rdfLabelSession, newNode, historyEntry, scrollPos, history;
       for (var i = tabCount - 1; i >= 0; i--) {
+         let tabData, uniqueId, rdfLabelSession, newNode;
          uniqueId = "panel" + Date.now() + i;
          rdfLabelSession = rdfLabelTabs + "/" + uniqueId;
          newNode = this.RDFService.GetResource(rdfLabelSession);
@@ -3509,8 +3545,8 @@ try{
       var activeIndex = (tabState.index || count) - 1;
       var historyStart = this.enableSaveHistory ? 0 : activeIndex;
       var historyEnd = this.enableSaveHistory ? count : activeIndex + 1;
-      var j, historyEntry, history = [];
-      for (j = historyStart; j < historyEnd; j++) {
+      var historyEntry, history = [];
+      for (let j = historyStart; j < historyEnd; j++) {
          try {
             historyEntry = tabState.entries[j];
             history.push(historyEntry.title || "");
@@ -3526,15 +3562,14 @@ try{
       }
       // insert the separator to history so we can extract it in loadTabHistory
       aTabData.history = separator + "|-|" + encodeURI(history.join(separator));
-      aTabData.index = this.enableSaveHistory ? activeIndex : 0,
-
+      aTabData.index = this.enableSaveHistory ? activeIndex : 0;
       aTabData.scroll = this.prefBranch.getBoolPref("save.scrollposition") ?
                          (tabState.entries[activeIndex].scroll || "0,0") : "0,0";
       // closed tab can not be protected - set protected to 0
       var _locked = TMP_SessionStore._getAttribute(tabState, "_locked") != "false" ? "1" : "0";
       aTabData.properties = "0" + _locked;
       if ("disallow" in tabState && tabState.disallow) {
-         for (var j = 0; j < TabmixSessionData.docShellItems.length; j++ )
+         for (let j = 0; j < TabmixSessionData.docShellItems.length; j++ )
             aTabData.properties += tabState.disallow.indexOf(TabmixSessionData.docShellItems[j]) == -1 ? "1" : "0";
       }
       else {
@@ -3583,7 +3618,7 @@ try{
       if (index < 1 || index > container.GetCount())
          return;
       var nodeToDelete = container.RemoveElementAt(index, true);
-      var nodeValue = nodeToDelete.QueryInterface(Ci.nsIRDFResource).Value
+      var nodeValue = nodeToDelete.QueryInterface(Ci.nsIRDFResource).Value;
       this.deleteSubtree(nodeValue);
       if (!container.GetCount()) this.deleteNode(rdfNodeTabs);
       this.saveStateDelayed();
@@ -3645,7 +3680,7 @@ try{
         backups.push(entry.leafName);
     }
 
-    if (backups.length ==  0)
+    if (backups.length ===  0)
       return null;
 
     backups.sort();
@@ -3676,8 +3711,9 @@ try{
     // Use YYYY-MM-DD (ISO 8601) as it doesn't contain illegal characters
     // and makes the alphabetical order of multiple backup files more useful.
     var d = new Date();
-    var date = [d.getFullYear(), '-', d.getMonth()<9 ? "0":"", d.getMonth()+1, '-', d.getDate()<10 ? "0":"", d.getDate()].join('');
-    var backupFilename = "tabmix_sessions-" + date + ".rdf"
+    var date = [d.getFullYear(), '-', d.getMonth()<9 ? "0":"", d.getMonth()+1, '-',
+                d.getDate()<10 ? "0":"", d.getDate()].join('');
+    var backupFilename = "tabmix_sessions-" + date + ".rdf";
     var backupFile = null;
     if (!aForceArchive) {
       var backupFileNames = [];
@@ -3714,7 +3750,7 @@ try{
 
       // do nothing if we either have today's backup already
       // or the user has set the pref to zero.
-      if (backupFile || aNumberOfBackups == 0)
+      if (backupFile || aNumberOfBackups === 0)
         return;
     }
 
@@ -3736,7 +3772,7 @@ try{
 
   get tabViewInstalled() {
     delete this.tabViewInstalled;
-    return this.tabViewInstalled = typeof TabView == "object";
+    return (this.tabViewInstalled = typeof TabView == "object");
   },
 
   _sendWindowStateEvent: function SM__sendWindowStateEvent(aType) {
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index ee9d2ee..fd7e952 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -6,7 +6,7 @@
  * original code by onemen
  *
  */
-var TMP_SessionStore = {
+var TMP_SessionStore = { // jshint ignore:line
    // make sure sessionstore is init
    _ssInited: null,
    initService: function TMP_ss_start() {
@@ -28,7 +28,7 @@ var TMP_SessionStore = {
      if (aUndoItem.renamed)
        return;
      let selectedTab = aUndoItem.selected && aUndoItem.tabs[aUndoItem.selected - 1];
-     if (!selectedTab || !selectedTab.entries || selectedTab.entries.length == 0)
+     if (!selectedTab || !selectedTab.entries || selectedTab.entries.length === 0)
        return;
      let tabData = this.getActiveEntryData(selectedTab);
      let url = selectedTab.attributes["label-uri"];
@@ -119,7 +119,7 @@ var TMP_SessionStore = {
       * we use nsISessionStore service in TMP.
       * if we use TMP session manager we set all other sessionstore pref to false to disable SessionRestore
       *
-      * Bug 449596 � remove the browser.sessionstore.enabled pref
+      * Bug 449596 - remove the browser.sessionstore.enabled pref
       * so here we don't set it to true, we just clear user pref to the default
       * if the pref exist in firefox this set the pref to true
       * if the pref don't exist this will remove the pref
@@ -182,25 +182,27 @@ var TMP_SessionStore = {
          let buttons = [bundle.GetStringFromName("Yes"), bundle.GetStringFromName("No")].join("\n");
          let self = this;
          let callBack = function (aResult) {
-            if ((msgNo == 1 && aResult.button == 1) || ((msgNo == 2 && aResult.button == 0))) {
+            if ((msgNo == 1 && aResult.button == 1) || ((msgNo == 2 && aResult.button === 0))) {
               self.setSessionRestore(false);
               Services.prefs.setBoolPref(TMP_SS_MANAGER, TMP_manager_enabled);
               Services.prefs.setBoolPref(TMP_SS_CRASHRECOVERY, TMP_crashRecovery_enabled);
             }
             else {
               // we don't change any of sessionstore default setting
-              // the user will be ask on exit what to do. (browser.warnOnRestart and browser.warnOnQuit are both true on default)
+              // the user will be ask on exit what to do.
+              // (browser.warnOnRestart and browser.warnOnQuit are both true on default)
               Services.prefs.setBoolPref(TMP_SS_MANAGER, false);
               Services.prefs.setBoolPref(TMP_SS_CRASHRECOVERY, false);
            }
            TabmixSvc.sm.settingPreference = false;
-         }
+         };
          let result = Tabmix.promptService([Tabmix.BUTTON_OK, Tabmix.HIDE_MENUANDTEXT, Tabmix.HIDE_CHECKBOX],
                [title, msg, "", "", buttons], window, start ? callBack : null);
          if (!start)
            callBack(result);
       }
-      // when user start new profile or update from firefox 2.0 profile browser.warnOnRestart and browser.warnOnQuit are both true on default
+      // when user start new profile or update from firefox 2.0 profile
+      // browser.warnOnRestart and browser.warnOnQuit are both true on default
       else if (!Services.prefs.prefHasUserValue("browser.warnOnRestart") ||
                 !Services.prefs.prefHasUserValue("browser.warnOnQuit ")) {
          if (!Tabmix.isVersion(200))
@@ -254,7 +256,7 @@ var TMP_SessionStore = {
             // until sessionstartup initialized just return the pref value,
             // we only use isWindowAfterSessionRestore when our Session Manager enable
             return Services.prefs.getBoolPref("browser.sessionstore.resume_session_once");
-         })
+         });
       }
    },
 
@@ -312,9 +314,9 @@ var TMP_SessionStore = {
       return  "";
    }
 
-}
+};
 
-var TMP_ClosedTabs = {
+var TMP_ClosedTabs = { // jshint ignore:line
    _buttonBroadcaster: null,
    get buttonBroadcaster() {
       if (!this._buttonBroadcaster)
@@ -331,7 +333,7 @@ var TMP_ClosedTabs = {
 
    setButtonDisableState: function ct_setButtonDisableState(aState) {
       if (typeof(aState) == "undefined")
-         aState = this.count == 0;
+         aState = this.count === 0;
       Tabmix.setItem(this.buttonBroadcaster, "disabled", aState || null);
    },
 
@@ -367,15 +369,15 @@ var TMP_ClosedTabs = {
 
       // populate menu
       var closedTabs = this.getClosedTabData;
-      var ltr = Tabmix.ltr;
+      var m, ltr = Tabmix.ltr;
       for (let i = 0; i < closedTabs.length; i++) {
-         var m = document.createElement("menuitem");
+         m = document.createElement("menuitem");
          var tabData = closedTabs[i];
          // Grab the title and uri (make the uri friendly text)
          var url = this.getUrl(tabData);
          var title = this.getTitle(tabData, url);
          var _uri = makeURI(url);
-         if ( _uri.scheme == "about" && title == "" )
+         if ( _uri.scheme == "about" && title === "" )
             url = title = "about:blank";
          else try {
             url = _uri.scheme + ":\/\/" + _uri.hostPort + _uri.path;
@@ -405,7 +407,7 @@ var TMP_ClosedTabs = {
          m.setAttribute("value", i);
          m.setAttribute("oncommand", "TMP_ClosedTabs.restoreTab('original', " + i + ");");
          m.addEventListener("click", TMP_ClosedTabs.checkForMiddleClick, false);
-         if (i == 0)
+         if (i === 0)
             m.setAttribute("key", "key_undoCloseTab");
          aPopup.appendChild(m);
       }
@@ -479,6 +481,7 @@ var TMP_ClosedTabs = {
                break;
             }
             // else do the default
+            /* falls through */
          default:
             this.SSS_undoCloseTab(aIndex, aWhere, true);
       }
@@ -518,7 +521,7 @@ var TMP_ClosedTabs = {
    SSS_restoreToNewWindow: function ct_restoreToNewWindow(aIndex) {
       var tabData = this.getClosedTabAtIndex(aIndex);
       // we pass the current tab as a place holder for tabData
-      var state = tabData = TabmixSvc.JSON.stringify(tabData ? tabData.state : {});
+      var state = TabmixSvc.JSON.stringify(tabData ? tabData.state : {});
       return gBrowser.duplicateTabToWindow(gBrowser.mCurrentTab, null, state);
    },
 
@@ -528,7 +531,6 @@ var TMP_ClosedTabs = {
 
       this.setButtonDisableState(true);
 
-      var aTab, blankTab;
       // catch blank tabs
       var blankTabs = [];
       for (let i = 0; i < gBrowser.tabs.length ; i++) {
@@ -538,13 +540,13 @@ var TMP_ClosedTabs = {
 
       var tab, multiple = closedTabCount > 1;
       for (let i = 0; i < closedTabCount; i++) {
-         blankTab = blankTabs.pop() || null;
-         tab = this.SSS_undoCloseTab(0, "original", i==0, blankTab, multiple);
+         let blankTab = blankTabs.pop() || null;
+         tab = this.SSS_undoCloseTab(0, "original", i === 0, blankTab, multiple);
       }
 
       // remove unused blank tabs
       while(blankTabs.length > 0){
-         blankTab = blankTabs.pop();
+         let blankTab = blankTabs.pop();
          blankTab.collapsed = true;
          gBrowser.removeTab(blankTab);
       }
@@ -553,7 +555,7 @@ var TMP_ClosedTabs = {
    },
 
    SSS_undoCloseTab: function ct_SSS_undoCloseTab(aIndex, aWhere, aSelectRestoredTab, aTabToRemove, skipAnimation) {
-      if (!Tabmix.prefs.getBoolPref("undoClose") || this.count == 0)
+      if (!Tabmix.prefs.getBoolPref("undoClose") || this.count === 0)
          return null;
 
       // get tab data
@@ -622,9 +624,9 @@ var TMP_ClosedTabs = {
       return tab;
    }
 
-}
+};
 
-var TabmixConvertSession = {
+var TabmixConvertSession = { // jshint ignore:line
    get getTitle() {
       return TabmixSvc.getString("incompatible.title") + " - " + TabmixSvc.getSMString("sm.title");
    },
@@ -655,7 +657,7 @@ var TabmixConvertSession = {
                       TabmixConvertSession.convertFile(a, b);
                     }, 0, null, true);
                   }
-                 }
+                 };
       this.confirm(this.getString("msg1") + "\n\n" + this.getString("msg2"), callBack);
    },
 
@@ -680,8 +682,8 @@ var TabmixConvertSession = {
 
    convertFile: function cs_convertFile(aFileUri, aSilent) {
       if (TabmixSvc.sessionManagerAddonInstalled) {
-         let tmp = {}
-         Cu.import("chrome://sessionmanager/content/modules/session_convert.jsm", tmp)
+         let tmp = {};
+         Cu.import("chrome://sessionmanager/content/modules/session_convert.jsm", tmp);
          tmp.SessionConverter.convertTMP(aFileUri, aSilent);
       }
       else {
@@ -761,7 +763,7 @@ var TabmixConvertSession = {
         this.node = rdfTab;
         this.index = TabmixSessionManager.getIntValue(rdfTab, "tabPos");
       }
-      _tabData.prototype.toString = function() { return this.index; }
+      _tabData.prototype.toString = function() { return this.index; };
 
       var tabsEnum = TabmixSessionManager.initContainer(rdfNodeTabs).GetElements();
       while (tabsEnum.hasMoreElements()) {
@@ -857,6 +859,7 @@ var TabmixConvertSession = {
             case "faviconized":
               if (isTrue)
                 extData.faviconized = true;
+              break;
             case "pinned":
             case "hidden":
               if (isTrue)
@@ -877,7 +880,7 @@ var TabmixConvertSession = {
       // save panorama data if exist
       if (!aClosedTab) {
         let data = TabmixSessionManager.getLiteralValue(rdfNodeTab, "tabview-tab");
-        if (data != "")
+        if (data !== "")
           extData["tabview-tab"] = data;
       }
       if (Object.keys(extData).length)
@@ -888,7 +891,7 @@ var TabmixConvertSession = {
    getHistoryState: function cs_getHistoryState(rdfNodeTab) {
       let decodeData = function(data, decode) {
         return decode ? TabmixSessionManager.getDecodedLiteralValue(null, data) : data;
-      }
+      };
       var history = TabmixSessionManager.getLiteralValue(rdfNodeTab, "history");
       var tmpData = history.split("|-|");
       var sep = tmpData.shift(); // remove seperator from data
@@ -911,4 +914,4 @@ var TabmixConvertSession = {
       }
       return entries;
    }
-}
+};
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index ed39258..5c97443 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -22,7 +22,7 @@ var TabmixTabbar = {
     // we have to set orient attribute for Linux theme,
     // maybe other themes need it for display the scroll arrow
     Tabmix.setItem(tabmixScrollBox, "orient", val == "multibar" ? "vertical" : "horizontal");
-    return val
+    return val;
   },
 
   get flowing() {
@@ -125,7 +125,8 @@ var TabmixTabbar = {
     if (Tabmix.prefs.getIntPref("tabs.closeButtons") == 5 && this.widthFitTitle)
       Tabmix.prefs.setIntPref("tabs.closeButtons", 1);
 
-    // fix bug in positioning the popup off screen or on the button when window is not maximize or when tab bar is in the bottom
+    // fix bug in positioning the popup off screen or on the button when window
+    // is not maximize or when tab bar is in the bottom
     Tabmix.setItem("alltabs-popup", "position",
            (window.windowState != window.STATE_MAXIMIZED || this.position == 1) ? "start_before" : "after_end");
 
@@ -371,7 +372,7 @@ var TabmixTabbar = {
     let tabBar = gBrowser.tabContainer;
     let multibar = tabBar.hasAttribute("multibar");
     let selected = tabBar.selectedItem;
-    let tabRow, top;
+    let tabRow, topY;
 
     let numPinnedTabs = gBrowser._numPinnedTabs;
     let isSpecial = TabmixSvc.australis &&
@@ -389,12 +390,12 @@ var TabmixTabbar = {
         if (/^before/.test(attrib))
           return tab._tPos == numPinnedTabs - 1 ? "before" : false;
         return tab._tPos == numPinnedTabs ? "after" : false;
-      }
+      };
       let getAttVal = function(val, hoverAttr) {
         if (!specialTab || hoverAttr && visible && /selected/.test(attrib))
           return val;
         return val ? "special" : val;
-      }
+      };
 
       let removed = "tabmix-removed-" + attrib;
       let oldTab = tabBar._tabmixPositionalTabs[type];
@@ -406,18 +407,18 @@ var TabmixTabbar = {
       let specialTab = isSpecialTab();
       if (tab && (TabmixSvc.australis && attrib == "beforeselected" ||
           multibar || tab.hasAttribute(removed) || specialTab)) {
-        let sameRow = multibar ? tabRow == tabBar.getTabRowNumber(tab, top) || null : true;
+        let sameRow = multibar ? tabRow == tabBar.getTabRowNumber(tab, topY) || null : true;
         Tabmix.setItem(tab, removed, !sameRow || null);
         Tabmix.setItem(tab, attrib, getAttVal(sameRow, true));
         if (visible)
           Tabmix.setItem(tab, prefix + attrib + "-visible", getAttVal(sameRow));
       }
-    }
+    };
 
     if (tabBar._hoveredTab && !tabBar._hoveredTab.closing) {
       if (multibar) {
-        top = tabBar.topTabY;
-        tabRow = tabBar.getTabRowNumber(tabBar._hoveredTab, top);
+        topY = tabBar.topTabY;
+        tabRow = tabBar.getTabRowNumber(tabBar._hoveredTab, topY);
       }
       updateAtt(tabBar._beforeHoveredTab, "beforeHoveredTab", "beforehovered");
       updateAtt(tabBar._afterHoveredTab, "afterHoveredTab", "afterhovered");
@@ -441,8 +442,8 @@ var TabmixTabbar = {
     }
 
     if (multibar) {
-      top = top || tabBar.topTabY;
-      tabRow = tabBar.getTabRowNumber(selected, top);
+      topY = topY || tabBar.topTabY;
+      tabRow = tabBar.getTabRowNumber(selected, topY);
     }
     updateAtt(prev, "beforeSelectedTab", "beforeselected", TabmixSvc.australis, "tabmix-");
     updateAtt(next, "afterSelectedTab", "afterselected", Tabmix.isVersion(220), "");
@@ -457,7 +458,7 @@ var TabmixTabbar = {
 
     var firstTab = tabs[0];
     var lastTab = tabBar.visibleTabsLastChild;
-    var top = tabBar.topTabY;
+    var topY = tabBar.topTabY;
     var lastTabRow = tabBar.lastTabRowNumber;
     if (lastTabRow == 1) { // one row
       if (firstTab.getAttribute("selected") == "true")
@@ -471,7 +472,7 @@ var TabmixTabbar = {
         // check if previous to last tab in the 1st row
         // this happen when the selected tab is the first tab in the 2nd row
         var prev = TMP_TabView.previousVisibleSibling(lastTab);
-        if (prev && tabBar.getTabRowNumber(prev, top) == 1)
+        if (prev && tabBar.getTabRowNumber(prev, topY) == 1)
           return lastTab.boxObject.height;
         else
           newRowHeight = prev.baseY - firstTab.baseY;
@@ -480,7 +481,7 @@ var TabmixTabbar = {
         // check if 2nd visible tab is in the 2nd row
         // (not likely that user set tab width to more then half screen width)
         var next = TMP_TabView.nextVisibleSibling(firstTab);
-        if (next && tabBar.getTabRowNumber(next, top) == 2)
+        if (next && tabBar.getTabRowNumber(next, topY) == 2)
           return lastTab.boxObject.height;
         else
           newRowHeight = lastTab.baseY - next.baseY;
@@ -520,8 +521,8 @@ var TabmixTabbar = {
       return false;
 
     var tabBar = gBrowser.tabContainer;
-    var top = tabBar.topTabY;
-    return tabBar.getTabRowNumber(tab1, top) == tabBar.getTabRowNumber(tab2, top);
+    var topY = tabBar.topTabY;
+    return tabBar.getTabRowNumber(tab1, topY) == tabBar.getTabRowNumber(tab2, topY);
   },
 
   setFirstTabInRow: function() {
@@ -552,7 +553,7 @@ var TabmixTabbar = {
     return count;
   }
 
-} // TabmixTabbar end
+}; // TabmixTabbar end
 
 // Function to catch changes to Tab Mix preferences and update existing windows and tabs
 //
@@ -560,7 +561,7 @@ var gTMPprefObserver = {
   preventUpdate: false,
   init: function() {
     Tabmix.prefs.clearUserPref("setDefault");
-    Tabmix.prefs.clearUserPref("PrefObserver.error")
+    Tabmix.prefs.clearUserPref("PrefObserver.error");
 
     let addObserver = function(pref, condition) {
       if (condition)
@@ -625,6 +626,7 @@ var gTMPprefObserver = {
         break;
       case "extensions.tabmix.tabbar.click_dragwindow":
         document.getElementById("TabsToolbar")._dragBindingAlive = Services.prefs.getBoolPref(prefName);
+        /* falls through */
       case "extensions.tabmix.tabbar.dblclick_changesize":
         let dragwindow = Tabmix.prefs.getBoolPref("tabbar.click_dragwindow");
         let changesize = Tabmix.prefs.getBoolPref("tabbar.dblclick_changesize");
@@ -636,11 +638,12 @@ var gTMPprefObserver = {
         break;
       case "extensions.tabmix.lockallTabs":
         TabmixTabbar.lockallTabs = Services.prefs.getBoolPref(prefName);
+        /* falls through */
       case "extensions.tabmix.lockAppTabs":
         if (!Tabmix.prefs.getBoolPref("updateOpenedTabsLockState"))
           break;
         let updatePinned = prefName == "extensions.tabmix.lockAppTabs";
-        let lockAppTabs = Tabmix.prefs.getBoolPref("lockAppTabs")
+        let lockAppTabs = Tabmix.prefs.getBoolPref("lockAppTabs");
         for (let i = 0; i < gBrowser.tabs.length; i++) {
           let tab = gBrowser.tabs[i];
           if (tab.pinned != updatePinned)
@@ -756,7 +759,7 @@ var gTMPprefObserver = {
           case 1: // Display close buttons on all tabs (Default)
             Tabmix.prefs.setIntPref("tabs.closeButtons", 1);
             break;
-          case 2: // Don�t display any close buttons
+          case 2: // Don’t display any close buttons
             break;
           case 3: // Display a single close button at the end of the tab strip
             break;
@@ -785,7 +788,7 @@ var gTMPprefObserver = {
         if (Tabmix.extensions.ctr) {
           let otherPref = prefName == "extensions.tabmix.tabs.closeButtons.onLeft" ?
                                       "extensions.classicthemerestorer.closeonleft" :
-                                      "extensions.tabmix.tabs.closeButtons.onLeft"
+                                      "extensions.tabmix.tabs.closeButtons.onLeft";
           value = Services.prefs.getBoolPref(prefName);
           if (Services.prefs.getBoolPref(otherPref) != value)
             Services.prefs.setBoolPref(otherPref, Services.prefs.getBoolPref(prefName));
@@ -796,7 +799,7 @@ var gTMPprefObserver = {
         gBrowser.tabContainer.setAttribute("closebuttons-side", onLeft ? "left" : "right");
         break;
       case "extensions.tabmix.tabs.closeButtons.enable":
-        prefValue = Services.prefs.getBoolPref(prefName)
+        prefValue = Services.prefs.getBoolPref(prefName);
         gBrowser.tabContainer.closeButtonsEnabled = prefValue;
         gBrowser.tabContainer.mTabstrip.offsetRatio = prefValue ? 0.70 : 0.50;
         gBrowser.tabContainer.adjustTabstrip();
@@ -815,7 +818,7 @@ var gTMPprefObserver = {
         if (!Tabmix.prefs.getBoolPref("undoClose")) {
           Services.prefs.setIntPref("browser.sessionstore.max_tabs_undo", 0);
         }
-        else if (Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo") == 0)
+        else if (Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo") === 0)
           Services.prefs.clearUserPref("browser.sessionstore.max_tabs_undo");
         break;
       case "browser.sessionstore.max_tabs_undo":
@@ -848,6 +851,7 @@ var gTMPprefObserver = {
       case "extensions.tabmix.sessions.manager":
       case "extensions.tabmix.sessions.crashRecovery":
         TMP_SessionStore.setService(2, false);
+        /* falls through */
       case "extensions.tabmix.sessions.save.closedtabs":
       case "extensions.tabmix.sessions.save.history":
       case "extensions.tabmix.sessionToolsMenu":
@@ -897,7 +901,7 @@ var gTMPprefObserver = {
           }
           // maxRow changed
           if (TabmixTabbar.isMultiRow) {
-            let currentVisible = tabBar.mTabstrip.isElementVisible(gBrowser.mCurrentTab);
+            let isVisible = tabBar.mTabstrip.isElementVisible(gBrowser.mCurrentTab);
             // we hide the button to see if tabs can fits to fewer rows without the scroll buttons
             if (tabBar.overflow && row > TabmixTabbar.visibleRows)
               tabBar.overflow = false;
@@ -905,7 +909,7 @@ var gTMPprefObserver = {
             if (tabBar.updateVerticalTabStrip() == "scrollbar") {
               tabBar.overflow = true;
               tabBar.mTabstrip._updateScrollButtonsDisabledState();
-              if (currentVisible)
+              if (isVisible)
                 gBrowser.ensureTabIsVisible(gBrowser.selectedTab, false);
             }
           }
@@ -1006,13 +1010,18 @@ var gTMPprefObserver = {
     let iconRule = selector + '.tab-protect-icon,' +
                            selector + '.tab-reload-icon,' +
                            selector + '.tab-lock-icon {' +
-                           '-moz-margin-start: %S; -moz-margin-end: %S;}'.replace("%S", marginStart).replace("%S", marginEnd);
+                           '-moz-margin-start: %S; -moz-margin-end: %S;}'
+                           .replace("%S", marginStart).replace("%S", marginEnd);
     this.insertRule(iconRule);
 
     /** at the moment we move the button over the title - see setCloseButtonMargin
     // move left button that show on hover closer to the tab icon
-    iconRule = '.tabbrowser-tabs[closebuttons-hover="notactivetab"][closebuttons-side="left"] > .tabbrowser-tab:not([pinned]):not([faviconized="true"]):not([selected="true"]):not([isPermaTab="true"]):not([protected])[showbutton=on] .tab-icon,' +
-               '.tabbrowser-tabs[closebuttons-hover="alltabs"][closebuttons-side="left"] > .tabbrowser-tab:not([pinned]):not([faviconized="true"]):not([isPermaTab="true"]):not([protected])[showbutton=on] .tab-icon {' +
+    iconRule = '.tabbrowser-tabs[closebuttons-hover="notactivetab"][closebuttons-side="left"] > ' +
+               '.tabbrowser-tab:not([pinned]):not([faviconized="true"]):not([selected="true"])' +
+               ':not([isPermaTab="true"]):not([protected])[showbutton=on] .tab-icon,' +
+               '.tabbrowser-tabs[closebuttons-hover="alltabs"][closebuttons-side="left"] > ' +
+               '.tabbrowser-tab:not([pinned]):not([faviconized="true"]):not([isPermaTab="true"])' +
+               ':not([protected])[showbutton=on] .tab-icon {' +
                '-moz-margin-end: %Spx;}'.replace("%S", - parseInt(marginEnd)/2);
     this.insertRule(iconRule);
     */
@@ -1024,7 +1033,8 @@ var gTMPprefObserver = {
     let _iconRule = _selector + '.tab-protect-icon,' +
                          _selector + '.tab-reload-icon,' +
                          _selector + '.tab-lock-icon {' +
-                         '-moz-margin-start: %S; -moz-margin-end: %S;}'.replace("%S", _marginStart).replace("%S", _marginEnd);
+                         '-moz-margin-start: %S; -moz-margin-end: %S;}'
+                         .replace("%S", _marginStart).replace("%S", _marginEnd);
     this.insertRule(_iconRule);
     if (!pinned)
       icon.removeAttribute("pinned");
@@ -1042,13 +1052,16 @@ var gTMPprefObserver = {
       newRule = aRule.replace(/%S/g, "tab-lock-icon").replace("%PX", marginEnd);
       this.insertRule(newRule);
     }.bind(this);
-    iconRule = '.tabbrowser-tabs%favhideclose%[closebuttons-side="left"][closebuttons="alltabs"] > .tabbrowser-tab:not([pinned]):not([protected])%faviconized% .%S ,' +
-                      '.tabbrowser-tabs%favhideclose%[closebuttons-side="left"][closebuttons="activetab"] > .tabbrowser-tab:not([pinned]):not([protected])[selected="true"]%faviconized% .%S {'+
-                      '-moz-margin-start: %PX !important;}'
+    iconRule = '.tabbrowser-tabs%favhideclose%[closebuttons-side="left"][closebuttons="alltabs"] > ' +
+               '.tabbrowser-tab:not([pinned]):not([protected])%faviconized% .%S ,' +
+               '.tabbrowser-tabs%favhideclose%[closebuttons-side="left"][closebuttons="activetab"] > ' +
+               '.tabbrowser-tab:not([pinned]):not([protected])[selected="true"]%faviconized% .%S {' +
+               '-moz-margin-start: %PX !important;}';
     if ("faviconize" in window) {
       let newRule = iconRule.replace(/%favhideclose%/g, ':not([favhideclose="true"])').replace(/%faviconized%/g, '');
       tabmix_setRule(newRule);
-      newRule = iconRule.replace(/%favhideclose%/g, '[favhideclose="true"]').replace(/%faviconized%/g, ':not([faviconized="true"])');
+      newRule = iconRule.replace(/%favhideclose%/g, '[favhideclose="true"]')
+                .replace(/%faviconized%/g, ':not([faviconized="true"])');
       tabmix_setRule(newRule);
     }
     else {
@@ -1065,8 +1078,12 @@ var gTMPprefObserver = {
 
     // move left button that show on hover over tab title
     icon.style.setProperty("display", "-moz-box", "important");
-    let iconMargin = '.tabbrowser-tabs[closebuttons-hover="notactivetab"][closebuttons-side="left"] > .tabbrowser-tab:not([pinned]):not([faviconized="true"]):not([selected="true"]):not([isPermaTab="true"]):not([protected]) .tab-close-button,' +
-                     '.tabbrowser-tabs[closebuttons-hover="alltabs"][closebuttons-side="left"] > .tabbrowser-tab:not([pinned]):not([faviconized="true"]):not([isPermaTab="true"]):not([protected]) .tab-close-button {' +
+    let iconMargin = '.tabbrowser-tabs[closebuttons-hover="notactivetab"][closebuttons-side="left"] > ' +
+                     '.tabbrowser-tab:not([pinned]):not([faviconized="true"]):not([selected="true"])' +
+                     ':not([isPermaTab="true"]):not([protected]) .tab-close-button,' +
+                     '.tabbrowser-tabs[closebuttons-hover="alltabs"][closebuttons-side="left"] > ' +
+                     '.tabbrowser-tab:not([pinned]):not([faviconized="true"]):not([isPermaTab="true"])' +
+                     ':not([protected]) .tab-close-button {' +
                      '-moz-margin-start: 0px !important;' +
                      '-moz-margin-end: %Spx !important;}'.replace("%S", - icon.getBoundingClientRect().width);
     icon.style.removeProperty("display");
@@ -1078,21 +1095,31 @@ var gTMPprefObserver = {
     let marginEnd = style.getPropertyValue(sMarginEnd);
     let textMarginEnd = parseInt(marginEnd) ? marginEnd : this._marginStart;
     delete this._marginStart;
-             let iconRule = '.tabbrowser-tabs%favhideclose%[closebuttons="noclose"] > .tabbrowser-tab%faviconized%:not([pinned]) .tab-label[tabmix="true"],' +
-                            '.tabbrowser-tabs%favhideclose%[closebuttons-side="left"] > .tabbrowser-tab%faviconized%:not([pinned]) .tab-label[tabmix="true"],' +
-                            '.tabbrowser-tabs%favhideclose%[closebuttons="activetab"]:not([closebuttons-hover="notactivetab"])[closebuttons-side="right"] > .tabbrowser-tab%faviconized%:not([pinned]):not([selected="true"]) .tab-label[tabmix="true"],' +
+             let iconRule = '.tabbrowser-tabs%favhideclose%[closebuttons="noclose"] > ' +
+                            '.tabbrowser-tab%faviconized%:not([pinned]) .tab-label[tabmix="true"],' +
+                            '.tabbrowser-tabs%favhideclose%[closebuttons-side="left"] > ' +
+                            '.tabbrowser-tab%faviconized%:not([pinned]) .tab-label[tabmix="true"],' +
+                            '.tabbrowser-tabs%favhideclose%[closebuttons="activetab"]' +
+                            ':not([closebuttons-hover="notactivetab"])[closebuttons-side="right"] > ' +
+                            '.tabbrowser-tab%faviconized%:not([pinned]):not([selected="true"]) ' +
+                            '.tab-label[tabmix="true"],' +
                             '.tabbrowser-tab%faviconized1%[protected]:not([pinned]) .tab-label[tabmix="true"] {' +
                             '-moz-margin-end: %PX !important;}'.replace("%PX", textMarginEnd);
     if ("faviconize" in window) {
-      let newRule = iconRule.replace(/%favhideclose%/g, ':not([favhideclose="true"])').replace(/%faviconized%/g, '').replace(/%faviconized1%/g, ':not([faviconized="true"])');
+      let newRule = iconRule.replace(/%favhideclose%/g, ':not([favhideclose="true"])')
+                            .replace(/%faviconized%/g, '')
+                            .replace(/%faviconized1%/g, ':not([faviconized="true"])');
       this.insertRule(newRule);
-      newRule = iconRule.replace(/%favhideclose%/g, '[favhideclose="true"]').replace(/%faviconized%/g, ':not([faviconized="true"])').replace(/%faviconized1%/g, ':not([faviconized="true"])');
+      newRule = iconRule.replace(/%favhideclose%/g, '[favhideclose="true"]')
+                        .replace(/%faviconized%/g, ':not([faviconized="true"])')
+                        .replace(/%faviconized1%/g, ':not([faviconized="true"])');
       this.insertRule(newRule);
       newRule = '.tabbrowser-tab[faviconized="true"][protected]:not([pinned]) {max-width: 36px !important;}';
       this.insertRule(newRule);
     }
     else {
-      let newRule = iconRule.replace(/%favhideclose%/g, '').replace(/%faviconized%/g, '').replace(/%faviconized1%/g, '');
+      let newRule = iconRule.replace(/%favhideclose%/g, '')
+                            .replace(/%faviconized%/g, '').replace(/%faviconized1%/g, '');
       this.insertRule(newRule);
     }
   },
@@ -1101,7 +1128,8 @@ var gTMPprefObserver = {
     // height shrink to actual size when the tabbar is in display: block (multi-row)
     let newRule = '#TabsToolbar[tabmix-show-newtabbutton*="aftertabs"] >' +
                   '#tabbrowser-tabs:not([overflow="true"]) > .tabbrowser-arrowscrollbox[flowing="multibar"]' +
-                  ' > .tabs-newtab-button[command="cmd_newNavigatorTab"] {height: #px;}'.replace("#", Tabmix._buttonsHeight);
+                  ' > .tabs-newtab-button[command="cmd_newNavigatorTab"] {height: #px;}'
+                  .replace("#", Tabmix._buttonsHeight);
     this.insertRule(newRule);
 
     if (TabmixSvc.australis && !Tabmix.isVersion(310) && !TabmixSvc.isLinux && !TabmixSvc.isMac) {
@@ -1128,7 +1156,7 @@ var gTMPprefObserver = {
     // new tab button on tab context menu
     newRule = '.tabmix-newtab-menu-icon {' +
               'list-style-image: url("#URL");' +
-              '-moz-image-region: #REGION;}'
+              '-moz-image-region: #REGION;}';
     let url = "chrome://browser/skin/Toolbar.png", region;
     let skin = Services.prefs.getCharPref("general.skins.selectedSkin");
     if (skin=="classic/1.0") {
@@ -1157,7 +1185,7 @@ var gTMPprefObserver = {
     }
     else {
       let newRule = '.tab-background-middle, .tab-background, .tabs-newtab-button {' +
-                    '-moz-margin-end: %PX; -moz-margin-start: %PX;}'
+                    '-moz-margin-end: %PX; -moz-margin-start: %PX;}';
       this.insertRule(newRule.replace(/%PX/g, margin), "bgMiddleMargin");
     }
   },
@@ -1165,14 +1193,16 @@ var gTMPprefObserver = {
   addDynamicRules: function() {
     // tab width rules
     let tst = Tabmix.extensions.treeStyleTab ? ":not([treestyletab-collapsed='true'])" : "";
-    let newRule = ".tabbrowser-tab[fadein]" + tst + ":not([pinned]) {min-width: #1px !important; max-width: #2px !important;}";
+    let newRule = ".tabbrowser-tab[fadein]" + tst +
+                  ":not([pinned]) {min-width: #1px !important; max-width: #2px !important;}";
     let _max = Services.prefs.getIntPref("browser.tabs.tabMaxWidth");
     let _min = Services.prefs.getIntPref("browser.tabs.tabMinWidth");
     newRule = newRule.replace("#1" ,_min).replace("#2" ,_max);
     this.insertRule(newRule, "width");
 
     // rule for controling moz-margin-start when we have pinned tab in multi-row
-    let marginStart = '#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[tabmix-firstTabInRow="true"]{-moz-margin-start: 0px;}';
+    let marginStart = '#tabbrowser-tabs[positionpinnedtabs] > ' +
+                      '.tabbrowser-tab[tabmix-firstTabInRow="true"]{-moz-margin-start: 0px;}';
     this.insertRule(marginStart, "tabmix-firstTabInRow");
 
     // for ColorfulTabs 8.0+
@@ -1203,7 +1233,7 @@ var gTMPprefObserver = {
       attribValue = [prefValues.bold ? "bold" : "not-bold",
                prefValues.italic ? "italic" : "not-italic",
                prefValues.underline ? "underline" : "not-underline"
-      ]
+      ];
       if (prefValues.text)
         attribValue.push(styleName + "-text");
       if (prefValues.bg)
@@ -1213,7 +1243,7 @@ var gTMPprefObserver = {
 
     let getTabs = function(attrib, val) {
       return Array.slice(document.getElementsByAttribute(attrib, val));
-    }
+    };
 
     let tabs, attrib = Tabmix.tabStyles[styleName] || styleName;
     Tabmix.tabStyles[styleName] = attribValue;
@@ -1236,7 +1266,7 @@ var gTMPprefObserver = {
       tabs = getTabs("tabmix_tabStyle", attrib);
       tabs.forEach(function(tab) {
         Tabmix.setItem(tab, "tabmix_tabStyle", attribValue || styleName);
-      })
+      });
     }
 
     // changing bold attribute can change tab width and effect tabBar scroll status
@@ -1262,7 +1292,7 @@ var gTMPprefObserver = {
     function updateStatus(pref, testVal, test, newVal) {
       try {
         var prefValue = Services.prefs.getIntPref(pref);
-        test = test ? prefValue == testVal : prefValue != testVal
+        test = test ? prefValue == testVal : prefValue != testVal;
       }
       catch(e){ test = true; }
 
@@ -1314,12 +1344,14 @@ var gTMPprefObserver = {
 
   setMenuIcons: function() {
     function setClass(items, hideIcons) {
-      if (hideIcons)
-        for (var i = 0; i < items.length; ++i)
+      if (hideIcons) {
+        for (let i = 0; i < items.length; ++i)
           items[i].removeAttribute("class");
-      else
-        for ( i = 0; i < items.length; ++i)
+      }
+      else {
+        for (let i = 0; i < items.length; ++i)
           items[i].setAttribute("class", items[i].getAttribute("tmp_iconic"));
+      }
     }
     var hideIcons = Tabmix.prefs.getBoolPref("hideIcons");
     var iconicItems = document.getElementsByAttribute("tmp_iconic", "*");
@@ -1335,7 +1367,7 @@ var gTMPprefObserver = {
       gBrowser.tabContainer.updateVisibility();
       return;
     }
-    var autoHide = TabmixTabbar.hideMode != 0;
+    var autoHide = TabmixTabbar.hideMode !== 0;
     if (autoHide != Services.prefs.getBoolPref("browser.tabs.autoHide")) {
       Services.prefs.setBoolPref("browser.tabs.autoHide", autoHide);
       if (TabmixTabbar.hideMode == 1)
@@ -1343,12 +1375,12 @@ var gTMPprefObserver = {
     }
   },
 
-  setTabBarVisibility: function TMP_PO_setTabBarVisibility(onFullScreenExit) {
+  setTabBarVisibility: function TMP_PO_setTabBarVisibility() {
     if (TabmixTabbar.hideMode == 2)
       gBrowser.tabContainer.visible = false;
     else if (!gBrowser.tabContainer.visible) {
       let moreThenOneTab = gBrowser.tabs.length > 1;
-      gBrowser.tabContainer.visible = moreThenOneTab || TabmixTabbar.hideMode == 0;
+      gBrowser.tabContainer.visible = moreThenOneTab || TabmixTabbar.hideMode === 0;
       if (moreThenOneTab) {
         gBrowser.ensureTabIsVisible(gBrowser.selectedTab, false);
         TabmixTabbar.updateBeforeAndAfter();
@@ -1357,7 +1389,7 @@ var gTMPprefObserver = {
   },
 
   changeNewTabButtonSide: function(aPosition) {
-    function $(id) document.getElementById(id);
+    function $(id) document.getElementById(id)
     let newTabButton = $("new-tab-button");
     if (TabmixTabbar.isButtonOnTabsToolBar(newTabButton)) {
       // update our attribute
@@ -1371,17 +1403,17 @@ var gTMPprefObserver = {
         let tabsPosition = Tabmix.getPlacement("tabbrowser-tabs");
         let boxPositoin = Tabmix.getPlacement("tabmixScrollBox");
         let after = boxPositoin == tabsPosition + 1 ? boxPositoin : tabsPosition;
-        let changePosition = (aPosition == 0 && buttonPosition > tabsPosition) ||
+        let changePosition = (aPosition === 0 && buttonPosition > tabsPosition) ||
                              (aPosition == 1 && buttonPosition < after) ||
                              (aPosition == 2 && buttonPosition != after + 1);
         if (changePosition) {
           let tabsToolbar = $("TabsToolbar");
           tabsToolbar.removeAttribute("tabbaronbottom");
-          let newPosition = aPosition == 0 ? tabsPosition : after + 1;
+          let newPosition = aPosition === 0 ? tabsPosition : after + 1;
           let doChange = function() {
             CustomizableUI.moveWidgetWithinArea("new-tab-button", newPosition);
             Tabmix.setItem(tabsToolbar, "tabbaronbottom", TabmixTabbar.position == 1 || null);
-          }
+          };
           if (TabmixTabbar.position == 1)
             setTimeout(function() doChange(), 15);
           else
@@ -1396,11 +1428,11 @@ var gTMPprefObserver = {
       let tabsPosition = toolBar.indexOf(gBrowser.tabContainer);
       let scrollBox = $("tabmixScrollBox");
       let after = scrollBox && toolBar.indexOf(scrollBox) || tabsPosition;
-      let changePosition = (aPosition == 0 && buttonPosition > tabsPosition) ||
+      let changePosition = (aPosition === 0 && buttonPosition > tabsPosition) ||
                            (aPosition == 1 && buttonPosition < after) ||
                            (aPosition == 2 && buttonPosition != after + 1);
       if (changePosition) {
-        let newPosition = aPosition == 0 ? tabsPosition : after + 1;
+        let newPosition = aPosition === 0 ? tabsPosition : after + 1;
         tabsToolbar.insertBefore(newTabButton, tabsToolbar.childNodes.item(newPosition));
         // update currentset
         let cSet = tabsToolbar.getAttribute("currentset") || tabsToolbar.getAttribute("defaultset");
@@ -1439,7 +1471,7 @@ var gTMPprefObserver = {
     let attrValue;
     if (!aShow)
       attrValue = null;
-    else if (aPosition == 0)
+    else if (aPosition === 0)
       attrValue = "left-side";
     else if (aPosition == 1)
       attrValue = "right-side";
@@ -1457,7 +1489,7 @@ var gTMPprefObserver = {
   },
 
   tabBarPositionChanged: function(aPosition) {
-    if (aPosition > 1 || (aPosition != 0 && Tabmix.extensions.verticalTabBar)) {
+    if (aPosition > 1 || (aPosition !== 0 && Tabmix.extensions.verticalTabBar)) {
       Tabmix.prefs.setIntPref("tabBarPosition", 0);
       return false;
     }
@@ -1584,7 +1616,7 @@ var gTMPprefObserver = {
         if (item.localName == "toolbarbutton")
           Tabmix.setItem(item, "context", show ? "autoreload_popup" : null);
       });
-    }
+    };
     setContext("ReloadOrDuplicate");
     setContext("Stop");
   },
@@ -1594,8 +1626,9 @@ var gTMPprefObserver = {
     function getPrefByType(prefName, aDefault, aType) {
       let PrefFn = {0: "", 32: "CharPref", 64: "IntPref", 128: "BoolPref"};
       let fn = PrefFn[Services.prefs.getPrefType(prefName)];
+      let val;
       try {
-        var val = Services.prefs["get" + fn](prefName);
+        val = Services.prefs["get" + fn](prefName);
         // bug in version 0.4.1.0 import old int pref with zero (0)
         // value into string pref
         if (aType == "IntPref" && fn != aType)
@@ -1630,12 +1663,14 @@ var gTMPprefObserver = {
     }
     // 2008-09-23
     if (Services.prefs.prefHasUserValue("browser.ctrlTab.mostRecentlyUsed")) {
-       Services.prefs.setBoolPref("browser.ctrlTab.previews", Services.prefs.getBoolPref("browser.ctrlTab.mostRecentlyUsed"));
+       Services.prefs.setBoolPref("browser.ctrlTab.previews",
+                                  Services.prefs.getBoolPref("browser.ctrlTab.mostRecentlyUsed"));
        Services.prefs.clearUserPref("browser.ctrlTab.mostRecentlyUsed");
     }
     // 2008-09-28
     if (Tabmix.prefs.prefHasUserValue("lasttab.handleCtrlTab")) {
-       Services.prefs.setBoolPref("browser.ctrlTab.previews", Tabmix.prefs.getBoolPref("lasttab.handleCtrlTab"));
+       Services.prefs.setBoolPref("browser.ctrlTab.previews",
+                                  Tabmix.prefs.getBoolPref("lasttab.handleCtrlTab"));
        Tabmix.prefs.clearUserPref("lasttab.handleCtrlTab");
     }
     // 2008-11-29
@@ -1654,8 +1689,10 @@ var gTMPprefObserver = {
        Tabmix.prefs.clearUserPref("newTabButton.leftside");
     }
     // 2009-10-10
-    // swap prefs --> warn when closing window "extensions.tabmix.windows.warnOnClose" replaced with "browser.tabs.warnOnClose"
-    //                warn when closing tabs "browser.tabs.warnOnClose" replaced with "extensions.tabmix.tabs.warnOnClose"
+    // swap prefs --> warn when closing window "extensions.tabmix.windows.warnOnClose"
+    //                replaced with "browser.tabs.warnOnClose"
+    //                warn when closing tabs "browser.tabs.warnOnClose"
+    //                replaced with "extensions.tabmix.tabs.warnOnClose"
     if (Tabmix.prefs.prefHasUserValue("windows.warnOnClose")) {
        Tabmix.prefs.setBoolPref("tabs.warnOnClose", Services.prefs.getBoolPref("browser.tabs.warnOnClose"));
        Services.prefs.setBoolPref("browser.tabs.warnOnClose", Tabmix.prefs.getBoolPref("windows.warnOnClose"));
@@ -1673,7 +1710,8 @@ var gTMPprefObserver = {
       Tabmix.prefs.setIntPref("tabs.closeButtons", val);
     }
     // partly fix a bug from version 0.3.8.3
-    else if (Services.prefs.prefHasUserValue("browser.tabs.closeButtons") && !Tabmix.prefs.prefHasUserValue("version") &&
+    else if (Services.prefs.prefHasUserValue("browser.tabs.closeButtons") &&
+             !Tabmix.prefs.prefHasUserValue("version") &&
              !Tabmix.prefs.prefHasUserValue("tabs.closeButtons")) {
       let value = getPrefByType("browser.tabs.closeButtons", 1, "IntPref");
       // these value are from 0.3.8.3. we don't know if 0,1 are also from 0.3.8.3 so we don't use 0,1.
@@ -1741,9 +1779,9 @@ var gTMPprefObserver = {
         let str = Cc["@mozilla.org/supports-string;1"].createInstance(nsISupportsString);
         str.data = Services.prefs.getComplexValue(oldPref, nsISupportsString).data;
         // only updtae new preference value if the old control preference is New Tab Page
-        let control = controlPref == null || Tabmix.prefs.prefHasUserValue(controlPref) &&
+        let control = controlPref === null || Tabmix.prefs.prefHasUserValue(controlPref) &&
                       Tabmix.prefs.getIntPref(controlPref) == 4;
-        if (str.data != "" && control)
+        if (str.data !== "" && control)
           Services.prefs.setComplexValue(newPref, nsISupportsString, str);
         Services.prefs.clearUserPref(oldPref);
       }
@@ -1859,17 +1897,18 @@ try {
           if (showComment && (_loadOnNewTab || _replaceLastTabWith))
             defaultChanged = "&newtabpage";
           let b = Tabmix.getTopWin().gBrowser;
-          b.selectedTab = b.addTab("http://tmp.garyr.net/version_update2.htm?version=" + currentVersion + defaultChanged);
+          b.selectedTab = b.addTab("http://tmp.garyr.net/version_update2.htm?version=" +
+                                   currentVersion + defaultChanged);
           b.selectedTab.loadOnStartup = true;
         },1000);
         // noting more to do at the moment
       }
-    }
+    };
     AddonManager.getAddonByID("{dc572301-7619-498c-a57d-39143191b318}", function(aAddon) {
       try {
         getVersion(aAddon.version);
       } catch (ex) {Tabmix.assert(ex);}
-    })
+    });
 
     // block item in tabclicking options that are not in use
     var blockedValues = [];
@@ -1887,15 +1926,15 @@ try {
 
     // capture gfx.direct2d.disabled value on first window
     // see getter at TabmixSvc
-    TabmixSvc.direct2dDisabled;
+    var tmp = TabmixSvc.direct2dDisabled; // jshint ignore:line
 
     // verify that all the prefs exist .....
     this.addMissingPrefs();
   },
 
   updateTabClickingOptions: function() {
-    var c = ["dblClickTab", "middleClickTab", "ctrlClickTab", "shiftClickTab", "altClickTab"
-                  ,"dblClickTabbar", "middleClickTabbar", "ctrlClickTabbar", "shiftClickTabbar", "altClickTabbar"];
+    var c = ["dblClickTab", "middleClickTab", "ctrlClickTab", "shiftClickTab", "altClickTab",
+             "dblClickTabbar", "middleClickTabbar", "ctrlClickTabbar", "shiftClickTabbar", "altClickTabbar"];
     for (let i = 0; i < c.length; i++)
       this.blockTabClickingOptions("extensions.tabmix." + c[i]);
   },
@@ -1917,7 +1956,7 @@ try {
       prefs.setBoolPref("extensions.tabmix.tabcontext.openNonRemoteWindow", true);
   }
 
-}
+};
 
 var TabmixProgressListener = {
   startup: function TMP_PL_startup(tabBrowser) {
@@ -1926,9 +1965,9 @@ var TabmixProgressListener = {
       return;
     Tabmix.changeCode(gBrowser, "gBrowser.setTabTitleLoading")._replace(
       'aTab.label = this.mStringBundle.getString("tabs.connecting");',
-      'if (TabmixTabbar.hideMode != 2 && TabmixTabbar.widthFitTitle && !aTab.hasAttribute("width")) \
-         aTab.setAttribute("width", aTab.getBoundingClientRect().width); \
-       $&'
+      'if (TabmixTabbar.hideMode != 2 && TabmixTabbar.widthFitTitle && !aTab.hasAttribute("width"))' +
+      '  aTab.setAttribute("width", aTab.getBoundingClientRect().width);' +
+      '$&'
     ).toCode();
     this.listener.mTabBrowser = tabBrowser;
     if (!Tabmix.isVersion(340))
@@ -1940,9 +1979,9 @@ var TabmixProgressListener = {
     mTabBrowser: null,
     showProgressOnTab: false,
 
-    _fixTabTitle: function TMP__contentLinkClick(tab, browser, url) {
+    _fixTabTitle: function TMP__contentLinkClick(tab, browser) {
       if (browser.getAttribute("remote") != "true" ||
-          browser._contentTitle != "" || this.mTabBrowser.isBlankTab(tab))
+          browser._contentTitle !== "" || this.mTabBrowser.isBlankTab(tab))
         return;
       tab.addEventListener("TabLabelModified", function titleChanged(event) {
         tab.removeEventListener("TabLabelModified", titleChanged, true);
@@ -1976,7 +2015,7 @@ var TabmixProgressListener = {
       if (aStateFlags & nsIWebProgressListener.STATE_START &&
           aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
         let url = aRequest.QueryInterface(Ci.nsIChannel).URI.spec;
-        this._fixTabTitle(tab, aBrowser, url);
+        this._fixTabTitle(tab, aBrowser);
         if (url == "about:blank") {
           tab.removeAttribute("busy");
           tab.removeAttribute("progress");
@@ -2001,7 +2040,7 @@ var TabmixProgressListener = {
         // remove blank tab that created by downloading a file.
         if (Tabmix.prefs.getBoolPref("enablefiletype") &&
             aWebProgress.DOMWindow.document.documentURI == "about:blank" &&
-            uri != "about:blank" && aStatus == 0 &&
+            uri != "about:blank" && aStatus === 0 &&
             this.mTabBrowser.isBlankTab(tab)) {
           if (tab.selected)
             this.mTabBrowser.previousTab(tab);
@@ -2028,7 +2067,7 @@ var TabmixProgressListener = {
         }
         // see gBrowser.openLinkWithHistory in tablib.js
         if (tab.hasAttribute("dontremovevisited"))
-          tab.removeAttribute("dontremovevisited")
+          tab.removeAttribute("dontremovevisited");
 
         if (!tab.hasAttribute("busy")) {
           TabmixSessionManager.tabLoaded(tab);
@@ -2048,4 +2087,4 @@ var TabmixProgressListener = {
       }
     }
   }
-}
+};

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