getIFrameParentUrl() {
return (window.location !== window.parent.location)
? document.referrer
: document.location.href;
};
The code above is run from an i-frame checks if an i-frame is embedded and gets the url of the site embedding the iframe. I have no idea where to even begin with this one. Is this function testable in Karma? If so, how? I need a pointer in the right direction, not necessarily the code.
Running in PhantomJs, if that's relevant.
Source of function if anyone wants more background: Access parent URL from iframe