Search code examples
javascriptsame-origin-policy

Getting a security error when i set document.domain


I am trying to bypass the same-origin policy of a domain to click on the contents of a cross domain frame.

The code didn't work because the same origin policy is enforced.

So,i decided to use document.domain to set the subdomain and the parent page to the same address.

Then i tried setting the document.domain but i keep getting a security error.

I used the document.domain syntax,but when i run the code i get a security error.

    document.domain;
//returns www.example.com
  document.domain = "example.com"

I keep getting "Security Error: The operation is insecure".


Solution

  • I didn't have a choice than to switch my browser to google chrome and i disabled the same origin policy through answers from Disable same origin policy in Chrome and voila.