Skip to content

Commit

Permalink
firefox 5.2.1 built version
Browse files Browse the repository at this point in the history
  • Loading branch information
mastef committed Sep 22, 2024
1 parent 2f27356 commit 66abbbf
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 19 deletions.
12 changes: 7 additions & 5 deletions outlib/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Tab = function (_React$Component) {_inherits(Tab, _React$Component);

children.push(
React.createElement("div", { key: "tab-title-" + this.props.tab.id, className: "tabtitle" },
this.props.tab.title));
this.props.tab.title || ""));


}
Expand Down Expand Up @@ -139,7 +139,7 @@ Tab = function (_React$Component) {_inherits(Tab, _React$Component);
e) {
if (!!this.props.drag) {
e.dataTransfer.setData("Text", this.props.tab.id);
e.dataTransfer.setData("text/uri-list", this.props.tab.url);
e.dataTransfer.setData("text/uri-list", this.props.tab.url || "");
this.props.drag(e, this.props.tab.id);
} else {
return false;
Expand Down Expand Up @@ -170,7 +170,7 @@ Tab = function (_React$Component) {_inherits(Tab, _React$Component);
} else {
return false;
}
} }, { key: "resolveFavIconUrl", value: function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {var image, favIcons, iconName;return regeneratorRuntime.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
} }, { key: "resolveFavIconUrl", value: function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {var image, favIcons, iconUrl, iconName;return regeneratorRuntime.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:


// firefox screenshots; needs <all_urls>
Expand All @@ -179,7 +179,7 @@ Tab = function (_React$Component) {_inherits(Tab, _React$Component);
// image = await browser.tabs.captureTab(this.props.tab.id);
// image = "url(" + image + ")";
// }else
if (this.props.tab.url.indexOf("chrome://") !== 0 && this.props.tab.url.indexOf("about:") !== 0) {
if (!!this.props.tab.url && this.props.tab.url.indexOf("chrome://") !== 0 && this.props.tab.url.indexOf("about:") !== 0) {
// chrome screenshots / only for active tabs; needs <all_urls>
// if(!!browser.tabs.captureVisibleTab && this.props.tab.highlighted) {
// console.log("tabsCapture");
Expand All @@ -195,7 +195,9 @@ Tab = function (_React$Component) {_inherits(Tab, _React$Component);
//}
} else {
favIcons = ["bookmarks", "chrome", "crashes", "downloads", "extensions", "flags", "history", "settings"];
iconName = this.props.tab.url.slice(9).match(/^\w+/g);
iconUrl = this.props.tab.url || "";
iconName = "";
if (iconUrl.length > 9) iconName = iconUrl.slice(9).match(/^\w+/g);
image = !iconName || favIcons.indexOf(iconName[0]) < 0 ? "" : "url(../images/chrome/" + iconName[0] + ".png)";
}
this.setState({
Expand Down
13 changes: 8 additions & 5 deletions 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.0";
if (typeof localStorage["version"] === "undefined") localStorage["version"] = "5.2.1";

layout = localStorage["layout"];
tabLimit = JSON.parse(localStorage["tabLimit"]);
Expand Down Expand Up @@ -170,8 +170,8 @@ TabManager = function (_React$Component) {_inherits(TabManager, _React$Component
this.update();
} }, { key: "hoverHandler", value: function hoverHandler(
tab) {
this.setState({ topText: tab.title });
this.setState({ bottomText: tab.url });
this.setState({ topText: tab.title || "" });
this.setState({ bottomText: tab.url || "" });
// clearTimeout(this.state.closeTimeout);
// this.state.closeTimeout = setTimeout(function () {
// window.close();
Expand All @@ -188,7 +188,7 @@ TabManager = function (_React$Component) {_inherits(TabManager, _React$Component
} }, { key: "hoverIcon", value: function hoverIcon(
e) {
var text = "";
if (e && e.target && e.target.title) {
if (e && e.target && !!e.target.title) {
text = e.target.title;
}
var bottom = " ";
Expand Down Expand Up @@ -809,7 +809,10 @@ TabManager = function (_React$Component) {_inherits(TabManager, _React$Component
}
for (var id in idList) {
var tab = this.state.tabsbyid[id];
var tabSearchTerm = (tab.title + tab.url).toLowerCase();
var tabSearchTerm;
if (!!tab.title) tabSearchTerm = tab.title;
if (!!tab.url) tabSearchTerm += " " + tab.url;
tabSearchTerm = tabSearchTerm.toLowerCase();
var match = false;
if (searchType == "normal") {
match = tabSearchTerm.indexOf(e.target.value.toLowerCase()) >= 0;
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.0")];
var logo = [React.createElement("img", { src: "images/browsers.svg", style: { maxWidth: "3rem" } }), React.createElement("h2", null, "Tab Manager Plus ", "5.2.1")];

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.0")];
var logo = [React.createElement("img", { src: "images/browsers.svg", style: { maxWidth: "3rem" } }), React.createElement("h2", null, "Tab Manager Plus ", "5.2.1")];

return (
React.createElement("div", { className: "logo-options" },
Expand Down
34 changes: 27 additions & 7 deletions outlib/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,31 +343,51 @@ Window = function (_React$Component) {_inherits(Window, _React$Component);
this.state.windowTitles = [];
this.state.tabs = tabs.length + this.props.window.id * 99;
for (var i = 0; i < tabs.length; i++) {

if (!!tabs[i].props && !!tabs[i].props.tab && !!tabs[i].props.tab.url) {
var url = new URL(tabs[i].props.tab.url);
var protocol = url.protocol;
var hostname = url.hostname;
if (protocol.indexOf("chrome-extension") > -1) {
hostname = tabs[i].props.tab.title;
var protocol = url.protocol || "";
var hostname = url.hostname || "";
if (protocol.indexOf("view-source") > -1 && !!url.pathname) {
url = new URL(url.pathname);
hostname = url.hostname || "source";
} else if (protocol.indexOf("chrome-extension") > -1) {
hostname = tabs[i].props.tab.title || "extension";
} else if (protocol.indexOf("about") > -1) {
hostname = tabs[i].props.tab.title;
hostname = tabs[i].props.tab.title || "about";
} else if (hostname.indexOf("mail.google") > -1) {
hostname = "gmail";
} else {
if (!hostname) hostname = "";
hostname = hostname.replace("www.", "");
var regex_var = new RegExp(/(\.[^\.]{0,2})(\.[^\.]{0,2})(\.*$)|(\.[^\.]*)(\.*$)/);
hostname = hostname.
replace(regex_var, "").
split(".").
pop();
}
if (hostname.length > 18) {
hostname = tabs[i].props.tab.title;

if (!!hostname && hostname.length > 18) {
hostname = tabs[i].props.tab.title || "";

while (hostname.length > 18 && hostname.indexOf("—") > -1) {
hostname = hostname.split("—");
hostname.pop();
hostname = hostname.join("—");
}

while (hostname.length > 18 && hostname.indexOf("-") > -1) {
hostname = hostname.split("-");
hostname.pop();
hostname = hostname.join("-");
}

while (hostname.length > 18 && hostname.indexOf(" ") > -1) {
hostname = hostname.split(" ");
hostname.pop();
hostname = hostname.join(" ");
}

}
this.state.windowTitles.push(hostname);
}
Expand Down

0 comments on commit 66abbbf

Please sign in to comment.