Skip to content

Conversation

@adamziel
Copy link
Collaborator

@adamziel adamziel commented Jul 14, 2025

Motivation for the change, related issues

This PR accepts https://wasm.wordpress.net as a valid origin for the Playground client served from playground.wordpress.net.

The WordPress Playground plugin embeds Playground from https://wasm.wordpress.net due to a historical nuance. This breaks the rendering of the block with the following error:

index.js:25317 Uncaught (in promise) Error: Invalid remote URL: https://wasm.wordpress.net/remote.html. Expected remote URL to have a path of "/remote.html" based on one of the following origins:
 https://playground.wordpress.net/

While this PR resolves the immediate issue on WordPress.org, we should also update the plugin to use playground.wordpress.net.

Before

CleanShot 2025-07-14 at 22 26 59@2x

After

CleanShot 2025-07-14 at 22 26 11@2x

Testing Instructions (or ideally a Blueprint)

There's no easy way to test this PR :(

@adamziel adamziel added [Type] Bug An existing feature does not function as intended [Package][@wp-playground] Client labels Jul 14, 2025
@adamziel adamziel merged commit aff1cc5 into trunk Jul 14, 2025
24 of 25 checks passed
@adamziel adamziel deleted the accept-wasm-wordpress-net-origin branch July 14, 2025 20:54
adamziel added a commit to WordPress/playground-tools that referenced this pull request Jul 22, 2025
brandonpayton added a commit that referenced this pull request Jul 22, 2025
Playground does not use the CORS proxy when its embedded on another site
via an iframe. This PR changes that and defaults to using CORS proxy
also in embeds.

Follows-up on
#2368

 ## Testing instructions

- CI
- Test CORS requests within Playground block after deployment

---------

Co-authored-by: Brandon Payton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package][@wp-playground] Client [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants