diff --git a/src/routes/popup/+page.svelte b/src/routes/popup/+page.svelte new file mode 100644 index 0000000..8d981e6 --- /dev/null +++ b/src/routes/popup/+page.svelte @@ -0,0 +1,77 @@ +
+ + + +
+ +
+ + + +
\ No newline at end of file diff --git a/static/popup.js b/static/popup.js new file mode 100644 index 0000000..1b24428 --- /dev/null +++ b/static/popup.js @@ -0,0 +1,26 @@ +async function showNoChromiumPopup() { + if (localStorage.getItem("no-chromium-popup-shown") != "1") { + + const divPage = document.createElement("div"); + const response = await fetch("/popup/"); + divPage.innerHTML = await response.text(); + + for (const child of divPage.querySelectorAll("#no-chromium-head > *")) { + document.head.appendChild(child); + } + + for (const child of divPage.querySelectorAll("#no-chromium-body > *")) { + document.body.appendChild(child); + } + + document.querySelector("#no-chromium-popup").style = ""; + document.querySelector("#no-chromium-hide-button").addEventListener("click", hideNoChromiumPopup); + } +} + +function hideNoChromiumPopup() { + document.querySelector("#no-chromium-popup").remove(); + localStorage.setItem("no-chromium-popup-shown", "1"); +} + +showNoChromiumPopup(); \ No newline at end of file diff --git a/static/test.html b/static/test.html new file mode 100644 index 0000000..475ce27 --- /dev/null +++ b/static/test.html @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file