-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load the iframe-worker.html from a separate domain
The Origin-Agent-Cluster: ?1 is used to request a separate process for the iframe-worker.html in Google Chrome. It worked perfectly when the root app was served from wasm.wordpress.net and the iframe-worker.html was served from wasm-worker.wordpress.net. Recently both these domains have been merged to allow direct communication between the Service Worker and the iframe Worker Thread. Now I'm observing the following error message: > The page requested an origin-keyed agent cluster using the Origin-Agent-Cluster header, but could not be origin-keyed since the origin 'https://wasm.wordpress.net' had previously been placed in a site-keyed agent cluster. Update your headers to uniformly request origin-keying for all pages on the origin. Accordingly to the Origin-Agent-Cluster docs at https://web.dev/origin-agent-cluster/, the clustered resource must be loaded from a different origin. That’s what this commit does. As a side-effect, the Service Worker can no longer directly communicate with the Worker Thread since they’re registered on separate origins now. The `worker-thread/window.library.ts` bridges that gap by proxying all the relevant BroadcastChannel communication to the Worker Thread. Fixes #74
- Loading branch information
Showing
3 changed files
with
41 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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