[Pkg-mozext-commits] [tabmixplus] 38/73: Enable Eslint 'no-continue'
David Prévot
taffit at moszumanska.debian.org
Mon May 9 02:30:53 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit 86bc72cacb4ab06c48099d75b38dc36986e075bf
Author: onemen <tabmix.onemen at gmail.com>
Date: Sun Apr 3 16:44:00 2016 +0300
Enable Eslint 'no-continue'
---
.eslintrc.js | 2 +-
chrome/content/click/click.js | 37 +++----
chrome/content/minit/tablib.js | 28 ++---
chrome/content/preferences/preferences.js | 8 +-
.../preferences/subdialogs/pref-appearance.xml | 4 +-
.../preferences/subdialogs/pref-filetype.js | 7 +-
chrome/content/session/promptservice.js | 16 +--
chrome/content/session/session.js | 118 ++++++++++-----------
chrome/content/session/sessionStore.js | 15 ++-
chrome/content/tab/scrollbox.xml | 10 +-
chrome/content/tab/tab.js | 33 +++---
chrome/content/utils.js | 12 ++-
modules/ContentClick.jsm | 17 +--
modules/TabGroupsMigrator.jsm | 27 +++--
14 files changed, 165 insertions(+), 169 deletions(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index ce1af3f..f8be9d9 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -29,7 +29,7 @@ module.exports = {
"no-console": 0,
"no-const-assign": 2,
"no-constant-condition": 2,
- "no-continue": 0,
+ "no-continue": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index 204b191..d913d17 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -784,15 +784,12 @@ var TabmixAllTabs = {
for (var i = 0; i < this.childNodes.length; i++) {
let curTab = this.childNodes[i].tab;
- if (!curTab) // "Tab Groups" menuitem and its menuseparator
- continue;
- let curTabBO = curTab.boxObject;
- if (!curTabBO) // "Tabs From Other Computers" menuitem
- continue;
- if (Tabmix.tabsUtils.isElementVisible(curTab))
- this.childNodes[i].setAttribute("tabIsVisible", "true");
- else
- this.childNodes[i].removeAttribute("tabIsVisible");
+ if (curTab && curTab.boxObject) {
+ if (Tabmix.tabsUtils.isElementVisible(curTab))
+ this.childNodes[i].setAttribute("tabIsVisible", "true");
+ else
+ this.childNodes[i].removeAttribute("tabIsVisible");
+ }
}
},
@@ -947,24 +944,24 @@ var TabmixAllTabs = {
let tab = tabs[t];
let visible = side && Tabmix.tabsUtils.isElementVisible(tab);
if (visible) {
- if (tab.pinned)
- continue;
- else if (side == "left")
- break;
- addToMenu = true;
- continue;
- }
- if (addToMenu)
+ if (!tab.pinned) {
+ if (side == "left") {
+ break;
+ }
+ addToMenu = true;
+ }
+ } else if (addToMenu) {
this.createMenuItems(popup, tab, t);
+ }
}
break;
}
case 3: {
for (i = TMP_LastTab.tabs.length - 1; i >= 0; i--) {
let tab = TMP_LastTab.tabs[i];
- if (tab.hidden)
- continue;
- this.createMenuItems(popup, tab, i);
+ if (!tab.hidden) {
+ this.createMenuItems(popup, tab, i);
+ }
}
break;
}
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 37b51e2..6e17097 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -1373,12 +1373,12 @@ var tablib = { // eslint-disable-line
var items = Array.prototype.filter.call(this.tabContainer.getElementsByAttribute("tabmix_selectedID", "*"),
tab => !tab.hidden && !tab.closing);
for (var i = 0; i < items.length; ++i) {
- if (aTab && items[i] == aTab)
- continue;
- temp_id = parseInt(items[i].getAttribute("tabmix_selectedID") || 0);
- if (temp_id && temp_id > max_id) {
- max_id = temp_id;
- tempIndex = tabs.indexOf(items[i]);
+ if (aTab && items[i] != aTab) {
+ temp_id = parseInt(items[i].getAttribute("tabmix_selectedID") || 0);
+ if (temp_id && temp_id > max_id) {
+ max_id = temp_id;
+ tempIndex = tabs.indexOf(items[i]);
+ }
}
}
@@ -1490,10 +1490,10 @@ var tablib = { // eslint-disable-line
function addProtected(aTabs) {
for (let i = 0; i < aTabs.length; i++) {
let tab = aTabs[i];
- if (!onExit && tab.hidden)
- continue;
- if (protectedTabs.indexOf(tab) == -1)
+ if (protectedTabs.indexOf(tab) == -1 &&
+ (onExit || !tab.hidden)) {
protectedTabs.push(aTabs[i]);
+ }
}
}
// we always restore pinned tabs no need to warn about closing
@@ -1937,11 +1937,11 @@ var tablib = { // eslint-disable-line
let l = tabs.length;
for (let i = 0; i < l; i++) {
let tab = tabs[i];
- if (tab == skipTab || tab.linkedBrowser.__SS_restoreState == 2)
- continue;
- try {
- tab.linkedBrowser.reload();
- } catch (ex) { }
+ if (tab != skipTab && tab.linkedBrowser.__SS_restoreState != 2) {
+ try {
+ tab.linkedBrowser.reload();
+ } catch (ex) { }
+ }
}
}
diff --git a/chrome/content/preferences/preferences.js b/chrome/content/preferences/preferences.js
index 06c97ed..713ecbe 100644
--- a/chrome/content/preferences/preferences.js
+++ b/chrome/content/preferences/preferences.js
@@ -500,10 +500,10 @@ function loadData(pattern) {
let valIndex = pattern[i].indexOf("=");
if (valIndex > 0) {
prefName = pattern[i].substring(0, valIndex);
- if (SMinstalled && sessionPrefs.indexOf(prefName) > -1)
- continue;
- prefValue = pattern[i].substring(valIndex + 1, pattern[i].length);
- setPrefByType(prefName, prefValue, true);
+ if (!SMinstalled || sessionPrefs.indexOf(prefName) == -1) {
+ prefValue = pattern[i].substring(valIndex + 1, pattern[i].length);
+ setPrefByType(prefName, prefValue, true);
+ }
}
}
gPrefWindow.afterShortcutsChanged();
diff --git a/chrome/content/preferences/subdialogs/pref-appearance.xml b/chrome/content/preferences/subdialogs/pref-appearance.xml
index c63abc8..6f290cc 100644
--- a/chrome/content/preferences/subdialogs/pref-appearance.xml
+++ b/chrome/content/preferences/subdialogs/pref-appearance.xml
@@ -145,9 +145,7 @@
for (let _id of Object.keys(this._prefValues)) {
var item = this._getElementById(_id);
- if (!item)
- continue;
- switch (item.localName) {
+ switch (item && item.localName) {
case "checkbox":
case "checkbox_tmp":
item.checked = this._prefValues[_id];
diff --git a/chrome/content/preferences/subdialogs/pref-filetype.js b/chrome/content/preferences/subdialogs/pref-filetype.js
index 31ea563..e74512e 100644
--- a/chrome/content/preferences/subdialogs/pref-filetype.js
+++ b/chrome/content/preferences/subdialogs/pref-filetype.js
@@ -32,9 +32,10 @@ function FillData() {
items = data.split(' ');
for (var i = 0; i < items.length; ++i) {
- if (items[i] === "") continue;
- item = items[i].trim();
- list.appendItem(item, item.toLowerCase());
+ if (items[i] !== "") {
+ item = items[i].trim();
+ list.appendItem(item, item.toLowerCase());
+ }
}
list.selectedIndex = 0;
diff --git a/chrome/content/session/promptservice.js b/chrome/content/session/promptservice.js
index 67fa88c..f4fb1b6 100644
--- a/chrome/content/session/promptservice.js
+++ b/chrome/content/session/promptservice.js
@@ -63,8 +63,8 @@ function prompt_init() {
var item;
for (i = 1; i < popup.childNodes.length; ++i) {
item = popup.childNodes[i];
- if (item.localName == "menuseparator") continue;
- if (item.getAttribute("disabled") != "true") {
+ if (item.localName != "menuseparator" &&
+ item.getAttribute("disabled") != "true") {
index = i;
break;
}
@@ -209,13 +209,13 @@ function inputText(textBox) {
if (validName === 0) {
for (var i = 0; i < gSavedName.length; i++) {
if (name == gSavedName[i].toLowerCase() && gSavedName[i] !== "") {
- if (dialogParams.GetInt(3) == TMP_DLG_RENAME) {
- if (gOrigName != name) validName = 2;
- continue;
+ if (dialogParams.GetInt(3) != TMP_DLG_RENAME) {
+ validName = 3;
+ dialogParams.SetInt(6, i);
+ break;
+ } else if (gOrigName != name) {
+ validName = 2;
}
- validName = 3;
- dialogParams.SetInt(6, i);
- break;
}
}
}
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index f3b229d..baff41e 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -474,9 +474,9 @@ TabmixSessionManager = {
while (windowEnum.hasMoreElements()) {
var rdfNodeWindow = windowEnum.getNext();
// skip this window....
- if (rdfNodeThisWin == rdfNodeWindow)
- continue;
- this.setLiteral(rdfNodeWindow, "dontLoad", "true");
+ if (rdfNodeThisWin != rdfNodeWindow) {
+ this.setLiteral(rdfNodeWindow, "dontLoad", "true");
+ }
}
if (window.toolbar.visible && gBrowser.isBlankNotBusyTab(gBrowser.mCurrentTab))
@@ -1532,13 +1532,14 @@ TabmixSessionManager = {
var windowEnum = container.GetElements();
while (windowEnum.hasMoreElements()) {
var rdfNodeWindow = windowEnum.getNext();
- if (prop && this.nodeHasArc(rdfNodeWindow, prop))
- continue;
- numWindows += 1;
- var rdfNodeTabs = this.getResource(rdfNodeWindow, "tabs");
- if (rdfNodeTabs instanceof Ci.nsIRDFResource) {
- var tabContainer = this.initContainer(rdfNodeTabs);
- numTabs += tabContainer.GetCount();
+ let skip = prop && this.nodeHasArc(rdfNodeWindow, prop);
+ if (!skip) {
+ numWindows += 1;
+ var rdfNodeTabs = this.getResource(rdfNodeWindow, "tabs");
+ if (rdfNodeTabs instanceof Ci.nsIRDFResource) {
+ var tabContainer = this.initContainer(rdfNodeTabs);
+ numTabs += tabContainer.GetCount();
+ }
}
}
return {win: numWindows, tab: numTabs};
@@ -1844,10 +1845,7 @@ TabmixSessionManager = {
if (!menu.parentNode.hasAttribute("sessionmanager-menu") &&
menu.parentNode.getAttribute("anonid") != "delete")
break;
- else
- continue;
- }
- if (destroy) {
+ } else if (destroy) {
i--;
menu.removeChild(item);
} else if (item.id.indexOf("-startSeparator") != -1) destroy = true;
@@ -1925,9 +1923,12 @@ TabmixSessionManager = {
var closedWinList = parentId.indexOf("closedwindows") != -1;
while (containerEnum.hasMoreElements()) {
node = containerEnum.getNext();
- if (this.nodeHasArc(node, "private") || this.nodeHasArc(node, "status") &&
- this.getLiteralValue(node, "status") != "saved") continue;
- nodes.push(node);
+ let skipNode = this.nodeHasArc(node, "private") ||
+ this.nodeHasArc(node, "status") &&
+ this.getLiteralValue(node, "status") != "saved";
+ if (!skipNode) {
+ nodes.push(node);
+ }
}
var count = nodes.length;
let restoreSession = function(event) {
@@ -1950,23 +1951,24 @@ TabmixSessionManager = {
mi.style.setProperty("color", "blue", "important");
mi.history = true;
}
- if (contents == 1 && loadsession > -1 && mi.session && mi.session == sessionpath) continue;
- mi.setAttribute("value", i);
- // Ubuntu global menu prevents Session manager menu from working from Tools menu
- // this hack is only for left click, middle click and right click still not working
- if (TabmixSvc.isLinux && parentId == "tm-sessionmanager")
- mi.addEventListener("command", restoreSession);
- mi.value = i;
- if (parentID != "onStart.loadsession") {
- index = closedWinList ? count - 1 - i : i;
- accessKey = (index > 25) ? "" : String.fromCharCode(65 + index) + " ";
- mi.setAttribute("accesskey", accessKey);
- mi.setAttribute("label", accessKey + name + (showNameExt ? nameExt : ""));
- if (showTooltip) mi.setAttribute("tooltiptext", accessKey + name + nameExt);
- } else {
- mi.setAttribute("label", name);
+ if (contents != 1 || loadsession < 0 || mi.session != sessionpath) {
+ mi.setAttribute("value", i);
+ // Ubuntu global menu prevents Session manager menu from working from Tools menu
+ // this hack is only for left click, middle click and right click still not working
+ if (TabmixSvc.isLinux && parentId == "tm-sessionmanager")
+ mi.addEventListener("command", restoreSession);
+ mi.value = i;
+ if (parentID != "onStart.loadsession") {
+ index = closedWinList ? count - 1 - i : i;
+ accessKey = (index > 25) ? "" : String.fromCharCode(65 + index) + " ";
+ mi.setAttribute("accesskey", accessKey);
+ mi.setAttribute("label", accessKey + name + (showNameExt ? nameExt : ""));
+ if (showTooltip) mi.setAttribute("tooltiptext", accessKey + name + nameExt);
+ } else {
+ mi.setAttribute("label", name);
+ }
+ popup.insertBefore(mi, closedWinList ? popup.childNodes[1] : endSeparator);
}
- popup.insertBefore(mi, closedWinList ? popup.childNodes[1] : endSeparator);
}
var allEmpty = true;
switch (parentID) {
@@ -2039,15 +2041,16 @@ TabmixSessionManager = {
var i, item, value, checked;
for (i = 0; i < popup.childNodes.length; i++) {
item = popup.childNodes[i];
- if (item.localName == "menuseparator") continue;
- value = item.getAttribute("value");
- checked = ((loadsession > -1 && item.session && item.session == sessionpath) ||
- (loadsession <= -1 && value && value == loadsession));
- if (checked) {
- item.setAttribute("default", "true");
- popup.parentNode.defaultIndex = i;
- popup.parentNode.sessionIndex = value;
- } else item.removeAttribute("default");
+ if (item.localName != "menuseparator") {
+ value = item.getAttribute("value");
+ checked = ((loadsession > -1 && item.session && item.session == sessionpath) ||
+ (loadsession <= -1 && value && value == loadsession));
+ if (checked) {
+ item.setAttribute("default", "true");
+ popup.parentNode.defaultIndex = i;
+ popup.parentNode.sessionIndex = value;
+ } else item.removeAttribute("default");
+ }
}
},
@@ -2515,11 +2518,11 @@ TabmixSessionManager = {
var wnd, savedTabs = 0, savedWin = 0, thisWin;
while (enumerator.hasMoreElements()) {
wnd = enumerator.getNext();
- if (this.isWindowPrivate(wnd))
- continue;
- thisWin = wnd.TabmixSessionManager.saveOneWindow(path, caller, false, saveClosedTabs);
- savedTabs += thisWin;
- if (thisWin > 0) savedWin += 1;
+ if (!this.isWindowPrivate(wnd)) {
+ thisWin = wnd.TabmixSessionManager.saveOneWindow(path, caller, false, saveClosedTabs);
+ savedTabs += thisWin;
+ if (thisWin > 0) savedWin += 1;
+ }
}
return {win: savedWin, tab: savedTabs};
},
@@ -3058,14 +3061,13 @@ TabmixSessionManager = {
var windowsList = [];
while (windowEnum.hasMoreElements()) {
let win = windowEnum.getNext();
- if (win.TabmixSessionManager.windowClosed)
- continue;
+ let closed = win.TabmixSessionManager.windowClosed;
if (this.isWindowPrivate(win) != this.isPrivateWindow) {
- if (overwriteWindows)
+ if (overwriteWindows && !closed)
win.close();
- continue;
+ } else if (!closed) {
+ windowsList.push(win);
}
- windowsList.push(win);
}
if (!state.selectedWindow || state.selectedWindow > state.windows.length) {
@@ -3531,15 +3533,11 @@ TabmixSessionManager = {
var rdfNodeTabs = this.getResource(winPath, "tabs");
var rdfLabelTabs = rdfNodeTabs.QueryInterface(Ci.nsIRDFResource).Value;
var ctabs = TMP_ClosedTabs.getClosedTabData;
- var tabCount = ctabs.length;
var maxTabsUndo = Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo");
- for (var i = tabCount - 1; i >= 0; i--) {
- let tabData = ctabs[i];
- let data = this.getSessionStoreDataForRDF(tabData);
- if (!data)
- continue;
+ ctabs = ctabs.filter(tabData => this.getSessionStoreDataForRDF(tabData));
+ ctabs.reverse().forEach(data => {
let uniqueId, rdfLabelSession, newNode;
- uniqueId = "panel" + Date.now() + i;
+ uniqueId = "panel" + Date.now() + Math.random();
rdfLabelSession = rdfLabelTabs + "/" + uniqueId;
newNode = this.RDFService.GetResource(rdfLabelSession);
toContainer.AppendElement(newNode);
@@ -3548,7 +3546,7 @@ TabmixSessionManager = {
// delete old entry if closedTabs container wasn't empty
if (toContainer.GetCount() > maxTabsUndo)
this.deleteClosedtabAt(1, winPath);
- }
+ });
this.saveStateDelayed();
},
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index 41e3a06..f102ef0 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -686,9 +686,8 @@ var TabmixConvertSession = {
let rdfNodeWindow = sessionEnum.getNext();
if (rdfNodeWindow instanceof Ci.nsIRDFResource) {
let windowPath = rdfNodeWindow.QueryInterface(Ci.nsIRDFResource).Value;
- if (TabmixSessionManager.nodeHasArc(windowPath, "dontLoad"))
- continue;
- let aWindowState = this.getWindowState(rdfNodeWindow, internal);
+ let getState = !TabmixSessionManager.nodeHasArc(windowPath, "dontLoad");
+ let aWindowState = getState && this.getWindowState(rdfNodeWindow, internal);
if (aWindowState) {// don't save empty windows
aWindowState.index = TabmixSessionManager.getLiteralValue(rdfNodeWindow, "SSi", index++);
_windows.push(aWindowState);
@@ -911,11 +910,11 @@ var TabmixConvertSession = {
let entry = {url: "", children: [], ID: 0};
let index = i * 3;
entry.url = historyData[index + 1];
- if (!entry.url)
- continue;
- entry.title = decodeData(historyData[index], !newFormat);
- entry.scroll = historyData[index + 2];
- entries.push(entry);
+ if (entry.url) {
+ entry.title = decodeData(historyData[index], !newFormat);
+ entry.scroll = historyData[index + 2];
+ entries.push(entry);
+ }
}
return entries;
}
diff --git a/chrome/content/tab/scrollbox.xml b/chrome/content/tab/scrollbox.xml
index 94da39d..63e4b08 100644
--- a/chrome/content/tab/scrollbox.xml
+++ b/chrome/content/tab/scrollbox.xml
@@ -411,11 +411,8 @@
var index, current = 0;
for (let i = 0; i < tabs.length; i++) {
let tab = tabs[i];
- if (tab.closing) {
- tab.removeAttribute("tabmix-firstTabInRow");
- continue;
- }
- let row = Tabmix.tabsUtils.getTabRowNumber(tab, topY);
+ let row = tab.closing ? -1 :
+ Tabmix.tabsUtils.getTabRowNumber(tab, topY);
if (row > current) {
current = row;
if (!tab.hasAttribute("tabmix-firstTabInRow"))
@@ -426,7 +423,8 @@
(Tabmix.ltr ? tab.getBoundingClientRect().width : 0);
if (!Tabmix.compare(tabEnd, containerEnd, Tabmix.rtl)) {
tab.removeAttribute("tabmix-firstTabInRow");
- continue;
+ // continue
+ row = -1;
}
}
if (row == firstVisibleRow) {
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index e35bad2..2c61d3f 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -1296,23 +1296,24 @@ gTMPprefObserver = {
let lockAppTabs = Tabmix.prefs.getBoolPref("lockAppTabs");
for (let i = 0; i < gBrowser.tabs.length; i++) {
let tab = gBrowser.tabs[i];
- if (tab.pinned != updatePinned)
- continue; // only update for the appropriate tabs type
- // when user change settings to lock all tabs we always lock all tabs
- // regardless if they were lock and unlocked before by the user
- if (updatePinned ? lockAppTabs : TabmixTabbar.lockallTabs) {
- tab.setAttribute("locked", "true");
- } else {
- tab.removeAttribute("locked");
- }
- if (updatePinned) {
- tab.removeAttribute("_lockedAppTabs");
- tab.setAttribute("_locked", tab.hasAttribute("locked"));
- } else {
- tab.removeAttribute("_locked");
+ // only update for the appropriate tabs type
+ if (tab.pinned == updatePinned) {
+ // when user change settings to lock all tabs we always lock all tabs
+ // regardless if they were lock and unlocked before by the user
+ if (updatePinned ? lockAppTabs : TabmixTabbar.lockallTabs) {
+ tab.setAttribute("locked", "true");
+ } else {
+ tab.removeAttribute("locked");
+ }
+ if (updatePinned) {
+ tab.removeAttribute("_lockedAppTabs");
+ tab.setAttribute("_locked", tab.hasAttribute("locked"));
+ } else {
+ tab.removeAttribute("_locked");
+ }
+ tab.linkedBrowser.tabmix_allowLoad = !tab.hasAttribute("locked");
+ TabmixSvc.saveTabAttributes(tab, "_locked", false);
}
- tab.linkedBrowser.tabmix_allowLoad = !tab.hasAttribute("locked");
- TabmixSvc.saveTabAttributes(tab, "_locked", false);
}
// force Sessionstore to save our changes
TabmixSvc.SessionStore.saveStateDelayed(window);
diff --git a/chrome/content/utils.js b/chrome/content/utils.js
index 77a1773..7fa2de9 100644
--- a/chrome/content/utils.js
+++ b/chrome/content/utils.js
@@ -182,11 +182,13 @@ var Tabmix = {
var count = 0;
while (enumerator.hasMoreElements()) {
let win = enumerator.getNext();
- if ("TabmixSessionManager" in win && win.TabmixSessionManager.windowClosed)
- continue;
- count++;
- if (!all && count == 2)
- break;
+ let isClosed = "TabmixSessionManager" in win &&
+ win.TabmixSessionManager.windowClosed;
+ if (!isClosed) {
+ count++;
+ if (!all && count == 2)
+ break;
+ }
}
return count;
},
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 93a000b..40e6887 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -738,6 +738,7 @@ ContentClickInternal = {
var testString, hrefExt, testExt;
for (var l = 0; l < filetype.length; l++) {
+ let doTest = true;
if (filetype[l].indexOf("/") != -1) {
// add \ before first ?
testString = filetype[l].substring(1, filetype[l].length - 1).replace(/^\?/, "\\?");
@@ -749,13 +750,15 @@ ContentClickInternal = {
// prevent filetype catch if it is in the middle of a word
testExt = new RegExp(testString + "[a-z0-9?.]+", 'i');
if (testExt.test(hrefExt))
- continue;
+ doTest = false;
} catch (ex) {}
}
try {
- testExt = new RegExp(testString, 'i');
- if (testExt.test(hrefExt))
- return true;
+ if (doTest) {
+ testExt = new RegExp(testString, 'i');
+ if (testExt.test(hrefExt))
+ return true;
+ }
} catch (ex) {}
}
return false;
@@ -986,10 +989,10 @@ ContentClickInternal = {
let winEnum = Services.wm.getEnumerator("navigator:browser");
while (winEnum.hasMoreElements()) {
let browserWin = winEnum.getNext();
- if (browserWin.closed || browserWin == window)
- continue;
- if (isValidWindow(browserWin))
+ if (!browserWin.closed && browserWin != window &&
+ isValidWindow(browserWin)) {
windows.push(browserWin);
+ }
}
this.isFrameInContent.start(windows, {href: href, name: targetFrame});
},
diff --git a/modules/TabGroupsMigrator.jsm b/modules/TabGroupsMigrator.jsm
index 941626d..19365d5 100644
--- a/modules/TabGroupsMigrator.jsm
+++ b/modules/TabGroupsMigrator.jsm
@@ -63,14 +63,13 @@ this.TabmixGroupsMigrator = {
let rdfNodeSession = sessionEnum.getNext();
if (rdfNodeSession instanceof Ci.nsIRDFResource) {
let windowPath = rdfNodeSession.QueryInterface(Ci.nsIRDFResource).Value;
- if (sm.nodeHasArc(windowPath, "dontLoad")) {
- continue;
- }
- let data = sm.getLiteralValue(windowPath, "tabview-groups", "{}");
- let parsedData = TabmixSvc.JSON.parse(data);
- if (parsedData.totalNumber > 1) {
- notify = true;
- return true;
+ if (!sm.nodeHasArc(windowPath, "dontLoad")) {
+ let data = sm.getLiteralValue(windowPath, "tabview-groups", "{}");
+ let parsedData = TabmixSvc.JSON.parse(data);
+ if (parsedData.totalNumber > 1) {
+ notify = true;
+ return true;
+ }
}
}
}
@@ -230,12 +229,12 @@ this.TabmixGroupsMigrator = {
let singleanonGroup = windowGroups[0].anonGroupID && windowGroups.length == 1;
if (singleanonGroup) {
windowGroups[0].tabGroupsMigrationTitle = winTitle;
- continue;
- }
- for (let group of windowGroups) {
- let title = group.anonGroupID ?
- getTitle(++anonGroupCount) : group.tabGroupsMigrationTitle;
- group.tabGroupsMigrationTitle = winTitle + " " + title;
+ } else {
+ for (let group of windowGroups) {
+ let title = group.anonGroupID ?
+ getTitle(++anonGroupCount) : group.tabGroupsMigrationTitle;
+ group.tabGroupsMigrationTitle = winTitle + " " + title;
+ }
}
} else {
windowGroupMap = new Map();
--
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