Skip to content

Commit

Permalink
Force reload in examples. (#974)
Browse files Browse the repository at this point in the history
After installing the service worker to use the COOP/COEP header, ensure
the document is reloaded.

Bug:#973
Fixed:#973
  • Loading branch information
ArthurSonzogni authored Dec 25, 2024
1 parent daa421f commit 751c8fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions examples/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import xterm_addon_fit from 'https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.5.
if ("serviceWorker" in navigator && !window.crossOriginIsolated) {
const url_sw = new URL("./sw.js", location.href);
const registration = await navigator.serviceWorker.register(url_sw);
if (registration.active && !navigator.serviceWorker.controller) {
window.location.reload(); // Reload to ensure the COOP/COEP headers are set.
}
window.location.reload(); // Reload to ensure the COOP/COEP headers are set.
}

const example_list = "@EXAMPLES@".split(";");
Expand Down

0 comments on commit 751c8fa

Please sign in to comment.