1
0
mirror of https://github.com/XFox111/TabsAsideExtension.git synced 2026-04-22 07:58:01 +03:00

Minor 1.4 (#16)

- Added ability to disable tabs loading on restoring (#10)
- Extension optimization
- Added "Contributors" page link
- Updated README.md

Co-authored-by: Amine A. <15179425+AmineI@users.noreply.github.com>
Co-Authored-By: Michael Gordeev <michael@xfox111.net>
This commit is contained in:
Michael Gordeev
2020-06-27 12:56:54 +03:00
committed by GitHub
parent 2b83f3bd60
commit cb45f1a7b3
6 changed files with 74 additions and 90 deletions
+32 -28
View File
@@ -39,24 +39,26 @@ else
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;
}
var loadOnRestoreCheckbox = document.querySelector("nav > p > input[type=checkbox]");
chrome.storage.sync.get({ "loadOnRestore": false },
values => loadOnRestoreCheckbox.checked = values.loadOnRestore
);
chrome.storage.onChanged.addListener(function (changes, namespace) {
if (namespace == 'sync'){
for (key in changes) {
if (key === 'loadOnRestore') {
loadOnRestoreCheckbox.checked = changes[key].newValue
}
}
}
});
loadOnRestoreCheckbox.addEventListener("click", function ()
{
chrome.runtime.sendMessage(
chrome.storage.sync.set(
{
command: "toggleDiscard"
}
);
}); */
"loadOnRestore": loadOnRestoreCheckbox.checked
});
});
document.querySelectorAll(".tabsAside.pane > header nav button").forEach(i =>
{
@@ -120,24 +122,26 @@ function InitializeStandalone()
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;
}
var loadOnRestoreCheckbox = document.querySelector("nav > p > input[type=checkbox]");
chrome.storage.sync.get({ "loadOnRestore": false },
values => loadOnRestoreCheckbox.checked = values.loadOnRestore
);
chrome.storage.onChanged.addListener(function (changes, namespace) {
if (namespace == 'sync'){
for (key in changes) {
if (key === 'loadOnRestore') {
loadOnRestoreCheckbox.checked = changes[key].newValue
}
}
}
});
loadOnRestoreCheckbox.addEventListener("click", function ()
{
chrome.runtime.sendMessage(
chrome.storage.sync.set(
{
command: "toggleDiscard"
}
);
}); */
"loadOnRestore": loadOnRestoreCheckbox.checked
});
});
document.querySelectorAll(".tabsAside.pane > header nav button").forEach(i =>
{