Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rmtbb/dfaef06d5edb4ada23de0316a44ec6e2 to your computer and use it in GitHub Desktop.

Select an option

Save rmtbb/dfaef06d5edb4ada23de0316a44ec6e2 to your computer and use it in GitHub Desktop.
Full Page Screenshot Bookmarklet by Remote BB
javascript:(function(){var s=document.createElement('script');s.src='https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js';s.onload=function(){html2canvas(document.body,{useCORS:true,logging:false}).then(function(c){var a=document.createElement('a');a.download=(document.title||'screenshot')+'.png';a.href=c.toDataURL();a.click();});};document.body.appendChild(s);})();
@rmtbb
Copy link
Author

rmtbb commented Jan 9, 2026

Full Page Screenshot Bookmarklet by Remote BB (Chrome Compatible)

This bookmarklet captures a full-page screenshot of the current webpage directly in the browser using html2canvas. The captured image is downloaded as a .png file named after the page title.


πŸ“Έ Features

  • Works in Chrome, Edge, Firefox, and others
  • Saves the entire scroll height
  • No extensions required
  • No external tools or servers β€” runs locally in the browser
  • Captures as PNG for high quality

πŸ›  Installation

  1. Create a new bookmark
  2. Edit the bookmark and replace the URL with the following minified code:

minified

javascript:(function(){var s=document.createElement('script');s.src='https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js';s.onload=function(){html2canvas(document.body,{useCORS:true,logging:false}).then(function(c){var a=document.createElement('a');a.download=(document.title||'screenshot')+'.png';a.href=c.toDataURL();a.click();});};document.body.appendChild(s);})();

unminified for clarity

javascript:(function () {

    // Load html2canvas from CDN
    var script = document.createElement('script');
    script.src = 'https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js';

    script.onload = function () {

        // Once loaded, render the page body to a canvas
        html2canvas(document.body, {
            useCORS: true,
            logging: false
        }).then(function (canvas) {

            // Create a temporary download link
            var link = document.createElement('a');

            // Use page title for file name (fallback if empty)
            var filename = document.title || 'screenshot';
            link.download = filename + '.png';

            // Convert canvas to data URL and trigger download
            link.href = canvas.toDataURL();
            link.click();
        });
    };

    document.body.appendChild(script);

})();


πŸš€ Usage

  1. Navigate to any webpage you want to capture

  2. Click the bookmarklet

  3. Wait for rendering to complete

  4. A .png file will automatically download


πŸ“ Output Details

  • Format: PNG

  • Filename: Page title (e.g., My Blog Article.png)


⚠ Known Limitations

Because this relies on html2canvas, accuracy may vary on:

  • Embedded videos

  • 3D/canvas elements

  • Cross-origin iframes (due to browser security)

  • Extremely long pages (large final image size)

For most static content (blogs, docs, dashboards, landing pages), it works well.


🧩 Alternatives

If you need:

Need Suggestion
Pixel-perfect screenshots Chrome built-in Capture full size screenshot
Automation / workflows Puppeteer / Playwright
PDF export Chrome print-to-PDF or Puppeteer
Infinite scrolling custom stitching tools

Enjoy!

BB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment