Initial release of Google Opal AI iOS Web Studio

This commit is contained in:
Amirul Islam Redwan71
2026-09-01 09:01:09 +06:00
commit b85c5cf065
10 changed files with 1839 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
const CACHE_NAME = 'opal-ai-v2-cache';
const ASSETS = [
'./',
'./index.html',
'./style.css',
'./app.js',
'./manifest.json',
'https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js'
];
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
return cache.addAll(ASSETS);
})
);
self.skipWaiting();
});
self.addEventListener('activate', (e) => {
e.waitUntil(
caches.keys().then((keys) => {
return Promise.all(
keys.map((key) => {
if (key !== CACHE_NAME) return caches.delete(key);
})
);
})
);
self.clients.claim();
});
self.addEventListener('fetch', (e) => {
e.respondWith(
caches.match(e.request).then((res) => {
return res || fetch(e.request);
})
);
});