Firefox has its own drawWindow method. With it, you can draw the entire document on canvas. But only in Firefox, unfortunately. And also because of security issues, you need permissions from the user. Therefore, it is suitable only for its internal project.
Here is a sample test page:
<!DOCTYPE html> <html> <head> <title>drawWindow</title> <script> window.onload = function(){ netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead'); document.getElementById('canvas').getContext('2d').drawWindow(window, 0, 0, 100, 200, "rgb(255,255,255)"); } </script> </head> <body> <h1>Test</h1> <canvas id="canvas"></canvas> </body> </html>
source share