1

I tried to get location of the iframe using following line of code,

var urlHash = iFrame.contentWindow.location.hash;

And I'm getting following error,

Uncaught DOMException: Blocked a frame with origin "https://localhost:7002" from accessing a cross-origin frame.
    at https://localhost:7002/app/login/abc.js:130:57

I went through following stackoverflow question and according to that the origine of the iframe and the js file is same. But according to the error message, they are not same origine. Please note that the iframe is generated using javascript code.

How can I get it worked?

Lakmal Vithanage
  • 2,607
  • 5
  • 35
  • 56
  • What more do you need? What is not included in the post you've already linked? – Teemu Mar 28 '18 at 07:27
  • @Teemu, I have edited question. According to the error message they are from different origin. But according to the reference, they are same origin. Anyway I'm getting erro, How can I figure out this issue? – Lakmal Vithanage Mar 28 '18 at 07:33
  • Just read the linked post, and do what your browser asks for, treat the files as cross-origin. – Teemu Mar 28 '18 at 07:34

0 Answers0