Skip to content

Commit 75e416f

Browse files
committed
secure origin error when in iframe
1 parent 2252b4b commit 75e416f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
const targetOrigin = location.origin === 'https://gist.host' ? 'https://gist.run' : 'http://localhost:9000';
99

10-
navigator.serviceWorker.register(`worker.js`, { scope: './' });
10+
navigator.serviceWorker.register(`${location.origin}/worker.js`, { scope: './' });
1111

1212
addEventListener('message', event => {
1313
if (event.origin !== targetOrigin) {

0 commit comments

Comments
 (0)