Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent for 'window.location.ancestorOrigins' in FF and IE

Following is Google Chrome version for getting parent window's URL from iFrame.

window.location.ancestorOrigins;

I'm looking for equivalent of above statement for FireFox and IE. Is it possible to achieve it.

Tried with document.referrer also giving the iFrame Url only.

like image 547
Ravi MCA Avatar asked Jan 12 '16 11:01

Ravi MCA


1 Answers

Unfortunately, FireFox and IE do not have an equivalent to ancestorOrigins.

The best you can do with regards to getting the parent URL is document.referrer and unfortunately if you are dealing with iframes, this means you may not be able to get to the outside page and get the true URL of the webpage.

like image 181
Oli C Avatar answered Oct 20 '22 02:10

Oli C