iframe-resizer icon indicating copy to clipboard operation
iframe-resizer copied to clipboard

Enhancement Suggestion to doc of IFrame Resizer

Open redstoneleo opened this issue 3 years ago • 1 comments

In order to make the doc of IFrame Resizer more friendly to users, I'd suggest the following :

  1. Add an example like this at https://github.com/davidjbradshaw/iframe-resizer#usage , otherwise lots of users didn't know how to correct use IFrame Resizer, some facts: https://stackoverflow.com/a/41890427/1485853 https://stackoverflow.com/a/41399534/1485853

  2. Specify the code order so that IFrame Resizer would work correctly : (1)

    <script type="text/javascript" src="./iframeResizer.min.js"></script>
    

    (2) iframe with iframeResizer.contentWindow.min.js contained within, for example, has

    <script type="text/javascript" src="./iframeResizer.contentWindow.min.js"></script>
    

    contained in the srcdoc attribute of iframe . (3)

    <script type="text/javascript">
          iFrameResize({ log: true }, 'iframe');
    </script>
    
  3. Here states that If the other page is on a domain outside your control and you can not add JavaScript to that page, then now is the time to give up all hope of ever getting the iFrame to size to the content. As it is impossible to work out the size of the contained page, without using JavaScript on both the parent and child pages. It would be better point out that the statement is only limited to iFrame Resizer, because there are still other solutions like this https://stackoverflow.com/a/32162488/1485853

redstoneleo avatar Dec 08 '21 11:12 redstoneleo

I don't think sandbox="allow-same-origin" does what you think it does

davidjbradshaw avatar Jan 14 '22 18:01 davidjbradshaw