Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite /scope:.+/<URL> to just <URL>
Related to WordPress/wordpress-playground#42 This commit implements the URL rewrite with: * A liveServer middleware for local dev * A .htaccess file for apache production setups Documenting this behavior in a visible place will be critical for mass adoption of this project. Nested iframes with src="about:srcdoc" are not controlled by the parent's frame ServiceWorker. This is a bug in Chrome and potentially other Chromium-based browser. This is problematic because WordPress site editor is rendered in one such iframe and it loads a bunch of stylesheets using a link tag like: <link rel="stylesheet" href="/scope:<scope>/<URL>" /> The /scope:<scope>/ part of the URL does not actually exist on the server – it's a WordPress instance scope introduced to make WASM WordPress usable in multiple browser tabs. Learn more at WordPress/wordpress-playground#31 The point is – these stylesheet requests bypass the ServiceWorker and are actually sent to the server where they get a 404 response. This effectively breaks the site editor. We cannot re-route these requests in a ServiceWorker, but we can do it on the server. That's what this commit is. Unfortunately this commit won't solve the problem in setups based on nginx and other server software – let's follow it up with a documentation update.
- Loading branch information