question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interval mechanism is active despite being run in newest Chrome where mutationObserver is supported

See original GitHub issue

Running the example in Chrome with the console visible I can see the Log output. No interval mechanism is active there.

But when I run my own tryout page I can see in the console that the script is always busy, always writing to the console. So I assume the interval mechanism is active. But how is that possible? My browser is the newest Chrome and supports mutationObserver.

Edit: I just noticed, the iframe content seems to always grow, not fast, but it steadily grows larger.

I use “iframe-resizer”: “^4.2.11”

The relevant parts in my setup are:

    <style>iframe{width:100%}</style>

    <iframe
      data-iframe
      src="https://canadalife-info.de/-lp/t9w5k12755/6ZZSl5"
      id="iFrameResizer1"
      scrolling="no">
    </iframe>
import { iframeResizer } from 'iframe-resizer';
const init = (iframe) => {
  iframeResizer(
    {
      checkOrigin: false,
      log: true,
      heightCalculationMethod: 'max',
    },
    iframe,
  );
};

Google Chrome ist auf dem neuesten Stand. Version 84.0.4147.135 (Offizieller Build) (64-Bit)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
teetotumcommented, Aug 26, 2020

Sorry for spamming. I just discovered that the iframe content uses setInterval(some_func, 1000) in an inline script to update the value of a hidden input field, incrementing it each second by 17 (WTF?). Am I right when I assume this is a DOM change, thereby triggering the mutationObserver, thereby triggering the re-evaluation of the whole iframe-resizer size-checking mechanism, thereby printing the corresponding log output to the browser console. And this means that I was wrong in thinking that the interval mechanism was kicking in. And the content is not growing, it just never shrinks, which means when I resize the browser a few times like a madman it gets stuck in the biggest height, not shrinking back to normal size, and I therefore thought it must be growing over time ( Just me jumping to conclusion once again.) Call me Sherlock.

Solved. There was a CSS rule in the content html,body { height: 100%; }. After I removed it the content resized as intended.

0reactions
davidjbradshawcommented, Aug 26, 2020

Yep that sums it up.

On Wed, 26 Aug 2020 at 15:02, Martin notifications@github.com wrote:

Sorry for spamming. I just discovered that the iframe content uses setInterval(some_func, 1000) in an inline script to update the value of a hidden input field, incrementing it each second by 17 (WTF?). Am I right when I assume this is a DOM change, thereby triggering the mutationObserver, thereby triggering the re-evaluation of the whole iframe-resizer size-checking mechanism, thereby printing the corresponding log output to the browser console. And this means that I was wrong in thinking that the interval mechanism was kicking in.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/davidjbradshaw/iframe-resizer/issues/851#issuecomment-680898990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEQOEQROHZVJY2H2XLBQULSCUIW7ANCNFSM4QKRKTJQ .

– Sent from my iPhone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MutationObserver - Web APIs | MDN
Creates and returns a new MutationObserver which will invoke a specified callback function when DOM changes occur. Instance methods. disconnect ...
Read more >
Why doesn't MutationObserver code run on Chrome 30?
As you can see , we should see a alert because a div element is inserted to the DOM. But it appears MutationObserver...
Read more >
A jquery-watch Plug-in for watching CSS styles and Attributes - Rick ...
So the updated version of the jquery-watch plug-in now uses the MutationObserver API with a fallback to setInterval() polling for events. The plug-in...
Read more >
146172 - Implement setImmediate/clearImmediate - chromium
That is to say, It could run at the very end of the current event loop, ... According to MDN, Firefox supports MutationObserver...
Read more >
Continuous Browser Extension Fingerprinting Through ...
“nearly half of all Chrome desktop users actively use extensions” [4]. However, this personalization suffers from inherent privacy risks:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found