diff --git a/manifest.json b/manifest.json index 31d9b9a..394aa8b 100644 --- a/manifest.json +++ b/manifest.json @@ -23,5 +23,11 @@ "matches": [""], "extension_ids": ["*"] } + ], + "content_scripts": [ + { + "matches": [""], + "js": ["content.js"] + } ] } diff --git a/new-tab.html b/new-tab.html index aa21bab..aa57d9a 100644 --- a/new-tab.html +++ b/new-tab.html @@ -224,20 +224,4 @@

- - diff --git a/script.js b/script.js index f7d86d8..6e467e3 100644 --- a/script.js +++ b/script.js @@ -26,7 +26,6 @@ function addZero(n) { return (parseInt(n, 10) < 10 ? "0" : "") + n; } - // Shortcuts fetch("/config.json") .then((response) => response.json()) @@ -463,6 +462,20 @@ document.addEventListener("keydown", function (event) { } }); +document.addEventListener("keydown", (event) => { + if (event.ctrlKey && event.altKey) { + const pg1 = document.getElementById("pg1"); + const pg2 = document.getElementById("pg2"); + if (pg2.style.opacity == 0) { + pg2.style.opacity = 1; + pg1.style.opacity = 0; + } else { + pg2.style.opacity = 0; + pg1.style.opacity = 1; + } + } +}); + // Protection document.addEventListener("contextmenu", (event) => event.preventDefault()); document.onkeydown = function (e) {