Created
June 11, 2021 18:12
-
-
Save wperron/63103094d7d7586f17ffd13c6a39e6d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener("fetch", (event) => { | |
event.respondWith(handler(event.request)); | |
}); | |
async function handler(req: Request): Promise<Response> { | |
if (typeof BroadcastChannel !== "undefined") { | |
console.log("found broadcast channel"); | |
return new Response("true"); | |
} | |
return new Response("false"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment