I´m doing an experiment locally to try to understand how the Cross Origin policy works with iframes:
- I have a simple page served locally with an iframe pointing to http://edition.cnn.com/
- I modified the hosts file in my computer to point localhost to mytest.cnn.com
According to the definition of the Cross Origin policy, if I try to access an element from the iframe from the page (now served from mytest.cnn.com), it should work, but I still get the same error "Blocked a frame with origin "http://mytest.cnn.com" from accessing a cross-origin frame".
I also tried changed the domain of the page to just "cnn.com", but I get the same result. Is there any special case applied because I´m serving the page from a local server?