Upload data via IFRAME
to circumvent CORS when there is no possibility of a JSONP, it is a frivolous solution. In the specification browsers must block this type of feature allowing only if the site containing Javascript send via postMessage
and interpret messages sent to him in isolation.
If this is not the case, you will be exploiting a security flaw that some browsers may have, so the trend is that these faults are suppressed and your system crashes. Whether by updating in the browser, security plugins or anti-virus integrated into the client’s browser.
A suitable solution to give information coming from another site that does not have this data directly client to client, is to use a server to do a tuning, how it works:
- Your client makes a request to your server
- Your server modifies the request including data such as API_KEY, cookies, etc needed to communicate with the target web service
- It sends and captures the answer from the webservice
- Handles the response and sends back to your customer the data whether raw or processed
The service can be expanded to a web service without problem, as long as your server treats the data correctly to send to the site that holds the desired information.
I couldn’t find any documentation on how this service works. If you can give some data about how this transfer happens (ajax, postmessage, plugins, etc.) it would be easier to answer the question.
– Gustavo Rodrigues
The most appropriate solution for you to take this data and make it available on your site is to work with a kind of tuning on your server, where you communicate your server directly with the host server and transmit the manipulated information to the client. This way will not infringe CORS and will be compatible with all browsers that do not show security fault.
– Gabriel Gartz