4 ms·
Getting around the same-origin policy for GET-ing binary resources?
by long 12y ago
Getting around the same-origin policy for GET-ing binary resources?
- greggman 12y agoHow would this get you around the same origin policy?
- long 12y agoInstead of doing $.get([remoteScript]), you inject img tags that point to prebuilt PNGs on a different server and decode them after they load. I could be wrong, but doesn't that work?
- lawl 12y agoIt doesn't. You can load the img tag, but the browser will not let you access the image itself from javascript, unless you have the proper CORS headers.
- bshimmin 12y agoQuite right - it will complain that the canvas is "tainted" and won't let you do useful things like calling `getImageData`.
- long 12y agoAh -- useful to know. Thanks for the corrections, folks.
- iso8859-1 12y agoimgur allows any origin
- lawl 12y agoThey ask the server to fetch this URL. The client doesn't upload it.
- deleted 12y ago[deleted]