Skip to content

Commit

Permalink
5.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mastef committed Oct 1, 2024
1 parent fcfbc1a commit 4ff9983
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"sourceType": "script",
"plugins": [
["inline-replace-variables", {
"__VERSION__": "5.2.2"
"__VERSION__": "5.2.3"
}]
]
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
5.2.3
=====
- Fix: Allow restoring saved sessions from the popup

5.2.2
=====
- Fix: Avoid non-Firefox permissions checks
Expand Down
7 changes: 6 additions & 1 deletion changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="logo-options">
<div class="logo-box">
<img src="images/browsers.svg" style="max-width: 3rem;">
<h2>Tab Manager Plus 5.2.2</h2>
<h2>Tab Manager Plus 5.2.3</h2>
</div>
</div>
<div class="toggle-options">
Expand All @@ -35,6 +35,11 @@ <h3>Here's what's planned for future versions</h3>
<h3>Here's what's new since the last time</h3>
<div class="toggle-box">

<h3>5.2.3</h3>
<ul>
<li>Fix: Allow restoring saved sessions from the popup</li>
</ul>

<h3>5.2.2</h3>
<ul>
<li>Fix: Avoid non-Firefox permissions checks</li>
Expand Down
2 changes: 1 addition & 1 deletion manifest-firefox.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
101 changes: 23 additions & 78 deletions outlib/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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);
2 changes: 1 addition & 1 deletion outlib/TabManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
Expand Down
2 changes: 1 addition & 1 deletion outlib/TabOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion outlib/TabOptionsFirefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
Loading

0 comments on commit 4ff9983

Please sign in to comment.