-
Notifications
You must be signed in to change notification settings - Fork 18
Update #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update #13
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,53 +1,62 @@ | ||||||||
| // Preconnect to CDN | ||||||||
| var preconnect = document.createElement("link"); | ||||||||
| preconnect.rel = "preconnect"; | ||||||||
| preconnect.href = "https://cdn.jsdelivr.net"; | ||||||||
| var preconnect = document.createElement('link'); | ||||||||
| preconnect.rel = 'preconnect'; | ||||||||
| preconnect.href = 'https://cdn.jsdelivr.net'; | ||||||||
| document.head.appendChild(preconnect); | ||||||||
|
|
||||||||
| // Preload Bootstrap icons CSS | ||||||||
| var preload = document.createElement("link"); | ||||||||
| preload.rel = "preload"; | ||||||||
| preload.as = "style"; | ||||||||
| preload.href = "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css"; | ||||||||
| var preload = document.createElement('link'); | ||||||||
| preload.rel = 'preload'; | ||||||||
| preload.as = 'style'; | ||||||||
| preload.href = 'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css'; | ||||||||
| document.head.appendChild(preload); | ||||||||
|
|
||||||||
| function loadScript(src, callback) { | ||||||||
| var script = document.createElement("script"); | ||||||||
| script.type = "text/javascript"; | ||||||||
| var script = document.createElement('script'); | ||||||||
| script.type = 'text/javascript'; | ||||||||
| script.src = src; | ||||||||
| script.defer = true; | ||||||||
| if (callback) script.onload = callback; | ||||||||
| document.head.appendChild(script); | ||||||||
| } | ||||||||
|
|
||||||||
| function loadCSS(href, callback) { | ||||||||
| var link = document.createElement("link"); | ||||||||
| link.rel = "stylesheet"; | ||||||||
| var link = document.createElement('link'); | ||||||||
| link.rel = 'stylesheet'; | ||||||||
| link.href = href; | ||||||||
| var supportsOnLoad = "onload" in link; | ||||||||
| var supportsOnLoad = 'onload' in link; | ||||||||
| if (supportsOnLoad) { | ||||||||
| link.onload = callback; | ||||||||
| } else { | ||||||||
| setTimeout(function() { | ||||||||
| setTimeout(function () { | ||||||||
| callback(); | ||||||||
| }, 1000); | ||||||||
| } | ||||||||
| document.head.appendChild(link); | ||||||||
| } | ||||||||
|
|
||||||||
| loadCSS('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css', function() {}); | ||||||||
| loadCSS( | ||||||||
| 'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css', | ||||||||
| function () {} | ||||||||
| ); | ||||||||
|
|
||||||||
| if (window.location.pathname === "/index.html" || window.location.pathname === "/") { | ||||||||
| const options = ["Right-Click to access more features", "Set a custom background in settings.", "Tab Cloaking is highly recommended", "About:Blank Cloak is highly recommended", "This site was originally created for fun and educational purposes."]; | ||||||||
| if (window.location.pathname === '/index.html' || window.location.pathname === '/') { | ||||||||
| const options = [ | ||||||||
| 'Right-Click to access more features', | ||||||||
| 'Set a custom background in settings.', | ||||||||
| 'Tab Cloaking is highly recommended', | ||||||||
| 'About:Blank Cloak is highly recommended', | ||||||||
| 'This site was originally created for fun and educational purposes.', | ||||||||
| ]; | ||||||||
|
|
||||||||
| function getRandomOption() { | ||||||||
| const randomNumber = Math.floor(Math.random() * options.length); | ||||||||
| return options[randomNumber]; | ||||||||
| } | ||||||||
|
|
||||||||
| const placeholder = document.getElementById("placeholder"); | ||||||||
| const bar = document.querySelector(".browse-input"); | ||||||||
| const search = document.getElementById("search"); | ||||||||
| const placeholder = document.getElementById('placeholder'); | ||||||||
| const bar = document.querySelector('.browse-input'); | ||||||||
| const search = document.getElementById('search'); | ||||||||
|
|
||||||||
| function setRandomPlaceholder() { | ||||||||
| if (!placeholder) return; | ||||||||
|
|
@@ -57,26 +66,24 @@ if (window.location.pathname === "/index.html" || window.location.pathname === " | |||||||
| setRandomPlaceholder(); | ||||||||
|
|
||||||||
| if (bar && search) { | ||||||||
| bar.addEventListener("focus", () => { | ||||||||
| search.style.marginLeft = "-367px"; | ||||||||
| bar.addEventListener('focus', () => { | ||||||||
| search.style.marginLeft = '-367px'; | ||||||||
| }); | ||||||||
|
|
||||||||
| bar.addEventListener("blur", () => { | ||||||||
| search.style.marginLeft = "-150px"; | ||||||||
| bar.addEventListener('blur', () => { | ||||||||
| search.style.marginLeft = '-150px'; | ||||||||
| }); | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| window.addEventListener("load", function() { | ||||||||
| window.addEventListener('load', function () { | ||||||||
| // Register service worker for asset caching | ||||||||
| if ("serviceWorker" in navigator) { | ||||||||
| navigator.serviceWorker.register("/sw.js"); | ||||||||
| if ('serviceWorker' in navigator) { | ||||||||
| navigator.serviceWorker.register('/sw.js'); | ||||||||
| } | ||||||||
|
|
||||||||
| loadScript("/worker.js"); | ||||||||
|
|
||||||||
| if (window.location.pathname === "/index.html" || window.location.pathname === "/") { | ||||||||
| location.href = "/math.html"; | ||||||||
| if (window.location.pathname === '/index.html' || window.location.pathname === '/') { | ||||||||
| location.href = '/math.html'; | ||||||||
| } | ||||||||
|
|
||||||||
|
Comment on lines
+85
to
88
|
||||||||
| if (window.location.pathname === '/index.html' || window.location.pathname === '/') { | |
| location.href = '/math.html'; | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1 +1,70 @@ | ||||||||||||||||||||||||||||||
| importScripts("/uv/uv.bundle.js"),importScripts("/uv/uv.config.js"),importScripts("/uv/uv.sw.js");const CACHE_NAME="arctic-v1.0",urlsToCache=["/static/","/static/index.html","/static/settings.html","/static/assets/css/app.css","/static/assets/css/menu.css","/static/assets/js/particles.js","/static/assets/js/themes.js","/static/assets/js/index.js","/static/assets/js/anym.js","/static/assets/js/main.js","/static/assets/img/salyte.jpg","/static/android-chrome-192x192.png","/static/android-chrome-512x512.png","/static/wk/wk2.js","/static/wk/wk3.js"],uv=new UVServiceWorker;self.addEventListener("install",event=>{event.waitUntil(caches.open(CACHE_NAME).then(cache=>cache.addAll(urlsToCache.map(url=>new Request(url,{cache:"reload"}))))),self.skipWaiting()}),self.addEventListener("activate",event=>(event.waitUntil(caches.keys().then(cacheNames=>Promise.all(cacheNames.map(cacheName=>{if(cacheName!==CACHE_NAME)return caches.delete(cacheName)})))),self.clients.claim()));async function handleRequest(event){if(uv.route(event))return await uv.fetch(event);const cachedResponse=await caches.match(event.request);if(cachedResponse)return cachedResponse;try{const response=await fetch(event.request);if(response&&response.status===200&&response.type==="basic"){const responseToCache=response.clone();caches.open(CACHE_NAME).then(cache=>{cache.put(event.request,responseToCache)})}return response}catch{return await fetch(event.request)}}self.addEventListener("fetch",event=>{event.respondWith(handleRequest(event))}) | ||||||||||||||||||||||||||||||
| importScripts('/uv/uv.bundle.js'); | ||||||||||||||||||||||||||||||
| importScripts('/uv/uv.config.js'); | ||||||||||||||||||||||||||||||
| importScripts('/uv/uv.sw.js'); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| const CACHE_NAME = 'arctic-v1.0'; | ||||||||||||||||||||||||||||||
| const urlsToCache = [ | ||||||||||||||||||||||||||||||
| '/', | ||||||||||||||||||||||||||||||
| '/index.html', | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| '/index.html', | |
| '/index.html', | |
| '/math.html', |
Copilot
AI
Apr 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTML requests versioned assets (e.g. /assets/css/app.css?v=3), but the pre-cache list uses unversioned URLs. Since caches.match(event.request) matches on the full URL including query params, these pre-cached entries won't satisfy the versioned requests. Consider caching the exact versioned URLs or adjusting the matching strategy (e.g. ignoreSearch) if appropriate.
Copilot
AI
Apr 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The service worker pre-caches '/settings.html' but not its required assets (notably '/assets/css/settings.css?v=3' and '/assets/js/settings.js?v=3'), so the settings page won't work offline even though the document is cached. Consider adding those dependencies to urlsToCache (matching the versioned URLs used in the HTML).
| '/assets/css/menu.css', | |
| '/assets/js/particles.js', | |
| '/assets/js/themes.js', | |
| '/assets/js/index.js', | |
| '/assets/js/anym.js', | |
| '/assets/js/main.js', | |
| '/assets/css/menu.css', | |
| '/assets/css/settings.css?v=3', | |
| '/assets/js/particles.js', | |
| '/assets/js/themes.js', | |
| '/assets/js/index.js', | |
| '/assets/js/anym.js', | |
| '/assets/js/main.js', | |
| '/assets/js/settings.js?v=3', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cypress/requestis no longer imported anywhere in the codebase, but it remains inpackage.jsondependencies. Consider removing it to reduce install size and avoid carrying an unused dependency.