mirror of
https://github.com/XFox111/TabsAsideExtension.git
synced 2026-04-22 07:58:01 +03:00
Patch 1.3.1
Fixed version number Fixed browser closing Hid elements of unimplemented features Added code for issue #10 (help wanted)
This commit is contained in:
+5
-1
@@ -31,11 +31,15 @@
|
|||||||
<button title="Options"></button>
|
<button title="Options"></button>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
|
<!-- <p>
|
||||||
|
<input type="checkbox" id="discardOnRestore" oncha/>
|
||||||
|
<label for="discardOnRestore">Load tabs on restore</label>
|
||||||
|
</p> -->
|
||||||
<div>
|
<div>
|
||||||
<button value="https://github.com/xfox111/ChromiumTabsAside">Visit GitHub page</button>
|
<button value="https://github.com/xfox111/ChromiumTabsAside">Visit GitHub page</button>
|
||||||
<button value="https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin">Leave feedback</button>
|
<button value="https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin">Leave feedback</button>
|
||||||
<button value="https://buymeacoffee.com/xfox111">Buy me a coffee!</button>
|
<button value="https://buymeacoffee.com/xfox111">Buy me a coffee!</button>
|
||||||
<button hidden>Backup saved tabs</button>
|
<!-- <button hidden>Backup saved tabs</button> -->
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<small>v1.0</small><br />
|
<small>v1.0</small><br />
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
<button title="Options"></button>
|
<button title="Options"></button>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
|
<!-- <p>
|
||||||
|
<input type="checkbox" id="discardOnRestore"/>
|
||||||
|
<label for="discardOnRestore">Load tabs on restore</label>
|
||||||
|
</p> -->
|
||||||
<div>
|
<div>
|
||||||
<button value="https://github.com/xfox111/ChromiumTabsAside">Visit GitHub page</button>
|
<button value="https://github.com/xfox111/ChromiumTabsAside">Visit GitHub page</button>
|
||||||
<button value="https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin">Leave feedback</button>
|
<button value="https://chrome.google.com/webstore/detail/tabs-aside/mgmjbodjgijnebfgohlnjkegdpbdjgin">Leave feedback</button>
|
||||||
|
|||||||
+45
-3
@@ -37,6 +37,26 @@ else
|
|||||||
|
|
||||||
document.querySelector(".tabsAside .saveTabs").onclick = SetTabsAside;
|
document.querySelector(".tabsAside .saveTabs").onclick = SetTabsAside;
|
||||||
|
|
||||||
|
document.querySelector("nav > p > small").textContent = chrome.runtime.getManifest()["version"];
|
||||||
|
|
||||||
|
/* var loadOnRestoreCheckbox = document.querySelector("nav > p > input[type=checkbox]");
|
||||||
|
chrome.runtime.sendMessage(
|
||||||
|
{
|
||||||
|
command: "getDiscardOption"
|
||||||
|
},
|
||||||
|
function(loadOnRestore)
|
||||||
|
{
|
||||||
|
loadOnRestoreCheckbox.checked = loadOnRestore;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
loadOnRestoreCheckbox.addEventListener("click", function ()
|
||||||
|
{
|
||||||
|
chrome.runtime.sendMessage(
|
||||||
|
{
|
||||||
|
command: "toggleDiscard"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}); */
|
||||||
|
|
||||||
document.querySelectorAll(".tabsAside.pane > header nav button").forEach(i =>
|
document.querySelectorAll(".tabsAside.pane > header nav button").forEach(i =>
|
||||||
{
|
{
|
||||||
@@ -98,6 +118,27 @@ function InitializeStandalone()
|
|||||||
|
|
||||||
document.querySelector(".tabsAside .saveTabs").onclick = SetTabsAside;
|
document.querySelector(".tabsAside .saveTabs").onclick = SetTabsAside;
|
||||||
|
|
||||||
|
document.querySelector("nav > p > small").textContent = chrome.runtime.getManifest()["version"];
|
||||||
|
|
||||||
|
/* var loadOnRestoreCheckbox = document.querySelector("nav > p > input[type=checkbox]");
|
||||||
|
chrome.runtime.sendMessage(
|
||||||
|
{
|
||||||
|
command: "getDiscardOption"
|
||||||
|
},
|
||||||
|
function(loadOnRestore)
|
||||||
|
{
|
||||||
|
loadOnRestoreCheckbox.checked = loadOnRestore;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
loadOnRestoreCheckbox.addEventListener("click", function ()
|
||||||
|
{
|
||||||
|
chrome.runtime.sendMessage(
|
||||||
|
{
|
||||||
|
command: "toggleDiscard"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}); */
|
||||||
|
|
||||||
document.querySelectorAll(".tabsAside.pane > header nav button").forEach(i =>
|
document.querySelectorAll(".tabsAside.pane > header nav button").forEach(i =>
|
||||||
{
|
{
|
||||||
i.onclick = function () { window.open(i.value, '_blank'); };
|
i.onclick = function () { window.open(i.value, '_blank'); };
|
||||||
@@ -142,8 +183,8 @@ function AddCollection(collection)
|
|||||||
"<button title='More...'></button>" +
|
"<button title='More...'></button>" +
|
||||||
"<nav>" +
|
"<nav>" +
|
||||||
"<button>Restore without removing</button>" +
|
"<button>Restore without removing</button>" +
|
||||||
"<button hidden>Add tabs to favorites</button>" +
|
// "<button hidden>Add tabs to favorites</button>" +
|
||||||
"<button hidden>Share tabs</button>" +
|
// "<button hidden>Share tabs</button>" +
|
||||||
"</nav>" +
|
"</nav>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"<button title='Remove collection'></button>" +
|
"<button title='Remove collection'></button>" +
|
||||||
@@ -164,7 +205,8 @@ function AddCollection(collection)
|
|||||||
|
|
||||||
list.querySelectorAll("div > div:last-child > div > span").forEach(i =>
|
list.querySelectorAll("div > div:last-child > div > span").forEach(i =>
|
||||||
{
|
{
|
||||||
i.onclick = function () {
|
i.onclick = function ()
|
||||||
|
{
|
||||||
chrome.runtime.sendMessage(
|
chrome.runtime.sendMessage(
|
||||||
{
|
{
|
||||||
command: "openTab",
|
command: "openTab",
|
||||||
|
|||||||
+27
-3
@@ -146,6 +146,15 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse)
|
|||||||
case "share":
|
case "share":
|
||||||
ShareTabs(message.collectionIndex);
|
ShareTabs(message.collectionIndex);
|
||||||
break;
|
break;
|
||||||
|
case "toggleDiscard":
|
||||||
|
if (localStorage.getItem("loadOnRestore") == "true")
|
||||||
|
localStorage.setItem("loadOnRestore", false);
|
||||||
|
else
|
||||||
|
localStorage.setItem("loadOnRestore", true);
|
||||||
|
break;
|
||||||
|
case "getDiscardOption":
|
||||||
|
sendResponse(localStorage.getItem("loadOnRestore") == "false" ? false : true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -202,8 +211,10 @@ function SaveCollection()
|
|||||||
|
|
||||||
collections = JSON.parse(localStorage.getItem("sets"));
|
collections = JSON.parse(localStorage.getItem("sets"));
|
||||||
|
|
||||||
chrome.tabs.remove(rawTabs.filter(i => !i.url.startsWith("chrome-extension") && !i.url.endsWith("TabsAside.html") && !i.pinned).map(tab => tab.id));
|
var newTabId;
|
||||||
chrome.tabs.create({});
|
chrome.tabs.create({}, function(tab) { newTabId = tab.id; });
|
||||||
|
|
||||||
|
chrome.tabs.remove(rawTabs.filter(i => !i.url.startsWith("chrome-extension") && !i.url.endsWith("TabsAside.html") && !i.pinned && i.id != newTabId).map(tab => tab.id));
|
||||||
});
|
});
|
||||||
|
|
||||||
UpdateTheme();
|
UpdateTheme();
|
||||||
@@ -225,7 +236,20 @@ function RestoreCollection(collectionIndex, removeCollection)
|
|||||||
{
|
{
|
||||||
url: i,
|
url: i,
|
||||||
active: false
|
active: false
|
||||||
|
}/* , function (tab)
|
||||||
|
{
|
||||||
|
if (localStorage.getItem("loadOnRestore") == "false" ? true : false)
|
||||||
|
{
|
||||||
|
setTimeout(function()
|
||||||
|
{
|
||||||
|
chrome.tabs.get(tab.id, function(tab1)
|
||||||
|
{
|
||||||
|
console.log(tab.url);
|
||||||
|
chrome.tabs.discard(tab1.id);
|
||||||
});
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
} */);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!removeCollection)
|
if (!removeCollection)
|
||||||
@@ -304,7 +328,7 @@ function AppendThumbnail(tabId, cahngeInfo, tab)
|
|||||||
},
|
},
|
||||||
function (dataUrl)
|
function (dataUrl)
|
||||||
{
|
{
|
||||||
if(!dataUrl)
|
if (!dataUrl)
|
||||||
{
|
{
|
||||||
console.log("Failed to retrieve thumbnail");
|
console.log("Failed to retrieve thumbnail");
|
||||||
return;
|
return;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Tabs Aside",
|
"name": "Tabs Aside",
|
||||||
"version": "1.3",
|
"version": "1.3.1",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"description": "Classic Microsoft Edge \"Tabs Aside\" feature for Chromium browsers",
|
"description": "Classic Microsoft Edge \"Tabs Aside\" feature for Chromium browsers",
|
||||||
"author": "Michael \"XFox\" Gordeev",
|
"author": "Michael \"XFox\" Gordeev",
|
||||||
|
|||||||
Reference in New Issue
Block a user