You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are testing using the non-minified version of html2canvas and checked any potential issues reported in the console
Bug reports:
In my use case, I tried to use html2canvas in http://localhost/a.html to render b.html in <iframe src="http://localhost/dir/b.html"></iframe>.
Since all the paths in b.html are relative like "images/c.jpg", I got log like this
If I use Javascript to convert the relative paths in iframe content into absolute before run html2canvas, the images can be rendered correctly and css files also can be loaded.
I found that in Clone.js iframeLoader seems alway assume a.html and b.html have the same baseURI. So I wonder is it the right place to add a better url hander for the render target.
Please make sure you are testing with the latest release of html2canvas.
Old versions are not supported and issues reported for them will be closed.
Please follow the general troubleshooting steps first:
Bug reports:
In my use case, I tried to use html2canvas in http://localhost/a.html to render b.html in <iframe src="http://localhost/dir/b.html"></iframe>.
Since all the paths in b.html are relative like "images/c.jpg", I got log like this
imageLoadHandler @ html2canvas.js:6790
addImage @ html2canvas.js:6818
loadImage @ html2canvas.js:6695
getImage @ html2canvas.js:858
NodeContainer @ html2canvas.js:772
parseNodeTree @ html2canvas.js:3621
parseNodeTree @ html2canvas.js:3650
parseNodeTree @ html2canvas.js:3650
NodeParser @ html2canvas.js:3596
(anonymous) @ html2canvas.js:3506
Promise.then (async)
(anonymous) @ html2canvas.js:3496
Promise.then (async)
renderElement @ html2canvas.js:3472
html2canvas @ html2canvas.js:3401
CSS file also can't be loaded because the path became 'http://localhost/' + 'css/d.css' rather than 'http://localhost/dir/css/d.css'.
If I use Javascript to convert the relative paths in iframe content into absolute before run html2canvas, the images can be rendered correctly and css files also can be loaded.
I found that in Clone.js iframeLoader seems alway assume a.html and b.html have the same baseURI. So I wonder is it the right place to add a better url hander for the render target.
Here is my quick and dirty fix:
Specifications:
The text was updated successfully, but these errors were encountered: