Fixing Issue 2998 - Replacing `!!window.frameElement` with `window.parent !== window`
Merge pull request #3035 from Inkbug/issue2998

Fix for Issue 2998 – "Consider using `window.parent !== window` instead of `!!window.frameElement`"