arrive icon indicating copy to clipboard operation
arrive copied to clipboard

arrive.js with iframes?

Open DenisGorbachev opened this issue 10 years ago • 5 comments

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 avatar May 19 '15 08:05 DenisGorbachev

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

uzairfarooq avatar May 20 '15 02:05 uzairfarooq

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

DenisGorbachev avatar May 20 '15 18:05 DenisGorbachev

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

uzairfarooq avatar May 20 '15 19:05 uzairfarooq

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?

manuelmeurer avatar Feb 12 '18 16:02 manuelmeurer

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.

kylekyle avatar Sep 04 '20 20:09 kylekyle