Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrive.js with iframes? #32

Open
DenisGorbachev opened this issue May 19, 2015 · 5 comments
Open

arrive.js with iframes? #32

DenisGorbachev opened this issue May 19, 2015 · 5 comments

Comments

@DenisGorbachev
Copy link

I have a parent page that embeds a child iframe. I set up arrival listeners for elements in child iframe; however, these listeners are never called. Is it possible to use arrive.js with iframes?

P.S. I'm running google-chrome --disable-web-security to bypass same-origin checks.

@DenisGorbachev DenisGorbachev changed the title google-chrome --disable-web-security arrive.js with iframes? May 19, 2015
@uzairfarooq
Copy link
Owner

Arrive won't fire for elements within an iframe unless you attach it to the document or some other element within an iframe. If you have access to the iframe then you can attach it to the document of iframe

@DenisGorbachev
Copy link
Author

@uzairfarooq that's exactly what I am doing: attaching arrive to the iframe document. However, it doesn't work. Could you please chevk?

@uzairfarooq
Copy link
Owner

uzairfarooq commented May 20, 2015

Hmm...haven't tried it before on iframe. Will look into it.

@manuelmeurer
Copy link

Hi @uzairfarooq, I'm also interested in this feature but can't get it to work. 😄
Anything I can do to help debug or implement this?

@kylekyle
Copy link

kylekyle commented Sep 4, 2020

The monitoring package is a rewrite of arrive and can watch for elements in iframes:

const monitor = monitoring(document.body, {iframes: true});
 
monitor.added('div', div => {
  if (div.ownerDocument != document) {
    console.log('new div in an iframe!');
  }
});

Disclosure: I am the author of monitoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants