mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
17 lines
No EOL
543 B
JavaScript
17 lines
No EOL
543 B
JavaScript
importScripts("scramjet.codecs.js");
|
|
importScripts("scramjet.config.js");
|
|
importScripts( __scramjet$config.bundle || "scramjet.bundle.js")
|
|
importScripts( __scramjet$config.worker || "scramjet.worker.js");
|
|
importScripts("bare-client.js")
|
|
|
|
const scramjet = new ScramjetServiceWorker();
|
|
|
|
self.addEventListener("fetch", async (event) => {
|
|
event.respondWith((async() => {
|
|
if (scramjet.route(event)) {
|
|
return await scramjet.fetch(event);
|
|
} else {
|
|
return await fetch(event.request);
|
|
}
|
|
})())
|
|
})
|