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.

Iframe-Resizer is not working on cross domain.

See original GitHub issue

Hi,

Iframe-resizer first benefit “height and width resizing of the iFrame to content size.” is not working. i tried all methods but didn’ work. And couldn’t use any method of plugin (getpageinfo, getid etc).

Page A (Main) Im calling iframeResizer.js on main page. jquery codes:

		$("iframe#test").on("load", function () {
			$('iframe#test').iFrameResize( [{
			checkOrigin:false,
			log:true,
			enablePublicMethods     : true,                
                         heightCalculationMethod : 'max'		 
			}] );
			
			});

html codes: <iframe id="test" width ="100%" src="http://www.myiframedomain.com" ></iframe>

Page B (http://www.myiframedomain.com) Im calling iframeResizer.contentWindow.min.js on Page B.

P.s: im loading last version of jquery both pages. Page A and B are different domains.

My main page console log is “[iFrameSizer][Host page: test] IFrame has not responded within 5 seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ingored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.” (only 1 message. no have any error log.)

Problem: There is no change height of id#test iframe . While the page is first loading im seeing scrollbar of iframe ( height 100-150px - real iframe height 1700px) but suddenly scrollbar is closing (like overflow:hidden) and my iframe height still 100-150px. (page is loading in 2-3 seconds)

In summary; is not working. What is the wrong ? How can do it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
davidjbradshawcommented, May 4, 2017

It would appear that the iframeResizer.contentWindow.min.js has not been loaded correctly in the iFrame.

1reaction
isabascommented, May 5, 2017

There is contentWindow JS in each page load . Can i destroy setup before loading. After again setup. (Destroy -Create cycle when page is loading).

i tried giving random classname to iframe. and selector is this random classname but still same error. 😕 ` $(“iframe#test”).on(“load change”, function () {

			var randomClassName =randomText();
			$('iframe#test').removeClass();
			$('iframe#test').addClass(randomClassName);
				
		var selectorClass = "."+randomClassName;
		$(selectorClass).iFrameResize( [{
		checkOrigin:false,
		log:true,
		sizeHeight:true,
		scrolling:true,
		enablePublicMethods     : true,                
       heightCalculationMethod : 'max'
	 
		}] );`

And Eror log is “[iFrameSizer][Host page: test] Ignored iFrame, already setup.”

i am thinking “i can not use class instead of id for selector” aren’t i?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use iFrameResizer on multiple domains?
i'm using Iframe Resizer and my code is not working cross domain. It works fine when the two domain are the same. Can...
Read more >
iFrame Resizer - GitHub Pages
iFrame Resizer. This library enables the automatic resizing of the height and width of both same and cross domain iFrames to fit their...
Read more >
Cross-Domain iframe Resizing
The source content has some JavaScript going on which animates the font size up and down, which of course makes the height of...
Read more >
Iframe Resizer
This library enables the automatic resizing of the height and width of both same and cross domain iFrames to fit their contained content....
Read more >
iframe-resizer
Keep same and cross domain iFrames sized to their content with support for ... Start using iframe-resizer in your project by running `npm...
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