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.

parentIFrame.autoResize(false) -- iframe still autoresizes

See original GitHub issue

When I resize the parent window the iframe also resizes.

window.iFrameResizer = {
  readyCallback: function() {
    parentIFrame.autoResize(false)
  }
}

On page load:

[iFrameSizer][Host page: theiframe] IFrame scrolling disabled for theiframe
[iFrameSizer][Host page: theiframe] [init] Sending msg to iframe[theiframe] (theiframe:8:false:true:32:true:true:null:taggedElement:null:null:0:false:parent:scroll) targetOrigin: http://192.168.0.101:4567
[iFrameSizer][Host page: theiframe] [iFrame.onload] Sending msg to iframe[theiframe] (theiframe:8:false:true:32:true:true:null:taggedElement:null:null:0:false:parent:scroll) targetOrigin: http://192.168.0.101:4567
[iFrameSizer][theiframe] Initialising iFrame (http://192.168.0.101:4567/deviframe/8ax?x=2016-04-28T11:00:24+03:00)
[iFrameSizer][theiframe] Reading data from page: {"targetOrigin":"http://192.168.0.101:4567"}
[iFrameSizer][theiframe] TargetOrigin for parent set to: http://192.168.0.101:4567
[iFrameSizer][theiframe] height calculation method set to "taggedElement"
[iFrameSizer][theiframe] HTML & body height set to "auto"
[iFrameSizer][theiframe] Enable public methods
[iFrameSizer][theiframe] Add event listener: Animation Start
[iFrameSizer][theiframe] Add event listener: Animation Iteration
[iFrameSizer][theiframe] Add event listener: Animation End
[iFrameSizer][theiframe] Add event listener: Input
[iFrameSizer][theiframe] Add event listener: Mouse Up
[iFrameSizer][theiframe] Add event listener: Mouse Down
[iFrameSizer][theiframe] Add event listener: Orientation Change
[iFrameSizer][theiframe] Add event listener: Print
[iFrameSizer][theiframe] Add event listener: Ready State Change
[iFrameSizer][theiframe] Add event listener: Touch Start
[iFrameSizer][theiframe] Add event listener: Touch End
[iFrameSizer][theiframe] Add event listener: Touch Cancel
[iFrameSizer][theiframe] Add event listener: Transition Start
[iFrameSizer][theiframe] Add event listener: Transition Iteration
[iFrameSizer][theiframe] Add event listener: Transition End
[iFrameSizer][theiframe] Create body MutationObserver
[iFrameSizer][theiframe] In page linking not enabled
[iFrameSizer][theiframe] Remove event listener: Animation Start
[iFrameSizer][theiframe] Remove event listener: Animation Iteration
[iFrameSizer][theiframe] Remove event listener: Animation End
[iFrameSizer][theiframe] Remove event listener: Input
[iFrameSizer][theiframe] Remove event listener: Mouse Up
[iFrameSizer][theiframe] Remove event listener: Mouse Down
[iFrameSizer][theiframe] Remove event listener: Orientation Change
[iFrameSizer][theiframe] Remove event listener: Print
[iFrameSizer][theiframe] Remove event listener: Ready State Change
[iFrameSizer][theiframe] Remove event listener: Touch Start
[iFrameSizer][theiframe] Remove event listener: Touch End
[iFrameSizer][theiframe] Remove event listener: Touch Cancel
[iFrameSizer][theiframe] Remove event listener: Transition Start
[iFrameSizer][theiframe] Remove event listener: Transition Iteration
[iFrameSizer][theiframe] Remove event listener: Transition End
[iFrameSizer][theiframe] Disconnect body MutationObserver
[iFrameSizer][theiframe] Parsed 1 HTML elements
[iFrameSizer][theiframe] Element position calculated in 0ms
[iFrameSizer][theiframe] Trigger event lock on
[iFrameSizer][theiframe] Sending message to host page (theiframe:1286:977:init)
[iFrameSizer][Host page: theiframe] Received: [iFrameSizer]theiframe:1286:977:init
[iFrameSizer][Host page: theiframe] Checking connection is from: http://192.168.0.101:4567
[iFrameSizer][Host page: theiframe] Checking height is in range 0-Infinity
[iFrameSizer][Host page: theiframe] Checking width is in range 0-Infinity
[iFrameSizer][Host page: theiframe] IFrame (theiframe) height set to 1286px
[iFrameSizer][Host page: theiframe] [Send Message] Sending msg to iframe[theiframe] (message:918) targetOrigin: http://192.168.0.101:4567
[iFrameSizer][theiframe] MessageCallback called from parent: 918
[iFrameSizer][theiframe]  --
[iFrameSizer][theiframe] Trigger event lock off
[iFrameSizer][theiframe] --
[iFrameSizer][Host page: theiframe] [Tab Visable] Sending msg to iframe[theiframe] (resize) targetOrigin: http://192.168.0.101:4567
[iFrameSizer][theiframe] Trigger event: Parent window requested size check
[iFrameSizer][theiframe] Parsed 1 HTML elements
[iFrameSizer][theiframe] Element position calculated in 1ms
[iFrameSizer][theiframe] Trigger event lock on
[iFrameSizer][theiframe] Sending message to host page (theiframe:618:977:resizeParent)
[iFrameSizer][Host page: theiframe] Received: [iFrameSizer]theiframe:618:977:resizeParent
[iFrameSizer][Host page: theiframe] Checking connection is from: http://192.168.0.101:4567
[iFrameSizer][Host page: theiframe] Checking height is in range 0-Infinity
[iFrameSizer][Host page: theiframe] Checking width is in range 0-Infinity
[iFrameSizer][Host page: theiframe] Requesting animation frame
[iFrameSizer][Host page: theiframe] IFrame (theiframe) height set to 618px
[iFrameSizer][theiframe] Trigger event lock off
[iFrameSizer][theiframe] --

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
davidjbradshawcommented, May 3, 2016

I’ve no idea why you would be using this if you don’t want it to work out the size at init.

0reactions
kurttomlinsoncommented, Oct 14, 2017

I worked around this by passing messages back and forth between the parent and child page and only turning on iFrameResize once I’m sure the user wants the iFrame expanded.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iFrame Resizer - GitHub Pages
Note: When set to false the iFrame will still inititally size to the contained content, only additional ... Turn autoResizing of the iFrame...
Read more >
iframe-resizer: cannot disable autoResize - Stack Overflow
I added autoResize:false, but it doesn't work: when I resize window width, iFrame height changes. This is my code: <iframe id="myIFrame" ...
Read more >
How to Automatically Resize an iframe | by Bret Cameron
How to Automatically Resize an iframe. Use HTML and JavaScript to create dynamic iframes, acting as if they're part of the parent window....
Read more >
HTML Content HS Frame inside Iframe - Highcharts
I can't implement roster directly into the website so decided to do it on an Iframe that auto resizes on window load (Guild...
Read more >
Resize Iframe to Fit Content (Same Domain Only) - CSS-Tricks
Still problematic… The source of the iframe content must reside on the same domain; if the content inside the iframe changes height, this...
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