Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate StoryMap oembed on wordpress self-hosted #2

Open
JoeGermuska opened this issue Mar 21, 2016 · 1 comment
Open

Investigate StoryMap oembed on wordpress self-hosted #2

JoeGermuska opened this issue Mar 21, 2016 · 1 comment

Comments

@JoeGermuska
Copy link
Member

I was pleased to find that oembed works already on Wordpress.com sites, as can be tested with any recently created or re-published StoryMap, like this one:

https://uploads.knightlab.com/storymapjs/7d5cf9cfc9fa75da134291f9fe3c57fb/sad-topographies/index.html

The same, when used in a Wordpress self-hosted site, seems to trigger the discovery, but when previewed, yields a CORS error because a null Origin header is sent. Ultimately, that preflight check must be coming from our own code. Can we figure out why the Origin header is null, but only in this case and not on wordpress.com sites?

@JoeGermuska
Copy link
Member Author

On Slack, @reefdog helped identify that Wordpress adds attributes security="restricted" sandbox="allow-scripts" to the iframe which is embedded. Sure enough, a simple standalone HTML page with those fails.

Can we work around this?

test case

<html>
  <head><title>iframe test</title></head>
  <body>
    <h1>with tags</h1>
    <iframe class="wp-embedded-content" security="restricted" sandbox="allow-scripts"
    src="https://s3.amazonaws.com/uploads.knightlab.com/storymapjs/7d5cf9cfc9fa75da134291f9fe3c57fb/sad-topographies/index.html"
    width='100%' height='200' frameborder='0'></iframe>
    <h1>without tags</h1>
    <iframe class="wp-embedded-content"
    src="https://s3.amazonaws.com/uploads.knightlab.com/storymapjs/7d5cf9cfc9fa75da134291f9fe3c57fb/sad-topographies/index.html"
    width='100%' height='200' frameborder='0'></iframe>
  </body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant