Adicionar opção para carregamento delayed (apos n segundos)

This commit is contained in:
2026-05-29 10:42:52 -03:00
parent acb9208cec
commit 49e01836dd
5 changed files with 88 additions and 25 deletions
+12 -1
View File
@@ -1,6 +1,7 @@
(() => {
const params = new URLSearchParams(location.search);
const destUrl = params.get('url');
const loadDelay = params.get('load_delay'); // seconds, or null
if (!destUrl) {
document.querySelector('.label').textContent = 'No URL provided.';
@@ -17,7 +18,13 @@
function navigate() {
if (navigated) return;
navigated = true;
location.replace(destUrl);
if( destUrl.indexOf('chrome://')==0 ) {
document.querySelector('.ring').style.display = 'none';
document.querySelector('.label').textContent = 'Cant load url';
}
else {
location.replace(destUrl);
}
}
// "Load now" button — immediate bypass
@@ -36,4 +43,8 @@
}
});
}
if( loadDelay!=null ) {
setTimeout(navigate, loadDelay*1000);
}
})();