Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome blocks different origin requests

When script tries to access a frame from a different origin Chrome blocks it and throws exception as

"Uncaught SecurityError: Blocked a frame with origin 'provider domain' from accessing a frame with origin 'mydomain'. Protocols, domains, and ports must match".

I got this error after some update in google chrome. Any suggestions?

like image 950
MANI Avatar asked Nov 07 '13 13:11

MANI


People also ask

How do I fix cross origin requests are only supported for protocol schemes Chrome Chrome extension https?

Just change the url to http://localhost instead of localhost . If you open the html file from local, you should create a local server to serve that html file, the simplest way is using Web Server for Chrome . That will fix the issue.


1 Answers

Direct Javascript calls between frames and/or windows are only allowed if they conform to the same-origin policy. If your window and iframe share a common parent domain you can set document.domain to "domain lower") one or both such that they can communicate. Otherwise you'll need to look into something like the postMessage() API.

like image 147
broofa Avatar answered Oct 02 '22 09:10

broofa