for(const.. => for(let..
This commit is contained in:
parent
9ef7b1edad
commit
82a455d3c1
2 changed files with 12 additions and 12 deletions
20
index.js
20
index.js
|
@ -64,7 +64,7 @@ let ContainerService = {
|
||||||
});
|
});
|
||||||
|
|
||||||
// It can happen that this jsm is loaded after the opening a container tab.
|
// It can happen that this jsm is loaded after the opening a container tab.
|
||||||
for (const tab of tabs) {
|
for (let tab of tabs) {
|
||||||
const userContextId = this._getUserContextIdFromTab(tab);
|
const userContextId = this._getUserContextIdFromTab(tab);
|
||||||
if (userContextId) {
|
if (userContextId) {
|
||||||
++this._identitiesState[userContextId].openTabs;
|
++this._identitiesState[userContextId].openTabs;
|
||||||
|
@ -160,7 +160,7 @@ let ContainerService = {
|
||||||
|
|
||||||
_getTabList(userContextId) {
|
_getTabList(userContextId) {
|
||||||
let list = [];
|
let list = [];
|
||||||
for (const tab of tabs) {
|
for (let tab of tabs) {
|
||||||
if (userContextId === this._getUserContextIdFromTab(tab)) {
|
if (userContextId === this._getUserContextIdFromTab(tab)) {
|
||||||
let object = { title: tab.title, url: tab.url, id: tab.id };
|
let object = { title: tab.title, url: tab.url, id: tab.id };
|
||||||
list.push(object);
|
list.push(object);
|
||||||
|
@ -179,7 +179,7 @@ let ContainerService = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const tab of tabs) {
|
for (let tab of tabs) {
|
||||||
if (args.userContextId !== this._getUserContextIdFromTab(tab)) {
|
if (args.userContextId !== this._getUserContextIdFromTab(tab)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ let ContainerService = {
|
||||||
|
|
||||||
// Let's collect UCIs/tabs for this window.
|
// Let's collect UCIs/tabs for this window.
|
||||||
let map = new Map;
|
let map = new Map;
|
||||||
for (const tab of tabs) {
|
for (let tab of tabs) {
|
||||||
if (pinnedTabs && !tabsUtils.isPinned(tab)) {
|
if (pinnedTabs && !tabsUtils.isPinned(tab)) {
|
||||||
// We don't have, or we already handled all the pinned tabs.
|
// We don't have, or we already handled all the pinned tabs.
|
||||||
break;
|
break;
|
||||||
|
@ -253,7 +253,7 @@ let ContainerService = {
|
||||||
|
|
||||||
// Let's move tabs.
|
// Let's move tabs.
|
||||||
sortMap.forEach(tabs => {
|
sortMap.forEach(tabs => {
|
||||||
for (const tab of tabs) {
|
for (let tab of tabs) {
|
||||||
xulWindow.gBrowser.moveTabTo(tab, pos++);
|
xulWindow.gBrowser.moveTabTo(tab, pos++);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -290,7 +290,7 @@ let ContainerService = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const tab of tabs) {
|
for (let tab of tabs) {
|
||||||
if (tab.id === args.tabId) {
|
if (tab.id === args.tabId) {
|
||||||
tab.window.activate();
|
tab.window.activate();
|
||||||
tab.activate();
|
tab.activate();
|
||||||
|
@ -324,7 +324,7 @@ let ContainerService = {
|
||||||
const newBrowserWindow = viewFor(window);
|
const newBrowserWindow = viewFor(window);
|
||||||
|
|
||||||
// Let's move the tab to the new window.
|
// Let's move the tab to the new window.
|
||||||
for (const tab of list) {
|
for (let tab of list) {
|
||||||
const newTab = newBrowserWindow.gBrowser.addTab("about:blank");
|
const newTab = newBrowserWindow.gBrowser.addTab("about:blank");
|
||||||
newBrowserWindow.gBrowser.swapBrowsersAndCloseOther(newTab, tab);
|
newBrowserWindow.gBrowser.swapBrowsersAndCloseOther(newTab, tab);
|
||||||
// swapBrowsersAndCloseOther is an internal method of gBrowser
|
// swapBrowsersAndCloseOther is an internal method of gBrowser
|
||||||
|
@ -337,7 +337,7 @@ let ContainerService = {
|
||||||
// Let's close all the normal tab in the new window. In theory it
|
// Let's close all the normal tab in the new window. In theory it
|
||||||
// should be only the first tab, but maybe there are addons doing
|
// should be only the first tab, but maybe there are addons doing
|
||||||
// crazy stuff.
|
// crazy stuff.
|
||||||
for (const tab of window.tabs) {
|
for (let tab of window.tabs) {
|
||||||
const userContextId = this._getUserContextIdFromTab(tab);
|
const userContextId = this._getUserContextIdFromTab(tab);
|
||||||
if (args.userContextId !== userContextId) {
|
if (args.userContextId !== userContextId) {
|
||||||
newBrowserWindow.gBrowser.removeTab(viewFor(tab));
|
newBrowserWindow.gBrowser.removeTab(viewFor(tab));
|
||||||
|
@ -395,7 +395,7 @@ let ContainerService = {
|
||||||
},
|
},
|
||||||
|
|
||||||
createIdentity(args) {
|
createIdentity(args) {
|
||||||
for (const arg of [ "name", "color", "icon"]) {
|
for (let arg of [ "name", "color", "icon"]) {
|
||||||
if (!(arg in args)) {
|
if (!(arg in args)) {
|
||||||
Promise.reject("createIdentity must be called with " + arg + " argument.");
|
Promise.reject("createIdentity must be called with " + arg + " argument.");
|
||||||
return;
|
return;
|
||||||
|
@ -414,7 +414,7 @@ let ContainerService = {
|
||||||
}
|
}
|
||||||
|
|
||||||
let identity = ContextualIdentityService.getIdentityFromId(args.userContextId);
|
let identity = ContextualIdentityService.getIdentityFromId(args.userContextId);
|
||||||
for (const arg of [ "name", "color", "icon"]) {
|
for (let arg of [ "name", "color", "icon"]) {
|
||||||
if ((arg in args)) {
|
if ((arg in args)) {
|
||||||
identity[arg] = args[arg];
|
identity[arg] = args[arg];
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ function showContainerTabsPanel(identity) {
|
||||||
hideShowLabel.innerText = identity.hasHiddenTabs ? "Show these container tabs" : "Hide these container tabs";
|
hideShowLabel.innerText = identity.hasHiddenTabs ? "Show these container tabs" : "Hide these container tabs";
|
||||||
|
|
||||||
// Let"s remove all the previous tabs.
|
// Let"s remove all the previous tabs.
|
||||||
for (const trTab of document.getElementsByClassName("container-info-tab")) {
|
for (let trTab of document.getElementsByClassName("container-info-tab")) {
|
||||||
trTab.remove();
|
trTab.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ function showContainerTabsPanel(identity) {
|
||||||
log('browser.runtime.sendMessage getTabs, tabs: ', tabs);
|
log('browser.runtime.sendMessage getTabs, tabs: ', tabs);
|
||||||
// For each one, let's create a new line.
|
// For each one, let's create a new line.
|
||||||
let fragment = document.createDocumentFragment();
|
let fragment = document.createDocumentFragment();
|
||||||
for (const tab of tabs) {
|
for (let tab of tabs) {
|
||||||
let tr = document.createElement("tr");
|
let tr = document.createElement("tr");
|
||||||
fragment.appendChild(tr);
|
fragment.appendChild(tr);
|
||||||
tr.classList.add("container-info-tab");
|
tr.classList.add("container-info-tab");
|
||||||
|
|
Loading…
Add table
Reference in a new issue