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

X-Frame-Options denies using voxel-webview with many interesting websites - use a CORS proxy #4

Open
deathcap opened this issue Feb 19, 2014 · 2 comments

Comments

@deathcap
Copy link
Member

Many popular sites use the X-Frame-Options HTTP header to prevent being loaded in an iframe, so they cannot be viewed with voxel-webview.

https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
http://stackoverflow.com/questions/6666423/overcoming-display-forbidden-by-x-frame-options

Some have specific 'embeddable' versions, e.g. for YouTube: http://www.youtube.com/embed/j6cxZp4ii6c?autoplay=true

screen shot 2014-02-18 at 8 06 26 pm

or Vimeo player, Google Maps &output=embed, or http://embed.ly/ - but this doesn't apply in general. Unable to load https://news.ycombinator.com/ (deny), http://reddit.com/ (same-origin), among others.

The Web Displays modifcation for Minecraft can do this because it embeds its own web browser, apparently: Awesomium (but maybe WebKit in the future?).

An extreme alternative: webkit.js (article), a pure JavaScript port of WebKit which can run the browser and output to canvas. But it not complete (likely doesn't support WebGL yet ;), and it seems more reasonable to use the browser's built-in functionality.. #6

A more moderate workaround: use a proxy, similar to CORS Proxy which adds the Access-Control-Allow-Origin header (actually, could even use this and then set the iframe contents?), but instead have it strip the X-Frame-Options header (should probably strip cookies too).

@deathcap
Copy link
Member Author

npmjs.org, which I was using as the default example URL, has now set X-Frame-Options: deny. Maybe as part of their recent security audit http://blog.npmjs.org/post/80277229932/newly-paranoid-maintainers - but this now prevents this example from working :(

@deathcap deathcap changed the title X-Frame-Options denies using voxel-webview with many interesting websites X-Frame-Options denies using voxel-webview with many interesting websites - use a CORS proxy Feb 5, 2015
@deathcap
Copy link
Member Author

ref GH-6 WebKit.js for rendering embedded web views instead of iframe

Added https://github.com/deathcap/voxel-webview/blob/master/default.html with some non-"X-Frame-Options: deny/sameorigin" website links. http://cors.maxogden.com is running a cors-proxy but using it is not as simple as http://cors.maxogden.com/http://www.google.com/ - need to use XMLHttpRequest to request programmatically. And also rewrite all the embedded links or external references.

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