forked from Trivernis/no-chromium
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
861 B
JavaScript
26 lines
861 B
JavaScript
async function showNoChromiumPopup() {
|
|
if (localStorage.getItem("no-chromium-popup-shown") != "1") {
|
|
|
|
const divPage = document.createElement("div");
|
|
const response = await fetch("https://no-chromium.org/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(); |