From 4ff998341c168656ec06dba571da8e74472435dd Mon Sep 17 00:00:00 2001 From: mastef Date: Tue, 1 Oct 2024 09:48:00 +0700 Subject: [PATCH] 5.2.3 --- .babelrc | 2 +- CHANGELOG.md | 4 + changelog.html | 7 +- manifest-firefox.json | 2 +- outlib/Session.js | 101 ++++----------- outlib/TabManager.js | 2 +- outlib/TabOptions.js | 2 +- outlib/TabOptionsFirefox.js | 2 +- outlib/background.js | 236 +++++++++++++++++++++++++----------- package.json | 2 +- readme.md | 2 +- 11 files changed, 202 insertions(+), 160 deletions(-) diff --git a/.babelrc b/.babelrc index 88e5f1f0..223e3084 100644 --- a/.babelrc +++ b/.babelrc @@ -9,7 +9,7 @@ "sourceType": "script", "plugins": [ ["inline-replace-variables", { - "__VERSION__": "5.2.2" + "__VERSION__": "5.2.3" }] ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 50bb27ac..72d7e77b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +5.2.3 +===== +- Fix: Allow restoring saved sessions from the popup + 5.2.2 ===== - Fix: Avoid non-Firefox permissions checks diff --git a/changelog.html b/changelog.html index 98a7f466..0e1b4fd2 100644 --- a/changelog.html +++ b/changelog.html @@ -19,7 +19,7 @@
-

Tab Manager Plus 5.2.2

+

Tab Manager Plus 5.2.3

@@ -35,6 +35,11 @@

Here's what's planned for future versions

Here's what's new since the last time

+

5.2.3

+
    +
  • Fix: Allow restoring saved sessions from the popup
  • +
+

5.2.2

  • Fix: Avoid non-Firefox permissions checks
  • diff --git a/manifest-firefox.json b/manifest-firefox.json index 8bc2d9a5..c78469ae 100644 --- a/manifest-firefox.json +++ b/manifest-firefox.json @@ -1,7 +1,7 @@ { "name": "Tab Manager Plus for Firefox", "short_name": "Tab Manager+", - "version": "5.2.2", + "version": "5.2.3", "manifest_version": 2, "description": "Quickly find open tabs, see all windows in one view, find duplicates and limit tabs per window. The best Tab Manager for Firefox.", "author": "stefanXO", diff --git a/outlib/Session.js b/outlib/Session.js index 26c246fe..fa4e7f11 100644 --- a/outlib/Session.js +++ b/outlib/Session.js @@ -127,91 +127,26 @@ Session = function (_React$Component) {_inherits(Session, _React$Component); return true; } }, { key: "stop", value: function stop( e) { - e.stopPropagation(); + this.stopProp(e); } }, { key: "windowClick", value: function () {var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee( - e) {var _this2, customName, whitelistWindow, whitelistTab, filteredWindow, newWindow, emptyTab, i, newTab, tabCreated, names;return regeneratorRuntime.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0: + e) {var _this2, backgroundPage;return regeneratorRuntime.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0: _this2 = this; - e.stopPropagation(); + this.stopProp(e); console.log("source window", this.props.window); // chrome.runtime.getBackgroundPage(function callback(tabs, backgroundPage) { // backgroundPage.createWindowWithTabs(tabs); // }.bind(null, this.props.window.tabs)); - - customName = false; - if (this.props.window && this.props.window.name && this.props.window.customName) { - customName = this.props.window.name; - } - - whitelistWindow = ["left", "top", "width", "height", "incognito", "type"]; - + _context.next = 5;return ( + browser.runtime.getBackgroundPage());case 5:backgroundPage = _context.sent; if (navigator.userAgent.search("Firefox") > -1) { - whitelistWindow = ["left", "top", "width", "height", "incognito", "type"]; + backgroundPage.createWindowWithTabsFromSessionDelayed(this.props.window); + } else { + backgroundPage.createWindowWithTabsFromSession(this.props.window); } - whitelistTab = ["url", "active", "selected", "pinned"]; - - if (navigator.userAgent.search("Firefox") > -1) { - whitelistTab = ["url", "active", "pinned"]; - } + /////// - filteredWindow = Object.keys(this.props.window.windowsInfo). - filter(function (key) { - return whitelistWindow.includes(key); - }). - reduce(function (obj, key) { - obj[key] = _this2.props.window.windowsInfo[key]; - return obj; - }, {}); - console.log("filtered window", filteredWindow);_context.next = 13;return ( - - browser.windows.create(filteredWindow).catch(function (error) { - console.error(error); - console.log(error); - console.log(error.message); - }));case 13:newWindow = _context.sent; - - emptyTab = newWindow.tabs[0].id; - - i = 0;case 16:if (!(i < this.props.window.tabs.length)) {_context.next = 27;break;} - newTab = Object.keys(this.props.window.tabs[i]). - filter(function (key) { - return whitelistTab.includes(key); - }). - reduce(function (obj, key) { - obj[key] = _this2.props.window.tabs[i][key]; - return obj; - }, {}); - console.log("source tab", newTab); - if (navigator.userAgent.search("Firefox") > -1) { - if (!!newTab.url && newTab.url.search("about:") > -1) { - console.log("filtered by about: url", newTab.url); - newTab.url = ""; - } - } - newTab.windowId = newWindow.id;_context.next = 23;return ( - browser.tabs.create(newTab).catch(function (error) { - console.error(error); - console.log(error); - console.log(error.message); - }));case 23:tabCreated = _context.sent;case 24:i++;_context.next = 16;break;case 27:_context.next = 29;return ( - - - browser.tabs.remove(emptyTab).catch(function (error) { - console.error(error); - console.log(error); - console.log(error.message); - }));case 29: - - if (customName) { - names = localStorage["windowNames"]; - if (!!names) { - names = JSON.parse(names); - } else { - names = {}; - } - names[newWindow.id] = customName || ""; - localStorage["windowNames"] = JSON.stringify(names); - } + console.log("updating parent"); this.props.parentUpdate(); @@ -235,17 +170,27 @@ Session = function (_React$Component) {_inherits(Session, _React$Component); // browser.windows.update(this.props.window.windowsInfo.id, { // "focused": true }, // function (a) {this.props.parentUpdate();}.bind(this)); - case 32:case "end":return _context.stop();}}}, _callee, this);}));function windowClick(_x) {return _ref.apply(this, arguments);}return windowClick;}() }, { key: "close", value: function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2( + case 10:case "end":return _context.stop();}}}, _callee, this);}));function windowClick(_x) {return _ref.apply(this, arguments);}return windowClick;}() }, { key: "close", value: function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2( e) {var value;return regeneratorRuntime.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0: - e.stopPropagation();_context2.next = 3;return ( + this.stopProp(e);_context2.next = 3;return ( browser.storage.local.remove(this.props.window.id));case 3:value = _context2.sent; console.log(value); this.props.parentUpdate(); // browser.windows.remove(this.props.window.windowsInfo.id); case 6:case "end":return _context2.stop();}}}, _callee2, this);}));function close(_x2) {return _ref2.apply(this, arguments);}return close;}() }, { key: "maximize", value: function maximize( e) { - e.stopPropagation(); + this.stopProp(e); // browser.windows.update(this.props.window.windowsInfo.id, { // "state": "normal" }, // function (a) {this.props.parentUpdate();}.bind(this)); + } }, { key: "stopProp", value: function stopProp( + e) { + if (e && e.nativeEvent) { + e.nativeEvent.preventDefault(); + e.nativeEvent.stopPropagation(); + } + if (e && e.preventDefault) { + e.preventDefault(); + e.stopPropagation(); + } } }]);return Session;}(React.Component); \ No newline at end of file diff --git a/outlib/TabManager.js b/outlib/TabManager.js index 83053a89..9cb1b0ec 100644 --- a/outlib/TabManager.js +++ b/outlib/TabManager.js @@ -52,7 +52,7 @@ TabManager = function (_React$Component) {_inherits(TabManager, _React$Component if (typeof localStorage["sessionsFeature"] === "undefined") localStorage["sessionsFeature"] = "0"; if (typeof localStorage["hideWindows"] === "undefined") localStorage["hideWindows"] = "0"; if (typeof localStorage["filter-tabs"] === "undefined") localStorage["filter-tabs"] = "0"; - if (typeof localStorage["version"] === "undefined") localStorage["version"] = "5.2.2"; + if (typeof localStorage["version"] === "undefined") localStorage["version"] = "5.2.3"; layout = localStorage["layout"]; tabLimit = JSON.parse(localStorage["tabLimit"]); diff --git a/outlib/TabOptions.js b/outlib/TabOptions.js index a8a5f0e9..43ca0b81 100644 --- a/outlib/TabOptions.js +++ b/outlib/TabOptions.js @@ -6,7 +6,7 @@ TabOptions = function (_React$Component) {_inherits(TabOptions, _React$Component _this.state = {};return _this; }_createClass(TabOptions, [{ key: "logo", value: function logo() { - var logo = [React.createElement("img", { src: "images/browsers.svg", style: { maxWidth: "3rem" } }), React.createElement("h2", null, "Tab Manager Plus ", "5.2.2")]; + var logo = [React.createElement("img", { src: "images/browsers.svg", style: { maxWidth: "3rem" } }), React.createElement("h2", null, "Tab Manager Plus ", "5.2.3")]; return ( React.createElement("div", { className: "logo-options" }, diff --git a/outlib/TabOptionsFirefox.js b/outlib/TabOptionsFirefox.js index 74941d84..6ca9aed9 100644 --- a/outlib/TabOptionsFirefox.js +++ b/outlib/TabOptionsFirefox.js @@ -6,7 +6,7 @@ TabOptions = function (_React$Component) {_inherits(TabOptions, _React$Component _this.state = {};return _this; }_createClass(TabOptions, [{ key: "logo", value: function logo() { - var logo = [React.createElement("img", { src: "images/browsers.svg", style: { maxWidth: "3rem" } }), React.createElement("h2", null, "Tab Manager Plus ", "5.2.2")]; + var logo = [React.createElement("img", { src: "images/browsers.svg", style: { maxWidth: "3rem" } }), React.createElement("h2", null, "Tab Manager Plus ", "5.2.3")]; return ( React.createElement("div", { className: "logo-options" }, diff --git a/outlib/background.js b/outlib/background.js index f1aa36b7..08c8ae7a 100644 --- a/outlib/background.js +++ b/outlib/background.js @@ -20,7 +20,7 @@ pinnedIndex++;case 13:if (!( - t.length > 0)) {_context.next = 60;break;} + t.length > 0)) {_context.next = 59;break;} i = 0;_iteratorNormalCompletion2 = true;_didIteratorError2 = false;_iteratorError2 = undefined;_context.prev = 18;_iterator2 = t[Symbol.iterator]();case 20:if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) {_context.next = 45;break;}oldTabId = _step2.value; i++;_context.next = 25;return ( @@ -35,20 +35,108 @@ movedTabs.length > 0)) {_context.next = 42;break;} newTab = movedTabs[0];if (! tabPinned) {_context.next = 42;break;}_context.next = 42;return ( - browser.tabs.update(newTab.id, { pinned: tabPinned }));case 42:_iteratorNormalCompletion2 = true;_context.next = 20;break;case 45:_context.next = 51;break;case 47:_context.prev = 47;_context.t0 = _context["catch"](18);_didIteratorError2 = true;_iteratorError2 = _context.t0;case 51:_context.prev = 51;_context.prev = 52;if (!_iteratorNormalCompletion2 && _iterator2.return) {_iterator2.return();}case 54:_context.prev = 54;if (!_didIteratorError2) {_context.next = 57;break;}throw _iteratorError2;case 57:return _context.finish(54);case 58:return _context.finish(51);case 59: + browser.tabs.update(newTab.id, { pinned: tabPinned }));case 42:_iteratorNormalCompletion2 = true;_context.next = 20;break;case 45:_context.next = 51;break;case 47:_context.prev = 47;_context.t0 = _context["catch"](18);_didIteratorError2 = true;_iteratorError2 = _context.t0;case 51:_context.prev = 51;_context.prev = 52;if (!_iteratorNormalCompletion2 && _iterator2.return) {_iterator2.return();}case 54:_context.prev = 54;if (!_didIteratorError2) {_context.next = 57;break;}throw _iteratorError2;case 57:return _context.finish(54);case 58:return _context.finish(51);case 59:_context.next = 61;return ( - ;case 60:_context.next = 62;return ( - browser.windows.update(w.id, { focused: true }));case 62:case "end":return _context.stop();}}}, _callee, this, [[18, 47, 51, 59], [52,, 54, 58]]);}));return function createWindowWithTabs(_x, _x2) {return _ref.apply(this, arguments);};}();var focusOnTabAndWindow = function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + browser.windows.update(w.id, { focused: true }));case 61:case "end":return _context.stop();}}}, _callee, this, [[18, 47, 51, 59], [52,, 54, 58]]);}));return function createWindowWithTabs(_x, _x2) {return _ref.apply(this, arguments);};}();var createWindowWithTabsFromSession = function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( - function _callee2(tab) {var windowId, tabId;return regeneratorRuntime.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0: + + function _callee2(window) {var customName, whitelistWindow, whitelistTab, filteredWindow, newWindow, emptyTab, i, newTab, tabCreated, names;return regeneratorRuntime.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0: + + customName = false; + if (window && window.name && window.customName) { + customName = window.name; + } + + whitelistWindow = ["left", "top", "width", "height", "incognito", "type"]; + + if (navigator.userAgent.search("Firefox") > -1) { + whitelistWindow = ["left", "top", "width", "height", "incognito", "type"]; + } + + whitelistTab = ["url", "active", "selected", "pinned"]; + + if (navigator.userAgent.search("Firefox") > -1) { + whitelistTab = ["url", "active", "pinned"]; + } + + filteredWindow = Object.keys(window.windowsInfo). + filter(function (key) { + return whitelistWindow.includes(key); + }). + reduce(function (obj, key) { + obj[key] = window.windowsInfo[key]; + return obj; + }, {});_context2.prev = 7;_context2.next = 10;return ( + + + browser.windows.create(filteredWindow));case 10:newWindow = _context2.sent;_context2.next = 18;break;case 13:_context2.prev = 13;_context2.t0 = _context2["catch"](7); + + console.error(_context2.t0); + console.log(_context2.t0); + console.log(_context2.t0.message);case 18: + + + emptyTab = newWindow.tabs[0].id; + + i = 0;case 20:if (!(i < window.tabs.length)) {_context2.next = 38;break;} + newTab = Object.keys(window.tabs[i]). + filter(function (key) { + return whitelistTab.includes(key); + }). + reduce(function (obj, key) { + obj[key] = window.tabs[i][key]; + return obj; + }, {}); + + if (navigator.userAgent.search("Firefox") > -1) { + if (!!newTab.url && newTab.url.search("about:") > -1) { + console.log("filtered by about: url", newTab.url); + newTab.url = ""; + } + } + newTab.windowId = newWindow.id;_context2.prev = 24;_context2.next = 27;return ( + + browser.tabs.create(newTab));case 27:tabCreated = _context2.sent;_context2.next = 35;break;case 30:_context2.prev = 30;_context2.t1 = _context2["catch"](24); + + console.error(_context2.t1); + console.log(_context2.t1); + console.log(_context2.t1.message);case 35:i++;_context2.next = 20;break;case 38:_context2.next = 40;return ( + + + + browser.tabs.remove(emptyTab).catch(function (error) { + console.error(error); + console.log(error); + console.log(error.message); + }));case 40: + + if (customName) { + names = localStorage["windowNames"]; + if (!!names) { + names = JSON.parse(names); + } else { + names = {}; + } + names[newWindow.id] = customName || ""; + localStorage["windowNames"] = JSON.stringify(names); + }case 41:case "end":return _context2.stop();}}}, _callee2, this, [[7, 13], [24, 30]]);}));return function createWindowWithTabsFromSession(_x3) {return _ref2.apply(this, arguments);};}();var focusOnTabAndWindow = function () {var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + + + + + + + + + function _callee3(tab) {var windowId, tabId;return regeneratorRuntime.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0: windowId = tab.windowId; if (!!tab.tabId) { @@ -61,7 +149,7 @@ browser.tabs.update(tabId, { active: true }).then(function (tabId, windowId) { tabActiveChanged({ tabId: tabId, windowId: windowId }); }.bind(this, tabId, windowId)); - }.bind(this, tabId, windowId));case 3:case "end":return _context2.stop();}}}, _callee2, this);}));return function focusOnTabAndWindow(_x3) {return _ref2.apply(this, arguments);};}();var updateTabCount = function () {var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + }.bind(this, tabId, windowId));case 3:case "end":return _context3.stop();}}}, _callee3, this);}));return function focusOnTabAndWindow(_x4) {return _ref3.apply(this, arguments);};}();var updateTabCount = function () {var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( @@ -72,20 +160,20 @@ - function _callee3() {var run, result, count, toRemove, i, t, found, j;return regeneratorRuntime.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0: + function _callee4() {var run, result, count, toRemove, i, t, found, j;return regeneratorRuntime.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0: run = true; if (localStorageAvailable()) { if (typeof localStorage["badge"] === "undefined") localStorage["badge"] = "1"; if (localStorage["badge"] == "0") run = false; }if (! - run) {_context3.next = 18;break;}_context3.next = 5;return ( - browser.tabs.query({}));case 5:result = _context3.sent; + run) {_context4.next = 17;break;}_context4.next = 5;return ( + browser.tabs.query({}));case 5:result = _context4.sent; count = 0; if (!!result && !!result.length) { count = result.length; - }_context3.next = 10;return ( - browser.browserAction.setBadgeText({ text: count + "" }));case 10:_context3.next = 12;return ( + }_context4.next = 10;return ( + browser.browserAction.setBadgeText({ text: count + "" }));case 10:_context4.next = 12;return ( browser.browserAction.setBadgeBackgroundColor({ color: "purple" }));case 12: toRemove = []; if (!!window.tabsActive) { @@ -98,7 +186,7 @@ }; } if (!found) toRemove.push(i); - }; + } } // console.log("to remove", toRemove); for (i = toRemove.length - 1; i >= 0; i--) { @@ -106,9 +194,9 @@ if (!!window.tabsActive && window.tabsActive.length > 0) { if (!!window.tabsActive[toRemove[i]]) window.tabsActive.splice(toRemove[i], 1); } - };_context3.next = 20;break;case 18:_context3.next = 20;return ( + }_context4.next = 19;break;case 17:_context4.next = 19;return ( - browser.browserAction.setBadgeText({ text: "" }));case 20:case "end":return _context3.stop();}}}, _callee3, this);}));return function updateTabCount() {return _ref3.apply(this, arguments);};}();var tabAdded = function () {var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + browser.browserAction.setBadgeText({ text: "" }));case 19:case "end":return _context4.stop();}}}, _callee4, this);}));return function updateTabCount() {return _ref4.apply(this, arguments);};}();var tabAdded = function () {var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( @@ -118,22 +206,22 @@ - function _callee4(tab) {var tabLimit, tabCount;return regeneratorRuntime.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0: + function _callee5(tab) {var tabLimit, tabCount;return regeneratorRuntime.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0: if (typeof localStorage["tabLimit"] === "undefined") localStorage["tabLimit"] = "0"; try { tabLimit = JSON.parse(localStorage["tabLimit"]); } catch (e) { tabLimit = 0; }if (!( - tabLimit > 0)) {_context4.next = 10;break;}if (!( - tab.id != browser.tabs.TAB_ID_NONE)) {_context4.next = 10;break;}_context4.next = 6;return ( - browser.tabs.query({ currentWindow: true }));case 6:tabCount = _context4.sent;if (!( - tabCount.length > tabLimit)) {_context4.next = 10;break;}_context4.next = 10;return ( + tabLimit > 0)) {_context5.next = 10;break;}if (!( + tab.id != browser.tabs.TAB_ID_NONE)) {_context5.next = 10;break;}_context5.next = 6;return ( + browser.tabs.query({ currentWindow: true }));case 6:tabCount = _context5.sent;if (!( + tabCount.length > tabLimit)) {_context5.next = 10;break;}_context5.next = 10;return ( createWindowWithTabs([tab], tab.incognito));case 10: - updateTabCountDebounce();case 11:case "end":return _context4.stop();}}}, _callee4, this);}));return function tabAdded(_x4) {return _ref4.apply(this, arguments);};}();var openSidebar = function () {var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + updateTabCountDebounce();case 11:case "end":return _context5.stop();}}}, _callee5, this);}));return function tabAdded(_x5) {return _ref5.apply(this, arguments);};}();var openSidebar = function () {var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( @@ -160,11 +248,11 @@ - function _callee5() {return regeneratorRuntime.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:_context5.next = 2;return ( - browser.sidebarAction.open());case 2:case "end":return _context5.stop();}}}, _callee5, this);}));return function openSidebar() {return _ref5.apply(this, arguments);};}();var openPopup = function () {var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + function _callee6() {return regeneratorRuntime.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:_context6.next = 2;return ( + browser.sidebarAction.open());case 2:case "end":return _context6.stop();}}}, _callee6, this);}));return function openSidebar() {return _ref6.apply(this, arguments);};}();var openPopup = function () {var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( - function _callee6() {var openInOwnTab;return regeneratorRuntime.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0: + function _callee7() {var openInOwnTab;return regeneratorRuntime.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0: if (typeof localStorage["openInOwnTab"] === "undefined") localStorage["openInOwnTab"] = "0"; openInOwnTab = false; try { @@ -172,18 +260,18 @@ } catch (e) { openInOwnTab = false; }if (! - openInOwnTab) {_context6.next = 12;break;}_context6.next = 6;return ( - browser.browserAction.setPopup({ popup: "popup.html?popup=true" }));case 6:_context6.next = 8;return ( - browser.browserAction.openPopup());case 8:_context6.next = 10;return ( - browser.browserAction.setPopup({ popup: "" }));case 10:_context6.next = 14;break;case 12:_context6.next = 14;return ( + openInOwnTab) {_context7.next = 12;break;}_context7.next = 6;return ( + browser.browserAction.setPopup({ popup: "popup.html?popup=true" }));case 6:_context7.next = 8;return ( + browser.browserAction.openPopup());case 8:_context7.next = 10;return ( + browser.browserAction.setPopup({ popup: "" }));case 10:_context7.next = 14;break;case 12:_context7.next = 14;return ( - browser.browserAction.openPopup());case 14:case "end":return _context6.stop();}}}, _callee6, this);}));return function openPopup() {return _ref6.apply(this, arguments);};}();var openAsOwnTab = function () {var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + browser.browserAction.openPopup());case 14:case "end":return _context7.stop();}}}, _callee7, this);}));return function openPopup() {return _ref7.apply(this, arguments);};}();var openAsOwnTab = function () {var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( - function _callee7() {var popup_page, tabs, currentTab, previousTab, i, tab;return regeneratorRuntime.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0: - popup_page = browser.runtime.getURL("popup.html");_context7.next = 3;return ( - browser.tabs.query({}));case 3:tabs = _context7.sent; + function _callee8() {var popup_page, tabs, currentTab, previousTab, i, tab;return regeneratorRuntime.wrap(function _callee8$(_context8) {while (1) {switch (_context8.prev = _context8.next) {case 0: + popup_page = browser.runtime.getURL("popup.html");_context8.next = 3;return ( + browser.tabs.query({}));case 3:tabs = _context8.sent; @@ -192,24 +280,24 @@ previousTab = window.tabsActive[window.tabsActive.length - 2]; } - i = 0;case 6:if (!(i < tabs.length)) {_context7.next = 17;break;} + i = 0;case 6:if (!(i < tabs.length)) {_context8.next = 17;break;} tab = tabs[i];if (!( - tab.url.indexOf("popup.html") > -1 && tab.url.indexOf(popup_page) > -1)) {_context7.next = 14;break;}if (!( - currentTab && currentTab.tabId && tab.id == currentTab.tabId && previousTab && previousTab.tabId)) {_context7.next = 13;break;}return _context7.abrupt("return", - focusOnTabAndWindow(previousTab));case 13:return _context7.abrupt("return", + tab.url.indexOf("popup.html") > -1 && tab.url.indexOf(popup_page) > -1)) {_context8.next = 14;break;}if (!( + currentTab && currentTab.tabId && tab.id == currentTab.tabId && previousTab && previousTab.tabId)) {_context8.next = 13;break;}return _context8.abrupt("return", + focusOnTabAndWindow(previousTab));case 13:return _context8.abrupt("return", browser.windows.update(tab.windowId, { focused: true }).then( function () { browser.tabs.highlight({ windowId: tab.windowId, tabs: tab.index }); - }.bind(this)));case 14:i++;_context7.next = 6;break;case 17:return _context7.abrupt("return", + }.bind(this)));case 14:i++;_context8.next = 6;break;case 17:return _context8.abrupt("return", - browser.tabs.create({ url: "popup.html" }));case 18:case "end":return _context7.stop();}}}, _callee7, this);}));return function openAsOwnTab() {return _ref7.apply(this, arguments);};}();var setupPopup = function () {var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + browser.tabs.create({ url: "popup.html" }));case 18:case "end":return _context8.stop();}}}, _callee8, this);}));return function openAsOwnTab() {return _ref8.apply(this, arguments);};}();var setupPopup = function () {var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( - function _callee8() {var openInOwnTab;return regeneratorRuntime.wrap(function _callee8$(_context8) {while (1) {switch (_context8.prev = _context8.next) {case 0: + function _callee9() {var openInOwnTab;return regeneratorRuntime.wrap(function _callee9$(_context9) {while (1) {switch (_context9.prev = _context9.next) {case 0: if (typeof localStorage["openInOwnTab"] === "undefined") localStorage["openInOwnTab"] = "0"; openInOwnTab = false; try { @@ -217,20 +305,20 @@ } catch (e) { openInOwnTab = false; } - console.log(openInOwnTab);_context8.next = 6;return ( + console.log(openInOwnTab);_context9.next = 6;return ( browser.browserAction.onClicked.removeListener(openAsOwnTab));case 6:if (! - openInOwnTab) {_context8.next = 13;break;}_context8.next = 9;return ( - browser.browserAction.setPopup({ popup: "" }));case 9:_context8.next = 11;return ( - browser.browserAction.onClicked.addListener(openAsOwnTab));case 11:_context8.next = 15;break;case 13:_context8.next = 15;return ( + openInOwnTab) {_context9.next = 13;break;}_context9.next = 9;return ( + browser.browserAction.setPopup({ popup: "" }));case 9:_context9.next = 11;return ( + browser.browserAction.onClicked.addListener(openAsOwnTab));case 11:_context9.next = 15;break;case 13:_context9.next = 15;return ( browser.browserAction.setPopup({ popup: "popup.html?popup=true" }));case 15: if (browser.sidebarAction) { browser.sidebarAction.setPanel({ panel: "popup.html?panel=true" }); - }case 16:case "end":return _context8.stop();}}}, _callee8, this);}));return function setupPopup() {return _ref8.apply(this, arguments);};}();var setupListeners = function () {var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + }case 16:case "end":return _context9.stop();}}}, _callee9, this);}));return function setupPopup() {return _ref9.apply(this, arguments);};}();var setupListeners = function () {var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( - function _callee9() {return regeneratorRuntime.wrap(function _callee9$(_context9) {while (1) {switch (_context9.prev = _context9.next) {case 0:_context9.next = 2;return ( + function _callee10() {return regeneratorRuntime.wrap(function _callee10$(_context10) {while (1) {switch (_context10.prev = _context10.next) {case 0:_context10.next = 2;return ( browser.contextMenus.removeAll());case 2: browser.contextMenus.create({ @@ -372,14 +460,14 @@ browser.windows.onRemoved.addListener(windowRemoved); updateTabCountDebounce(); - setTimeout(cleanUp, 5000);case 42:case "end":return _context9.stop();}}}, _callee9, this);}));return function setupListeners() {return _ref9.apply(this, arguments);};}(); + setTimeout(cleanUp, 5000);case 42:case "end":return _context10.stop();}}}, _callee10, this);}));return function setupListeners() {return _ref10.apply(this, arguments);};}(); // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. -var hideWindows = function () {var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( +var hideWindows = function () {var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( @@ -437,49 +525,49 @@ var hideWindows = function () {var _ref10 = _asyncToGenerator( /*#__PURE__*/rege - function _callee11(windowId) {var result;return regeneratorRuntime.wrap(function _callee11$(_context11) {while (1) {switch (_context11.prev = _context11.next) {case 0:if (!( - navigator.userAgent.search("Firefox") > -1)) {_context11.next = 2;break;}return _context11.abrupt("return");case 2:if (!( + function _callee12(windowId) {var result;return regeneratorRuntime.wrap(function _callee12$(_context12) {while (1) {switch (_context12.prev = _context12.next) {case 0:if (!( + navigator.userAgent.search("Firefox") > -1)) {_context12.next = 2;break;}return _context12.abrupt("return");case 2:if (!( - !windowId || windowId < 0)) {_context11.next = 6;break;}return _context11.abrupt("return");case 6:if (! + !windowId || windowId < 0)) {_context12.next = 6;break;}return _context12.abrupt("return");case 6:if (! - localStorageAvailable()) {_context11.next = 12;break;} + localStorageAvailable()) {_context12.next = 12;break;} if (typeof localStorage["hideWindows"] === "undefined") localStorage["hideWindows"] = "0";if (!( - localStorage["hideWindows"] == "0")) {_context11.next = 10;break;}return _context11.abrupt("return");case 10:_context11.next = 14;break;case 12: + localStorage["hideWindows"] == "0")) {_context12.next = 10;break;}return _context12.abrupt("return");case 10:_context12.next = 14;break;case 12: - console.log("no local storage");return _context11.abrupt("return");case 14:_context11.next = 16;return ( + console.log("no local storage");return _context12.abrupt("return");case 14:_context12.next = 16;return ( - browser.permissions.contains({ permissions: ['system.display'] }));case 16:result = _context11.sent; + browser.permissions.contains({ permissions: ['system.display'] }));case 16:result = _context12.sent; if (result) { // The extension has the permissions. - chrome.system.display.getInfo(function () {var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(windowId, displaylayouts) {var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, displaylayout, windows, monitor, i, a, result;return regeneratorRuntime.wrap(function _callee10$(_context10) {while (1) {switch (_context10.prev = _context10.next) {case 0: + chrome.system.display.getInfo(function () {var _ref12 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(windowId, displaylayouts) {var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, displaylayout, windows, monitor, i, a, result;return regeneratorRuntime.wrap(function _callee11$(_context11) {while (1) {switch (_context11.prev = _context11.next) {case 0: window.displayInfo = []; _iteratorNormalCompletion = true; _didIteratorError = false; - _iteratorError = undefined;_context10.prev = 4; + _iteratorError = undefined;_context11.prev = 4; for (_iterator = displaylayouts[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {displaylayout = _step.value; window.displayInfo.push(displaylayout.bounds); - }_context10.next = 12;break;case 8:_context10.prev = 8;_context10.t0 = _context10["catch"](4); + }_context11.next = 12;break;case 8:_context11.prev = 8;_context11.t0 = _context11["catch"](4); _didIteratorError = true; - _iteratorError = _context10.t0;case 12:_context10.prev = 12;_context10.prev = 13; + _iteratorError = _context11.t0;case 12:_context11.prev = 12;_context11.prev = 13; if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); - }case 15:_context10.prev = 15;if (! + }case 15:_context11.prev = 15;if (! - _didIteratorError) {_context10.next = 18;break;}throw ( - _iteratorError);case 18:return _context10.finish(15);case 19:return _context10.finish(12);case 20:_context10.next = 22;return ( + _didIteratorError) {_context11.next = 18;break;}throw ( + _iteratorError);case 18:return _context11.finish(15);case 19:return _context11.finish(12);case 20:_context11.next = 22;return ( - browser.windows.getAll({ populate: true }));case 22:windows = _context10.sent; + browser.windows.getAll({ populate: true }));case 22:windows = _context11.sent; monitor = -1; for (i = windows.length - 1; i >= 0; i--) { if (windows[i].id == windowId) { @@ -492,15 +580,15 @@ var hideWindows = function () {var _ref10 = _asyncToGenerator( /*#__PURE__*/rege } }; - i = windows.length - 1;case 27:if (!(i >= 0)) {_context10.next = 35;break;}if (!( - windows[i].id != windowId)) {_context10.next = 32;break;}if (! - is_in_bounds(windows[i], window.displayInfo[monitor])) {_context10.next = 32;break;}_context10.next = 32;return ( - browser.windows.update(windows[i].id, { "state": "minimized" }));case 32:i--;_context10.next = 27;break;case 35: + i = windows.length - 1;case 27:if (!(i >= 0)) {_context11.next = 35;break;}if (!( + windows[i].id != windowId)) {_context11.next = 32;break;}if (! + is_in_bounds(windows[i], window.displayInfo[monitor])) {_context11.next = 32;break;}_context11.next = 32;return ( + browser.windows.update(windows[i].id, { "state": "minimized" }));case 32:i--;_context11.next = 27;break;case 35: - ;case 36:case "end":return _context10.stop();}}}, _callee10, this, [[4, 8, 12, 20], [13,, 15, 19]]);}));return function (_x6, _x7) {return _ref11.apply(this, arguments);};}(). + ;case 36:case "end":return _context11.stop();}}}, _callee11, this, [[4, 8, 12, 20], [13,, 15, 19]]);}));return function (_x7, _x8) {return _ref12.apply(this, arguments);};}(). bind(null, windowId)); - }case 18:case "end":return _context11.stop();}}}, _callee11, this);}));return function hideWindows(_x5) {return _ref10.apply(this, arguments);};}();var cleanUp = function () {var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( + }case 18:case "end":return _context12.stop();}}}, _callee12, this);}));return function hideWindows(_x6) {return _ref11.apply(this, arguments);};}();var cleanUp = function () {var _ref14 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark( @@ -572,14 +660,14 @@ var hideWindows = function () {var _ref10 = _asyncToGenerator( /*#__PURE__*/rege - function _callee13() {var activewindows, windowids, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, w, windows, i, names, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, id;return regeneratorRuntime.wrap(function _callee13$(_context13) {while (1) {switch (_context13.prev = _context13.next) {case 0:_context13.next = 2;return ( - browser.windows.getAll({ populate: true }));case 2:activewindows = _context13.sent; - windowids = [];_iteratorNormalCompletion3 = true;_didIteratorError3 = false;_iteratorError3 = undefined;_context13.prev = 7; + function _callee14() {var activewindows, windowids, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, w, windows, i, names, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, id;return regeneratorRuntime.wrap(function _callee14$(_context14) {while (1) {switch (_context14.prev = _context14.next) {case 0:_context14.next = 2;return ( + browser.windows.getAll({ populate: true }));case 2:activewindows = _context14.sent; + windowids = [];_iteratorNormalCompletion3 = true;_didIteratorError3 = false;_iteratorError3 = undefined;_context14.prev = 7; for (_iterator3 = activewindows[Symbol.iterator](); !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {w = _step3.value; windowids.push(w.id); } // console.log("window ids...", windowids); - _context13.next = 15;break;case 11:_context13.prev = 11;_context13.t0 = _context13["catch"](7);_didIteratorError3 = true;_iteratorError3 = _context13.t0;case 15:_context13.prev = 15;_context13.prev = 16;if (!_iteratorNormalCompletion3 && _iterator3.return) {_iterator3.return();}case 18:_context13.prev = 18;if (!_didIteratorError3) {_context13.next = 21;break;}throw _iteratorError3;case 21:return _context13.finish(18);case 22:return _context13.finish(15);case 23:windows = JSON.parse(localStorage["windowAge"]); + _context14.next = 15;break;case 11:_context14.prev = 11;_context14.t0 = _context14["catch"](7);_didIteratorError3 = true;_iteratorError3 = _context14.t0;case 15:_context14.prev = 15;_context14.prev = 16;if (!_iteratorNormalCompletion3 && _iterator3.return) {_iterator3.return();}case 18:_context14.prev = 18;if (!_didIteratorError3) {_context14.next = 21;break;}throw _iteratorError3;case 21:return _context14.finish(18);case 22:return _context14.finish(15);case 23:windows = JSON.parse(localStorage["windowAge"]); if (windows instanceof Array) { } else { @@ -603,14 +691,14 @@ var hideWindows = function () {var _ref10 = _asyncToGenerator( /*#__PURE__*/rege } // console.log("before", JSON.parse(JSON.stringify(names))); - _iteratorNormalCompletion4 = true;_didIteratorError4 = false;_iteratorError4 = undefined;_context13.prev = 33;for (_iterator4 = Object.keys(names)[Symbol.iterator](); !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {id = _step4.value; + _iteratorNormalCompletion4 = true;_didIteratorError4 = false;_iteratorError4 = undefined;_context14.prev = 33;for (_iterator4 = Object.keys(names)[Symbol.iterator](); !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {id = _step4.value; if (windowids.indexOf(parseInt(id)) < 0) { // console.log("did not find", id); delete names[id]; } } // console.log("after", JSON.parse(JSON.stringify(names))); - _context13.next = 41;break;case 37:_context13.prev = 37;_context13.t1 = _context13["catch"](33);_didIteratorError4 = true;_iteratorError4 = _context13.t1;case 41:_context13.prev = 41;_context13.prev = 42;if (!_iteratorNormalCompletion4 && _iterator4.return) {_iterator4.return();}case 44:_context13.prev = 44;if (!_didIteratorError4) {_context13.next = 47;break;}throw _iteratorError4;case 47:return _context13.finish(44);case 48:return _context13.finish(41);case 49:localStorage["windowNames"] = JSON.stringify(names);case 50:case "end":return _context13.stop();}}}, _callee13, this, [[7, 11, 15, 23], [16,, 18, 22], [33, 37, 41, 49], [42,, 44, 48]]);}));return function cleanUp() {return _ref13.apply(this, arguments);};}();function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}var browser = browser || chrome;window.tabsActive = [];window.displayInfo = [];function focusOnTabAndWindowDelayed(tab) {var tab = JSON.parse(JSON.stringify(tab));setTimeout(focusOnTabAndWindow.bind(this, tab), 125);}function focusOnWindowDelayed(windowId) {setTimeout(focusOnWindow.bind(this, windowId), 125);}function focusOnWindow(windowId) {browser.windows.update(windowId, { focused: true });}var updateTabCountDebounce = debounce(updateTabCount, 250);function tabRemoved() {updateTabCountDebounce();}function tabActiveChanged(tab) {if (!!tab && !!tab.tabId) {if (!window.tabsActive) window.tabsActive = [];if (!!window.tabsActive && window.tabsActive.length > 0) {var lastActive = window.tabsActive[window.tabsActive.length - 1];if (!!lastActive && lastActive.tabId == tab.tabId && lastActive.windowId == tab.windowId) {return;}}while (window.tabsActive.length > 20) {window.tabsActive.shift();}for (var i = window.tabsActive.length - 1; i >= 0; i--) {if (window.tabsActive[i].tabId == tab.tabId) {window.tabsActive.splice(i, 1);}};window.tabsActive.push(tab);}updateTabCountDebounce();}function debounce(func, wait, immediate) {var timeout;return function () {var context = this,args = arguments;var later = function later() {timeout = null;if (!immediate) func.apply(context, args);};var callNow = immediate && !timeout;clearTimeout(timeout);timeout = setTimeout(later, wait);if (callNow) func.apply(context, args);};};function localStorageAvailable() {var test = 'test';try {localStorage.setItem(test, test);localStorage.removeItem(test);return true;} catch (e) {return false;}}function windowFocus(windowId) {try {if (!!windowId) {windowActive(windowId); // console.log("onFocused", windowId); + _context14.next = 41;break;case 37:_context14.prev = 37;_context14.t1 = _context14["catch"](33);_didIteratorError4 = true;_iteratorError4 = _context14.t1;case 41:_context14.prev = 41;_context14.prev = 42;if (!_iteratorNormalCompletion4 && _iterator4.return) {_iterator4.return();}case 44:_context14.prev = 44;if (!_didIteratorError4) {_context14.next = 47;break;}throw _iteratorError4;case 47:return _context14.finish(44);case 48:return _context14.finish(41);case 49:localStorage["windowNames"] = JSON.stringify(names);case 50:case "end":return _context14.stop();}}}, _callee14, this, [[7, 11, 15, 23], [16,, 18, 22], [33, 37, 41, 49], [42,, 44, 48]]);}));return function cleanUp() {return _ref14.apply(this, arguments);};}();function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new Promise(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return Promise.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}var browser = browser || chrome;window.tabsActive = [];window.displayInfo = [];function createWindowWithTabsFromSessionDelayed(window) {var window = JSON.parse(JSON.stringify(window));setTimeout(createWindowWithTabsFromSession.bind(this, window), 125);}function focusOnTabAndWindowDelayed(tab) {var tab = JSON.parse(JSON.stringify(tab));setTimeout(focusOnTabAndWindow.bind(this, tab), 125);}function focusOnWindowDelayed(windowId) {setTimeout(focusOnWindow.bind(this, windowId), 125);}function focusOnWindow(windowId) {browser.windows.update(windowId, { focused: true });}var updateTabCountDebounce = debounce(updateTabCount, 250);function tabRemoved() {updateTabCountDebounce();}function tabActiveChanged(tab) {if (!!tab && !!tab.tabId) {if (!window.tabsActive) window.tabsActive = [];if (!!window.tabsActive && window.tabsActive.length > 0) {var lastActive = window.tabsActive[window.tabsActive.length - 1];if (!!lastActive && lastActive.tabId == tab.tabId && lastActive.windowId == tab.windowId) {return;}}while (window.tabsActive.length > 20) {window.tabsActive.shift();}for (var i = window.tabsActive.length - 1; i >= 0; i--) {if (window.tabsActive[i].tabId == tab.tabId) {window.tabsActive.splice(i, 1);}};window.tabsActive.push(tab);}updateTabCountDebounce();}function debounce(func, wait, immediate) {var timeout;return function () {var context = this,args = arguments;var later = function later() {timeout = null;if (!immediate) func.apply(context, args);};var callNow = immediate && !timeout;clearTimeout(timeout);timeout = setTimeout(later, wait);if (callNow) func.apply(context, args);};};function localStorageAvailable() {var test = 'test';try {localStorage.setItem(test, test);localStorage.removeItem(test);return true;} catch (e) {return false;}}function windowFocus(windowId) {try {if (!!windowId) {windowActive(windowId); // console.log("onFocused", windowId); hideWindows(windowId);}} catch (e) {}}function windowCreated(window) {try {if (!!window && !!window.id) {windowActive(window.id);}} catch (e) {} // console.log("onCreated", window.id); }function windowRemoved(windowId) {try {if (!!windowId) {windowActive(windowId);}} catch (e) {} // console.log("onRemoved", windowId); }function is_in_bounds(object, bounds) {var C = object,B = bounds;if (C.left >= B.left && C.left <= B.left + B.width) {if (C.top >= B.top && C.top <= B.top + B.height) {return true;}}return false;};function windowActive(windowId) {if (windowId < 0) return;var windows = JSON.parse(localStorage["windowAge"]);if (windows instanceof Array) {} else {windows = [];}if (windows.indexOf(windowId) > -1) windows.splice(windows.indexOf(windowId), 1);windows.unshift(windowId);localStorage["windowAge"] = JSON.stringify(windows); // browser.windows.getLastFocused({ populate: true }, function (w) { @@ -626,4 +714,4 @@ var hideWindows = function () {var _ref10 = _asyncToGenerator( /*#__PURE__*/rege // }; // }); // console.log(windows); -}browser.commands.onCommand.addListener(function (command) {if (command == "switch_to_previous_active_tab") {if (!!window.tabsActive && window.tabsActive.length > 1) {focusOnTabAndWindow(window.tabsActive[window.tabsActive.length - 2]);}}});browser.runtime.onMessage.addListener(function (request, sender, sendResponse) {if (request.command == "reload_popup_controls") {setupPopup();}});_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {var windows, i;return regeneratorRuntime.wrap(function _callee12$(_context12) {while (1) {switch (_context12.prev = _context12.next) {case 0:_context12.next = 2;return browser.windows.getAll({ populate: true });case 2:windows = _context12.sent;localStorage["windowAge"] = JSON.stringify([]);if (!!windows && windows.length > 0) {windows.sort(function (a, b) {if (a.id < b.id) return 1;if (a.id > b.id) return -1;return 0;});for (i = 0; i < windows.length; i++) {if (!!windows[i].id) windowActive(windows[i].id);};}case 5:case "end":return _context12.stop();}}}, _callee12, this);}))();setInterval(setupListeners, 300000);setupListeners(); \ No newline at end of file +}browser.commands.onCommand.addListener(function (command) {if (command == "switch_to_previous_active_tab") {if (!!window.tabsActive && window.tabsActive.length > 1) {focusOnTabAndWindow(window.tabsActive[window.tabsActive.length - 2]);}}});browser.runtime.onMessage.addListener(function (request, sender, sendResponse) {if (request.command == "reload_popup_controls") {setupPopup();}});_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {var windows, i;return regeneratorRuntime.wrap(function _callee13$(_context13) {while (1) {switch (_context13.prev = _context13.next) {case 0:_context13.next = 2;return browser.windows.getAll({ populate: true });case 2:windows = _context13.sent;localStorage["windowAge"] = JSON.stringify([]);if (!!windows && windows.length > 0) {windows.sort(function (a, b) {if (a.id < b.id) return 1;if (a.id > b.id) return -1;return 0;});for (i = 0; i < windows.length; i++) {if (!!windows[i].id) windowActive(windows[i].id);};}case 5:case "end":return _context13.stop();}}}, _callee13, this);}))();setInterval(setupListeners, 300000);setupListeners(); \ No newline at end of file diff --git a/package.json b/package.json index 0a45b2cb..05fd8a5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tab-manager", - "version": "5.2.2", + "version": "5.2.3", "description": "This is an extended version of the old Tab Manager Google Chrome extension. Should work on both Chrome and Firefox. Malware free, with a new view type and many new features.", "main": "index.js", "directories": { diff --git a/readme.md b/readme.md index b3cb10fe..d26318fc 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Tab Manager Plus 5.2.2 +# Tab Manager Plus 5.2.3 ##### Search through your tabs instantly, save windows for later, limit open tabs per window - and many more.