Looking at frame length breaks down generally if page A itself has frames (I know this might not be the case for this specific instance). The more reliable and meaningful test would be:
if (window!=window.top) { /* I'm in a frame! */ }
More Related Contents:
- Chrome userscript error: “Unsafe JavaScript attempt to access frame”
- Invoking JavaScript code in an iframe from the parent page
- Adjust width and height of iframe to fit with content in it
- Run Greasemonkey script on the same page, multiple times?
- How do I get the information from a meta tag with JavaScript?
- How to prevent IFRAME from redirecting top-level window
- Communicate between scripts in the background context (background script, browser action, page action, options page, etc.)
- Pass value to iframe from a window
- How to embed an autoplaying YouTube video in an iframe?
- “Access is denied” JavaScript error when trying to access the document object of a programmatically-created (IE-only)
- Unsafe JavaScript attempt to access frame with URL
- Setting focus to iframe contents
- How to change style of iframe content cross-domain?
- putting html inside an iframe (using javascript)
- How can I access the DOM elements within an iFrame
- How to exclude iframe in Greasemonkey or Tampermonkey?
- Can I apply CSS to the elements within an iframe?
- Is it possible to add Request Headers to an iframe src request?
- Is there a way to uniquely identify an iframe that the content script runs in for my Chrome extension?
- Check if parent window is iframe or not
- Accessing an element outside of iframe
- Iframe.readyState does not work in chrome
- iFrame onload JavaScript event
- Trigger a button click inside an iframe [duplicate]
- Accessing iframe from chrome extension
- Google DFP – Resize SafeFrame custom creative outer Iframe container from inside (expand ad)
- Reload an IFRAME without adding to the history
- iframe not reading cookies in Chrome
- How can I detect a Scrollbar presence ( using Javascript ) in HTML iFrame?
- iframe inside angular2 component, Property ‘contentWindow’ does not exist on type ‘HTMLElement’