davidjbradshaw / iframe-resizer

Keep iFrames sized to their content.
https://iframe-resizer.com
Other
6.63k stars 978 forks source link

fix close release destroyObserver #1229

Closed aniude closed 3 months ago

aniude commented 3 months ago

Good spot, not sure what happened there. Interested to know how you spotted it. Was it causing an issue?

I found that in Chrome memory watcher, when I destroy the iframe element, this object still get reference to frame object as DetachIFrameObject

davidjbradshaw commented 3 months ago

Just tried to merge this but I get the following eslint errors

/Users/davidbradshaw/dev/iframe-resizer/src/iframeResizer.js
   733:5  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  1152:9  error  Function 'createDestroyObserver' expected no return value              consistent-return
davidjbradshaw commented 3 months ago

@aniude I think the first issue can be fixed by changing

 destroyObserver && destroyObserver.disconnect()

to

destroyObserver?.disconnect()

Not sure what is causing the second warning

aniude commented 3 months ago

@aniude I think the first issue can be fixed by changing

 destroyObserver && destroyObserver.disconnect()

to

destroyObserver?.disconnect()

Not sure what is causing the second warning

I changed it. check it again.

davidjbradshaw commented 3 months ago

Merged into V4 branch and released as v4.3.10 Thanks for the fix.

Btw you might want to checkout the version 5 I'm currently working. Draft docs can be found at http://iframe-resizer.com. Would love any feedback on it that you might have.

aniude commented 3 months ago

Merged into V4 branch and released as v4.3.10 Thanks for the fix.

Btw you might want to checkout the version 5 I'm currently working. Draft docs can be found at http://iframe-resizer.com. Would love any feedback on it that you might have.

It seems that the UI is more better. I can't wait anymore. thanks.