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
917 B
JavaScript
26 lines
917 B
JavaScript
async function showNoChromiumPopup() {
|
|
if (navigator.userAgent.includes("Chrome") && 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 = "z-index: 9999;";
|
|
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(); |