[Pkg-mozext-commits] [tabmixplus] 84/147: Enable Eslint object-shorthand
David Prévot
taffit at moszumanska.debian.org
Sat Aug 5 15:27:39 UTC 2017
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit c11f1f9fd2aa85e4b762044c991b8baa5d35ee9c
Author: onemen <tabmix.onemen at gmail.com>
Date: Tue Jan 3 20:58:08 2017 +0200
Enable Eslint object-shorthand
---
.eslintrc.js | 2 +-
chrome/content/changecode.js | 10 +-
chrome/content/click/click.js | 14 +-
chrome/content/extensions/extensions.js | 28 ++--
chrome/content/extensions/sage.js | 4 +-
chrome/content/flst/lasttab.js | 34 ++---
chrome/content/links/contentLinks.js | 2 +-
chrome/content/links/setup.js | 2 +-
chrome/content/minit/minit.js | 54 +++----
chrome/content/minit/tabView.js | 6 +-
chrome/content/minit/tablib.js | 14 +-
chrome/content/overlay/removeBlankTab.js | 10 +-
chrome/content/places/places.js | 44 +++---
chrome/content/preferences/appearance.js | 20 +--
chrome/content/preferences/events.js | 22 +--
chrome/content/preferences/links.js | 10 +-
chrome/content/preferences/menu.js | 16 +-
chrome/content/preferences/mouse.js | 16 +-
.../preferences/overlay/overlaySanitizeUI.js | 12 +-
.../preferences/overlay/preferencesOverlay.js | 12 +-
chrome/content/preferences/preferences.js | 42 +++---
chrome/content/preferences/session.js | 16 +-
.../preferences/subdialogs/pref-appearance.js | 10 +-
chrome/content/scripts/content.js | 52 +++----
chrome/content/session/session.js | 168 ++++++++++-----------
chrome/content/session/sessionStore.js | 34 ++---
chrome/content/tab/scrollbox.xml | 4 +-
chrome/content/tab/tab.js | 100 ++++++------
chrome/content/tabmix.js | 16 +-
chrome/content/utils.js | 28 ++--
modules/AboutNewTab.jsm | 12 +-
modules/AsyncUtils.jsm | 6 +-
modules/AutoReload.jsm | 36 ++---
modules/ContentClick.jsm | 66 ++++----
modules/ContextMenu.jsm | 4 +-
modules/Decode.jsm | 4 +-
modules/DocShellCapabilities.jsm | 12 +-
modules/DownloadLastDir.jsm | 6 +-
modules/DynamicRules.jsm | 26 ++--
modules/LinkNodeUtils.jsm | 6 +-
modules/MergeWindows.jsm | 18 +--
modules/NewTabURL.jsm | 8 +-
modules/Places.jsm | 18 +--
modules/RenameTab.jsm | 22 +--
modules/Shortcuts.jsm | 34 ++---
modules/SingleWindowModeUtils.jsm | 8 +-
modules/Slideshow.jsm | 10 +-
modules/TabGroupsMigrator.jsm | 40 ++---
modules/TabRestoreQueue.jsm | 8 +-
modules/TabmixSvc.jsm | 30 ++--
modules/Utils.jsm | 12 +-
modules/extensions/AddonManager.jsm | 38 ++---
modules/extensions/CompatibilityCheck.jsm | 2 +-
modules/extensions/TabGroupsManager.jsm | 4 +-
modules/log.jsm | 20 +--
55 files changed, 626 insertions(+), 626 deletions(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index 746f2f9..ab89a44 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -223,7 +223,7 @@ module.exports = {
}],
"object-curly-spacing": [2, "never"],
"object-property-newline": [2, {"allowMultiplePropertiesPerLine": true}],
- "object-shorthand": 0, // since Firefox 33
+ "object-shorthand": [2, "always", {"avoidQuotes": true}],
"one-var": 0,
"one-var-declaration-per-line": 0,
"operator-assignment": [2, "always"],
diff --git a/chrome/content/changecode.js b/chrome/content/changecode.js
index 76c4c65..b66e58c 100644
--- a/chrome/content/changecode.js
+++ b/chrome/content/changecode.js
@@ -100,7 +100,7 @@ Tabmix.changeCode = function(aParent, afnName, aOptions) {
}
},
- defineProperty: function(aObj, aName, aCode) {
+ defineProperty(aObj, aName, aCode) {
if (!this.type)
throw new Error("Tabmix:\n" + this.fullName + " don't have setter or getter");
@@ -137,7 +137,7 @@ Tabmix.changeCode = function(aParent, afnName, aOptions) {
Object.defineProperty(obj, fnName, descriptor);
},
- show: function(aObj, aName) {
+ show(aObj, aName) {
if (aObj && aName in aObj)
console.show({obj: aObj, name: aName, fullName: this.fullName});
else if (typeof this.fullName == "string") {
@@ -146,7 +146,7 @@ Tabmix.changeCode = function(aParent, afnName, aOptions) {
}
},
- isValidToChange: function(aName) {
+ isValidToChange(aName) {
var notFoundCount = this.notFound.length;
if (this.needUpdate && !notFoundCount)
return true;
@@ -168,10 +168,10 @@ Tabmix.changeCode = function(aParent, afnName, aOptions) {
return false;
},
- getCallerData: function(stack) {
+ getCallerData(stack) {
let caller = (stack.caller || {}).caller || {};
let {filename, lineNumber, columnNumber, name} = caller;
- return {filename: filename, lineNumber: lineNumber, columnNumber: columnNumber, fnName: name};
+ return {filename, lineNumber, columnNumber, fnName: name};
}
};
diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index e5fe3d8..4381f87 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -96,7 +96,7 @@ var TabmixTabClickOptions = {
this.clickAction(prefName, clickOutTabs, tab, aEvent);
},
- clearTabFlipTimeOut: function() {
+ clearTabFlipTimeOut() {
clearTimeout(this._tabFlipTimeOut);
this._tabFlipTimeOut = null;
},
@@ -153,7 +153,7 @@ var TabmixTabClickOptions = {
case 2 :
if (aTab && aTab.parentNode) {
let byMouse = Tabmix.isVersion(520) ? event && event.mozInputSource == MouseEvent.MOZ_SOURCE_MOUSE : true;
- gBrowser.removeTab(aTab, {animate: true, byMouse: byMouse});
+ gBrowser.removeTab(aTab, {animate: true, byMouse});
}
break;
case 3 :
@@ -288,7 +288,7 @@ var TabmixTabClickOptions = {
return true;
},
- toggleEventListener: function(enable) {
+ toggleEventListener(enable) {
let eventListener = enable ? "addEventListener" : "removeEventListener";
document.getElementById("TabsToolbar")[eventListener]("dblclick", this.blockDblclick, false);
},
@@ -297,7 +297,7 @@ var TabmixTabClickOptions = {
* block dblclick on TabsToolbar when tabbar.dblclick_changesize is false
* and tabbar.click_dragwindow is true
*/
- blockDblclick: function(aEvent) {
+ blockDblclick(aEvent) {
if (aEvent.button !== 0 || aEvent.target.localName == "tabs" ||
Tabmix.prefs.getBoolPref("tabbar.dblclick_changesize") ||
!Tabmix.prefs.getBoolPref("tabbar.click_dragwindow"))
@@ -367,7 +367,7 @@ var TabmixContext = {
sep.parentNode.insertBefore(sep, $id("tm-content-closetab"));
},
- updateTabbarContextMenu: function(show) {
+ updateTabbarContextMenu(show) {
let tabBar = gBrowser.tabContainer;
if (show) {
this._originalTabbarContextMenu = tabBar.getAttribute("context");
@@ -377,14 +377,14 @@ var TabmixContext = {
}
},
- toggleEventListener: function(enable) {
+ toggleEventListener(enable) {
var eventListener = enable ? "addEventListener" : "removeEventListener";
document.getElementById("contentAreaContextMenu")[eventListener]("popupshowing", this, false);
gBrowser.tabContextMenu[eventListener]("popupshowing", this, false);
gBrowser.tabContextMenu[eventListener]("popupshown", this, false);
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
let id = aEvent.target.id;
switch (aEvent.type) {
case "popupshowing":
diff --git a/chrome/content/extensions/extensions.js b/chrome/content/extensions/extensions.js
index 81c44c8..0a3a841 100644
--- a/chrome/content/extensions/extensions.js
+++ b/chrome/content/extensions/extensions.js
@@ -469,7 +469,7 @@ var TMP_extensionsCompatibility = {
}
},
- setVerticalTabs: function() {
+ setVerticalTabs() {
// https://addons.mozilla.org/EN-US/firefox/addon/vertical-tabs/
// https://addons.mozilla.org/en-US/firefox/addon/vertical-tabs-reloaded/
// https://addons.mozilla.org/EN-US/firefox/addon/side-tabs/
@@ -487,7 +487,7 @@ var TMP_extensionsCompatibility = {
};
TMP_extensionsCompatibility.RSSTICKER = {
- init: function() {
+ init() {
Tabmix.changeCode(RSSTICKER, "RSSTICKER.writeFeed")._replace(
'tbb.setAttribute("onclick"',
'tbb.setAttribute("onclick", "this.onClick(event);");\
@@ -500,7 +500,7 @@ TMP_extensionsCompatibility.RSSTICKER = {
).toCode();
},
- onClick: function(event) {
+ onClick(event) {
if (event.ctrlKey) {
this.markAsRead(true);
} else if ((this.parent.alwaysOpenInNewTab && (event.which == 1)) || (event.which == 2)) {
@@ -510,7 +510,7 @@ TMP_extensionsCompatibility.RSSTICKER = {
}
},
- onContextOpen: function(target) {
+ onContextOpen(target) {
if (!target) {
if (Tabmix.whereToOpen(null).lock)
this.parent.browser.openInNewTab(this.href);
@@ -532,7 +532,7 @@ TMP_extensionsCompatibility.RSSTICKER = {
// prevent Wizz RSS from load pages in locked tabs
TMP_extensionsCompatibility.wizzrss = {
started: null,
- init: function() {
+ init() {
if (this.started)
return;
this.started = true;
@@ -548,7 +548,7 @@ TMP_extensionsCompatibility.wizzrss = {
});
},
- openURI: function(uri) {
+ openURI(uri) {
var w = Tabmix.getTopWin();
var tabBrowser = w.gBrowser;
@@ -564,7 +564,7 @@ TMP_extensionsCompatibility.wizzrss = {
// prevent Newsfox from load pages in locked tabs
TMP_extensionsCompatibility.newsfox = {
- init: function() {
+ init() {
Tabmix.changeCode(window, "openNewsfox")._replace(
/if \(newTab\) {/,
'newTab = newTab || Tabmix.whereToOpen(null).lock; \
@@ -583,7 +583,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
installed: false,
errorMsg: "Error in Tabmix when trying to load compatible functions with TreeStyleTab extension",
- preInit: function() {
+ preInit() {
let tstHelper = TreeStyleTabWindowHelper;
if (typeof tstHelper.overrideExtensionsPreInit == "function") {
// overrideExtensionsPreInit look for 'gBrowser.restoreTab' in tablib.init
@@ -618,7 +618,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
}
},
- onContentLoaded: function() {
+ onContentLoaded() {
// workaround, with version 0.15.2015061300a003855
// gBrowser.treeStyleTab.initTabContentsOrder throw on Firefox 41+
Tabmix.TST_initTabContentsOrder = function() {
@@ -688,7 +688,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
}
},
- onWindowLoaded: function() {
+ onWindowLoaded() {
// we don't need this hack since treestyletab version 0.16.2016021602
if (typeof PlacesUIUtils.__treestyletab__openTabset != "function") {
/**
@@ -747,7 +747,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
}
},
- onBeforeNewTabCommand: function(tab, openTabNext) {
+ onBeforeNewTabCommand(tab, openTabNext) {
if (!this.installed) {
return;
}
@@ -759,7 +759,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
},
// Don't call openNewTabNext if treeStyleTab already set readiedToAttachNewTab
- checkToOpenTabNext: function(tab, check) {
+ checkToOpenTabNext(tab, check) {
if (this.installed && check &&
!gBrowser.treeStyleTab.checkToOpenChildTab(tab)) {
this.openNewTabNext(tab, true);
@@ -768,7 +768,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
// instruct treeStyleTab to use 'kNEWTAB_OPEN_AS_NEXT_SIBLING' when our preference
// is to open the tab next
- openNewTabNext: function(tab, openTabNext, clean) {
+ openNewTabNext(tab, openTabNext, clean) {
if (!this.installed || !openTabNext) {
return;
}
@@ -821,7 +821,7 @@ TMP_extensionsCompatibility.treeStyleTab = {
}
},
- getProperties: function(tab) {
+ getProperties(tab) {
if (!this.installed) {
return "";
}
diff --git a/chrome/content/extensions/sage.js b/chrome/content/extensions/sage.js
index 613cf1a..e5fb3fc 100644
--- a/chrome/content/extensions/sage.js
+++ b/chrome/content/extensions/sage.js
@@ -7,7 +7,7 @@
// https://addons.mozilla.org/en-us/firefox/addon/sage/
var TMP_Sage = {
OPEN_TAB_FOR_SAGE: "extensions.tabmix.opentabfor.sage",
- init: function() {
+ init() {
TMP_Places.contextMenu.toggleEventListener(true);
if ("updateItemContextMenu" in window) {
@@ -55,7 +55,7 @@ var TMP_Sage = {
}
},
- buildContextMenu: function() {
+ buildContextMenu() {
var _open = document.getElementById("rssOpenItem");
var _openInWindow = document.getElementById("rssOpenNewWindowItem");
var _openInTab = document.getElementById("rssOpenNewTabItem");
diff --git a/chrome/content/flst/lasttab.js b/chrome/content/flst/lasttab.js
index a47c6a7..665cfb9 100644
--- a/chrome/content/flst/lasttab.js
+++ b/chrome/content/flst/lasttab.js
@@ -20,7 +20,7 @@ var TMP_LastTab = {
TabListLock: false,
_inited: false,
- DisplayTabList: function() {
+ DisplayTabList() {
var tablist = this.TabList;
TabmixAllTabs.createCommonList(tablist, this.handleCtrlTab ? 3 : 2);
@@ -44,7 +44,7 @@ var TMP_LastTab = {
this.TabListLock = true;
},
- init: function() {
+ init() {
this._inited = true;
this.TabList = document.getElementById("lasttabTabList");
@@ -76,7 +76,7 @@ var TMP_LastTab = {
this.ReadPreferences();
},
- deinit: function() {
+ deinit() {
if (!this._inited)
return;
@@ -92,7 +92,7 @@ var TMP_LastTab = {
}
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "focus":
if (event.target == window.content) {
@@ -126,7 +126,7 @@ var TMP_LastTab = {
* disallow mouse down on TabsToolbar to start dragging the window when one
* of the key modifiers is down
*/
- disallowDragwindow: function(keyDown) {
+ disallowDragwindow(keyDown) {
if (!Tabmix.isVersion(470)) {
return;
}
@@ -138,14 +138,14 @@ var TMP_LastTab = {
},
disallowDragState: false,
- updateDisallowDrag: function(disallow) {
+ updateDisallowDrag(disallow) {
let el = disallow ? "addEventListener" : "removeEventListener";
window[el]("blur", this);
this.disallowDragState = disallow;
Tabmix.setItem("TabsToolbar", "tabmix-disallow-drag", disallow || null);
},
- ItemActive: function(event) {
+ ItemActive(event) {
TabmixAllTabs.updateMenuItemActive(event);
if (this.respondToMouseInTabList) {
if (this.KeyboardNavigating) {
@@ -159,7 +159,7 @@ var TMP_LastTab = {
}
},
- ItemInactive: function(event) {
+ ItemInactive(event) {
TabmixAllTabs.updateMenuItemInactive(event);
if (!this.respondToMouseInTabList && event.target.value == this.inverseIndex(this.TabIndex))
event.target.setAttribute("_moz-menuactive", "true");
@@ -182,13 +182,13 @@ var TMP_LastTab = {
this.TabHistory.splice(i, 1);
},
- isCtrlTab: function(event) {
+ isCtrlTab(event) {
return (this.handleCtrlTab || this.showTabList) &&
event.keyCode == Ci.nsIDOMKeyEvent.DOM_VK_TAB &&
event.ctrlKey && !event.altKey && !event.metaKey;
},
- OnKeyDown: function(event) {
+ OnKeyDown(event) {
this.CtrlKey = event.ctrlKey && !event.altKey && !event.metaKey;
Tabmix.keyModifierDown = event.shiftKey || event.ctrlKey || event.altKey || event.metaKey;
if (Tabmix.isVersion(320))
@@ -312,19 +312,19 @@ var TMP_LastTab = {
this._tabs = null;
},
- onMenuCommand: function(event) {
+ onMenuCommand(event) {
if (this.respondToMouseInTabList) {
TabmixAllTabs._tabSelectedFromList(event.target.tab);
this.PushSelectedTab();
}
},
- onPopupshowing: function() {
+ onPopupshowing() {
this.TabList.addEventListener("DOMMenuItemActive", this, true);
this.TabList.addEventListener("DOMMenuItemInactive", this, true);
},
- onPopuphidden: function() {
+ onPopuphidden() {
this.TabList.removeEventListener("DOMMenuItemActive", this, true);
this.TabList.removeEventListener("DOMMenuItemInactive", this, true);
if (!this.SuppressTabListReset) {
@@ -341,7 +341,7 @@ var TMP_LastTab = {
}
},
- OnSelect: function() {
+ OnSelect() {
// session manager can select new tab before TMP_LastTab is init
if (!this._inited)
return;
@@ -369,7 +369,7 @@ var TMP_LastTab = {
this.TabHistory.push(selectedTab);
},
- ReadPreferences: function() {
+ ReadPreferences() {
// when Build-in tabPreviews is on we disable our own function
var mostRecentlyUsed = Services.prefs.getBoolPref("browser.ctrlTab.previews");
var tabPreviews = document.getElementById("ctrlTab-panel") && "ctrlTab" in window;
@@ -394,14 +394,14 @@ var TMP_LastTab = {
this.respondToMouseInTabList = Tabmix.prefs.getBoolPref("lasttab.respondToMouseInTabList");
},
- inverseIndex: function(index) {
+ inverseIndex(index) {
return this.handleCtrlTab ? index : this.tabs.length - 1 - index;
}
};
Tabmix.slideshow = {
- cancel: function() {
+ cancel() {
if (Tabmix.SlideshowInitialized && Tabmix.flst.slideShowTimer) {
Tabmix.flst.cancel();
}
diff --git a/chrome/content/links/contentLinks.js b/chrome/content/links/contentLinks.js
index f5899a3..b6d11d1 100644
--- a/chrome/content/links/contentLinks.js
+++ b/chrome/content/links/contentLinks.js
@@ -1,7 +1,7 @@
"use strict";
Tabmix.contentAreaClick = {
- init: function() {
+ init() {
// this getter trigger by call to isGreasemonkeyInstalled from
// TMP_extensionsCompatibility.onDelayedStartup
XPCOMUtils.defineLazyGetter(Tabmix, "ContentClick", () => {
diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index c9f3a7d..c3cddb3 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -84,7 +84,7 @@ Tabmix.beforeBrowserInitOnLoad = function() {
get isStopped() {
return TabmixSvc.SessionStore._loadState === 0; // STATE_STOPPED
},
- setRunning: function() {
+ setRunning() {
TabmixSvc.SessionStore._loadState = 1; // STATE_RUNNING
}
};
diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index 876862c..019bdfd 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -148,7 +148,7 @@ var TMP_tabDNDObserver = {
return Tabmix.isVersion(280) && gBrowser.tabContainer._isCustomizing;
},
- onDragStart: function(event, tabmixDragstart) {
+ onDragStart(event, tabmixDragstart) {
// we get here on capturing phase before "tabbrowser-close-tab-button"
// binding stop the event propagation
if (event.originalTarget.getAttribute("anonid") == "tmp-close-button") {
@@ -703,7 +703,7 @@ var TMP_tabDNDObserver = {
this.updateStatusField();
},
- updateStatusField: function() {
+ updateStatusField() {
var statusTextFld = document.getElementById("statusbar-display");
if (statusTextFld && this.statusFieldChanged) {
statusTextFld.label = "";
@@ -715,7 +715,7 @@ var TMP_tabDNDObserver = {
},
// get _tPos from group index
- _getDNDIndex: function(aEvent) {
+ _getDNDIndex(aEvent) {
var indexInGroup = this.getNewIndex(aEvent);
var tabs = gBrowser.visibleTabs;
var lastIndex = tabs.length - 1;
@@ -724,7 +724,7 @@ var TMP_tabDNDObserver = {
return tabs[indexInGroup]._tPos;
},
- getNewIndex: function(event) {
+ getNewIndex(event) {
let getTabRowNumber = (tab, top) => (tab.pinned ? 1 : Tabmix.tabsUtils.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
@@ -760,7 +760,7 @@ var TMP_tabDNDObserver = {
return numTabs;
},
- getLeft_Right: function(event, newIndex, oldIndex, dragType) {
+ getLeft_Right(event, newIndex, oldIndex, dragType) {
var mX = event.screenX;
var left_right;
var tab = gBrowser.tabs[newIndex];
@@ -870,7 +870,7 @@ var TMP_tabDNDObserver = {
ind.style.MozMarginStart = (-ind.clientWidth) + "px";
}
- this.dragmarkindex = {newIndex: newIndex, index: index};
+ this.dragmarkindex = {newIndex, index};
},
clearDragmark: function minit_clearDragmark() {
@@ -890,22 +890,22 @@ var TMP_tabDNDObserver = {
this.dragmarkindex = null;
},
- setFirefoxDropIndicator: function(val) {
+ setFirefoxDropIndicator(val) {
gBrowser.tabContainer._tabDropIndicator.collapsed = !val;
},
- removeDragmarkAttribute: function(tab) {
+ removeDragmarkAttribute(tab) {
tab.removeAttribute("dragmark");
},
- setDragmarkAttribute: function(tab, markSide) {
+ setDragmarkAttribute(tab, markSide) {
tab.setAttribute("dragmark", markSide);
},
/*
* helper functions
*/
- _getDropEffectForTabDrag: function(event) {
+ _getDropEffectForTabDrag(event) {
let tabBar = gBrowser.tabContainer;
if (Tabmix.isVersion(440)) {
return tabBar._getDropEffectForTabDrag(event);
@@ -920,7 +920,7 @@ var TMP_tabDNDObserver = {
return null;
},
- isCopyDropEffect: function(dt, event, type) {
+ isCopyDropEffect(dt, event, type) {
let isCopy = dt.dropEffect == "copy";
if (isCopy && type == this.DRAG_LINK) {
// Dragging bookmark or livemark from the Bookmarks toolbar, or dragging
@@ -956,7 +956,7 @@ var TMP_tabDNDObserver = {
}; // TMP_tabDNDObserver end
var TMP_undocloseTabButtonObserver = {
- onDragOver: function(aEvent) {
+ onDragOver(aEvent) {
var dt = aEvent.dataTransfer;
var sourceNode = TMP_tabDNDObserver.getSourceNode(dt) || this.NEW_getSourceNode(dt);
if (!sourceNode || sourceNode.localName != "tab") {
@@ -981,7 +981,7 @@ var TMP_undocloseTabButtonObserver = {
return true;
},
- onDragExit: function(aEvent) {
+ onDragExit(aEvent) {
if (aEvent.target.hasAttribute("dragover")) {
var statusTextFld = document.getElementById("statusbar-display");
if (statusTextFld)
@@ -993,7 +993,7 @@ var TMP_undocloseTabButtonObserver = {
}
},
- onDrop: function(aEvent) {
+ onDrop(aEvent) {
var dt = aEvent.dataTransfer;
var sourceNode = TMP_tabDNDObserver.getSourceNode(dt) || this.NEW_getSourceNode(dt);
if (sourceNode && sourceNode.localName == "tab")
@@ -1071,7 +1071,7 @@ Tabmix.hidePopup = function TMP_hidePopup(aPopupMenu) {
var TMP_TabView = {
subScriptLoaded: false,
- init: function() {
+ init() {
try {
if (this.installed) {
this._patchBrowserTabview();
@@ -1089,11 +1089,11 @@ var TMP_TabView = {
return installed;
},
- exist: function(id) {
+ exist(id) {
return this.installed && typeof TabView[id] == "function";
},
- checkTabs: function(tabs) {
+ checkTabs(tabs) {
var firstTab;
for (var i = 0; i < tabs.length; i++) {
let tab = tabs[i];
@@ -1106,12 +1106,12 @@ var TMP_TabView = {
},
// including _removingTabs
- currentGroup: function() {
+ currentGroup() {
return Array.prototype.filter.call(gBrowser.tabs, tab => !tab.hidden);
},
// visibleTabs don't include _removingTabs
- getTabPosInCurrentGroup: function(aTab) {
+ getTabPosInCurrentGroup(aTab) {
if (aTab) {
let tabs = Array.prototype.filter.call(gBrowser.tabs, tab => !tab.hidden);
return tabs.indexOf(aTab);
@@ -1119,7 +1119,7 @@ var TMP_TabView = {
return -1;
},
- getIndexInVisibleTabsFromTab: function(aTab) {
+ getIndexInVisibleTabsFromTab(aTab) {
if (aTab)
return gBrowser.visibleTabs.indexOf(aTab);
return -1;
@@ -1189,7 +1189,7 @@ Tabmix.navToolbox = {
}
},
- cleanCurrentset: function() {
+ cleanCurrentset() {
let tabsToolbar = document.getElementById("TabsToolbar");
let cSet = tabsToolbar.getAttribute("currentset");
if (cSet.indexOf("tabmixScrollBox") > -1) {
@@ -1276,7 +1276,7 @@ Tabmix.navToolbox = {
}
},
- handleCommand: function(event, openUILinkWhere, openUILinkParams = {}) {
+ handleCommand(event, openUILinkWhere, openUILinkParams = {}) {
let prevTab, prevTabPos;
let action = this._parseActionUrl(this.value) || {};
if (Tabmix.prefs.getBoolPref("moveSwitchToTabNext") &&
@@ -1317,7 +1317,7 @@ Tabmix.navToolbox = {
}
},
- handleCommand_beforeV50: function() {
+ handleCommand_beforeV50() {
let obj = gURLBar, fn;
// Fix incompatibility with Omnibar (O is not defined)
// URL Dot 0.4.x extension
@@ -1395,7 +1395,7 @@ Tabmix.navToolbox = {
}
},
- whereToOpenSearch: function(aWhere) {
+ whereToOpenSearch(aWhere) {
var tab = gBrowser.selectedTab;
var isBlankTab = gBrowser.isBlankNotBusyTab(tab);
var isLockTab = !isBlankTab && tab.hasAttribute("locked");
@@ -1505,7 +1505,7 @@ Tabmix.navToolbox = {
}
},
- tabStripAreaChanged: function() {
+ tabStripAreaChanged() {
/**
* we need to position three elements in TabsToolbar :
* tabmixScrollBox, new-tab-button, and tabmix-tabs-closebutton.
@@ -1525,7 +1525,7 @@ Tabmix.navToolbox = {
TMP_eventListener.updateMultiRow(true);
},
- setScrollButtons: function(reset, onlyPosition) {
+ setScrollButtons(reset, onlyPosition) {
let box = document.getElementById("tabmixScrollBox");
if (!box)
return;
@@ -1553,7 +1553,7 @@ Tabmix.navToolbox = {
},
_closeButtonInitialized: false,
- setCloseButtonPosition: function() {
+ setCloseButtonPosition() {
if (this._closeButtonInitialized)
return;
diff --git a/chrome/content/minit/tabView.js b/chrome/content/minit/tabView.js
index 2ad9a7d..ea02296 100644
--- a/chrome/content/minit/tabView.js
+++ b/chrome/content/minit/tabView.js
@@ -292,7 +292,7 @@
let parsedData;
function setData(groupID) {
- let data = {groupID: groupID};
+ let data = {groupID};
parsedData = data;
return TabmixSvc.JSON.stringify(data);
}
@@ -373,7 +373,7 @@
this._lastSessionGroupName = "";
}
let bounds = {left: 0, top: 0, width: 350, height: 300};
- aGroupItems[groupID] = {bounds: bounds, userSize: null, title: "", id: groupID, newItem: true};
+ aGroupItems[groupID] = {bounds, userSize: null, title: "", id: groupID, newItem: true};
aGroupsData.totalNumber = Object.keys(aGroupItems).length;
this._tabviewData["tabview-group"] = aGroupItems;
this._tabviewData["tabview-groups"] = aGroupsData;
@@ -454,7 +454,7 @@
for (let tab of gBrowser.tabs) {
if (tab.pinned || tab.hidden || tab.closing || blankTabs.indexOf(tab) > -1)
return;
- let data = {groupID: groupID};
+ let data = {groupID};
data = TabmixSvc.JSON.stringify(data);
TabmixSvc.ss.setTabValue(tab, "tabview-tab", data);
if (this.enableBackup)
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 5290302..a09aaf3 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -54,7 +54,7 @@ var tablib = { // eslint-disable-line
};
},
- _loadURIWithFlags: function(browser, uri, params) {
+ _loadURIWithFlags(browser, uri, params) {
if (tablib.allowLoad(browser, uri)) {
return null;
}
@@ -79,7 +79,7 @@ var tablib = { // eslint-disable-line
return gBrowser.loadOneTab(uri, params);
},
- allowLoad: function(browser, uri) {
+ allowLoad(browser, uri) {
var tab = gBrowser.getTabForBrowser(browser);
if (!tab) {
browser.tabmix_allowLoad = true;
@@ -130,7 +130,7 @@ var tablib = { // eslint-disable-line
*
* current code only check if the caller is in the exception list
*/
- isException: function(loadInCurrent) {
+ isException(loadInCurrent) {
if (loadInCurrent)
return loadInCurrent;
@@ -172,7 +172,7 @@ var tablib = { // eslint-disable-line
(typeof params != "object" || params instanceof Ci.nsIURI)) {
referrerURI = params;
params = {
- referrerURI: referrerURI,
+ referrerURI,
charset: args[2],
postData: args[3],
ownerTab: args[4],
@@ -921,7 +921,7 @@ var tablib = { // eslint-disable-line
Tabmix.setNewFunction(window, "URLBarSetURI", _URLBarSetURI);
},
- populateUndoWindowSubmenu: function(undoPopup) {
+ populateUndoWindowSubmenu(undoPopup) {
/* eslint-disable tabmix/balanced-listeners */
if (!undoPopup.hasAttribute("context"))
undoPopup.setAttribute("context", "tm_undocloseWindowContextMenu");
@@ -1921,7 +1921,7 @@ var tablib = { // eslint-disable-line
return canClose;
},
- whereToOpenDrop: function(aEvent, aUri) {
+ whereToOpenDrop(aEvent, aUri) {
if (!aEvent) {
return "current";
}
@@ -1957,7 +1957,7 @@ var tablib = { // eslint-disable-line
gURLBar.focus();
},
- reloadTabs: function(tabs, skipTab) {
+ reloadTabs(tabs, skipTab) {
let l = tabs.length;
for (let i = 0; i < l; i++) {
let tab = tabs[i];
diff --git a/chrome/content/overlay/removeBlankTab.js b/chrome/content/overlay/removeBlankTab.js
index 969ddd4..d759a99 100644
--- a/chrome/content/overlay/removeBlankTab.js
+++ b/chrome/content/overlay/removeBlankTab.js
@@ -12,7 +12,7 @@ if (typeof Ci == "undefined") {
}
var TabmixRemoveBlankTab = {
- initialize: function() {
+ initialize() {
switch (window.document.documentElement.id) {
case "unknownContentType":
// chrome\toolkit\content\mozapps\downloads\unknownContentType.xul
@@ -25,7 +25,7 @@ var TabmixRemoveBlankTab = {
}
},
- unknownContentType: function() {
+ unknownContentType() {
let {win, b} = this.getWindowAndBrowser(dialog.mContext);
if (win && b) {
let tab = win.gBrowser.getTabForBrowser(b);
@@ -41,7 +41,7 @@ var TabmixRemoveBlankTab = {
}
},
- handlingDialog: function() {
+ handlingDialog() {
/*
* from chrome\toolkit\content\mozapps\handling\dialog.js
* window.arguments[8]:
@@ -63,7 +63,7 @@ var TabmixRemoveBlankTab = {
}
},
- getWindowAndBrowser: function(aContext) {
+ getWindowAndBrowser(aContext) {
let result = {win: null, b: null};
if (aContext) {
let nav = aContext.QueryInterface(Ci.nsIInterfaceRequestor)
@@ -92,7 +92,7 @@ var TabmixRemoveBlankTab = {
return result;
},
- removeTab: function(win, tab) {
+ removeTab(win, tab) {
window.addEventListener("unload", function _unload(aEvent) {
aEvent.currentTarget.removeEventListener("unload", _unload, false);
if (win && !win.closed) {
diff --git a/chrome/content/places/places.js b/chrome/content/places/places.js
index c2ca784..170715e 100644
--- a/chrome/content/places/places.js
+++ b/chrome/content/places/places.js
@@ -116,7 +116,7 @@ var TMP_Places = {
}
},
- openMenuItem: function(aUri, aEvent, aParams, aPref) {
+ openMenuItem(aUri, aEvent, aParams, aPref) {
let pref = "extensions.tabmix.opentabfor." + aPref;
let where = this.isBookmarklet(aUri) ? "current" :
this.fixWhereToOpen(aEvent, whereToOpenLink(aEvent, false, true), pref);
@@ -133,7 +133,7 @@ var TMP_Places = {
BMB_bookmarksPopup: "bookmarks",
},
- openUILink: function(url, event, where, params) {
+ openUILink(url, event, where, params) {
// divert all the calls from places UI to use our preferences
// HistoryMenu.prototype._onCommand
// BookmarkingUI._updateRecentBookmarks/onItemCommand
@@ -175,12 +175,12 @@ var TMP_Places = {
return where;
},
- isBookmarklet: function(url) {
+ isBookmarklet(url) {
var jsURL = /^ *javascript:/;
return jsURL.test(url);
},
- fixWhereToOpen: function(aEvent, aWhere, aPref) {
+ fixWhereToOpen(aEvent, aWhere, aPref) {
var w = Tabmix.getTopWin();
if (!w)
return aWhere;
@@ -206,7 +206,7 @@ var TMP_Places = {
return aWhere;
},
- getPrefByDocumentURI: function(aWindow) {
+ getPrefByDocumentURI(aWindow) {
switch (aWindow.document.documentURI) {
case "chrome://browser/content/places/places.xul": {
let history = PlacesUIUtils.getString("OrganizerQueryHistory");
@@ -310,7 +310,7 @@ var TMP_Places = {
this.setTabTitle(aTab, url, bmIds[i]);
if (loadProgressively) {
tabs.push(aTab);
- tabsData.push({entries: [{url: url, title: aTab.label}], index: 0});
+ tabsData.push({entries: [{url, title: aTab.label}], index: 0});
}
if (!tabToSelect)
@@ -370,7 +370,7 @@ var TMP_Places = {
return [tabCount > progressively, tabCount > onDemand];
},
- restoreTabs: function(tabs, tabsData, restoreOnDemand) {
+ restoreTabs(tabs, tabsData, restoreOnDemand) {
this.restoringTabs.push(...tabs);
this.bookmarksOnDemand = restoreOnDemand;
let fnName = Tabmix.isVersion(280) ? "restoreTabs" :
@@ -394,14 +394,14 @@ var TMP_Places = {
bookmarksOnDemand: false,
restoringTabs: [],
- resetRestoreState: function(tab) {
+ resetRestoreState(tab) {
if (tab.linkedBrowser.__SS_restoreState) {
TabmixSvc.SessionStore._resetTabRestoringState(tab);
}
this.updateRestoringTabsList(tab);
},
- updateRestoringTabsList: function(tab) {
+ updateRestoringTabsList(tab) {
if (!this.restoringTabs.length && !this.bookmarksOnDemand) {
return;
}
@@ -456,11 +456,11 @@ var TMP_Places = {
return (this._titlefrombookmark = Tabmix.prefs.getBoolPref("titlefrombookmark"));
},
- getTitleFromBookmark: function(aUrl, aTitle, aItemId, aTab) {
+ getTitleFromBookmark(aUrl, aTitle, aItemId, aTab) {
return this.PlacesUtils.getTitleFromBookmark(aUrl, aTitle, aItemId, aTab);
},
- isUserRenameTab: function(aTab, aUrl) {
+ isUserRenameTab(aTab, aUrl) {
if (aTab.hasAttribute("label-uri")) {
let label = aTab.getAttribute("label-uri");
if (label == aUrl || label == "*")
@@ -469,7 +469,7 @@ var TMP_Places = {
return false;
},
- afterTabTitleChanged: function(bookmarkChanged = true) {
+ afterTabTitleChanged(bookmarkChanged = true) {
if (bookmarkChanged && !this.inUpdateBatch) {
this.AboutNewTab.updateAllBrowsers(window);
}
@@ -514,7 +514,7 @@ var TMP_Places = {
}
},
- onDelayedStartup: function() {
+ onDelayedStartup() {
if (!this._titlefrombookmark || !gBrowser.tabs)
return;
@@ -522,7 +522,7 @@ var TMP_Places = {
},
// extensions.tabmix.titlefrombookmark changed
- onPreferenceChanged: function(aPrefValue) {
+ onPreferenceChanged(aPrefValue) {
this._titlefrombookmark = aPrefValue;
if (aPrefValue) {
@@ -651,18 +651,18 @@ var TMP_Places = {
this.currentTab = null;
},
- onItemVisited: function() {},
- onItemMoved: function() {}
+ onItemVisited() {},
+ onItemMoved() {}
};
TMP_Places.contextMenu = {
- toggleEventListener: function(enable) {
+ toggleEventListener(enable) {
var eventListener = enable ? "addEventListener" : "removeEventListener";
window[eventListener]("unload", this, false);
document.getElementById("placesContext")[eventListener]("popupshowing", this, false);
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
switch (aEvent.type) {
case "popupshowing":
this.buildContextMenu();
@@ -719,12 +719,12 @@ TMP_Places.contextMenu = {
};
Tabmix.onContentLoaded = {
- changeCode: function() {
+ changeCode() {
this.change_miscellaneous();
this.change_utilityOverlay();
},
- change_miscellaneous: function() {
+ change_miscellaneous() {
Tabmix.changeCode(nsContextMenu.prototype, "nsContextMenu.prototype.openLinkInTab")._replace(
/allowMixedContent:|charset:/,
'inBackground: !Services.prefs.getBoolPref("browser.tabs.loadInBackground"),\n' +
@@ -781,7 +781,7 @@ Tabmix.onContentLoaded = {
).toCode();
},
- change_utilityOverlay: function() {
+ change_utilityOverlay() {
// fix small bug when the event is not mouse event
// inverse focus of middle/ctrl/meta clicked bookmarks/history
// don't inverse focus when called from onPopupClick and One-Click Search
@@ -869,7 +869,7 @@ Tabmix.onContentLoaded = {
// update compatibility with X-notifier(aka WebMail Notifier) 2.9.13+
// object name wmn replace with xnotifier for version 3.0+
- getXnotifierFunction: function(aName) {
+ getXnotifierFunction(aName) {
let com = window.com;
if (typeof com == "object" && typeof com.tobwithu == "object") {
let fn = ["wmn", "xnotifier"].filter(f => {
diff --git a/chrome/content/preferences/appearance.js b/chrome/content/preferences/appearance.js
index 2fd7caf..1f2f952 100644
--- a/chrome/content/preferences/appearance.js
+++ b/chrome/content/preferences/appearance.js
@@ -2,7 +2,7 @@
"use strict";
var gAppearancePane = {
- init: function() {
+ init() {
var browserWindow = Tabmix.getTopWin();
// disable options for position the tabbar and scroll mode if TreeStyleTab extension installed
if (browserWindow.Tabmix.extensions.verticalTabBar) {
@@ -74,13 +74,13 @@ var gAppearancePane = {
this.toolbarButtons(browserWindow);
},
- tabCloseButtonChanged: function() {
+ tabCloseButtonChanged() {
var tabCbValue = $("pref_tabCloseButton").value;
Tabmix.setItem("tabDelayCheck", "hidden", tabCbValue != 2 && tabCbValue != 4);
Tabmix.setItem("tabWidthBox", "hidden", tabCbValue != 5);
},
- setTabCloseButtonUI: function() {
+ setTabCloseButtonUI() {
if ($("pref_flexTabs").value) {
$("alltabsItem").disabled = true;
let tabCbUI = $("tabCloseButton");
@@ -93,18 +93,18 @@ var gAppearancePane = {
}
},
- tabsScrollChanged: function() {
+ tabsScrollChanged() {
var multiRow = $("pref_tabsScroll").value == 2;
$("multi-rows").hidden = !multiRow;
$("one-row").hidden = multiRow;
},
- tabmixCustomizeToolbar: function() {
+ tabmixCustomizeToolbar() {
this._tabmixCustomizeToolbar = true;
Tabmix.getTopWin().BrowserCustomizeToolbar();
},
- toolbarButtons: function(aWindow) {
+ toolbarButtons(aWindow) {
// Display > Toolbar
var buttons = ["btn_sessionmanager", "btn_undoclose", "btn_closedwindows", "btn_tabslist"];
var onToolbar = $("onToolbar");
@@ -138,7 +138,7 @@ var gAppearancePane = {
// block width change on instantApply
// user is force to hit apply
- userChangedWidth: function(item) {
+ userChangedWidth(item) {
gPrefWindow.widthChanged = $("minWidth").value != $("pref_minWidth").valueFromPreferences ||
$("maxWidth").value != $("pref_maxWidth").valueFromPreferences;
if (!gPrefWindow.instantApply)
@@ -148,7 +148,7 @@ var gAppearancePane = {
return $(item.getAttribute("preference")).value;
},
- changeTabsWidth: function() {
+ changeTabsWidth() {
if (!gPrefWindow.widthChanged)
return;
gPrefWindow.widthChanged = false;
@@ -158,13 +158,13 @@ var gAppearancePane = {
[$("pref_minWidth").value, $("pref_maxWidth").value] = [minWidth, maxWidth];
},
- resetWidthChange: function() {
+ resetWidthChange() {
gPrefWindow.widthChanged = false;
$("minWidth").value = $("pref_minWidth").value;
$("maxWidth").value = $("pref_maxWidth").value;
},
- openAdvanceAppearance: function() {
+ openAdvanceAppearance() {
window.openDialog("chrome://tabmixplus/content/preferences/subdialogs/pref-appearance.xul",
"advanceAppearanceDialog", "modal,titlebar,toolbar,centerscreen");
}
diff --git a/chrome/content/preferences/events.js b/chrome/content/preferences/events.js
index bf2e72f..4bc2499 100644
--- a/chrome/content/preferences/events.js
+++ b/chrome/content/preferences/events.js
@@ -2,7 +2,7 @@
"use strict";
var gEventsPane = {
- init: function() {
+ init() {
// for locales with long labels
var hbox = $("focusTab-box");
var label = $("focusTab-label").boxObject.width;
@@ -56,7 +56,7 @@ var gEventsPane = {
// align Tab opening group boxes
// add setWidth attribute to columns that need to be aligned
- alignTabOpeningBoxes: function() {
+ alignTabOpeningBoxes() {
const widths = {};
const rows = $("tabopening").querySelectorAll("hbox");
function updateGrid(fn) {
@@ -79,7 +79,7 @@ var gEventsPane = {
});
},
- disableShowTabList: function() {
+ disableShowTabList() {
var ctrlTabPv = $("pref_ctrltab.tabPreviews");
var disableShowTabList = $("pref_ctrltab").value &&
ctrlTabPv && ctrlTabPv.value;
@@ -88,7 +88,7 @@ var gEventsPane = {
gPrefWindow.setDisabled("respondToMouse", disableShowTabList);
},
- disableReplaceLastTabWith: function() {
+ disableReplaceLastTabWith() {
// we disable replaceLastTabWith if one of this test is true
// browser.tabs.closeWindowWithLastTab = true OR
// extensions.tabmix.keepLastTab = true
@@ -97,7 +97,7 @@ var gEventsPane = {
this.newTabUrl($("pref_replaceLastTabWith"), disable, !disable);
},
- newTabUrl: function(preference, disable, setFocus) {
+ newTabUrl(preference, disable, setFocus) {
var showTabUrlBox = preference.value == 4;
var item = $(preference.id.replace("pref_", ""));
var idnum = item.getAttribute("idnum") || "";
@@ -107,7 +107,7 @@ var gEventsPane = {
$("newTabUrl" + idnum).focus();
},
- syncFromNewTabUrlPref: function(item) {
+ syncFromNewTabUrlPref(item) {
var preference = $(item.getAttribute("preference"));
// If the pref is set to the default, set the value to ""
// to show the placeholder text
@@ -117,7 +117,7 @@ var gEventsPane = {
return this.syncToNewTabUrlPref(value, TabmixSvc.aboutBlank);
},
- syncToNewTabUrlPref: function(value, def = TabmixSvc.aboutNewtab) {
+ syncToNewTabUrlPref(value, def = TabmixSvc.aboutNewtab) {
// If the value is "", use about:newtab or about:blank.
if (value === "") {
return def;
@@ -127,14 +127,14 @@ var gEventsPane = {
return undefined;
},
- onNewTabKeyDown: function(event) {
+ onNewTabKeyDown(event) {
// block spaces from the user to go to about:newtab preference
if (event.keyCode == 32) {
event.preventDefault();
}
},
- editSlideShowKey: function() {
+ editSlideShowKey() {
document.documentElement.showPane($("paneMenu"));
if (typeof gMenuPane == "object")
gMenuPane.editSlideShowKey();
@@ -143,7 +143,7 @@ var gEventsPane = {
},
loadProgressively: {
- syncToCheckBox: function(item) {
+ syncToCheckBox(item) {
let preference = $(item.getAttribute("preference"));
if (preference.value == 0) {
preference.value = 1;
@@ -155,7 +155,7 @@ var gEventsPane = {
return preference.value > -1;
},
- syncFromCheckBox: function(item) {
+ syncFromCheckBox(item) {
let preference = $(item.getAttribute("preference"));
let control = $(item.getAttribute("control"));
control.disabled = !item.checked;
diff --git a/chrome/content/preferences/links.js b/chrome/content/preferences/links.js
index 742457e..cfcd651 100644
--- a/chrome/content/preferences/links.js
+++ b/chrome/content/preferences/links.js
@@ -2,7 +2,7 @@
"use strict";
var gLinksPane = {
- init: function() {
+ init() {
this.singleWindow($("singleWindow").checked);
this.externalLinkValue($("externalLink").checked);
@@ -11,7 +11,7 @@ var gLinksPane = {
gPrefWindow.initPane("paneLinks");
},
- externalLinkValue: function(checked) {
+ externalLinkValue(checked) {
let external = $("externalLinkTarget");
let preference = $(external.getAttribute("preference"));
if (!checked)
@@ -23,7 +23,7 @@ var gLinksPane = {
gPrefWindow.setDisabled("obs_externalLink", !checked);
},
- updateExternalLinkCheckBox: function(external) {
+ updateExternalLinkCheckBox(external) {
let preference = $(external.getAttribute("preference"));
if (external.value == preference.value)
return;
@@ -36,7 +36,7 @@ var gLinksPane = {
}
},
- singleWindow: function(enableSingleWindow) {
+ singleWindow(enableSingleWindow) {
function updateStatus(itemId, testVal, test, newVal) {
var item = $(itemId);
if (test ? item.value == testVal : item.value != testVal) {
@@ -52,7 +52,7 @@ var gLinksPane = {
}
},
- openFiletypeEditor: function() {
+ openFiletypeEditor() {
window.openDialog("chrome://tabmixplus/content/preferences/subdialogs/pref-filetype.xul",
"filetypePrefsDialog", "modal,titlebar,toolbar,centerscreen");
}
diff --git a/chrome/content/preferences/menu.js b/chrome/content/preferences/menu.js
index 8780e6e..2994300 100644
--- a/chrome/content/preferences/menu.js
+++ b/chrome/content/preferences/menu.js
@@ -2,7 +2,7 @@
"use strict";
var gMenuPane = {
- init: function() {
+ init() {
$("pinTab").label = gPrefWindow.pinTabLabel;
$("togglePinTab").setAttribute("label", gPrefWindow.pinTabLabel);
$("clearClosedTabs").setAttribute("label", TabmixSvc.getString("undoclosetab.clear.label"));
@@ -59,7 +59,7 @@ var gMenuPane = {
gPrefWindow.initPane("paneMenu");
},
- initializeShortcuts: function() {
+ initializeShortcuts() {
if (Shortcuts.prefsChangedByTabmix)
return;
@@ -74,7 +74,7 @@ var gMenuPane = {
},
_slideShow: "",
- updateShortcuts: function(aShortcuts, aCallBack) {
+ updateShortcuts(aShortcuts, aCallBack) {
let boxes = Array.prototype.filter.call(aShortcuts.childNodes, aCallBack);
$("shortcuts-panel").setAttribute("usedKeys", boxes.length > 0);
if (this._slideShow != $("shortcut-group").keys.slideShow) {
@@ -83,14 +83,14 @@ var gMenuPane = {
}
},
- setSlideShowLabel: function() {
+ setSlideShowLabel() {
let slideShow = $("slideShow");
let label = slideShow.disabled ? "??" : getFormattedKey(slideShow.key);
$("slideDelayLabel").value = slideShow.getAttribute("_label").replace("#1", label);
gPrefWindow.setDisabled("obs_slideDelay", slideShow.disabled);
},
- editSlideShowKey: function() {
+ editSlideShowKey() {
$("menu").selectedIndex = 3;
let slideShow = $("slideShow");
let item = $("hide-unused-shortcuts");
@@ -102,7 +102,7 @@ var gMenuPane = {
shortcuts.scrollTop = shortcuts.scrollHeight - shortcuts.clientHeight;
},
- updateSessionShortcuts: function() {
+ updateSessionShortcuts() {
let block = !($("pref_sessionManager") || $("pref_sessionManager1")).value ||
Shortcuts.permanentPrivateBrowsing;
$("saveWindow").blocked = block;
@@ -110,7 +110,7 @@ var gMenuPane = {
},
// for shortcuts panel
- toggleLinkLabel: function(item) {
+ toggleLinkLabel(item) {
var panel = $("shortcuts-panel");
var wasShow = panel.getAttribute(item.id) == 'false';
item.value = item.getAttribute(wasShow ? 'show' : 'hide');
@@ -119,7 +119,7 @@ var gMenuPane = {
// update item showInverseLink label in menu pane
// when "Links" in Events > Tab Focus changed
- setInverseLinkLabel: function() {
+ setInverseLinkLabel() {
var showInverseLink = $("showInverseLink");
var val = ($("pref_selectTab") || $("pref_selectTab1")).value;
var label = showInverseLink.getAttribute((val ? "bg" : "fg") + "label");
diff --git a/chrome/content/preferences/mouse.js b/chrome/content/preferences/mouse.js
index 6817951..de942a6 100644
--- a/chrome/content/preferences/mouse.js
+++ b/chrome/content/preferences/mouse.js
@@ -5,7 +5,7 @@ var gMousePane = {
_inited: false,
clickTab: null,
clickTabbar: null,
- init: function() {
+ init() {
this._inited = true;
if (TabmixSvc.isMac) {
@@ -32,7 +32,7 @@ var gMousePane = {
gPrefWindow.initPane("paneMouse");
},
- tabSelectionChanged: function(aEvent) {
+ tabSelectionChanged(aEvent) {
if (aEvent.target.localName != "tabs")
return;
gPrefWindow.tabSelectionChanged(aEvent);
@@ -42,7 +42,7 @@ var gMousePane = {
},
_options: ["dbl", "middle", "ctrl", "shift", "alt"],
- updatePanelPrefs: function(aIndex) {
+ updatePanelPrefs(aIndex) {
let panel = this._options[aIndex];
let prefID = "pref_" + panel + "ClickTab";
// update "ClickTab" menulist
@@ -56,24 +56,24 @@ var gMousePane = {
Tabmix.setItem(this.clickTabbar.previousSibling, "disabled", disabled || null);
},
- updatePref: function(element, prefID) {
+ updatePref(element, prefID) {
let preference = $(prefID);
element.setAttribute("preference", prefID);
preference.setElementValue(element);
},
- ensureElementIsVisible: function(aPopup) {
+ ensureElementIsVisible(aPopup) {
var scrollBox = document.getAnonymousElementByAttribute(aPopup, "class", "popup-internal-box");
scrollBox.ensureElementIsVisible(aPopup.parentNode.selectedItem);
},
- resetPreference: function(checkbox) {
+ resetPreference(checkbox) {
let menulist = $(checkbox.getAttribute("control"));
let prefID = menulist.getAttribute("preference");
$(prefID).valueFromPreferences = checkbox.checked ? (menulist[prefID] || undefined) : -1;
},
- setCheckedState: function(menulist) {
+ setCheckedState(menulist) {
let prefID = menulist.getAttribute("preference");
let val = $(prefID).value;
if (val != -1)
@@ -82,7 +82,7 @@ var gMousePane = {
menulist.previousSibling.checked = !menulist.disabled;
},
- updateDblClickTabbar: function(pref) {
+ updateDblClickTabbar(pref) {
let dblClickTabbar = $("pref_dblclick_changesize");
if (pref.value && !dblClickTabbar.value)
dblClickTabbar.value = pref.value;
diff --git a/chrome/content/preferences/overlay/overlaySanitizeUI.js b/chrome/content/preferences/overlay/overlaySanitizeUI.js
index 3c0eda8..71eda5b 100644
--- a/chrome/content/preferences/overlay/overlaySanitizeUI.js
+++ b/chrome/content/preferences/overlay/overlaySanitizeUI.js
@@ -2,7 +2,7 @@
"use strict";
Tabmix.setSanitizer = {
- init: function() {
+ init() {
this.isPromptDialog = typeof window.gSanitizePromptDialog == "object";
let dialog = document.getElementById("SanitizeDialog");
["_label", "_accesskey", "_confirm"].forEach(att => {
@@ -19,12 +19,12 @@ Tabmix.setSanitizer = {
}
},
- addSanitizeItem: function() {
+ addSanitizeItem() {
if (typeof Sanitizer != 'function')
return;
// Sanitizer will execute this
Sanitizer.prototype.items['extensions-tabmix'] = {
- clear: function() {
+ clear() {
try {
let win = Tabmix.getTopWin();
win.Tabmix.Sanitizer.sanitize();
@@ -41,7 +41,7 @@ Tabmix.setSanitizer = {
};
},
- addMenuItem: function() {
+ addMenuItem() {
var prefs = document.getElementsByTagName("preferences")[0];
var _item;
var itemList = document.getElementById("itemList");
@@ -98,7 +98,7 @@ Tabmix.setSanitizer = {
},
checked: false,
- disableMenuItem: function() {
+ disableMenuItem() {
let disabled = gSanitizePromptDialog.selectedTimespan !== Sanitizer.TIMESPAN_EVERYTHING;
let checkbox = document.getElementById("extensions-tabmix");
checkbox.setAttribute("disabled", disabled);
@@ -109,7 +109,7 @@ Tabmix.setSanitizer = {
}
},
- confirm: function(aCheckbox) {
+ confirm(aCheckbox) {
if (!aCheckbox.checked)
return;
diff --git a/chrome/content/preferences/overlay/preferencesOverlay.js b/chrome/content/preferences/overlay/preferencesOverlay.js
index 8f30ae2..6b878a7 100644
--- a/chrome/content/preferences/overlay/preferencesOverlay.js
+++ b/chrome/content/preferences/overlay/preferencesOverlay.js
@@ -4,7 +4,7 @@
Components.utils.import("resource://tabmixplus/TabmixSvc.jsm");
var gTabMix_preferencesOverlay = {
- id: function(id) {
+ id(id) {
return document.getElementById(id);
},
@@ -42,7 +42,7 @@ var gTabMix_preferencesOverlay = {
},
/* ........ paneTabs .............. */
- initPaneTabsOptions: function() {
+ initPaneTabsOptions() {
this.id("_hideTabbar").value = this.id("extensions.tabmix.hideTabbar").value;
this.id("generalWindowOpen").value = this.id("browser.link.open_newwindow").value;
this.id("warnCloseMultiple").checked = this.id("extensions.tabmix.tabs.warnOnClose").value;
@@ -51,7 +51,7 @@ var gTabMix_preferencesOverlay = {
this.setSingleWindowUI();
},
- setSingleWindowUI: function() {
+ setSingleWindowUI() {
var val = TabmixSvc.prefBranch.getBoolPref("singleWindow");
let item = this.id("linkTargetWindow");
item.disabled = val;
@@ -61,7 +61,7 @@ var gTabMix_preferencesOverlay = {
item.removeAttribute("style");
},
- showTabmixOptions: function(panel) {
+ showTabmixOptions(panel) {
var windowMediator = Services.wm;
var browserWindow = windowMediator.getMostRecentWindow('navigator:browser');
@@ -78,7 +78,7 @@ var gTabMix_preferencesOverlay = {
},
/* ........ paneMain .............. */
- initMainPane: function() {
+ initMainPane() {
var menuList = this.id("browserStartupPage");
var hBox = menuList.parentNode;
menuList.parentNode.id = "whenBrowserStartBox";
@@ -86,7 +86,7 @@ var gTabMix_preferencesOverlay = {
this.onStartupPrefChanged();
},
- onStartupPrefChanged: function() {
+ onStartupPrefChanged() {
var tabmixSession = this.id('tabmix.sm').value || this.id('tabmix.cr').value;
if (tabmixSession)
this.id("whenBrowserStartBox").setAttribute("tabmixSession", true);
diff --git a/chrome/content/preferences/preferences.js b/chrome/content/preferences/preferences.js
index 903a393..606808f 100644
--- a/chrome/content/preferences/preferences.js
+++ b/chrome/content/preferences/preferences.js
@@ -11,7 +11,7 @@ this.$ = id => document.getElementById(id);
var gPrefWindow = {
widthChanged: false,
_initialized: false,
- init: function() {
+ init() {
this._initialized = true;
var prefWindow = $("TabMIxPreferences");
@@ -62,7 +62,7 @@ var gPrefWindow = {
$("syncPrefs").setAttribute("checked", Tabmix.prefs.getBoolPref("syncPrefs"));
},
- initPane: function(aPaneID) {
+ initPane(aPaneID) {
this.initBroadcasters(aPaneID);
// let _selectPane method set width for first prefpane
if (!this._initialized) {
@@ -81,7 +81,7 @@ var gPrefWindow = {
window.innerWidth += diff;
},
- deinit: function() {
+ deinit() {
window.removeEventListener("change", this, false);
window.removeEventListener("beforeaccept", this, false);
delete Tabmix.getTopWin().tabmix_setSession;
@@ -89,7 +89,7 @@ var gPrefWindow = {
window.gIncompatiblePane.deinit();
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
switch (aEvent.type) {
case "change":
if (aEvent.target.localName != "preference")
@@ -111,7 +111,7 @@ var gPrefWindow = {
},
changes: [],
- resetChanges: function() {
+ resetChanges() {
// remove all pending changes
if (!this.instantApply || this.widthChanged) {
if (this.widthChanged)
@@ -126,7 +126,7 @@ var gPrefWindow = {
}
},
- updateApplyButton: function(aEvent) {
+ updateApplyButton(aEvent) {
var item = aEvent.target;
if (item.localName != "preference")
return;
@@ -139,7 +139,7 @@ var gPrefWindow = {
this.setButtons(!this.changes.length);
},
- onApply: function() {
+ onApply() {
this.setButtons(true);
if (this.widthChanged)
gAppearancePane.changeTabsWidth();
@@ -161,7 +161,7 @@ var gPrefWindow = {
Services.prefs.savePrefFile(null);
},
- setButtons: function(disable) {
+ setButtons(disable) {
var docElt = document.documentElement;
// when in instantApply mode apply and accept buttons are hidden except when user
// change min/max width value
@@ -176,7 +176,7 @@ var gPrefWindow = {
cancelButton.setAttribute("icon", action);
},
- removeChild: function(id) {
+ removeChild(id) {
let child = $(id);
// override preferences getter before we remove the preference
if (child.localName == "preference")
@@ -184,7 +184,7 @@ var gPrefWindow = {
child.parentNode.removeChild(child);
},
- initBroadcasters: function(paneID) {
+ initBroadcasters(paneID) {
var broadcasters = $(paneID + ":Broadcaster");
if (!broadcasters)
return;
@@ -195,7 +195,7 @@ var gPrefWindow = {
}
},
- updateBroadcaster: function(aPreference, aBroadcaster) {
+ updateBroadcaster(aPreference, aBroadcaster) {
if (aPreference.type != "bool" && !aPreference.hasAttribute("notChecked"))
return;
let broadcaster = aBroadcaster ||
@@ -207,7 +207,7 @@ var gPrefWindow = {
}
},
- setDisabled: function(itemOrId, val) {
+ setDisabled(itemOrId, val) {
var item = typeof (itemOrId) == "string" ? $(itemOrId) : itemOrId;
if (!item)
return;
@@ -217,7 +217,7 @@ var gPrefWindow = {
Tabmix.setItem(item, "disabled", val || null);
},
- tabSelectionChanged: function(event) {
+ tabSelectionChanged(event) {
var tabs = event.target;
if (tabs.localName != "tabs" || !tabs.hasAttribute("onselect"))
return;
@@ -236,7 +236,7 @@ var gPrefWindow = {
}
},
- afterShortcutsChanged: function() {
+ afterShortcutsChanged() {
Shortcuts.prefsChangedByTabmix = false;
if (typeof gMenuPane == "object" &&
$("pref_shortcuts").value != $("shortcut-group").value)
@@ -245,12 +245,12 @@ var gPrefWindow = {
// syncfrompreference and synctopreference are for checkbox preference
// controlled by int preference
- syncfrompreference: function(item) {
+ syncfrompreference(item) {
let preference = $(item.getAttribute("preference"));
return preference.value != parseInt(preference.getAttribute("notChecked"));
},
- synctopreference: function(item, checkedVal) {
+ synctopreference(item, checkedVal) {
let preference = $(item.getAttribute("preference"));
let control = $(item.getAttribute("control"));
let notChecked = parseInt(preference.getAttribute("notChecked"));
@@ -558,19 +558,19 @@ function openHelp(helpTopic) {
window.gIncompatiblePane = {
lastSelected: "paneLinks",
- init: function(docElt) {
+ init(docElt) {
this.paneButton = document.getAnonymousElementByAttribute(docElt, "pane", "paneIncompatible");
let radioGroup = this.paneButton.parentNode;
radioGroup.addEventListener("command", this, false);
this.checkForIncompatible(false);
},
- deinit: function() {
+ deinit() {
let radioGroup = this.paneButton.parentNode;
radioGroup.removeEventListener("command", this, false);
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
if (aEvent.type != "command")
return;
let prefWindow = document.documentElement;
@@ -578,14 +578,14 @@ window.gIncompatiblePane = {
this.lastSelected = prefWindow.lastSelected;
},
- checkForIncompatible: function(aShowList) {
+ checkForIncompatible(aShowList) {
let tmp = {};
Components.utils.import("resource://tabmixplus/extensions/CompatibilityCheck.jsm", tmp);
tmp = new tmp.CompatibilityCheck(window, aShowList, true);
},
// call back function from CompatibilityCheck.jsm
- hide_IncompatibleNotice: function(aHide, aFocus) {
+ hide_IncompatibleNotice(aHide, aFocus) {
if (this.paneButton.collapsed != aHide) {
this.paneButton.collapsed = aHide;
$("paneIncompatible").collapsed = aHide;
diff --git a/chrome/content/preferences/session.js b/chrome/content/preferences/session.js
index 015421d..4166302 100644
--- a/chrome/content/preferences/session.js
+++ b/chrome/content/preferences/session.js
@@ -4,7 +4,7 @@
var gSessionPane = {
gSessionManager: null,
- init: function() {
+ init() {
if (TabmixSvc.isLinux)
$("sessionManager-panels").setAttribute("linux", "true");
@@ -17,12 +17,12 @@ var gSessionPane = {
gPrefWindow.initPane("paneSession");
},
- updateSessionShortcuts: function() {
+ updateSessionShortcuts() {
if (typeof gMenuPane == "object")
gMenuPane.updateSessionShortcuts();
},
- isSessionStoreEnabled: function(onStart) {
+ isSessionStoreEnabled(onStart) {
if (this.gSessionManager)
return;
@@ -36,7 +36,7 @@ var gSessionPane = {
$("session").selectedIndex = 0;
},
- setSessionsOptions: function(item) {
+ setSessionsOptions(item) {
let instantApply = document.documentElement.instantApply;
var useSessionManager = !item.checked;
$("sessionsPanel").setAttribute("manager", useSessionManager ? "tabmix" : "firefox");
@@ -85,7 +85,7 @@ var gSessionPane = {
gPrefWindow.setButtons(!gPrefWindow.changes.length);
},
- setSessionpath: function(val) {
+ setSessionpath(val) {
var menuItem = $("onStart.popup").getElementsByAttribute("value", val)[0];
$("pref_sessionpath").value = menuItem.getAttribute("session");
},
@@ -101,7 +101,7 @@ var gSessionPane = {
return sm && sm.gSessionManager || sm;
},
- setVisibleContent: function(sessionManagerInstalled, onStart) {
+ setVisibleContent(sessionManagerInstalled, onStart) {
if (typeof sessionManagerInstalled != "boolean")
return;
@@ -120,11 +120,11 @@ var gSessionPane = {
}
},
- sessionManagerOptions: function() {
+ sessionManagerOptions() {
this.sessionManagerAddon.openOptions();
},
- convertSession: function() {
+ convertSession() {
var browserWindow = Tabmix.getTopWin();
if ($("chooseFile").selectedItem.value == "0")
browserWindow.TabmixConvertSession.selectFile(window);
diff --git a/chrome/content/preferences/subdialogs/pref-appearance.js b/chrome/content/preferences/subdialogs/pref-appearance.js
index 2e22f59..3d10d83 100644
--- a/chrome/content/preferences/subdialogs/pref-appearance.js
+++ b/chrome/content/preferences/subdialogs/pref-appearance.js
@@ -5,7 +5,7 @@ var $ = id => document.getElementById(id);
var tabstyles = {
pref: "appearance_tab",
- init: function() {
+ init() {
$("stylestabs").selectedIndex = Tabmix.prefs.prefHasUserValue(this.pref) ?
Tabmix.prefs.getIntPref(this.pref) : 0;
@@ -22,13 +22,13 @@ var tabstyles = {
extra.classList.add("text-link");
},
- save: function() {
+ save() {
Tabmix.prefs.setIntPref(this.pref, $("stylestabs").selectedIndex);
// store the pref immediately
Services.prefs.savePrefFile(null);
},
- cancel: function() {
+ cancel() {
let panels = $("stylespanels").childNodes;
for (let panel of panels) {
$(panel.id)._ondialogcancel();
@@ -36,7 +36,7 @@ var tabstyles = {
this.save();
},
- openHelp: function() {
+ openHelp() {
var win = window.opener || Tabmix.getTopWin();
if (win)
win.openHelp("display-tab#customize_styles");
@@ -44,7 +44,7 @@ var tabstyles = {
document.documentElement.getButton("help").disabled = true;
},
- toggleRGB_visibility: function() {
+ toggleRGB_visibility() {
let doc = document.documentElement;
let extra = doc.getButton("extra2");
let item = $("hide-RGB");
diff --git a/chrome/content/scripts/content.js b/chrome/content/scripts/content.js
index bcd7ce0..0b40997 100644
--- a/chrome/content/scripts/content.js
+++ b/chrome/content/scripts/content.js
@@ -53,7 +53,7 @@ var TabmixContentHandler = {
"Tabmix:collectOpener",
],
- init: function() {
+ init() {
this.MESSAGES.forEach(m => addMessageListener(m, this));
if (PROCESS_TYPE_CONTENT) {
@@ -61,7 +61,7 @@ var TabmixContentHandler = {
}
},
- receiveMessage: function({name, data}) {
+ receiveMessage({name, data}) {
// The docShell might be gone. Don't process messages,
// that will just lead to errors anyway.
if (!docShell) {
@@ -79,7 +79,7 @@ var TabmixContentHandler = {
}
case "Tabmix:collectPermissions": {
let caps = DocShellCapabilities.collect(docShell).join(",");
- sendSyncMessage("Tabmix:collectPermissionsComplete", {caps: caps});
+ sendSyncMessage("Tabmix:collectPermissionsComplete", {caps});
break;
}
case "Tabmix:resetContentName": {
@@ -91,7 +91,7 @@ var TabmixContentHandler = {
// workaround for bug 1081891
let title = content.document.title;
if (title)
- sendAsyncMessage("DOMTitleChanged", {title: title});
+ sendAsyncMessage("DOMTitleChanged", {title});
break;
}
case "Tabmix:updateHistoryTitle": {
@@ -104,7 +104,7 @@ var TabmixContentHandler = {
scrollX: content.scrollX,
scrollY: content.scrollY
};
- sendAsyncMessage("Tabmix:updateScrollPosition", {scroll: scroll});
+ sendAsyncMessage("Tabmix:updateScrollPosition", {scroll});
break;
}
case "Tabmix:setScrollPosition": {
@@ -136,7 +136,7 @@ var TabmixContentHandler = {
}
case "Tabmix:isFrameInContent": {
let result = LinkNodeUtils.isFrameInContent(content, data.href, data.name);
- sendAsyncMessage("Tabmix:isFrameInContentResult", {result: result, epoch: data.epoch});
+ sendAsyncMessage("Tabmix:isFrameInContentResult", {result, epoch: data.epoch});
break;
}
case "Tabmix:collectOpener": {
@@ -146,11 +146,11 @@ var TabmixContentHandler = {
}
},
- getCapabilities: function() {
+ getCapabilities() {
return DocShellCapabilities.collect(docShell).join(",") || "";
},
- onDrop: function(event) {
+ onDrop(event) {
let links;
const linkName = { };
const linkHandler = Cc["@mozilla.org/content/dropped-link-handler;1"]
@@ -162,7 +162,7 @@ var TabmixContentHandler = {
// we can not send a message with array of wrapped nsIDroppedLinkItem
links = links.map(link => {
const {url, name, type} = link;
- return {url: url, name: name, type: type};
+ return {url, name, type};
});
} else {
links = [{url: linkHandler.dropLink(event, linkName, true)}];
@@ -178,7 +178,7 @@ var TabmixContentHandler = {
shiftKey: event.shiftKey,
altKey: event.altKey
},
- links: links,
+ links,
name: linkName.value
};
let result = sendSyncMessage("Tabmix:contentDrop", data);
@@ -196,7 +196,7 @@ TabmixClickEventHandler = {
}
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "click":
this.contentAreaClick(event);
@@ -204,7 +204,7 @@ TabmixClickEventHandler = {
}
},
- contentAreaClick: function(event) {
+ contentAreaClick(event) {
// tabmix_isMultiProcessBrowser is undefined for remote browser when
// window.gMultiProcessBrowser is true
if (!event.isTrusted || event.defaultPrevented || event.button == 2 ||
@@ -246,7 +246,7 @@ TabmixClickEventHandler = {
href: null,
title: null,
bookmark: false,
- referrerPolicy: referrerPolicy,
+ referrerPolicy,
originAttributes: principal ? principal.originAttributes : {},
isContentWindowPrivate: TabmixSvc.version(510) && PrivateBrowsingUtils.isContentWindowPrivate(ownerDoc.defaultView),
};
@@ -263,7 +263,7 @@ TabmixClickEventHandler = {
}
let result = sendSyncMessage("TabmixContent:Click",
- {json: json, href: href, node: linkNode});
+ {json, href, node: linkNode});
let data = result[0];
if (data.where == "default")
return;
@@ -341,7 +341,7 @@ TabmixClickEventHandler = {
* element. This includes SVG links, because callers expect |node|
* to behave like an <a> element, which SVG links (XLink) don't.
*/
- _hrefAndLinkNodeForClickEvent: function(event) {
+ _hrefAndLinkNodeForClickEvent(event) {
function isHTMLLink(aNode) {
// Be consistent with what nsContextMenu.js does.
return ((aNode instanceof content.HTMLAnchorElement && aNode.href) ||
@@ -383,7 +383,7 @@ TabmixClickEventHandler = {
};
var AboutNewTabHandler = {
- init: function(global) {
+ init(global) {
if (!TabmixSvc.version(420)) {
return;
}
@@ -405,13 +405,13 @@ var AboutNewTabHandler = {
});
},
- receiveMessage: function({name}) {
+ receiveMessage({name}) {
if (name == "Tabmix:updateTitlefrombookmark") {
this.updateTitles();
}
},
- updateTitles: function() {
+ updateTitles() {
if (content && content.gGrid) {
TabmixAboutNewTab.updateTitles(content.gGrid.cells);
}
@@ -419,13 +419,13 @@ var AboutNewTabHandler = {
};
var ContextMenuHandler = {
- init: function(global) {
+ init(global) {
Cc["@mozilla.org/eventlistenerservice;1"]
.getService(Ci.nsIEventListenerService)
.addSystemEventListener(global, "contextmenu", this.prepareContextMenu, true);
},
- prepareContextMenu: function(event) {
+ prepareContextMenu(event) {
if (event.defaultPrevented) {
return;
}
@@ -435,7 +435,7 @@ var ContextMenuHandler = {
links = ContextMenu.getSelectedLinks(content).join("\n");
}
- sendRpcMessage("Tabmix:contextmenu", {links: links});
+ sendRpcMessage("Tabmix:contextmenu", {links});
}
};
@@ -443,11 +443,11 @@ const AMO = new RegExp("https://addons.mozilla.org/.+/firefox/addon/tab-mix-plus
const BITBUCKET = "https://bitbucket.org/onemen/tabmixplus/issues?status=new&status=open";
var TabmixPageHandler = {
- init: function(global) {
+ init(global) {
global.addEventListener("DOMContentLoaded", this);
},
- handleEvent: function(event) {
+ handleEvent(event) {
const doc = content.document;
if (event.target != doc) {
return;
@@ -467,7 +467,7 @@ var TabmixPageHandler = {
},
buttonID: "tabmixplus-bug-report",
- createAMOButton: function() {
+ createAMOButton() {
const doc = content.document;
const email = doc.querySelector('ul>li>.email[href="mailto:tabmix.onemen at gmail.com"]');
if (email && !doc.getElementById(this.buttonID)) {
@@ -484,7 +484,7 @@ var TabmixPageHandler = {
},
count: 0,
- moveAMOButton: function(eventType) {
+ moveAMOButton(eventType) {
const doc = content.document;
// add-review is null on DOMContentLoaded
const addReview = doc.getElementById("add-review");
@@ -510,7 +510,7 @@ var TabmixPageHandler = {
}
},
- styleBitbucket: function() {
+ styleBitbucket() {
let createIssue = content.document.getElementById("create-issue-contextual");
if (createIssue) {
createIssue.classList.remove("aui-button-subtle");
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 541fc81..c52fa97 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -23,7 +23,7 @@ var TabmixSessionManager, TabmixSessionData;
* sanitize private data by delete the files session.rdf session.old
*/
Tabmix.Sanitizer = {
- isSanitizeTMPwithoutPrompet: function(aOnExit) {
+ isSanitizeTMPwithoutPrompet(aOnExit) {
/*
* The behavior is:
* - Tools > Clear Recent History... - Always show the UI
@@ -44,7 +44,7 @@ Tabmix.Sanitizer = {
return sanitizeTabmix;
},
- tryToSanitize: function(aOnExit) {
+ tryToSanitize(aOnExit) {
if (this.isSanitizeTMPwithoutPrompet(aOnExit)) {
this.sanitize();
return true;
@@ -104,7 +104,7 @@ Tabmix.Sanitizer = {
TabmixSvc.sm.sanitized = true;
},
- clearDisk: function(aFile) {
+ clearDisk(aFile) {
if (aFile.exists()) {
try {
aFile.remove(aFile.isDirectory());
@@ -218,7 +218,7 @@ TabmixSessionData = {
/* ............... DEPRECATED ............... */
// treeStyleTab extension look for it
- setTabProperties: function() { }
+ setTabProperties() { }
};
TabmixSessionManager = {
@@ -253,7 +253,7 @@ TabmixSessionManager = {
globalPrivateBrowsing: false,
firstNonPrivateWindow: false,
- initializePrivateStateVars: function() {
+ initializePrivateStateVars() {
this.globalPrivateBrowsing = PrivateBrowsingUtils.permanentPrivateBrowsing;
this.isPrivateWindow = this.isWindowPrivate(window);
this.firstNonPrivateWindow = TabmixSvc.sm.private && !this.isPrivateWindow;
@@ -267,7 +267,7 @@ TabmixSessionManager = {
return this.globalPrivateBrowsing || TabmixSvc.sm.private;
},
- isWindowPrivate: function(aWindow) {
+ isWindowPrivate(aWindow) {
return PrivateBrowsingUtils.isWindowPrivate(aWindow);
},
@@ -596,8 +596,8 @@ TabmixSessionManager = {
},
sessionShutDown: false,
- shutDown: function(aCanClose, aLastWindow, aSaveSession, aRemoveClosedTabs,
- aKeepClosedWindows, _flush) {
+ shutDown(aCanClose, aLastWindow, aSaveSession, aRemoveClosedTabs,
+ aKeepClosedWindows, _flush) {
if (this.sessionShutDown)
return;
if (aLastWindow && aCanClose) {
@@ -800,7 +800,7 @@ TabmixSessionManager = {
}
},
- restoreWindowArguments: function() {
+ restoreWindowArguments() {
if (this.overrideHomepage)
window.arguments[0] = this.overrideHomepage;
this.overrideHomepage = null;
@@ -839,7 +839,7 @@ TabmixSessionManager = {
},
// init common services
- initService: function() {
+ initService() {
this.RDFService = Components.classes["@mozilla.org/rdf/rdf-service;1"]
.getService(Components.interfaces.nsIRDFService);
this.CONUtils = Components.classes["@mozilla.org/rdf/container-utils;1"]
@@ -893,7 +893,7 @@ TabmixSessionManager = {
return TabmixSvc.FileUtils.getDir("ProfD", []);
},
- getAnonymousId: function() {
+ getAnonymousId() {
const kSaltTable = [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
@@ -908,14 +908,14 @@ TabmixSessionManager = {
return id;
},
- getNC: function(arc) {
+ getNC(arc) {
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));
},
- deleteNode: function(rdfNode) {
+ deleteNode(rdfNode) {
var arcOut = this.DATASource.ArcLabelsOut(rdfNode);
while (arcOut.hasMoreElements()) {
var aLabel = arcOut.getNext();
@@ -926,7 +926,7 @@ TabmixSessionManager = {
}
},
- deleteSubtree: function(labelRoot) {
+ deleteSubtree(labelRoot) {
var allElements = this.DATASource.GetAllResources();
while (allElements.hasMoreElements()) {
var aResource = allElements.getNext();
@@ -935,7 +935,7 @@ TabmixSessionManager = {
}
},
- initContainer: function(node) {
+ initContainer(node) {
try {
if (typeof (node) == "string")
node = this.RDFService.GetResource(node);
@@ -947,7 +947,7 @@ TabmixSessionManager = {
},
// return true if node is empty container or node is not container
- containerEmpty: function(node) {
+ containerEmpty(node) {
try {
if (typeof (node) == "string")
node = this.RDFService.GetResource(node);
@@ -975,14 +975,14 @@ TabmixSessionManager = {
};
},
- getValue: function(node, label, typeID, def) {
+ getValue(node, label, typeID, def) {
if (typeof (node) == "string") node = this.RDFService.GetResource(node);
label = this.getNC(label);
var rdfNode = this.DATASource.GetTarget(node, label, true);
return (rdfNode instanceof Components.interfaces[typeID]) ? rdfNode.Value : def;
},
- getLiteralValue: function(node, arc, def) {
+ getLiteralValue(node, arc, def) {
if (typeof (def) == "undefined") def = "";
return this.getValue(node, arc, "nsIRDFLiteral", def);
},
@@ -992,7 +992,7 @@ TabmixSessionManager = {
* we use this code only for the case that old escape string was left unused after
* unescape was removed.
*/
- getDecodedLiteralValue: function(node, key) {
+ getDecodedLiteralValue(node, key) {
let encodedString = node ? this.getLiteralValue(node, key) : key;
// in the past we use escape for encoding, we try first to decode with decodeURI
// only if we fail we use deprecated unescape
@@ -1018,23 +1018,23 @@ TabmixSessionManager = {
}
},
- getIntValue: function(node, arc, def) {
+ getIntValue(node, arc, def) {
if (typeof (def) == "undefined") def = 0;
return this.getValue(node, arc, "nsIRDFInt", def);
},
- getResourceValue: function(node, arc, def) {
+ getResourceValue(node, arc, def) {
if (typeof (def) == "undefined") def = null;
return this.getValue(node, arc, "nsIRDFResource", def);
},
- getResource: function(node, arc) {
+ getResource(node, arc) {
if (typeof (node) == "string") node = this.RDFService.GetResource(node);
arc = this.getNC(arc);
return this.DATASource.GetTarget(node, arc, true);
},
- nodeHasArc: function(node, arc) {
+ nodeHasArc(node, arc) {
if (typeof (node) == "string") node = this.RDFService.GetResource(node);
arc = this.getNC(arc);
return this.DATASource.hasArcOut(node, arc);
@@ -1051,21 +1051,21 @@ TabmixSessionManager = {
this.changeValue(node, arc, value);
},
- setIntLiteral: function(node, arc, value) {
+ setIntLiteral(node, arc, value) {
if (typeof (node) == "string") node = this.RDFService.GetResource(node);
arc = this.getNC(arc);
value = this.RDFService.GetIntLiteral(value);
this.changeValue(node, arc, value);
},
- setResource: function(node, arc, value) {
+ setResource(node, arc, value) {
if (typeof (node) == "string") node = this.RDFService.GetResource(node);
arc = this.getNC(arc);
if (typeof (value) == "string") value = this.RDFService.GetResource(value);
this.changeValue(node, arc, value);
},
- changeValue: function(node, arc, newValue) {
+ changeValue(node, arc, newValue) {
if (this.DATASource.hasArcOut(node, arc)) {
var oldValue = this.DATASource.GetTarget(node, arc, true);
if (newValue != oldValue) this.DATASource.Change(node, arc, oldValue, newValue);
@@ -1073,7 +1073,7 @@ TabmixSessionManager = {
},
// use it only to remove node with literal value
- removeAttribute: function(node, arc) {
+ removeAttribute(node, arc) {
if (typeof (node) == "string") node = this.RDFService.GetResource(node);
if (this.nodeHasArc(node, arc)) {
var value = this.getLiteralValue(node, arc);
@@ -1115,7 +1115,7 @@ TabmixSessionManager = {
throw Components.results.NS_NOINTERFACE;
},
- closeProtectedTabs: function() {
+ closeProtectedTabs() {
var protectedTabs = gBrowser.tabContainer.getElementsByAttribute("protected", true);
for (var i = protectedTabs.length - 1; i >= 0; i--) {
var tab = protectedTabs[i];
@@ -1259,7 +1259,7 @@ TabmixSessionManager = {
}
},
- promptReplaceStartup: function(caller, path) {
+ promptReplaceStartup(caller, path) {
var loadsession = this.prefBranch.getIntPref("onStart.loadsession");
var sessionpath = this.prefBranch.getCharPref("onStart.sessionpath");
var result = {button: Tabmix.NO_NEED_TO_REPLACE};
@@ -1359,7 +1359,7 @@ TabmixSessionManager = {
}
},
- copyNode: function(oldNode, newNode, oldRoot, newRoot) {
+ copyNode(oldNode, newNode, oldRoot, newRoot) {
var newTarget;
var arcOut = this.DATASource.ArcLabelsOut(oldNode);
while (arcOut.hasMoreElements()) {
@@ -1375,7 +1375,7 @@ TabmixSessionManager = {
}
},
- copySubtree: function(oldRoot, newRoot) {
+ copySubtree(oldRoot, newRoot) {
var allElements = this.DATASource.GetAllResources();
while (allElements.hasMoreElements()) {
var aResource = allElements.getNext();
@@ -1386,7 +1386,7 @@ TabmixSessionManager = {
}
},
- replaceStartupPref: function(result, newPath) {
+ replaceStartupPref(result, newPath) {
var sessionpath = !newPath ? "--" : this.prefBranch.getCharPref("onStart.sessionpath");
this.prefBranch.setIntPref("onStart.loadsession", result.value);
if (result.value > -1) {
@@ -1396,7 +1396,7 @@ TabmixSessionManager = {
Services.prefs.savePrefFile(null); // store the pref immediately
},
- sessionUtil: function(action, what, sessionPath) {
+ sessionUtil(action, what, sessionPath) {
// action = save , replace
// type = thiswindow , allwindows
if (Tabmix.isSingleBrowserWindow)
@@ -1430,7 +1430,7 @@ TabmixSessionManager = {
else Tabmix.log("Error in " + action + " " + what);
},
- isValidtoSave: function() {
+ isValidtoSave() {
if (!this.enableManager) return false;
if (!this.isWindowValidtoSave()) {
var title = TabmixSvc.getSMString("sm.title");
@@ -1443,14 +1443,14 @@ TabmixSessionManager = {
return true;
},
- isWindowValidtoSave: function() {
+ isWindowValidtoSave() {
if (gBrowser.isBlankWindow())
return false;
return typeof privateTab != "object" ||
Array.prototype.some.call(gBrowser.tabs, tab => !window.privateTab.isTabPrivate(tab));
},
- saveOneOrAll: function(action, path, saveClosedTabs) {
+ saveOneOrAll(action, path, saveClosedTabs) {
if (this.isPrivateWindow)
return false;
var numTabs, numWindows;
@@ -1490,7 +1490,7 @@ TabmixSessionManager = {
return true;
},
- getSessionName: function(action, old) {
+ getSessionName(action, old) {
var showCheckbox, closedtabMsg, saveClosedTabs = this.saveClosedtabs;
if (action != "rename" && saveClosedTabs) {
closedtabMsg = TabmixSvc.getSMString("sm.saveClosedTab.chkbox.label");
@@ -1549,7 +1549,7 @@ TabmixSessionManager = {
return {win: numWindows, tab: numTabs};
},
- getNameData: function(numWindows, numTabs) {
+ getNameData(numWindows, numTabs) {
var d = new Date();
var date = [d.getFullYear(), '/', d.getMonth() < 9 ? "0" : "",
d.getMonth() + 1, '/', d.getDate() < 10 ? "0" : "", d.getDate()].join('');
@@ -1564,7 +1564,7 @@ TabmixSessionManager = {
return ", (" + numWindows + " " + W + ", " + numTabs + " " + T + ") (" + date + " " + time + ")";
},
- updateSessionMenu: function(menu) {
+ updateSessionMenu(menu) {
var triggerNode = menu.triggerNode;
if (typeof (triggerNode.session) == "undefined")
return false;
@@ -1628,7 +1628,7 @@ TabmixSessionManager = {
return true;
},
- restoreSession: function(node, overwriteWindows) {
+ restoreSession(node, overwriteWindows) {
if (!this.enableManager)
return;
// call restoreSession after delay to let the popup menu time to hide
@@ -1637,7 +1637,7 @@ TabmixSessionManager = {
}, 0);
},
- delayRestoreSession: function(node, overwriteWindows) {
+ delayRestoreSession(node, overwriteWindows) {
var path = node.session;
var command = node.command;
if (command == "loadSession")
@@ -1646,7 +1646,7 @@ TabmixSessionManager = {
this.openclosedwindow(path, overwriteWindows);
},
- setSessionAsStartup: function(popup) {
+ setSessionAsStartup(popup) {
if (popup.getAttribute("checked")) {
let node = popup.parentNode.triggerNode;
var aValue = node.getAttribute("value"); // -1, -2 for for closed session, 1, 2.... for saved session
@@ -1662,7 +1662,7 @@ TabmixSessionManager = {
}
},
- setShowNameExt: function(contextMenu) {
+ setShowNameExt(contextMenu) {
this.prefBranch.setBoolPref("menu.showext", !this.prefBranch.getBoolPref("menu.showext"));
Services.prefs.savePrefFile(null); // store the pref immediately
if (contextMenu) {
@@ -1680,7 +1680,7 @@ TabmixSessionManager = {
}
},
- bookmarkSession: function(node) {
+ bookmarkSession(node) {
if (!Tabmix.isVersion(450) || Tabmix.isVersion(520)) {
return;
}
@@ -1713,7 +1713,7 @@ TabmixSessionManager = {
}
},
- saveGuid: function(promise, oldGuid) {
+ saveGuid(promise, oldGuid) {
promise.then(({guid}) => {
if (oldGuid != guid) {
this.setLiteral("rdf:backupSessionWithGroups", "guid", guid);
@@ -1722,7 +1722,7 @@ TabmixSessionManager = {
});
},
- removeFromMenu: function(event, popup, root) {
+ removeFromMenu(event, popup, root) {
if (!Tabmix.prefs.getBoolPref("middleclickDelete")) return;
if (event.button == 1 && ("session" in event.target)) {
this.removeSavedSession(event.target);
@@ -1731,7 +1731,7 @@ TabmixSessionManager = {
}
},
- removeSavedSession: function(aMenuItem, aRemoveSession) {
+ removeSavedSession(aMenuItem, aRemoveSession) {
var node = aMenuItem.parentNode.parentNode;
var path = aMenuItem.session;
if (aRemoveSession || node.hasAttribute("sessionmanager-menu")) {
@@ -1808,7 +1808,7 @@ TabmixSessionManager = {
}
},
- removeAllClosedWindows: function() {
+ removeAllClosedWindows() {
var currentSession = this.gSessionPath[0];
if (!this.containerEmpty(currentSession)) {
let sessionContainer = this.initContainer(currentSession);
@@ -1829,7 +1829,7 @@ TabmixSessionManager = {
if (!container.GetCount()) this.deleteNode(rdfNode);
},
- deleteWithProp: function(container, prop, value) {
+ deleteWithProp(container, prop, value) {
var containerEnum = container.GetElements();
var nodeToDelete = [];
var noProp = typeof (prop) == "undefined";
@@ -1843,7 +1843,7 @@ TabmixSessionManager = {
this.deleteArrayNodes(container, nodeToDelete, true);
},
- deleteArrayNodes: function(container, nodeToDelete, deleteSubTree) {
+ deleteArrayNodes(container, nodeToDelete, deleteSubTree) {
for (var i = 0; i < nodeToDelete.length; i++) {
var nodeValue = nodeToDelete[i].QueryInterface(Ci.nsIRDFResource).Value;
if (deleteSubTree) this.deleteSubtree(nodeValue);
@@ -1851,7 +1851,7 @@ TabmixSessionManager = {
}
},
- destroyMenuItems: function(menu, aRemoveAllItems) {
+ destroyMenuItems(menu, aRemoveAllItems) {
// Destroy the items.
var destroy = aRemoveAllItems || false, endSeparator;
for (var i = 0; i < menu.childNodes.length; i++) {
@@ -1880,7 +1880,7 @@ TabmixSessionManager = {
this.createMenu(popup_menu, this._rdfRoot + '/windows');
},
- createMenuForDialog: function(popup, contents) {
+ createMenuForDialog(popup, contents) {
if (contents == Tabmix.SHOW_CLOSED_WINDOW_LIST) {
// create closed window list popup menu
this.createMenu(popup, window.opener.this.gSessionPath[0], contents);
@@ -1898,7 +1898,7 @@ TabmixSessionManager = {
}
},
- updateMenuPopupContent: function(popupMenu) {
+ updateMenuPopupContent(popupMenu) {
const update = popup => {
if (!popup.parentNode.open) {
return;
@@ -2070,7 +2070,7 @@ TabmixSessionManager = {
},
// set defaultIndex, sessionIndex and default Attribute
- setDefaultIndex: function(popup, loadsession, sessionpath) {
+ setDefaultIndex(popup, loadsession, sessionpath) {
popup.parentNode.defaultIndex = -1; // index with menuseparator
popup.parentNode.sessionIndex = -1; // index without menuseparator
var i, item, value, checked;
@@ -2090,7 +2090,7 @@ TabmixSessionManager = {
},
// update disable/enable to closed window list in tool menu and toolbar
- updateClosedWindowsMenu: function(action) {
+ updateClosedWindowsMenu(action) {
var disabled = (action == "check") ? this.isClosedWindowsEmpty() : action;
var wnd, enumerator = Tabmix.windowEnumerator();
while (enumerator.hasMoreElements()) {
@@ -2438,7 +2438,7 @@ TabmixSessionManager = {
},
// Add delay when calling prompt on startup
- promptService: function(intParam, strParam, aWindow, aCallBack) {
+ promptService(intParam, strParam, aWindow, aCallBack) {
setTimeout(() => {
Tabmix.promptService(intParam, strParam, aWindow, aCallBack);
}, 0);
@@ -2448,7 +2448,7 @@ TabmixSessionManager = {
* user wants to restore only pinned tabs
* use SessionStore functions to prepare and restore
*/
- deferredRestore: function(afterCrash) {
+ deferredRestore(afterCrash) {
if (!this.prefBranch.getBoolPref("onStart.restorePinned"))
return;
@@ -2477,7 +2477,7 @@ TabmixSessionManager = {
* move all tabs & closed tabs into one window
* (original code by Session Manager extension)
*/
- mergeWindows: function(state) {
+ mergeWindows(state) {
if (state.windows.length < 2)
return;
// take off first window
@@ -2498,7 +2498,7 @@ TabmixSessionManager = {
state.windows = [win];
},
- _sendRestoreCompletedNotifications: function(waitForCallBack) {
+ _sendRestoreCompletedNotifications(waitForCallBack) {
// notify observers things are complete.
// we send sessionstore-windows-restored notification as soon as _init
// function finished, if there are pending call back from one of our
@@ -2742,7 +2742,7 @@ TabmixSessionManager = {
this.saveStateDelayed();
},
- updateTabPos: function(aTab, label, add0_1) {
+ updateTabPos(aTab, label, add0_1) {
var tab, node;
if (!add0_1) add0_1 = 0;
for (var i = aTab._tPos + add0_1; i < gBrowser.tabs.length; i++) {
@@ -2820,7 +2820,7 @@ TabmixSessionManager = {
this.saveStateDelayed();
},
- setTabsScroll: function() {
+ setTabsScroll() {
if (this.prefBranch.getBoolPref("save.scrollposition"))
for (var i = 0; i < gBrowser.tabs.length; i++)
this.tabScrolled(gBrowser.tabs[i]);
@@ -2839,12 +2839,12 @@ TabmixSessionManager = {
this.updateScrollPosition(aTab, aBrowser.contentWindow);
},
- updateScrollPosition: function(tab, scroll) {
+ updateScrollPosition(tab, scroll) {
if (scroll)
this.setLiteral(this.getNodeForTab(tab), "scroll", scroll.scrollX + "," + scroll.scrollY);
},
- tabSelected: function(needFlush) {
+ tabSelected(needFlush) {
if (!this.enableBackup || this.windowClosed)
return;
let tab = gBrowser.mCurrentTab;
@@ -2860,7 +2860,7 @@ TabmixSessionManager = {
this.saveStateDelayed();
},
- getTabPosition: function() { // calc selected tab position if blank tab not restore
+ getTabPosition() { // calc selected tab position if blank tab not restore
if (gBrowser.isBlankTab(gBrowser.mCurrentTab)) return 0; // if the current tab is blank we don't restore the index
var blankTab = 0;
for (var i = 0; i < gBrowser.mCurrentTab._tPos; i++) {
@@ -2869,15 +2869,15 @@ TabmixSessionManager = {
return gBrowser.mCurrentTab._tPos - blankTab;
},
- getNodeForTab: function(aTab) {
+ getNodeForTab(aTab) {
return this.gThisWinTabs + "/" + aTab.linkedPanel;
},
- isTabPrivate: function(aTab) {
+ isTabPrivate(aTab) {
return typeof privateTab == "object" && window.privateTab.isTabPrivate(aTab);
},
- privateTabChanged: function(aEvent) {
+ privateTabChanged(aEvent) {
if (!this.enableBackup || this.windowClosed || typeof privateTab != "object")
return;
@@ -2977,7 +2977,7 @@ TabmixSessionManager = {
* @return object containing history entries, current history index and
* current history scroll position
*/
- serializeHistory: function(state) {
+ serializeHistory(state) {
if (!state)
return null;
// Ensure sure that all entries have url
@@ -3017,7 +3017,7 @@ TabmixSessionManager = {
// insert the separator to history so we can extract it in
// TabmixConvertSession.getHistoryState
history: separator + "|-|" + encodeURI(history.join(separator)),
- index: index,
+ index,
scroll: currentScroll
};
},
@@ -3037,7 +3037,7 @@ TabmixSessionManager = {
TabmixSvc.ss.restoreLastSession();
},
- setLastSession: function(restoring) {
+ setLastSession(restoring) {
let state = TabmixConvertSession.getSessionState(this.gSessionPath[1]);
TabmixSvc.sm.lastSessionPath = this.gSessionPath[1];
@@ -3392,8 +3392,8 @@ TabmixSessionManager = {
let forceNotRemote = !data.pinned;
tab = gBrowser.addTab("about:blank", {
skipAnimation: true,
- forceNotRemote: forceNotRemote,
- userContextId: userContextId,
+ forceNotRemote,
+ userContextId,
});
gBrowser.removeTab(tabToRemove);
gBrowser.moveTabTo(tab, newIndex + t);
@@ -3547,7 +3547,7 @@ TabmixSessionManager = {
}
},
- updateSelected: function(newIndex, removeAttribute) {
+ updateSelected(newIndex, removeAttribute) {
let oldIndex = gBrowser.tabContainer.selectedIndex;
if (newIndex != oldIndex) {
let tabs = gBrowser.tabs;
@@ -3559,7 +3559,7 @@ TabmixSessionManager = {
}
},
- setStripVisibility: function(tabCount) {
+ setStripVisibility(tabCount) {
// un-hide the tab bar
if (tabCount > 1 && Tabmix.prefs.getIntPref("hideTabbar") != 2 &&
!gBrowser.tabContainer.visible) {
@@ -3567,7 +3567,7 @@ TabmixSessionManager = {
}
},
- copyClosedTabsToSessionStore: function(winData, aOverwrite) {
+ copyClosedTabsToSessionStore(winData, aOverwrite) {
if (!this.saveClosedtabs)
return;
this.copyClosedTabsToRDF(this.gThisWin);
@@ -3638,7 +3638,7 @@ TabmixSessionManager = {
return data;
},
- deleteAllClosedtabs: function(sessionContainer) { // delete all closed tabs in this session
+ deleteAllClosedtabs(sessionContainer) { // delete all closed tabs in this session
var windowEnum = sessionContainer.GetElements();
while (windowEnum.hasMoreElements()) {
var rdfNodeWindow = windowEnum.getNext();
@@ -3674,7 +3674,7 @@ TabmixSessionManager = {
this.saveStateDelayed();
},
- removeTab: function(aTab) {
+ removeTab(aTab) {
// add blank tab before removing last tab to prevent browser closing with last tab
// and the default replacing last tab option
if (gBrowser.tabs.length == 1)
@@ -3824,7 +3824,7 @@ TabmixSessionManager = {
return TMP_TabView.installed;
},
- notifyAboutMissingTabView: function(showNotification) {
+ notifyAboutMissingTabView(showNotification) {
// show notification when Tabview is missing and the session have hidden tabs
if (TabmixSvc.isPaleMoon) {
let hiddenTabs = gBrowser.tabs.length > gBrowser.visibleTabs.length;
@@ -3835,7 +3835,7 @@ TabmixSessionManager = {
}
},
- _beforeRestore: function(winData) {
+ _beforeRestore(winData) {
TabmixSvc.SessionStore._setWindowStateBusy(window);
if (this.tabViewInstalled || TabmixSvc.isPaleMoon) {
// save group count before we start the restore
@@ -3847,26 +3847,26 @@ TabmixSessionManager = {
},
// we override these functions when TabView exist
- _setWindowStateBusy: function(winData) {
+ _setWindowStateBusy(winData) {
this._beforeRestore(winData);
},
- _setWindowStateReady: function(aOverwriteTabs, showNotification, tabsRemoved) {
+ _setWindowStateReady(aOverwriteTabs, showNotification, tabsRemoved) {
if (Tabmix.isVersion(350)) {
TabmixSvc.SessionStore._setWindowStateReady(window);
}
this.notifyAboutMissingTabView(tabsRemoved);
},
- _saveTabviewData: function() { },
- _setTabviewTab: function() { },
+ _saveTabviewData() { },
+ _setTabviewTab() { },
groupUpdates: {},
_tabviewData: {},
/* ............... DEPRECATED ............... */
// treeStyleTab extension look for it
- loadOneTab: function() { }
+ loadOneTab() { }
};
/**
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index 3e493b2..55dfd68 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -35,13 +35,13 @@ var TMP_SessionStore = {
return aData.entries[activeIndex] || {};
},
- getTitleFromTabState: function(aTab) {
+ getTitleFromTabState(aTab) {
let tabData = TabmixSvc.JSON.parse(TabmixSvc.ss.getTabState(aTab));
return this.getActiveEntryData(tabData).title || null;
},
// check if pending tab has no history or is about:blank
- isBlankPendingTab: function(aTab) {
+ isBlankPendingTab(aTab) {
if (!aTab.hasAttribute("pending"))
return false;
let tabData = TabmixSvc.JSON.parse(TabmixSvc.ss.getTabState(aTab));
@@ -186,7 +186,7 @@ var TMP_SessionStore = {
}
},
- isSessionStoreEnabled: function() {
+ isSessionStoreEnabled() {
return Services.prefs.getIntPref("browser.startup.page") == 3 ||
Services.prefs.getBoolPref("browser.sessionstore.resume_from_crash");
},
@@ -195,7 +195,7 @@ var TMP_SessionStore = {
// we call this only one time on window load
// and store the value in Tabmix.isWindowAfterSessionRestore
// we call this from onContentLoaded before nsSessionStore run its onLoad
- setAfterSessionRestored: function() {
+ setAfterSessionRestored() {
let afterSessionRestore;
if (!Tabmix.isFirstWindow)
afterSessionRestore = false;
@@ -232,7 +232,7 @@ var TMP_SessionStore = {
}
},
- setSessionRestore: function(aEnable) {
+ setSessionRestore(aEnable) {
Services.prefs.setBoolPref("browser.warnOnQuit", aEnable);
Services.prefs.setBoolPref("browser.sessionstore.resume_from_crash", aEnable);
if (aEnable)
@@ -295,7 +295,7 @@ var TMP_ClosedTabs = {
},
// make btn_undoclose single-functionality or dual-functionality
- setButtonType: function(menuOnly) {
+ setButtonType(menuOnly) {
var buttonType = menuOnly ? "menu" : "menu-button";
if (this.buttonBroadcaster.getAttribute("type") != buttonType)
this.buttonBroadcaster.setAttribute("type", buttonType);
@@ -417,7 +417,7 @@ var TMP_ClosedTabs = {
return true;
},
- addMenuItem: function(popup, id, label, val, keyId) {
+ addMenuItem(popup, id, label, val, keyId) {
const m = popup.appendChild(document.createElement("menuitem"));
m.setAttribute("id", id);
m.setAttribute("label", label);
@@ -431,7 +431,7 @@ var TMP_ClosedTabs = {
return m;
},
- handleEvent: function(event) {
+ handleEvent(event) {
switch (event.type) {
case "click":
this.checkForMiddleClick(event);
@@ -442,7 +442,7 @@ var TMP_ClosedTabs = {
}
},
- restoreCommand: function(aEvent) {
+ restoreCommand(aEvent) {
const item = aEvent.originalTarget;
const index = Number(item.getAttribute("value"));
if (index == -3) {
@@ -465,7 +465,7 @@ var TMP_ClosedTabs = {
this.doCommand("restoreTab", where, aEvent.originalTarget, deleteItem);
},
- contextMenuOnPopupShowing: function(popup) {
+ contextMenuOnPopupShowing(popup) {
const val = this.keepMenuOpen ? "single" : "auto";
Array.prototype.forEach.call(popup.childNodes, item => {
item.setAttribute("closemenu", val);
@@ -473,14 +473,14 @@ var TMP_ClosedTabs = {
return popup.triggerNode.value >= 0;
},
- contextMenuOnCommand: function(event) {
+ contextMenuOnCommand(event) {
const menuItem = event.originalTarget;
const [command, where] = menuItem.getAttribute("commandData").split(",");
const popup = menuItem.parentNode;
this.doCommand(command, where, popup.triggerNode);
},
- doCommand: function(command, where, item, keepMenuOpen) {
+ doCommand(command, where, item, keepMenuOpen) {
const popup = item.parentNode;
const index = Number(item.getAttribute("value"));
this[command](where || index, index);
@@ -533,7 +533,7 @@ var TMP_ClosedTabs = {
}
},
- removeAllClosedTabs: function() {
+ removeAllClosedTabs() {
// update our session data
var updateRDF = TabmixSessionManager.enableBackup && Tabmix.prefs.getBoolPref("sessions.save.closedtabs");
if (updateRDF)
@@ -597,7 +597,7 @@ var TMP_ClosedTabs = {
}
},
- SSS_undoCloseTab: function(aIndex, aWhere, aSelectRestoredTab, aBlankTabToReuse, skipAnimation) {
+ SSS_undoCloseTab(aIndex, aWhere, aSelectRestoredTab, aBlankTabToReuse, skipAnimation) {
if (!Tabmix.prefs.getBoolPref("undoClose") || this.count === 0)
return null;
@@ -630,7 +630,7 @@ var TMP_ClosedTabs = {
gBrowser.addTab("about:blank", {
skipAnimation: tabToRemove || skipAnimation,
dontMove: true,
- userContextId: userContextId,
+ userContextId,
});
if (!reuseExisting && aBlankTabToReuse) {
gBrowser.removeTab(aBlankTabToReuse, {animate: false});
@@ -767,7 +767,7 @@ var TabmixConvertSession = {
return {
windows: _windows,
selectedWindow: _windows.indexOf(selected) + 1,
- tabsCount: tabsCount,
+ tabsCount,
};
},
@@ -874,7 +874,7 @@ var TabmixConvertSession = {
// until version 0.4.1.5 textZoom was included in scroll data
scroll = scroll.split(",").splice(0, 2).join(",");
if (scroll != "0,0") {
- tabData.scroll = {scroll: scroll};
+ tabData.scroll = {scroll};
}
}
tabData.userContextId = TabmixSessionManager.getIntValue(rdfNodeTab, "userContextId", 0);
diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index 0b77dce..1b962d5 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -255,7 +255,7 @@
<field name="tabmixPrefObserver"><![CDATA[
({
scrollbox: this,
- observe: function(subject, topic, data) {
+ observe(subject, topic, data) {
switch (data) {
case "toolkit.scrollbox.clickToScroll.scrollDelay":
this.scrollbox._scrollDelay = Services.prefs.getIntPref(data);
@@ -439,7 +439,7 @@
}
if (row == firstVisibleRow) {
let rect = tab.getBoundingClientRect();
- this.firstVisible = {tab: tab, x: rect.left, y: rect.top};
+ this.firstVisible = {tab, x: rect.left, y: rect.top};
index = ++i;
break;
}
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index 4b11be7..764e8bd 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -35,12 +35,12 @@ var TabmixTabbar = {
return this.flowing == "multibar";
},
- isButtonOnTabsToolBar: function(button) {
+ isButtonOnTabsToolBar(button) {
return button && button.parentNode == document.getElementById("TabsToolbar");
},
// get privateTab-toolbar-openNewPrivateTab, when the button is on the tabbar
- newPrivateTabButton: function() {
+ newPrivateTabButton() {
let button = document.getElementById("privateTab-toolbar-openNewPrivateTab");
return this.isButtonOnTabsToolBar(button) ? button : null;
},
@@ -166,7 +166,7 @@ var TabmixTabbar = {
}, 50, currentVisible);
},
- setShowNewTabButtonAttr: function() {
+ setShowNewTabButtonAttr() {
let newTabButton = document.getElementById("new-tab-button");
let showNewTabButton = Tabmix.prefs.getBoolPref("newTabButton") &&
this.isButtonOnTabsToolBar(newTabButton);
@@ -359,7 +359,7 @@ var TabmixTabbar = {
this.tabBarHeightModified();
},
- tabBarHeightModified: function() {
+ tabBarHeightModified() {
gTMPprefObserver.updateTabbarBottomPosition();
TMP_eventListener.updateMouseTargetRect();
@@ -541,7 +541,7 @@ var TabmixTabbar = {
Tabmix.tabsUtils.getTabRowNumber(tab2, topY);
},
- setFirstTabInRow: function() {
+ setFirstTabInRow() {
var tabBar = gBrowser.tabContainer;
// call our tabstrip function only when we are in multi-row and
// in overflow with pinned tabs
@@ -549,7 +549,7 @@ var TabmixTabbar = {
tabBar.mTabstrip.setFirstTabInRow();
},
- removeShowButtonAttr: function() {
+ removeShowButtonAttr() {
var tabBar = gBrowser.tabContainer;
if ("__showbuttonTab" in tabBar) {
tabBar.__showbuttonTab.removeAttribute("showbutton");
@@ -597,7 +597,7 @@ Tabmix.tabsUtils = {
events: ["dblclick", "click", "dragstart", "drop", "dragend", "dragexit"],
- init: function() {
+ init() {
if (!Tabmix.isVersion(470)) {
this.events.unshift("MozMouseHittest");
}
@@ -672,7 +672,7 @@ Tabmix.tabsUtils = {
Tabmix.initialization.run("beforeStartup", tabbrowser, this.tabBar);
},
- onUnload: function() {
+ onUnload() {
if (!this.initialized)
return;
TMP_eventListener.toggleEventListener(this.tabBar, this.events, false, this);
@@ -682,7 +682,7 @@ Tabmix.tabsUtils = {
this._tabmixPositionalTabs = null;
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
switch (aEvent.type) {
case "MozMouseHittest":
if (Tabmix.keyModifierDown && !document.hasFocus()) {
@@ -737,7 +737,7 @@ Tabmix.tabsUtils = {
}
},
- initializeTabmixUI: function() {
+ initializeTabmixUI() {
// https://addons.mozilla.org/EN-US/firefox/addon/vertical-tabs/
// verticalTabs 0.9.1+ is restartless.
let isVertical = Tabmix.extensions.verticalTabs;
@@ -774,7 +774,7 @@ Tabmix.tabsUtils = {
}
},
- updateVerticalTabStrip: function(aReset) {
+ updateVerticalTabStrip(aReset) {
if (Tabmix.extensions.verticalTabBar || gInPrintPreviewMode ||
this.inDOMFullscreen || FullScreen._isChromeCollapsed ||
!this.tabBar.visible && TabmixTabbar.visibleRows == 1)
@@ -845,7 +845,7 @@ Tabmix.tabsUtils = {
return multibar;
},
- setTabStripOrient: function() {
+ setTabStripOrient() {
// we can't set display:block and orient=vertical when widthFitTitle is false
// and we are in one row.
let vertical = TabmixTabbar.isMultiRow &&
@@ -860,7 +860,7 @@ Tabmix.tabsUtils = {
* in the current row. we don't want the button to be on the next row when the
* tab is on the current row
*/
- adjustNewtabButtonVisibility: function() {
+ adjustNewtabButtonVisibility() {
if (!TabmixTabbar.isMultiRow && this.tabBar.mTabstrip.orient == "vertical")
return;
@@ -983,7 +983,7 @@ Tabmix.tabsUtils = {
return val;
},
- showNewTabButtonOnSide: function(aCondition, aValue) {
+ showNewTabButtonOnSide(aCondition, aValue) {
if (this._show_newtabbutton) {
Tabmix.setItem("TabsToolbar", "tabmix-show-newtabbutton",
aCondition ? aValue : this._show_newtabbutton);
@@ -999,7 +999,7 @@ Tabmix.tabsUtils = {
return this.getTabRowNumber(Tabmix.visibleTabs.last, this.topTabY);
},
- getTabRowNumber: function(aTab, aTop) {
+ getTabRowNumber(aTab, aTop) {
var {top, height} = aTab ? aTab.getBoundingClientRect() : {};
height = aTab ? aTab.boxObject.height : 0;
if (!height) // don't panic
@@ -1022,7 +1022,7 @@ Tabmix.tabsUtils = {
return !this.tabBar.mTabstrip._scrollButtonDown.disabled;
},
- createTooltip: function(box) {
+ createTooltip(box) {
let rows = this.lastTabRowNumber;
let active = this.getTabRowNumber(gBrowser.selectedTab, this.topTabY);
let rowsStr = TabmixSvc.getString("rowsTooltip.rowscount");
@@ -1031,7 +1031,7 @@ Tabmix.tabsUtils = {
"\n" + activeStr.replace("#1", active);
},
- isSingleRow: function(visibleTabs) {
+ isSingleRow(visibleTabs) {
if (!this.tabBar.hasAttribute("multibar"))
return true;
// we get here when we are about to go to single row
@@ -1045,7 +1045,7 @@ Tabmix.tabsUtils = {
* this function is here for the case restart-less extension override our
* mTabstrip binding when Tabmix's uses its own scroll buttons
*/
- updateScrollButtons: function(useTabmixButtons) {
+ updateScrollButtons(useTabmixButtons) {
let tabstrip = this.tabBar.mTabstrip;
tabstrip._scrollButtonDown = useTabmixButtons ?
tabstrip._scrollButtonDownRight :
@@ -1066,7 +1066,7 @@ Tabmix.tabsUtils = {
}
},
- isElementVisible: function(element) {
+ isElementVisible(element) {
if (!element || !element.parentNode || element.collapsed || element.hidden)
return false;
@@ -1097,7 +1097,7 @@ Tabmix.tabsUtils = {
Tabmix.bottomToolbarUtils = {
initialized: false,
- init: function() {
+ init() {
this.updatePosition();
if (this.initialized) {
return;
@@ -1108,14 +1108,14 @@ Tabmix.bottomToolbarUtils = {
window.addEventListener("resize", this, false);
},
- onUnload: function() {
+ onUnload() {
if (!this.initialized) {
return;
}
window.removeEventListener("resize", this, false);
},
- updatePosition: function() {
+ updatePosition() {
var updateFullScreen,
tabBar = gBrowser.tabContainer;
Tabmix.setItem(tabBar.mTabstrip, "flowing", TabmixTabbar.flowing);
@@ -1150,7 +1150,7 @@ Tabmix.bottomToolbarUtils = {
}
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
switch (aEvent.type) {
case "resize": {
gTMPprefObserver.updateTabbarBottomPosition(aEvent);
@@ -1183,7 +1183,7 @@ Tabmix.visibleTabs = {
return gBrowser.selectedTab;
},
- previous: function(aTab) {
+ previous(aTab) {
var tabs = gBrowser.visibleTabs;
var index = tabs.indexOf(aTab);
if (--index > -1)
@@ -1191,7 +1191,7 @@ Tabmix.visibleTabs = {
return null;
},
- next: function(aTab) {
+ next(aTab) {
var tabs = gBrowser.visibleTabs;
var index = tabs.indexOf(aTab);
if (index > -1 && ++index < tabs.length)
@@ -1199,7 +1199,7 @@ Tabmix.visibleTabs = {
return null;
},
- indexOf: function(aTab) {
+ indexOf(aTab) {
if (aTab)
return gBrowser.visibleTabs.indexOf(aTab);
return -1;
@@ -1210,7 +1210,7 @@ Tabmix.visibleTabs = {
//
gTMPprefObserver = {
preventUpdate: false,
- init: function() {
+ init() {
Tabmix.prefs.clearUserPref("setDefault");
Tabmix.prefs.clearUserPref("PrefObserver.error");
@@ -1247,7 +1247,7 @@ gTMPprefObserver = {
"browser.ctrlTab.previews"],
// removes the observer-object from service -- called when the window is no longer open
- removeObservers: function() {
+ removeObservers() {
let prefSvc = Services.prefs;
for (var i = 0; i < this.OBSERVING.length; ++i)
prefSvc.removeObserver(this.OBSERVING[i], this);
@@ -1617,7 +1617,7 @@ gTMPprefObserver = {
}
},
- setTabbarDragging: function(allowDrag) {
+ setTabbarDragging(allowDrag) {
let TabsToolbar = document.getElementById("TabsToolbar");
TabsToolbar._dragBindingAlive = allowDrag;
Tabmix.setItem(TabsToolbar, "tabmix-disallow-drag", !allowDrag || null);
@@ -1648,7 +1648,7 @@ gTMPprefObserver = {
},
dynamicRules: {},
- insertRule: function(cssText, name) {
+ insertRule(cssText, name) {
let index = this.tabStyleSheet.insertRule(cssText,
this.tabStyleSheet.cssRules.length);
if (name)
@@ -1907,7 +1907,7 @@ gTMPprefObserver = {
}
},
- addDynamicRules: function() {
+ addDynamicRules() {
// tab width rules
let tst = Tabmix.extensions.treeStyleTab ? ":not([treestyletab-collapsed='true'])" : "";
let newRule = ".tabbrowser-tab[fadein]" + tst +
@@ -1939,14 +1939,14 @@ gTMPprefObserver = {
}
},
- updateStyleAttributes: function() {
+ updateStyleAttributes() {
let styles = ["current", "unloaded", "unread", "other"];
styles.forEach(styleName => {
this.updateStyleAttribute(styleName + "Tab", styleName);
});
},
- updateStyleAttribute: function(ruleName, styleName) {
+ updateStyleAttribute(ruleName, styleName) {
let attribValue = null;
let enabled = Tabmix.prefs.getBoolPref(ruleName);
if (enabled) {
@@ -1973,7 +1973,7 @@ gTMPprefObserver = {
return attribValue;
},
- updateTabsStyle: function(ruleName) {
+ updateTabsStyle(ruleName) {
let styleName = ruleName.replace("Tab", "");
let attName = "tabmix_" + styleName + "Style";
let currentAttrib = gBrowser.tabContainer.getAttribute(attName) || "";
@@ -2003,7 +2003,7 @@ gTMPprefObserver = {
}
},
- setProgressMeter: function() {
+ setProgressMeter() {
var showOnTabs = Tabmix.prefs.getBoolPref("progressMeter");
var attribValue = null;
if (showOnTabs)
@@ -2012,7 +2012,7 @@ gTMPprefObserver = {
TabmixProgressListener.listener.showProgressOnTab = showOnTabs;
},
- setLink_openPrefs: function() {
+ setLink_openPrefs() {
if (!Tabmix.singleWindowMode)
return;
@@ -2036,7 +2036,7 @@ gTMPprefObserver = {
// code for Single Window Mode...
// disable the "Open New Window action
// disable & hides some menuitem
- setSingleWindowUI: function() {
+ setSingleWindowUI() {
Tabmix.singleWindowMode = Tabmix.prefs.getBoolPref("singleWindow");
var newWindowButton = document.getElementById("new-window-button");
if (newWindowButton)
@@ -2071,7 +2071,7 @@ gTMPprefObserver = {
}
},
- setMenuIcons: function() {
+ setMenuIcons() {
var hideIcons = Tabmix.prefs.getBoolPref("hideIcons");
function setClass(items) {
if (hideIcons) {
@@ -2089,7 +2089,7 @@ gTMPprefObserver = {
setClass(iconicItems);
},
- setAutoHidePref: function() {
+ setAutoHidePref() {
TabmixTabbar.hideMode = Tabmix.prefs.getIntPref("hideTabbar");
gBrowser.tabContainer.updateVisibility();
},
@@ -2107,7 +2107,7 @@ gTMPprefObserver = {
}
},
- changeNewTabButtonSide: function(aPosition) {
+ changeNewTabButtonSide(aPosition) {
let $ = id => document.getElementById(id);
let newTabButton = $("new-tab-button");
if (TabmixTabbar.isButtonOnTabsToolBar(newTabButton)) {
@@ -2174,7 +2174,7 @@ gTMPprefObserver = {
}
},
- setShowNewTabButtonAttr: function(aShow, aPosition) {
+ setShowNewTabButtonAttr(aShow, aPosition) {
// check new tab button visibility when we are in multi-row and the
// preference is to show new-tab-button after last tab
Tabmix.tabsUtils.checkNewtabButtonVisibility = TabmixTabbar.isMultiRow &&
@@ -2208,7 +2208,7 @@ gTMPprefObserver = {
Tabmix.setItem("TabsToolbar", "tabmix-show-newtabbutton", attrValue);
},
- tabBarPositionChanged: function(aPosition) {
+ tabBarPositionChanged(aPosition) {
if (aPosition > 1 || (aPosition !== 0 && Tabmix.extensions.verticalTabBar)) {
Tabmix.prefs.setIntPref("tabBarPosition", 0);
return false;
@@ -2244,7 +2244,7 @@ gTMPprefObserver = {
},
// TabsOnTop removed by bug 755593
- setTabsOnTop: function(onBottom) {
+ setTabsOnTop(onBottom) {
// hide/show TabsOnTop menu & menuseparator
let toggleTabsOnTop = document.getElementsByAttribute("command", "cmd_ToggleTabsOnTop");
for (let i = 0; i < toggleTabsOnTop.length; i++) {
@@ -2308,7 +2308,7 @@ gTMPprefObserver = {
},
// Show Reload Every menu on Reload button
- showReloadEveryOnReloadButton: function() {
+ showReloadEveryOnReloadButton() {
let show = Tabmix.prefs.getBoolPref("reloadEvery.onReloadButton");
Tabmix.setItem("reload-button", "type", show ? "menu-button" : null);
Tabmix.setItem("urlbar-go-button", "context", show ? "autoreload_popup" : null);
@@ -2325,7 +2325,7 @@ gTMPprefObserver = {
},
// we replace some Tabmix settings with Firefox settings
- updateSettings: function() {
+ updateSettings() {
function getPrefByType(prefName, aDefault, aType) {
let PrefFn = {0: "", 32: "CharPref", 64: "IntPref", 128: "BoolPref"};
let fn = PrefFn[Services.prefs.getPrefType(prefName)];
@@ -2654,14 +2654,14 @@ gTMPprefObserver = {
void TabmixSvc.direct2dDisabled;
},
- updateTabClickingOptions: function() {
+ updateTabClickingOptions() {
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]);
},
- blockTabClickingOptions: function(prefName) {
+ blockTabClickingOptions(prefName) {
if (TabmixSvc.blockedClickingOptions.indexOf(Services.prefs.getIntPref(prefName)) > -1) {
if (Services.prefs.prefHasUserValue(prefName))
Services.prefs.clearUserPref(prefName);
@@ -2710,9 +2710,9 @@ TabmixProgressListener = {
}, true);
},
- onProgressChange: function(aBrowser, aWebProgress, aRequest,
- aCurSelfProgress, aMaxSelfProgress,
- aCurTotalProgress, aMaxTotalProgress) {
+ onProgressChange(aBrowser, aWebProgress, aRequest,
+ aCurSelfProgress, aMaxSelfProgress,
+ aCurTotalProgress, aMaxTotalProgress) {
if (!this.showProgressOnTab || TabmixTabbar.hideMode == 2 || !aMaxTotalProgress)
return;
var percentage = Math.ceil((aCurTotalProgress * 100) / aMaxTotalProgress);
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index e5c0eea..5f8775a 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -231,7 +231,7 @@ Tabmix.afterDelayedStartup = function() {
let buttons = [{
label: "Disable Debug Mode",
accessKey: "D",
- callback: function() {
+ callback() {
Tabmix.prefs.setBoolPref("enableDebug", false);
}
}];
@@ -304,7 +304,7 @@ var TMP_eventListener = {
}
},
- toggleEventListener: function(aObj, aArray, aEnable, aHandler) {
+ toggleEventListener(aObj, aArray, aEnable, aHandler) {
var handler = aHandler || this;
var eventListener = aEnable ? "addEventListener" : "removeEventListener";
aArray.forEach(function(eventName) {
@@ -587,7 +587,7 @@ var TMP_eventListener = {
},
tabWidthCache: new WeakMap(),
- onTabAttrModified: function(aEvent) {
+ onTabAttrModified(aEvent) {
if (!TabmixTabbar.widthFitTitle)
return;
@@ -669,7 +669,7 @@ var TMP_eventListener = {
this.updateMultiRow();
},
- showNavToolbox: function() {
+ showNavToolbox() {
this._updateMarginBottom("");
this.toggleTabbarVisibility(true);
this.updateMultiRow();
@@ -688,7 +688,7 @@ var TMP_eventListener = {
* update FullScreen._mouseTargetRect when in full screen and the tabbar is
* visible. we call this function from tabBarHeightModified and showNavToolbox
*/
- updateMouseTargetRect: function() {
+ updateMouseTargetRect() {
if (!Tabmix.isVersion(400)) {
return;
}
@@ -722,7 +722,7 @@ var TMP_eventListener = {
},
// for tabs bellow content
- toggleTabbarVisibility: function(aShow, aAnimate) {
+ toggleTabbarVisibility(aShow, aAnimate) {
let fullScrToggler = document.getElementById("fullscr-bottom-toggler");
if (TabmixTabbar.position != 1 || !fullScrToggler) {
return;
@@ -757,7 +757,7 @@ var TMP_eventListener = {
}
},
- updateMultiRow: function(aReset) {
+ updateMultiRow(aReset) {
if (aReset)
Tabmix.tabsNewtabButton = null;
if (TabmixTabbar.isMultiRow) {
@@ -944,7 +944,7 @@ var TMP_eventListener = {
TabmixSessionManager.tabSelected(true);
},
- updateDisplay: function(tab) {
+ updateDisplay(tab) {
if (!tab.hasAttribute("visited"))
tab.setAttribute("visited", true);
diff --git a/chrome/content/utils.js b/chrome/content/utils.js
index f321ca2..c7ae38e 100644
--- a/chrome/content/utils.js
+++ b/chrome/content/utils.js
@@ -11,7 +11,7 @@ var Tabmix = {
return (this.defaultPrefs = Services.prefs.getDefaultBranch("extensions.tabmix."));
},
- isVersion: function() {
+ isVersion() {
return TabmixSvc.version.apply(null, arguments);
},
@@ -22,13 +22,13 @@ var Tabmix = {
},
// Show/hide one item (specified via name or the item element itself).
- showItem: function(aItemOrId, aShow) {
+ showItem(aItemOrId, aShow) {
var item = typeof (aItemOrId) == "string" ? document.getElementById(aItemOrId) : aItemOrId;
if (item && item.hidden == Boolean(aShow))
item.hidden = !aShow;
},
- setItem: function(aItemOrId, aAttr, aVal) {
+ setItem(aItemOrId, aAttr, aVal) {
var elem = typeof (aItemOrId) == "string" ? document.getElementById(aItemOrId) : aItemOrId;
if (elem) {
if (aVal === null || aVal === undefined) {
@@ -43,7 +43,7 @@ var Tabmix = {
}
},
- setAttributeList: function(aItemOrId, aAttr, aValue, aAdd) {
+ setAttributeList(aItemOrId, aAttr, aValue, aAdd) {
let elem = typeof (aItemOrId) == "string" ? document.getElementById(aItemOrId) : aItemOrId;
let att = elem.getAttribute(aAttr);
let array = att ? att.split(" ") : [];
@@ -58,7 +58,7 @@ var Tabmix = {
elem.removeAttribute(aAttr);
},
- getTopWin: function() {
+ getTopWin() {
return Services.wm.getMostRecentWindow("navigator:browser");
},
@@ -72,7 +72,7 @@ var Tabmix = {
return this.prefs.getBoolPref("singleWindow");
},
- isNewWindowAllow: function(isPrivate) {
+ isNewWindowAllow(isPrivate) {
// allow to open new window if:
// user are not in single window mode or
// there is no other window with the same privacy type
@@ -80,7 +80,7 @@ var Tabmix = {
!this.RecentWindow.getMostRecentBrowserWindow({private: isPrivate});
},
- lazy_import: function(aObject, aName, aModule, aSymbol, aFlag, aArg) {
+ lazy_import(aObject, aName, aModule, aSymbol, aFlag, aArg) {
if (aFlag)
this[aModule + "Initialized"] = false;
var self = this;
@@ -98,13 +98,13 @@ var Tabmix = {
});
},
- backwardCompatibilityGetter: function(aObject, aOldName, aNewName) {
+ backwardCompatibilityGetter(aObject, aOldName, aNewName) {
if (aOldName in aObject)
return;
var self = this;
Object.defineProperty(aObject, aOldName, {
- get: function() {
+ get() {
self.informAboutChangeInTabmix(aOldName, aNewName);
delete aObject[aOldName];
return (aObject[aOldName] = self.getObject(window, aNewName));
@@ -113,7 +113,7 @@ var Tabmix = {
});
},
- informAboutChangeInTabmix: function(aOldName, aNewName) {
+ informAboutChangeInTabmix(aOldName, aNewName) {
let err = Error(aOldName + " is deprecated in Tabmix, use " + aNewName + " instead.");
// cut off the first lines, we looking for the function that trigger the getter.
let stack = Error().stack.split("\n").slice(3);
@@ -132,7 +132,7 @@ var Tabmix = {
}
},
- promptService: function(intParam, strParam, aWindow, aCallBack) {
+ promptService(intParam, strParam, aWindow, aCallBack) {
var dpb = Cc["@mozilla.org/embedcomp/dialogparam;1"]
.createInstance(Ci.nsIDialogParamBlock);
// intParam[0] - default button accept=0, cancel=1, extra1=2
@@ -219,7 +219,7 @@ var Tabmix = {
return item.boxObject.screenX + (end ? item.getBoundingClientRect().width : 0);
},
- show: function(aMethod, aDelay, aWindow) {
+ show(aMethod, aDelay, aWindow) {
TabmixSvc.console.show(aMethod, aDelay, aWindow || window);
},
@@ -237,12 +237,12 @@ var Tabmix = {
return null;
},
- installChangecode: function() {
+ installChangecode() {
Services.scriptloader.loadSubScript("chrome://tabmixplus/content/changecode.js", window);
this.installChangecode = function() {};
},
- _init: function() {
+ _init() {
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
diff --git a/modules/AboutNewTab.jsm b/modules/AboutNewTab.jsm
index c88128b..02e544c 100644
--- a/modules/AboutNewTab.jsm
+++ b/modules/AboutNewTab.jsm
@@ -23,15 +23,15 @@ XPCOMUtils.defineLazyModuleGetter(this, "TabmixPlacesUtils",
var AboutNewTabInternal;
this.TabmixAboutNewTab = Object.freeze({
- updateAllBrowsers: function(window) {
+ updateAllBrowsers(window) {
AboutNewTabInternal.updateAllBrowsers(window);
},
- updateBrowser: function(browser) {
+ updateBrowser(browser) {
AboutNewTabInternal.updateBrowser(browser);
},
- updateTitles: function(cells) {
+ updateTitles(cells) {
AboutNewTabInternal.updateTitles(cells);
},
});
@@ -39,7 +39,7 @@ this.TabmixAboutNewTab = Object.freeze({
AboutNewTabInternal = {
// update all opened about:newtab browsers in a window including preloaded
// browser if exist
- updateAllBrowsers: function(window) {
+ updateAllBrowsers(window) {
let tabBrowser = window.gBrowser;
let tabPanels = tabBrowser.mPanelContainer.childNodes;
let browsers = Array.prototype.map.call(tabPanels, tabPanel => tabBrowser.getBrowserForTabPanel(tabPanel))
@@ -47,7 +47,7 @@ AboutNewTabInternal = {
browsers.forEach(browser => this.updateBrowser(browser));
},
- updateBrowser: function(browser) {
+ updateBrowser(browser) {
if (TabmixSvc.version(420)) {
browser.messageManager.sendAsyncMessage("Tabmix:updateTitlefrombookmark");
} else {
@@ -60,7 +60,7 @@ AboutNewTabInternal = {
}
},
- updateTitles: function(cells = []) {
+ updateTitles(cells = []) {
cells.forEach(cell => {
let site = cell.site;
if (!site) {
diff --git a/modules/AsyncUtils.jsm b/modules/AsyncUtils.jsm
index 41c4765..8b79956 100644
--- a/modules/AsyncUtils.jsm
+++ b/modules/AsyncUtils.jsm
@@ -10,15 +10,15 @@ XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/Promise.jsm");
this.AsyncUtils = {
- spawnFn: function(thisArg, fn, index) {
+ spawnFn(thisArg, fn, index) {
return this.promisify(thisArg, fn, index)();
},
- asyncFn: function(thisArg, fn, index) {
+ asyncFn(thisArg, fn, index) {
return this.promisify(thisArg, fn, index);
},
- promisify: function(thisArg, fn, index) {
+ promisify(thisArg, fn, index) {
return function(...args) {
return new Promise((resolve, reject) => {
if (typeof index == "undefined")
diff --git a/modules/AutoReload.jsm b/modules/AutoReload.jsm
index fcc10d6..d1b8ec2 100644
--- a/modules/AutoReload.jsm
+++ b/modules/AutoReload.jsm
@@ -10,11 +10,11 @@ Cu.import("resource://tabmixplus/TabmixSvc.jsm", this);
var _setItem = function() {};
this.AutoReload = {
- init: function() {
+ init() {
_setItem = TabmixSvc.topWin().Tabmix.setItem;
},
- initTab: function(aTab) {
+ initTab(aTab) {
aTab.autoReloadEnabled = false;
aTab.removeAttribute("_reload");
aTab.autoReloadTime = TabmixSvc.prefBranch.getIntPref("reload_time");
@@ -25,7 +25,7 @@ this.AutoReload = {
/**
* Popup command
*/
- addClonePopup: function(aPopup, aTab) {
+ addClonePopup(aPopup, aTab) {
var win = aTab.ownerDocument.defaultView;
let popup = win.document.getElementById("autoreload_popup");
let parent = aPopup.parentNode;
@@ -41,7 +41,7 @@ this.AutoReload = {
aPopup.inited = true;
},
- onPopupShowing: function(aPopup, aTab) {
+ onPopupShowing(aPopup, aTab) {
var menuItems = aPopup.childNodes;
aPopup._tab = null;
if (aTab.localName != "tab")
@@ -74,7 +74,7 @@ this.AutoReload = {
}
},
- updateCustomList: function(aPopup) {
+ updateCustomList(aPopup) {
let start = aPopup.getElementsByAttribute("anonid", "start_custom_list")[0];
let end = aPopup.getElementsByAttribute("anonid", "end_custom_list")[0];
while (start.nextSibling && start.nextSibling != end)
@@ -113,7 +113,7 @@ this.AutoReload = {
});
},
- setLabel: function(aItem, aSeconds) {
+ setLabel(aItem, aSeconds) {
var timeLabel = aItem.hasAttribute("_label") ? aItem.getAttribute("_label") + " " : "";
if (aSeconds > 59) {
let minutes = parseInt(aSeconds / 60);
@@ -127,7 +127,7 @@ this.AutoReload = {
aItem.setAttribute("label", timeLabel);
},
- setTime: function(aTab, aReloadTime) {
+ setTime(aTab, aReloadTime) {
if (aTab.localName != "tab")
aTab = this._currentTab(aTab);
aTab.autoReloadTime = aReloadTime;
@@ -135,7 +135,7 @@ this.AutoReload = {
this._enable(aTab);
},
- setCustomTime: function(aTab) {
+ setCustomTime(aTab) {
if (aTab.localName != "tab")
aTab = this._currentTab(aTab);
let result = {ok: false};
@@ -147,7 +147,7 @@ this.AutoReload = {
}
},
- enableAllTabs: function(aTabBrowser) {
+ enableAllTabs(aTabBrowser) {
var tabs = aTabBrowser.visibleTabs;
for (let i = 0; i < tabs.length; i++) {
let tab = tabs[i];
@@ -159,7 +159,7 @@ this.AutoReload = {
}
},
- disableAllTabs: function(aTabBrowser) {
+ disableAllTabs(aTabBrowser) {
var tabs = aTabBrowser.visibleTabs;
for (let i = 0; i < tabs.length; i++) {
let tab = tabs[i];
@@ -171,7 +171,7 @@ this.AutoReload = {
/**
* called from popup and from tabclick options
*/
- toggle: function(aTab) {
+ toggle(aTab) {
if (aTab.localName != "tab")
aTab = this._currentTab(aTab);
if (aTab.autoReloadEnabled)
@@ -180,7 +180,7 @@ this.AutoReload = {
this._enable(aTab);
},
- _enable: function(aTab) {
+ _enable(aTab) {
var browser = aTab.linkedBrowser;
var url = browser.currentURI.spec;
if (url.match(/^about:/) || url.match(/^(http|https):\/\/mail.google.com/))
@@ -194,7 +194,7 @@ this.AutoReload = {
this._update(aTab, aTab.autoReloadURI + " " + aTab.autoReloadTime);
},
- _disable: function(aTab) {
+ _disable(aTab) {
aTab.autoReloadEnabled = false;
_setItem(aTab, "_reload", null);
aTab.autoReloadURI = null;
@@ -203,7 +203,7 @@ this.AutoReload = {
this._update(aTab);
},
- _update: function(aTab, aValue) {
+ _update(aTab, aValue) {
_setItem(aTab, "reload-data", aValue);
let win = aTab.ownerDocument.defaultView;
TabmixSvc.saveTabAttributes(aTab, "reload-data");
@@ -214,7 +214,7 @@ this.AutoReload = {
* we supposed to get here only when using firefox 3
* keep it just to be on the safe side.
*/
- _currentTab: function(aTabContainer) {
+ _currentTab(aTabContainer) {
if (aTabContainer && aTabContainer.localName == "tabs")
return aTabContainer.selectedItem;
@@ -225,7 +225,7 @@ this.AutoReload = {
* called by TabmixProgressListener.listener and Tabmix.restoreTabState
* for pending tabs
*/
- onTabReloaded: function(aTab, aBrowser) {
+ onTabReloaded(aTab, aBrowser) {
var win = aTab.ownerDocument.defaultView;
if (aTab.autoReloadTimerID)
_clearTimeout(aTab, win);
@@ -254,7 +254,7 @@ this.AutoReload = {
_setItem(aTab, "_reload", aTab.autoReloadEnabled || null);
},
- confirm: function(window, tab, isRemote) {
+ confirm(window, tab, isRemote) {
if (tab.postDataAcceptedByUser)
return true;
let title = TabmixSvc.getString('confirm_autoreloadPostData_title');
@@ -270,7 +270,7 @@ this.AutoReload = {
return resultOK;
},
- reloadRemoteTab: function(browser, data) {
+ reloadRemoteTab(browser, data) {
var window = browser.ownerDocument.defaultView;
let tab = window.gBrowser.getTabForBrowser(browser);
// RemoteWebNavigation accepting postdata or headers only from Firefox 42.
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 4013339..9707b89 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -26,35 +26,35 @@ XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
var ContentClickInternal;
this.TabmixContentClick = {
- init: function() {
+ init() {
ContentClickInternal.init();
},
- onQuitApplication: function() {
+ onQuitApplication() {
ContentClickInternal.onQuitApplication();
},
- getParamsForLink: function(event, linkNode, href, browser, focusedWindow) {
+ getParamsForLink(event, linkNode, href, browser, focusedWindow) {
return ContentClickInternal.getParamsForLink(event, linkNode, href, browser, focusedWindow);
},
- contentLinkClick: function(event, browser, focusedWindow) {
+ contentLinkClick(event, browser, focusedWindow) {
ContentClickInternal.contentLinkClick(event, browser, focusedWindow);
},
- isGreasemonkeyInstalled: function(window) {
+ isGreasemonkeyInstalled(window) {
ContentClickInternal.isGreasemonkeyInstalled(window);
},
- isLinkToExternalDomain: function(curpage, url) {
+ isLinkToExternalDomain(curpage, url) {
return ContentClickInternal.isLinkToExternalDomain(curpage, url);
},
- isUrlForDownload: function(url) {
+ isUrlForDownload(url) {
return ContentClickInternal.isUrlForDownload(url);
},
- selectExistingTab: function(window, href, targetAttr) {
+ selectExistingTab(window, href, targetAttr) {
ContentClickInternal.selectExistingTab(window, href, targetAttr);
}
};
@@ -64,7 +64,7 @@ ContentClickInternal = {
_timer: null,
_initialized: false,
- init: function() {
+ init() {
if (!TabmixSvc.version(380) || this._initialized)
return;
this._initialized = true;
@@ -90,7 +90,7 @@ ContentClickInternal = {
this.initContentAreaClick();
},
- onQuitApplication: function() {
+ onQuitApplication() {
if (this._timer)
this._timer.clear();
@@ -129,7 +129,7 @@ ContentClickInternal = {
json.tabmixContentClick.suppressTabsOnFileDownload || false;
let params = {
charset: browser.characterSet,
- suppressTabsOnFileDownload: suppressTabsOnFileDownload,
+ suppressTabsOnFileDownload,
referrerURI: browser.documentURI,
referrerPolicy: json.referrerPolicy,
noReferrer: json.noReferrer,
@@ -153,7 +153,7 @@ ContentClickInternal = {
};
},
- receiveMessage: function(message) {
+ receiveMessage(message) {
if (message.name == "Tabmix:isFrameInContentResult") {
const {epoch} = message.data;
if (this.frameSearch.has(epoch)) {
@@ -179,7 +179,7 @@ ContentClickInternal = {
},
// for non-link element with onclick that change location.href
- getHrefFromNodeOnClick: function(event, browser, wrappedOnClickNode) {
+ getHrefFromNodeOnClick(event, browser, wrappedOnClickNode) {
if (!wrappedOnClickNode || !this.getHrefFromOnClick(event, null, wrappedOnClickNode,
wrappedOnClickNode.getAttribute("onclick")))
return false;
@@ -203,12 +203,12 @@ ContentClickInternal = {
return true;
},
- getParamsForLink: function(event, linkNode, href, browser, focusedWindow) {
+ getParamsForLink(event, linkNode, href, browser, focusedWindow) {
let wrappedNode = this.getWrappedNode(linkNode, focusedWindow, event.button === 0);
return this._getParamsForLink(event, wrappedNode, href, browser);
},
- _getParamsForLink: function(event, wrappedNode, href, browser, clean, wrappedOnClickNode) {
+ _getParamsForLink(event, wrappedNode, href, browser, clean, wrappedOnClickNode) {
this._browser = browser;
this._window = browser.ownerDocument.defaultView;
@@ -244,21 +244,21 @@ ContentClickInternal = {
this.resetData();
return {
- where: where,
+ where,
_href: href,
suppressTabsOnFileDownload: suppressTabsOnFileDownload || false,
- targetAttr: targetAttr
+ targetAttr
};
},
_data: null,
- resetData: function() {
+ resetData() {
this._data = null;
this._browser = null;
this._window = null;
},
- getPref: function() {
+ getPref() {
XPCOMUtils.defineLazyGetter(this, "targetPref", () => {
return TabmixSvc.prefBranch.getIntPref("opentabforLinks");
});
@@ -277,7 +277,7 @@ ContentClickInternal = {
*
* @return wrapped node including attribute functions
*/
- getWrappedNode: function(node, focusedWindow, getTargetIsFrame) {
+ getWrappedNode(node, focusedWindow, getTargetIsFrame) {
let wrapNode = function wrapNode(aNode, aGetTargetIsFrame) {
let nObj = LinkNodeUtils.wrap(aNode, focusedWindow, aGetTargetIsFrame);
nObj.hasAttribute = function(att) {
@@ -305,7 +305,7 @@ ContentClickInternal = {
* @param wrappedOnClickNode wrapped DOM node containing onclick, may exist only
* when link node is null.
*/
- getData: function(event, href, wrappedNode, wrappedOnClickNode) {
+ getData(event, href, wrappedNode, wrappedOnClickNode) {
let self = this;
function LinkData() {
this.event = event;
@@ -470,7 +470,7 @@ ContentClickInternal = {
return ["default at 17"];
},
- contentLinkClick: function(event, browser, focusedWindow) {
+ contentLinkClick(event, browser, focusedWindow) {
this._contentLinkClick(event, browser, focusedWindow);
if (event.__hrefFromOnClick) {
event.stopImmediatePropagation();
@@ -644,7 +644,7 @@ ContentClickInternal = {
this._GM_function.set(window, GM_function);
},
- miscellaneous: function(node) {
+ miscellaneous(node) {
if ("className" in node) {
// don't interrupt with noscript
if (node.className.indexOf("__noscriptPlaceholder__") > -1)
@@ -688,7 +688,7 @@ ContentClickInternal = {
_GM_function: new WeakMap(),
- isGMEnabled: function() {
+ isGMEnabled() {
if (this._GM_function.has(this._window))
return this._GM_function.get(this._window)();
return false;
@@ -1012,13 +1012,13 @@ ContentClickInternal = {
addValidWindow(browserWin);
}
}
- this.isFrameInContent(windows, {href: href, name: targetFrame}, isMultiProcess);
+ this.isFrameInContent(windows, {href, name: targetFrame}, isMultiProcess);
},
frameSearchEpoch: 0,
frameSearch: new Map(),
- isFrameInContent: function(windows, frameData, isMultiProcess) {
+ isFrameInContent(windows, frameData, isMultiProcess) {
const deleteEpoch = epoch => {
if (this.frameSearch.has(epoch)) {
this.frameSearch.delete(epoch);
@@ -1028,7 +1028,7 @@ ContentClickInternal = {
epoch: 0,
frameData: null,
windows: null,
- start: function(epoch) {
+ start(epoch) {
this.frameData = frameData;
this.epoch = epoch;
this.frameData.epoch = this.epoch;
@@ -1036,12 +1036,12 @@ ContentClickInternal = {
let window = this.windows.shift();
this.next(window.gBrowser.tabs[0]);
},
- stop: function() {
+ stop() {
this.frameData = null;
this.windows = null;
deleteEpoch(this.epoch);
},
- result: function(browser, data) {
+ result(browser, data) {
let window = browser.ownerDocument.defaultView;
let tab = window.gBrowser.getTabForBrowser(browser);
if (data.result) {
@@ -1054,7 +1054,7 @@ ContentClickInternal = {
this.next(tab.nextSibling);
}
},
- next: function(tab) {
+ next(tab) {
if (!tab && this.windows.length) {
let window = this.windows.shift();
tab = window.gBrowser.tabs[0];
@@ -1067,7 +1067,7 @@ ContentClickInternal = {
} else {
let result = LinkNodeUtils.isFrameInContent(browser.contentWindow,
this.frameData.href, this.frameData.name);
- this.result(browser, {result: result});
+ this.result(browser, {result});
}
} else {
this.stop();
@@ -1197,7 +1197,7 @@ ContentClickInternal = {
* @brief prevent onclick function with the form javascript:top.location.href = url
* or the form window.location = url when we force new tab from link
*/
- getHrefFromOnClick: function(event, href, node, onclick) {
+ getHrefFromOnClick(event, href, node, onclick) {
if (typeof event.__hrefFromOnClick != "undefined")
return event.__hrefFromOnClick;
@@ -1213,7 +1213,7 @@ ContentClickInternal = {
return (event.__hrefFromOnClick = result.__hrefFromOnClick);
},
- _hrefFromOnClick: function(href, node, onclick, result) {
+ _hrefFromOnClick(href, node, onclick, result) {
let re = /^(javascript:)?(window\.|top\.)?(document\.)?location(\.href)?=/;
if (!re.test(onclick))
return;
diff --git a/modules/ContextMenu.jsm b/modules/ContextMenu.jsm
index 75e1084..29ac747 100644
--- a/modules/ContextMenu.jsm
+++ b/modules/ContextMenu.jsm
@@ -11,7 +11,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "TabmixUtils",
"resource://tabmixplus/Utils.jsm");
this.ContextMenu = {
- getSelectedLinks: function(content, check) {
+ getSelectedLinks(content, check) {
let doc = content.document;
// get focused window selection
let selectionObject = TabmixUtils.focusedWindow(content).getSelection();
@@ -19,7 +19,7 @@ this.ContextMenu = {
return [];
let filter = {
- acceptNode: function(n) {
+ acceptNode(n) {
if (n.nodeName == 'A' || n.nodeName == 'li') {
return Ci.nsIDOMNodeFilter.FILTER_ACCEPT;
}
diff --git a/modules/Decode.jsm b/modules/Decode.jsm
index e2fe184..fafbe95 100644
--- a/modules/Decode.jsm
+++ b/modules/Decode.jsm
@@ -10,14 +10,14 @@ this.EXPORTED_SYMBOLS = ["Decode"];
use unescape if exist, if removed from firefox we use our own function
*/
this.Decode = {
- escape: function(str) {
+ escape(str) {
// we always use encodeURI
return encodeURI(str);
// let self = this;
// return str.replace(/[^\w @\*\-\+\.\/]/g, function(aChar) {return self._(aChar);});
// return str.replace(/[^\w @\*\-\+\.\/]/g, getReturnValue);
},
- unescape: function(str) {
+ unescape(str) {
if (typeof unescape == "function")
return unescape(str);
diff --git a/modules/DocShellCapabilities.jsm b/modules/DocShellCapabilities.jsm
index f667c3a..acf21df 100644
--- a/modules/DocShellCapabilities.jsm
+++ b/modules/DocShellCapabilities.jsm
@@ -14,11 +14,11 @@ XPCOMUtils.defineLazyModuleGetter(this, "TabmixSvc",
"resource://tabmixplus/TabmixSvc.jsm");
this.DocShellCapabilities = {
- init: function() {
+ init() {
this.useFrameScript = TabmixSvc.version(320);
},
- update: function(browser, data) {
+ update(browser, data) {
// Update the persistent tab state cache
TabStateCache.update(browser, {disallow: data.disallow || null});
if (data.reload)
@@ -27,7 +27,7 @@ this.DocShellCapabilities = {
caps: ["Images", "Subframes", "MetaRedirects", "Plugins", "Javascript"],
- collect: function(tab) {
+ collect(tab) {
let browser = tab.linkedBrowser;
if (!this.useFrameScript) {
@@ -43,7 +43,7 @@ this.DocShellCapabilities = {
return "";
},
- restore: function(tab, disallow, reload) {
+ restore(tab, disallow, reload) {
let browser = tab.linkedBrowser;
if (reload && tab.getAttribute("pending") == "true")
reload = false;
@@ -64,14 +64,14 @@ this.DocShellCapabilities = {
/*** for tab context menu ***/
- onGet: function(nodes, tab) {
+ onGet(nodes, tab) {
let disallow = this.collect(tab);
for (let i = 0; i < nodes.length; i++) {
nodes[i].setAttribute("checked", disallow.indexOf(nodes[i].value) == -1);
}
},
- onSet: function(tab, node) {
+ onSet(tab, node) {
let nodes = node.parentNode.childNodes;
let disallow = [];
for (let i = 0; i < nodes.length; i++) {
diff --git a/modules/DownloadLastDir.jsm b/modules/DownloadLastDir.jsm
index 3655565..1e93e65 100644
--- a/modules/DownloadLastDir.jsm
+++ b/modules/DownloadLastDir.jsm
@@ -13,7 +13,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Services",
this.TabmixDownloadLastDir = {
_initialized: false,
- init: function() {
+ init() {
if (this._initialized)
return;
this._initialized = true;
@@ -22,7 +22,7 @@ this.TabmixDownloadLastDir = {
// it fails if we already closed the tab that initialized the download
// with TypeError: can't access dead object
let descriptor = {
- get: function() {
+ get() {
if (this._window) {
try {
this._window.QueryInterface(Ci.nsIInterfaceRequestor);
@@ -33,7 +33,7 @@ this.TabmixDownloadLastDir = {
}
return this._window;
},
- set: function(val) {
+ set(val) {
this._window = val;
return val;
},
diff --git a/modules/DynamicRules.jsm b/modules/DynamicRules.jsm
index 7f25cee..627da67 100644
--- a/modules/DynamicRules.jsm
+++ b/modules/DynamicRules.jsm
@@ -49,7 +49,7 @@ this.DynamicRules = {
return TabmixSvc.isAustralisBgStyle(this.orient);
},
- init: function(aWindow) {
+ init(aWindow) {
if (this._initialized)
return;
this._initialized = true;
@@ -68,7 +68,7 @@ this.DynamicRules = {
this.createTemplates();
},
- observe: function(subject, topic, data) {
+ observe(subject, topic, data) {
switch (topic) {
case "browser-window-before-show":
if (!TabmixSvc.isPaleMoon) {
@@ -84,7 +84,7 @@ this.DynamicRules = {
}
},
- registerMutationObserver: function(window) {
+ registerMutationObserver(window) {
const tabsMutate = aMutations => {
for (let mutation of aMutations) {
if (mutation.attributeName == "orient") {
@@ -102,7 +102,7 @@ this.DynamicRules = {
});
},
- onPrefChange: function(data) {
+ onPrefChange(data) {
let prefName = data.split(".").pop();
if (STYLENAMES.indexOf(prefName) > -1) {
if (prefName == data)
@@ -114,7 +114,7 @@ this.DynamicRules = {
}
},
- onQuitApplication: function() {
+ onQuitApplication() {
Services.obs.removeObserver(this, "browser-window-before-show", false);
Services.obs.removeObserver(this, "quit-application");
Prefs.removeObserver("", this);
@@ -124,7 +124,7 @@ this.DynamicRules = {
}, this);
},
- updateOpenedWindows: function(ruleName) {
+ updateOpenedWindows(ruleName) {
// update all opened windows
TabmixSvc.forEachBrowserWindow(window => {
if (ruleName != "progressMeter")
@@ -134,7 +134,7 @@ this.DynamicRules = {
});
},
- createTemplates: function() {
+ createTemplates() {
let space20 = ' '.repeat(20);
let space26 = ' '.repeat(26);
let bgImage = {};
@@ -224,7 +224,7 @@ this.DynamicRules = {
}
},
- userChangedStyle: function(ruleName, notifyWindows) {
+ userChangedStyle(ruleName, notifyWindows) {
if (ruleName in this && this[ruleName] == "preventUpdate")
return;
@@ -256,7 +256,7 @@ this.DynamicRules = {
this.updateOpenedWindows(ruleName);
},
- updateStyles: function(name, prefObj) {
+ updateStyles(name, prefObj) {
let templates = this.cssTemplates[name];
let style = {};
for (let rule of Object.keys(templates)) {
@@ -275,7 +275,7 @@ this.DynamicRules = {
// update background type when squaredTabsStyle pref or tabbar
// orient changed
- updateStyleType: function() {
+ updateStyleType() {
let australis = this.isAustralis;
if (australis == (this.styleType == "australis")) {
return;
@@ -317,7 +317,7 @@ this.DynamicRules = {
* - when user changed text or background color
* - when user disable/enable the style
*/
- registerSheet: function(name) {
+ registerSheet(name) {
let enabled = TabmixSvc.prefBranch.getBoolPref(name);
if (!enabled)
return;
@@ -339,7 +339,7 @@ this.DynamicRules = {
}
},
- unregisterSheet: function(name) {
+ unregisterSheet(name) {
let styleSheet = this.registered[name] || null;
if (styleSheet &&
SSS.sheetRegistered(styleSheet, TYPE))
@@ -356,7 +356,7 @@ this.DynamicRules = {
return (this.defaultPrefs = defaults);
},
- validatePrefValue: function(ruleName) {
+ validatePrefValue(ruleName) {
// styles format: italic:boolean, bold:boolean, underline:boolean,
// text:boolean, textColor:string, textOpacity:string,
// bg:boolean, bgColor:string, bgOpacity:string
diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index 8fa2905..34352dc 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -5,7 +5,7 @@ this.EXPORTED_SYMBOLS = ["LinkNodeUtils"];
const ATTRIBS = ["href", "onclick", "onmousedown", "rel", "role"];
this.LinkNodeUtils = {
- isFrameInContent: function(content, href, name) {
+ isFrameInContent(content, href, name) {
if (!content)
return false;
if (content.location.href == href && content.name == name)
@@ -18,7 +18,7 @@ this.LinkNodeUtils = {
return false;
},
- wrap: function(node, focusedWindow, getTargetIsFrame) {
+ wrap(node, focusedWindow, getTargetIsFrame) {
if (!node || typeof node.__tabmix == "boolean")
return node;
@@ -48,7 +48,7 @@ this.LinkNodeUtils = {
return wrapper;
},
- getNodeWithOnClick: function(node) {
+ getNodeWithOnClick(node) {
// for safety reason look only 3 level up
let i = 0;
while (i < 3 && node && node.hasAttribute && !node.hasAttribute("onclick")) {
diff --git a/modules/MergeWindows.jsm b/modules/MergeWindows.jsm
index 18fd07a..b0b9fe6 100644
--- a/modules/MergeWindows.jsm
+++ b/modules/MergeWindows.jsm
@@ -100,7 +100,7 @@ this.MergeWindows = {
this.concatTabsAndMerge(aTargetWindow, aWindows);
},
- mergePopUpsToNewWindow: function(aWindows, aPrivate) {
+ mergePopUpsToNewWindow(aWindows, aPrivate) {
var features = "chrome,all,dialog=no";
features += aPrivate ? ",private" : ",non-private";
var newWindow = aWindows[0].openDialog("chrome://browser/content/browser.xul",
@@ -112,7 +112,7 @@ this.MergeWindows = {
newWindow.addEventListener("SSWindowStateReady", mergePopUps, false);
},
- concatTabsAndMerge: function(aTargetWindow, aWindows) {
+ concatTabsAndMerge(aTargetWindow, aWindows) {
let tabsToMove = [];
for (let i = 0; i < aWindows.length; i++)
tabsToMove = tabsToMove.concat(Array.prototype.slice.call(aWindows[i].gBrowser.tabs));
@@ -122,7 +122,7 @@ this.MergeWindows = {
// tabs from popup windows open after opener or at the end
// other tabs open according to our openTabNext preference
// and move to place by tabbrowser.addTab
- moveTabsFromPopups: function(newTab, aTab, openerWindow, tabbrowser) {
+ moveTabsFromPopups(newTab, aTab, openerWindow, tabbrowser) {
if (!newTab) {
newTab = aTab.__tabmixNewTab;
delete aTab.__tabmixNewTab;
@@ -213,11 +213,11 @@ this.MergeWindows = {
}
},
- isPopupWindow: function(aWindow) {
+ isPopupWindow(aWindow) {
return !aWindow.toolbar.visible;
},
- isWindowPrivate: function(aWindow) {
+ isWindowPrivate(aWindow) {
return PrivateBrowsingUtils.isWindowPrivate(aWindow);
},
@@ -242,7 +242,7 @@ this.MergeWindows = {
* multiple is false most recent non-popup windows or most recent
* popup windows
*/
- getWindowsList: function(aWindow, aOptions) {
+ getWindowsList(aWindow, aOptions) {
let checkPrivacy = typeof aOptions == "object" &&
"private" in aOptions;
@@ -282,10 +282,10 @@ this.MergeWindows = {
let normalWindowsCount = windows.length;
if (aOptions.multiple)
- return {windows: windows.concat(popUps), normalWindowsCount: normalWindowsCount};
+ return {windows: windows.concat(popUps), normalWindowsCount};
let target = windows[0] || popUps[0] || null;
- return {windows: target ? [target] : [], normalWindowsCount: normalWindowsCount};
+ return {windows: target ? [target] : [], normalWindowsCount};
},
notify: function TMP_mergeNotify(aWindow, privateNotMatch) {
@@ -305,7 +305,7 @@ this.MergeWindows = {
}
},
- warnBeforeClosingWindow: function(aWindow) {
+ warnBeforeClosingWindow(aWindow) {
// prompt a warning before closing a window with left over tabs
var canClose = this.prefs.getBoolPref("closeOnSelect");
if (!canClose)
diff --git a/modules/NewTabURL.jsm b/modules/NewTabURL.jsm
index 1e353f6..aaa6e77 100644
--- a/modules/NewTabURL.jsm
+++ b/modules/NewTabURL.jsm
@@ -27,7 +27,7 @@ this.Tabmix_NewTabURL = {
Ci.nsISupportsWeakReference
]),
- init: function() {
+ init() {
if (!TabmixSvc.version(440)) {
this.updateNewTabURL = this._updateNewTabURL;
}
@@ -38,7 +38,7 @@ this.Tabmix_NewTabURL = {
Services.prefs.addObserver(FIREFOX_PREF, this, true);
},
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "nsPref:changed":
if (aData == FIREFOX_PREF)
@@ -48,7 +48,7 @@ this.Tabmix_NewTabURL = {
},
// for Firefox 41 - 43
- _updateNewTabURL: function() {
+ _updateNewTabURL() {
let value = Services.prefs.getComplexValue(FIREFOX_PREF, Ci.nsISupportsString).data;
if (value == ABOUT_NEW_TAB)
NewTabURL.reset();
@@ -57,7 +57,7 @@ this.Tabmix_NewTabURL = {
},
// for Firefox 44+
- updateNewTabURL: function() {
+ updateNewTabURL() {
let value = Services.prefs.getComplexValue(FIREFOX_PREF, Ci.nsISupportsString).data;
if (value == ABOUT_NEW_TAB) {
aboutNewTabService.resetNewTabURL();
diff --git a/modules/Places.jsm b/modules/Places.jsm
index 3ee308b..75611b5 100644
--- a/modules/Places.jsm
+++ b/modules/Places.jsm
@@ -29,19 +29,19 @@ XPCOMUtils.defineLazyModuleGetter(this,
var PlacesUtilsInternal;
this.TabmixPlacesUtils = Object.freeze({
- init: function(aWindow) {
+ init(aWindow) {
PlacesUtilsInternal.init(aWindow);
},
- onQuitApplication: function() {
+ onQuitApplication() {
PlacesUtilsInternal.onQuitApplication();
},
- applyCallBackOnUrl: function(aUrl, aCallBack) {
+ applyCallBackOnUrl(aUrl, aCallBack) {
return PlacesUtilsInternal.applyCallBackOnUrl(aUrl, aCallBack);
},
- getTitleFromBookmark: function(aUrl, aTitle, aItemId, aTab) {
+ getTitleFromBookmark(aUrl, aTitle, aItemId, aTab) {
return PlacesUtilsInternal.getTitleFromBookmark(aUrl, aTitle, aItemId, aTab);
},
});
@@ -52,7 +52,7 @@ PlacesUtilsInternal = {
_timer: null,
_initialized: false,
- init: function(aWindow) {
+ init(aWindow) {
if (this._initialized)
return;
this._initialized = true;
@@ -64,7 +64,7 @@ PlacesUtilsInternal = {
this.initPlacesUIUtils(aWindow);
},
- onQuitApplication: function() {
+ onQuitApplication() {
if (this._timer)
this._timer.clear();
@@ -202,7 +202,7 @@ PlacesUtilsInternal = {
const PREF = "extensions.tabmix.titlefrombookmark";
let updateValue = () => {
let value = Services.prefs.getBoolPref(PREF);
- let definition = {value: value, configurable: true};
+ let definition = {value, configurable: true};
Object.defineProperty(this, "titlefrombookmark", definition);
return value;
};
@@ -211,7 +211,7 @@ PlacesUtilsInternal = {
return updateValue();
},
- getBookmarkTitle: function(aUrl, aID) {
+ getBookmarkTitle(aUrl, aID) {
let aItemId = aID.value || -1;
try {
if (aItemId > -1) {
@@ -230,7 +230,7 @@ PlacesUtilsInternal = {
return null;
},
- applyCallBackOnUrl: function(aUrl, aCallBack) {
+ applyCallBackOnUrl(aUrl, aCallBack) {
let hasHref = aUrl.indexOf("#") > -1;
let result = aCallBack.apply(this, [aUrl]) ||
hasHref && aCallBack.apply(this, aUrl.split("#"));
diff --git a/modules/RenameTab.jsm b/modules/RenameTab.jsm
index 393a8a6..1c80437 100644
--- a/modules/RenameTab.jsm
+++ b/modules/RenameTab.jsm
@@ -14,11 +14,11 @@ this.RenameTab = {
window: null,
panel: null,
data: {},
- _element: function(aID) {
+ _element(aID) {
return this.window.document.getElementById(aID);
},
- editTitle: function(aTab) {
+ editTitle(aTab) {
if (this.panel && this.panel.state != "closed")
this.hidePopup();
@@ -64,7 +64,7 @@ this.RenameTab = {
);
},
- observe: function(aSubject, aTopic) {
+ observe(aSubject, aTopic) {
if (aTopic != "xul-overlay-merged")
return;
@@ -83,7 +83,7 @@ this.RenameTab = {
this._doShowPanel();
},
- _doShowPanel: function() {
+ _doShowPanel() {
var popup = this.panel;
popup.addEventListener("keypress", this, false);
// dock the panel to the tab icon when possible, otherwise show the panel
@@ -114,12 +114,12 @@ this.RenameTab = {
this.data.permanently = permanently.checked;
},
- resetTitle: function() {
+ resetTitle() {
this.data.value = this.data.docTitle;
this.update(true);
},
- update: function(aReset) {
+ update(aReset) {
var data = this.data;
var tab = data.tab;
var label = data.value;
@@ -138,14 +138,14 @@ this.RenameTab = {
this.hidePopup();
},
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
if (aEvent.type == "keypress" &&
aEvent.keyCode == Components.interfaces.nsIDOMKeyEvent.DOM_VK_RETURN &&
aEvent.target.localName != "button")
this.update();
},
- onpopupshown: function(aEvent) {
+ onpopupshown(aEvent) {
if (aEvent.target == this.panel) {
var textbox = this._element("tabmixRenametab_titleField");
textbox.focus();
@@ -153,7 +153,7 @@ this.RenameTab = {
}
},
- onpopuphidden: function(aEvent) {
+ onpopuphidden(aEvent) {
if (aEvent.originalTarget == this.panel) {
this.panel.removeEventListener("keypress", this, false);
this.window = null;
@@ -162,13 +162,13 @@ this.RenameTab = {
}
},
- onNewTitle: function(aTitle) {
+ onNewTitle(aTitle) {
this.data.value = aTitle;
if (!this.data.modified)
this.window.Tabmix.setItem(this.panel, "modified", aTitle != this.data.docTitle || null);
},
- hidePopup: function() {
+ hidePopup() {
this.panel.hidePopup();
}
};
diff --git a/modules/Shortcuts.jsm b/modules/Shortcuts.jsm
index 7380685..1253297 100644
--- a/modules/Shortcuts.jsm
+++ b/modules/Shortcuts.jsm
@@ -45,7 +45,7 @@ this.Shortcuts = {
undoClose: {default: "VK_F12 accel"},
undoCloseTab: {id: "key_undoCloseTab", default: "T accel,shift"},
clearClosedTabs: {
- command: function() {
+ command() {
this.TMP_ClosedTabs.restoreTab('original', -1);
}
},
@@ -68,7 +68,7 @@ this.Shortcuts = {
initialized: false,
keyConfigInstalled: false,
- initService: function(aWindow) {
+ initService(aWindow) {
if (this.initialized)
return;
this.initialized = true;
@@ -125,7 +125,7 @@ this.Shortcuts = {
Services.obs.addObserver(this, "quit-application", false);
},
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "nsPref:changed":
this.onPrefChange(aData);
@@ -172,7 +172,7 @@ this.Shortcuts = {
/* ........ Window Event Handlers .............. */
- handleEvent: function(aEvent) {
+ handleEvent(aEvent) {
switch (aEvent.type) {
case "command":
this.onCommand(aEvent.currentTarget);
@@ -354,7 +354,7 @@ this.Shortcuts = {
return shortcuts;
},
- _userChangedKeyPref: function(value) {
+ _userChangedKeyPref(value) {
let key = value && this.keyParse(value);
if (!key)
return "";
@@ -377,7 +377,7 @@ this.Shortcuts = {
return this.validateKey(key);
},
- setShortcutsPref: function() {
+ setShortcutsPref() {
this.updatingShortcuts = true;
setPref("extensions.tabmix.shortcuts", JSON.stringify(this.prefBackup));
this.updatingShortcuts = false;
@@ -387,7 +387,7 @@ this.Shortcuts = {
let disabled = /^d&/.test(value);
let [keyVal, modifiers] = value.replace(/^d&/, "").split(" ");
let isKey = keyVal.length == 1;
- return {modifiers: modifiers || "", key: isKey ? keyVal : "", keycode: isKey ? "" : keyVal, disabled: disabled};
+ return {modifiers: modifiers || "", key: isKey ? keyVal : "", keycode: isKey ? "" : keyVal, disabled};
},
// convert key object {modifiers, key, keycode} into a string with " " separator
@@ -411,21 +411,21 @@ this.Shortcuts = {
return key ? this.keyStringify(key) : "";
},
- getFormattedKey: function(key) {
+ getFormattedKey(key) {
return getFormattedKey(key);
},
- getFormattedKeyForID: function(id) {
+ getFormattedKeyForID(id) {
let key = this.keyParse(this.keys[id].value);
return getFormattedKey(key);
},
- getPlatformAccel: function() {
+ getPlatformAccel() {
return getPlatformAccel();
},
// add id for key Browser:Reload
- _setReloadKeyId: function(aWindow) {
+ _setReloadKeyId(aWindow) {
let reload = aWindow.document.getElementsByAttribute("command", "Browser:Reload");
if (!reload)
return;
@@ -451,7 +451,7 @@ KeyConfig = {
prefsChangedByTabmix: false,
// when keyConfig extension installed sync the preference
// user may change shortcuts in both extensions
- init: function() {
+ init() {
this.keyIdsMap = {};
// keyConfig use index number for its ids
let oldReloadId = "xxx_key29_Browser:Reload";
@@ -482,11 +482,11 @@ KeyConfig = {
this.prefs.addObserver("", this, false);
},
- deinit: function() {
+ deinit() {
this.prefs.removeObserver("", this);
},
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
if (this.prefsChangedByTabmix)
return;
let key = this.keyIdsMap[aData];
@@ -501,7 +501,7 @@ KeyConfig = {
}
},
- syncFromKeyConfig: function(aKey, aPrefName, aShortcuts) {
+ syncFromKeyConfig(aKey, aPrefName, aShortcuts) {
let prefValue, newValue, keyData = Shortcuts.keys[aKey];
try {
prefValue = getPref("keyconfig.main." + aPrefName).split("][");
@@ -530,7 +530,7 @@ KeyConfig = {
return false;
},
- syncToKeyConfig: function(aChangedKeys, onChange) {
+ syncToKeyConfig(aChangedKeys, onChange) {
for (let key of Object.keys(aChangedKeys)) {
let prefVal = aChangedKeys[key];
this.prefsChangedByTabmix = true;
@@ -549,7 +549,7 @@ KeyConfig = {
}
},
- resetPref: function(prefName) {
+ resetPref(prefName) {
this.prefs.clearUserPref(prefName);
}
diff --git a/modules/SingleWindowModeUtils.jsm b/modules/SingleWindowModeUtils.jsm
index e94ecc9..bed1117 100644
--- a/modules/SingleWindowModeUtils.jsm
+++ b/modules/SingleWindowModeUtils.jsm
@@ -19,7 +19,7 @@ this.SingleWindowModeUtils = {
* window that is not the same as aExclude, and is
* additionally not a popup window.
*/
- getBrowserWindow: function(aExclude) {
+ getBrowserWindow(aExclude) {
// on per-window private browsing mode,
// allow to open one normal window and one private window in single window mode
var isPrivate = PrivateBrowsingUtils.isWindowPrivate(aExclude);
@@ -39,7 +39,7 @@ this.SingleWindowModeUtils = {
return null;
},
- newWindow: function(aWindow) {
+ newWindow(aWindow) {
if (!aWindow.Tabmix.singleWindowMode)
return false;
@@ -84,7 +84,7 @@ this.SingleWindowModeUtils = {
return true;
},
- restoreDimensionsAndPosition: function(newWindow, restorePosition) {
+ restoreDimensionsAndPosition(newWindow, restorePosition) {
const rect = newWindow.__winRect;
if (typeof rect != "object") {
return;
@@ -101,7 +101,7 @@ this.SingleWindowModeUtils = {
delete newWindow.__winRect;
},
- onLoad: function(newWindow) {
+ onLoad(newWindow) {
var existingWindow = this.getBrowserWindow(newWindow);
// no navigator:browser window open yet?
if (!existingWindow)
diff --git a/modules/Slideshow.jsm b/modules/Slideshow.jsm
index 9023da8..c8ed015 100644
--- a/modules/Slideshow.jsm
+++ b/modules/Slideshow.jsm
@@ -20,7 +20,7 @@ function flst() {
}
flst.prototype = {
- showAlert: function(msg, id) {
+ showAlert(msg, id) {
try {
msg = msg.replace(/F8|F9/, Shortcuts.getFormattedKeyForID(id));
let alerts = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
@@ -29,7 +29,7 @@ flst.prototype = {
},
// toggle flst on/off
- toggle: function() {
+ toggle() {
if (TabmixSvc.prefBranch.getIntPref("focusTab") != 4) {
TabmixSvc.prefBranch.setIntPref("focusTab", 4);
this.showAlert(this.flstOn, "toggleFLST");
@@ -39,7 +39,7 @@ flst.prototype = {
}
},
- toggleSlideshow: function() {
+ toggleSlideshow() {
if (this.slideShowTimer) {
this.cancel();
} else if (this.moreThenOneTab) {
@@ -51,14 +51,14 @@ flst.prototype = {
}
},
- notify: function() {
+ notify() {
if (this.moreThenOneTab)
this.tabContainer.advanceSelectedTab(1, true);
else
this.cancel();
},
- cancel: function() {
+ cancel() {
this.slideShowTimer.cancel();
this.slideShowTimer = null;
this.showAlert(this.slideshowOff, "slideShow");
diff --git a/modules/TabGroupsMigrator.jsm b/modules/TabGroupsMigrator.jsm
index 5322e34..53d471a 100644
--- a/modules/TabGroupsMigrator.jsm
+++ b/modules/TabGroupsMigrator.jsm
@@ -48,7 +48,7 @@ this.TabmixGroupsMigrator = {
/**
* If previous or last session contains tab groups, save a back
*/
- backupSessions: function(window, isAfterCrash) {
+ backupSessions(window, isAfterCrash) {
let sm = window.TabmixSessionManager;
let notify;
@@ -96,7 +96,7 @@ this.TabmixGroupsMigrator = {
}
sm.saveClosedSession({
- session: session,
+ session,
name: {name: string(type)},
nameExt: sm.getLiteralValue(session, "nameExt", ""),
button: -1
@@ -122,12 +122,12 @@ this.TabmixGroupsMigrator = {
}
},
- getNotificationBox: function(doc) {
+ getNotificationBox(doc) {
return doc.getElementById("high-priority-global-notificationbox") ||
doc.getElementById("global-notificationbox");
},
- closeNotificationFromAllWindows: function() {
+ closeNotificationFromAllWindows() {
TabmixSvc.forEachBrowserWindow(aWindow => {
let notificationBox = this.getNotificationBox(aWindow.document);
let notification = notificationBox.getNotificationWithValue("tabmix-missing-tabview");
@@ -137,7 +137,7 @@ this.TabmixGroupsMigrator = {
});
},
- missingTabViewNotification: function(win, backup = "") {
+ missingTabViewNotification(win, backup = "") {
let string = s => TabmixSvc.getSMString("sm.tabview." + s);
// If there's already an existing notification bar, don't do anything.
@@ -151,7 +151,7 @@ this.TabmixGroupsMigrator = {
let buttons = [{
label: string("install.label"),
accessKey: string("install.accesskey"),
- callback: function() {
+ callback() {
let link = TabmixSvc.isPaleMoon ?
"http://www.palemoon.org/tabgroups.shtml" :
"https://addons.mozilla.org/en-US/firefox/addon/tab-groups-panorama/";
@@ -165,7 +165,7 @@ this.TabmixGroupsMigrator = {
buttons.push({
label: string("removed.learnMore.label"),
accessKey: string("removed.learnMore.accesskey"),
- callback: function() {
+ callback() {
win.openUILinkIn("http://tabmixplus.org/support/viewpage.php?t=2&p=tab-groups-removal", "tab");
}
});
@@ -187,23 +187,23 @@ this.TabmixGroupsMigrator = {
);
},
- removeHiddenTabGroupsFromState: function(state) {
+ removeHiddenTabGroupsFromState(state) {
if (!TabGroupsMigrator) {
return {hiddenTabState: {windows: []}};
}
let groupData = TabGroupsMigrator._gatherGroupData(state);
let hiddenTabState = TabGroupsMigrator._removeHiddenTabGroupsFromState(state, groupData);
- return {hiddenTabState: hiddenTabState, groupData: groupData};
+ return {hiddenTabState, groupData};
},
- isGroupExist: function(groupData) {
+ isGroupExist(groupData) {
return [...groupData.keys()].length > 0;
},
// add windows without groups to the data as single group
// add window count to each folder title
- gatherGroupData: function(state) {
+ gatherGroupData(state) {
if (!TabGroupsMigrator) {
return null;
}
@@ -248,7 +248,7 @@ this.TabmixGroupsMigrator = {
return allGroupData;
},
- setTabTitle: function(groupData) {
+ setTabTitle(groupData) {
for (let [, windowGroupMap] of groupData) {
let windowGroups = [...windowGroupMap.values()];
for (let group of windowGroups) {
@@ -261,14 +261,14 @@ this.TabmixGroupsMigrator = {
}
},
- promiseItemId: function({guid}) {
+ promiseItemId({guid}) {
return PlacesUtils.promiseItemId(guid).then(id => {
- return {id: id, guid: guid};
+ return {id, guid};
});
},
// create SessionsFolder: function() {
- createSessionsFolder: function() {
+ createSessionsFolder() {
let BM = PlacesUtils.bookmarks;
return BM.insert({
parentGuid: BM.menuGuid,
@@ -279,12 +279,12 @@ this.TabmixGroupsMigrator = {
.catch(TabmixSvc.console.reportError);
},
- getSessionsFolder: function(folder) {
+ getSessionsFolder(folder) {
return this.promiseItemId(folder).catch(() => this.createSessionsFolder());
},
- bookmarkAllGroupsFromState: function(groupData, guid, name) {
- let folder = {guid: guid};
+ bookmarkAllGroupsFromState(groupData, guid, name) {
+ let folder = {guid};
if (!TabGroupsMigrator || !this.isGroupExist(groupData)) {
return Promise.resolve(folder);
}
@@ -315,11 +315,11 @@ this.TabmixGroupsMigrator = {
return sessionsFolder;
},
- showBackgroundTabGroupRestorationPage: function(state, backgroundData) {
+ showBackgroundTabGroupRestorationPage(state, backgroundData) {
const RECOVERY_URL = "chrome://browser/content/aboutTabGroupsMigration.xhtml";
let win = state.windows[state.windows.length - 1];
let formdata = {id: {sessionData: JSON.stringify(backgroundData)}, url: RECOVERY_URL};
- let newTab = {entries: [{url: RECOVERY_URL}], formdata: formdata, index: 1};
+ let newTab = {entries: [{url: RECOVERY_URL}], formdata, index: 1};
// Add tab and mark it as selected:
win.selected = win.tabs.push(newTab);
},
diff --git a/modules/TabRestoreQueue.jsm b/modules/TabRestoreQueue.jsm
index 24f20ad..4e8b178 100644
--- a/modules/TabRestoreQueue.jsm
+++ b/modules/TabRestoreQueue.jsm
@@ -11,7 +11,7 @@ XPCOMUtils.defineLazyModuleGetter(this,
let internal = {
tabmix: {
- restoreOnDemand: function(restoreOnDemand, visible, tabToRestoreSoon) {
+ restoreOnDemand(restoreOnDemand, visible, tabToRestoreSoon) {
if (!visible.length) {
return restoreOnDemand;
}
@@ -33,7 +33,7 @@ let internal = {
},
// Returns and removes the tab with the highest priority.
- shift: function() {
+ shift() {
let set;
let {priority, hidden, visible} = this.tabs;
@@ -52,7 +52,7 @@ let internal = {
return set && set.shift();
},
- willRestoreSoon: function(tab) {
+ willRestoreSoon(tab) {
let {priority, hidden, visible} = this.tabs;
let {restoreOnDemand, restorePinnedTabsOnDemand,
restoreHiddenTabs} = this.prefs;
@@ -75,7 +75,7 @@ let internal = {
};
this.TabRestoreQueue = {
- init: function() {
+ init() {
const global = {};
const tabRestoreQueue = TabmixSvc.SessionStoreGlobal.TabRestoreQueue;
global.TabRestoreQueue = tabRestoreQueue;
diff --git a/modules/TabmixSvc.jsm b/modules/TabmixSvc.jsm
index f26d631..a3e9981 100644
--- a/modules/TabmixSvc.jsm
+++ b/modules/TabmixSvc.jsm
@@ -42,16 +42,16 @@ this.TabmixSvc = {
aboutNewtab: "about:#".replace("#", "newtab"),
newtabUrl: "browser.#.url".replace("#", "newtab"),
- debugMode: function() {
+ debugMode() {
return this.prefBranch.prefHasUserValue("enableDebug") &&
this.prefBranch.getBoolPref("enableDebug");
},
- version: function() {
+ version() {
return isVersion.apply(null, arguments);
},
- getString: function(aStringKey) {
+ getString(aStringKey) {
try {
return this._strings.GetStringFromName(aStringKey);
} catch (e) {
@@ -60,7 +60,7 @@ this.TabmixSvc = {
}
},
- getFormattedString: function(aStringKey, aStringsArray) {
+ getFormattedString(aStringKey, aStringsArray) {
try {
return this._strings.formatStringFromName(aStringKey, aStringsArray, aStringsArray.length);
} catch (e) {
@@ -69,7 +69,7 @@ this.TabmixSvc = {
}
},
- getSMString: function(aStringKey) {
+ getSMString(aStringKey) {
try {
return this.SMstrings.GetStringFromName(aStringKey);
} catch (e) {
@@ -78,7 +78,7 @@ this.TabmixSvc = {
}
},
- setLabel: function(property) {
+ setLabel(property) {
var label, key;
if (property.startsWith("sm.")) {
label = this.getSMString(property + ".label");
@@ -93,7 +93,7 @@ this.TabmixSvc = {
return label;
},
- getDialogStrings: function(...keys) {
+ getDialogStrings(...keys) {
let stringBundle = Services.strings.createBundle("chrome://global/locale/commonDialogs.properties");
return keys.map(key => {
@@ -106,7 +106,7 @@ this.TabmixSvc = {
});
},
- topWin: function() {
+ topWin() {
return Services.wm.getMostRecentWindow("navigator:browser");
},
@@ -125,7 +125,7 @@ this.TabmixSvc = {
* @param aFunc
* Callback each window is passed to
*/
- forEachBrowserWindow: function(aFunc) {
+ forEachBrowserWindow(aFunc) {
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
while (windowsEnum.hasMoreElements()) {
let window = windowsEnum.getNext();
@@ -166,7 +166,7 @@ this.TabmixSvc = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
_initialized: false,
- init: function(aWindow) {
+ init(aWindow) {
// windowStartup must only be called once for each window
if ("firstWindowInSession" in aWindow.Tabmix)
return;
@@ -203,7 +203,7 @@ this.TabmixSvc = {
Cu.import("resource://tabmixplus/TabRestoreQueue.jsm", {});
},
- addMissingPrefs: function() {
+ addMissingPrefs() {
// add missing preference to the default branch
let prefs = Services.prefs.getDefaultBranch("");
@@ -220,7 +220,7 @@ this.TabmixSvc = {
}
},
- observe: function(aSubject, aTopic) {
+ observe(aSubject, aTopic) {
switch (aTopic) {
case "quit-application":
TabmixPlacesUtils.onQuitApplication();
@@ -236,7 +236,7 @@ this.TabmixSvc = {
}
},
- saveTabAttributes: function(tab, attrib, save) {
+ saveTabAttributes(tab, attrib, save) {
tabStateCache.saveTabAttributes(tab, attrib, save);
},
@@ -258,7 +258,7 @@ this.TabmixSvc = {
statesToRestore: {},
},
- isAustralisBgStyle: function(orient) {
+ isAustralisBgStyle(orient) {
if (typeof orient != "string") {
throw Components.Exception("orient is not valid", Components.results.NS_ERROR_INVALID_ARG);
}
@@ -380,7 +380,7 @@ tabStateCache = {
return this.TabStateCache;
},
- saveTabAttributes: function(tab, attrib, save = true) {
+ saveTabAttributes(tab, attrib, save = true) {
if (TabmixSvc.isPaleMoon) {
return;
}
diff --git a/modules/Utils.jsm b/modules/Utils.jsm
index fab4a18..23190bd 100644
--- a/modules/Utils.jsm
+++ b/modules/Utils.jsm
@@ -30,7 +30,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "TabmixAboutNewTab",
"resource://tabmixplus/AboutNewTab.jsm");
this.TabmixUtils = {
- initMessageManager: function(window) {
+ initMessageManager(window) {
let mm = window.getGroupMessageManager("browsers");
FMM_MESSAGES.forEach(msg => mm.addMessageListener(msg, this));
@@ -50,12 +50,12 @@ this.TabmixUtils = {
}
},
- deinit: function(window) {
+ deinit(window) {
let mm = window.getGroupMessageManager("browsers");
FMM_MESSAGES.forEach(msg => mm.removeMessageListener(msg, this));
},
- receiveMessage: function(message) {
+ receiveMessage(message) {
let browser = message.target;
let win, tab;
switch (message.name) {
@@ -110,7 +110,7 @@ this.TabmixUtils = {
return null;
},
- focusedWindow: function(content) {
+ focusedWindow(content) {
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
let focusedWindow = {};
@@ -118,7 +118,7 @@ this.TabmixUtils = {
return focusedWindow.value;
},
- makeInputStream: function(aString) {
+ makeInputStream(aString) {
let stream = Cc["@mozilla.org/io/string-input-stream;1"]
.createInstance(Ci.nsISupportsCString);
stream.data = aString;
@@ -126,7 +126,7 @@ this.TabmixUtils = {
},
// change current history title
- updateHistoryTitle: function(history, title) {
+ updateHistoryTitle(history, title) {
var shEntry = history.getEntryAtIndex(history.index, false).QueryInterface(Ci.nsISHEntry);
shEntry.setTitle(title);
}
diff --git a/modules/extensions/AddonManager.jsm b/modules/extensions/AddonManager.jsm
index da10902..5434d1a 100644
--- a/modules/extensions/AddonManager.jsm
+++ b/modules/extensions/AddonManager.jsm
@@ -20,7 +20,7 @@ const GOOGLE_PLUS_REGEXP = /http(s)?:\/\/plus.url.google.com\/url\?/;
// update the code after every extensions change
var TabGroups = {
tabViewState: false,
- isUpdateNeeded: function() {
+ isUpdateNeeded() {
let win = TabmixSvc.topWin();
let needUpdate = typeof win.TabView == "object" &&
!win.TabView.hasOwnProperty("tabmixInitialized");
@@ -28,21 +28,21 @@ var TabGroups = {
this.tabViewState = needUpdate;
return needUpdate && !currentState;
},
- onEnabled: function() {
+ onEnabled() {
if (this.isUpdateNeeded()) {
TabmixSvc.forEachBrowserWindow(aWindow => {
aWindow.TMP_TabView.init();
});
}
},
- onDisabled: function() {
+ onDisabled() {
},
};
// https://addons.mozilla.org/en-US/firefox/addon/google-no-tracking-url/
var GoogleNoTrackingUrl = {
id: "jid1-zUrvDCat3xoDSQ at jetpack",
- onEnabled: function() {
+ onEnabled() {
const pref = "extensions." + this.id + "aggresiveGoogleImagesCleanup";
TabmixSvc.isFixedGoogleUrl = function(url) {
const aggresiveWithImageUrls = TabmixSvc.prefs.get(pref, false);
@@ -54,7 +54,7 @@ var GoogleNoTrackingUrl = {
isImageSearchResult && aggresiveWithImageUrls;
};
},
- onDisabled: function() {
+ onDisabled() {
TabmixSvc.isFixedGoogleUrl = () => false;
},
};
@@ -62,13 +62,13 @@ var GoogleNoTrackingUrl = {
// https://addons.mozilla.org/en-US/firefox/addon/private-tab
var PrivateTab = {
id: "privateTab at infocatcher",
- onEnabled: function() {
+ onEnabled() {
this._resetNewTabButton();
},
- onDisabled: function() {
+ onDisabled() {
this._resetNewTabButton();
},
- _resetNewTabButton: function() {
+ _resetNewTabButton() {
TabmixSvc.forEachBrowserWindow(aWindow => {
aWindow.TMP_eventListener.updateMultiRow(true);
});
@@ -79,15 +79,15 @@ var PrivateTab = {
const SMID = "{1280606b-2510-4fe0-97ef-9b5a22eafe30}";
var SessionManager = {
id: SMID,
- init: function() {
+ init() {
this._saveTabmixPrefs();
TabmixSvc.sessionManagerAddonInstalled = true;
},
- _saveTabmixPrefs: function() {
+ _saveTabmixPrefs() {
this.manager_enabled = TabmixSvc.prefBranch.getBoolPref("sessions.manager");
this.crashRecovery_enabled = TabmixSvc.prefBranch.getBoolPref("sessions.crashRecovery");
},
- onEnabled: function() {
+ onEnabled() {
TabmixSvc.sessionManagerAddonInstalled = true;
this._saveTabmixPrefs();
let win = TabmixSvc.topWin();
@@ -95,7 +95,7 @@ var SessionManager = {
win.TMP_SessionStore.setService(-1);
this._notify(true);
},
- onDisabled: function() {
+ onDisabled() {
TabmixSvc.sessionManagerAddonInstalled = false;
if (this.manager_enabled || this.crashRecovery_enabled) {
let win = TabmixSvc.topWin();
@@ -106,7 +106,7 @@ var SessionManager = {
}
this._notify(false);
},
- _notify: function(isActive) {
+ _notify(isActive) {
// in preference/session.js we only care when the preference is boolean
let pref = "sessionManagerAddon.isActive";
TabmixSvc.prefBranch.setBoolPref(pref, isActive);
@@ -115,7 +115,7 @@ var SessionManager = {
};
var TabmixListener = {
- init: function(id) {
+ init(id) {
if (id == SessionManager.id) {
SessionManager.init();
} else if (id == GoogleNoTrackingUrl.id) {
@@ -124,7 +124,7 @@ var TabmixListener = {
TabGroups.onEnabled();
}
},
- onChange: function(aAddon, aAction) {
+ onChange(aAddon, aAction) {
let id = aAddon.id;
if (id == SessionManager.id)
SessionManager[aAction]();
@@ -136,13 +136,13 @@ var TabmixListener = {
TabGroups[aAction]();
}
},
- onEnabled: function(aAddon) {
+ onEnabled(aAddon) {
this.onChange(aAddon, "onEnabled");
},
- onDisabled: function(aAddon) {
+ onDisabled(aAddon) {
this.onChange(aAddon, "onDisabled");
},
- onInstalled: function(aAddon) {
+ onInstalled(aAddon) {
if (!aAddon.isActive || aAddon.userDisabled || aAddon.appDisabled)
return;
this.onEnabled(aAddon);
@@ -151,7 +151,7 @@ var TabmixListener = {
var TabmixAddonManager = {
initialized: false,
- init: function() {
+ init() {
if (this.initialized)
return;
this.initialized = true;
diff --git a/modules/extensions/CompatibilityCheck.jsm b/modules/extensions/CompatibilityCheck.jsm
index ce3f037..edec7d4 100644
--- a/modules/extensions/CompatibilityCheck.jsm
+++ b/modules/extensions/CompatibilityCheck.jsm
@@ -62,7 +62,7 @@ CompatibilityCheck.prototype = {
this._version = addon.version;
}
AddOn.prototype = {
- toString: function() {
+ toString() {
return this._name.toLowerCase();
}
};
diff --git a/modules/extensions/TabGroupsManager.jsm b/modules/extensions/TabGroupsManager.jsm
index cb282e5..049bb71 100644
--- a/modules/extensions/TabGroupsManager.jsm
+++ b/modules/extensions/TabGroupsManager.jsm
@@ -121,7 +121,7 @@ this.TMP_TabGroupsManager = {
},
// for TabGroupsManager use - don't change function name
- tabmixSessionsManager: function() {
+ tabmixSessionsManager() {
// this here refers to the top browser window
if (!this.Tabmix.isFirstWindow || this.Tabmix._afterTabduplicated) {
return false;
@@ -132,7 +132,7 @@ this.TMP_TabGroupsManager = {
},
// for TabGroupsManager use
- _saveAllGroupsData: function(jsonText, windowNode) {
+ _saveAllGroupsData(jsonText, windowNode) {
if (!this.enableBackup && !windowNode)
return;
try {
diff --git a/modules/log.jsm b/modules/log.jsm
index 91cc4af..d76e44b 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -14,7 +14,7 @@ XPCOMUtils.defineLazyGetter(this, "OS", () => {
var gNextID = 1;
this.console = {
- getObject: function(aWindow, aMethod) {
+ getObject(aWindow, aMethod) {
let msg = "";
if (!aWindow)
msg += "aWindow is undefined";
@@ -42,7 +42,7 @@ this.console = {
},
_timers: {},
- show: function(aMethod, aDelay, aWindow) {
+ show(aMethod, aDelay, aWindow) {
try {
if (typeof (aDelay) == "undefined")
aDelay = 500;
@@ -89,7 +89,7 @@ this.console = {
// get functions names from Error().stack
// excluding any internal caller (name start with TMP_console_)
- _getNames: function(aCount, stack) {
+ _getNames(aCount, stack) {
stack = this._getStackExcludingInternal(stack);
if (!aCount)
aCount = 1;
@@ -104,14 +104,14 @@ this.console = {
// get the name of the function that is in the nth place in Error().stack
// excluding any internal caller in the count
- getCallerNameByIndex: function(aIndex) {
+ getCallerNameByIndex(aIndex) {
let fn = this._getStackExcludingInternal()[aIndex];
if (fn)
return this._name(fn);
return null;
},
- _getStackExcludingInternal: function(stack) {
+ _getStackExcludingInternal(stack) {
if (!stack)
stack = Error().stack.split("\n").slice(2);
else
@@ -124,7 +124,7 @@ this.console = {
},
_char: "@",
- _name: function(fn) {
+ _name(fn) {
let fnName = fn.substr(0, fn.indexOf(this._char));
if (fn && !fnName) {
// get file name and line number
@@ -165,7 +165,7 @@ this.console = {
let stack = this._getStackExcludingInternal();
let stackUtil = {
- contain: function(...names) {
+ contain(...names) {
if (Array.isArray(names[0])) {
names = names[0];
}
@@ -243,7 +243,7 @@ options = {
return (this._pathRegExp = new RegExp("jar:|file:///|" + path, "g"));
},
- _formatStack: function(stack) {
+ _formatStack(stack) {
let lines = [], _char = this._char, re = this._pathRegExp;
stack.forEach(line => {
let atIndex = line.indexOf("@");
@@ -275,7 +275,7 @@ options = {
/* logMessage */
- clog: function(aMessage, caller) {
+ clog(aMessage, caller) {
this._logMessage(":\n" + aMessage, "infoFlag", caller);
},
@@ -321,7 +321,7 @@ options = {
return parent || {};
},
- reportError: function(ex = null, msg = "") {
+ reportError(ex = null, msg = "") {
if (ex === null) {
ex = "reportError was called with null";
}
--
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