window.frameElement throws an Error in IE if the iframe has
another origin than its parent. If there is an error on accessing
window.frameElement, then we know that we are inside an iframe.
Looks good to me @Kijewski ! The only thing I found is that the JSLint now fails and I'm not sure why...
@mattab, probably I have to declare the variable at the top of the function. The rest of the code does. Let's see what Travis says.
OK, that was one error. The first lint printed
JSLINT errors [object Object],[object Object]
JSLINT errors [object Object]
but I don't know what the other error is. :-/
Feel free to squash already. We will need to test it then in various browsers
fyi: wrote a test for the isInsideIframe function, maybe will be useful for crossbrowser testing https://github.com/piwik/piwik/pull/10300