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.

Same origin iframes aren't getting rendered

See original GitHub issue

Same origin iframes aren’t getting rendered.

image

Page:

<html>
<head>
<script src="/html2canvas.js"></script>
<script>
    function render(){
        html2canvas(document.body, {
          onrendered: function(canvas) {
            document.body.appendChild(canvas);
          }
        });
    }
</script>
</head>
<body>
    <input type="button" value="picture" onclick="render()"></input>
    <iframe src="/hello.html"></iframe>
</body>
</html>

Iframe content:

<html>
<head>
</head>
<body>
     <h1>Hello World</h1>
</body>
</html>

Log:

html2canvas: Preload starts: finding background-images 
html2canvas: Preload: Finding images 
html2canvas: Preload: Done. 
html2canvas: start: images: 0 / 0 (failed: 0) 
Finished loading images: # 0 (failed: 0) 
finished rendering 0 children. 
finished rendering 6 children. 
Done parsing, moving to Render. 
html2canvas: Renderer: Canvas renderer done - returning canvas obj 

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
liuzhibin123commented, Mar 14, 2018

The new version of this problem be solved?

0reactions
Snedecommented, May 20, 2014

Good 😄 Hope it will come as a feature someday.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detect when iframe & elements are completely rendered, not ...
So i have an embedded iframe and i need to detect when the elements are completely rendered. The jquery load() and ready() events...
Read more >
Why do browsers enforce the same-origin security policy on ...
First, let's clarify that the behavior observed here (the iframe does not render) is much stricter than the default same-origin policy.
Read more >
Same-origin policy - Web security | MDN
The same-origin policy is a critical security mechanism that restricts how a document or script loaded by one origin can interact with a ......
Read more >
The ultimate guide to iframes - LogRocket Blog
Not a fan of iframes? This post provides an overview of the tag's best features, shows you how to use them, and how...
Read more >
Reasons to move from same-origin iframes to third-party ...
Hi, The old widget.js timeline version created a same-origin iframe without any src attribute and added the timeline content to this frame.
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