Closed Bug 1615010 Opened 4 years ago Closed 4 years ago

Using the screenshotting tool in DevTools doesn't seem to work

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 766661

People

(Reporter: mtigley, Unassigned)

Details

Steps to reproduce

  1. Open DevTools
  2. Make sure the "Take screenshot of entire page" option is checked from the DevTools settings panel.
  3. Go to https://www.samsung.com/ca/smartphones/galaxy-s20/
  4. Try taking a screenshot of the entire page using the "screenshot" icon in the DevTools toolbar.

Expected Results
Screenshot of entire page should be taken.

Actual Results
Nothing happens.

If I check the browser toolbox's console logs, I can see the following errors whenever I try using the screenshotting tool.

Error while calling actor 'screenshot's method 'capture' <empty string> Actor.js:91:13
createScreenshotDataURL@resource://devtools/shared/screenshot/capture.js:99:7
captureScreenshot@resource://devtools/shared/screenshot/capture.js:41:10
capture@resource://devtools/server/actors/screenshot.js:40:12
handler@resource://devtools/shared/protocol/Actor.js:154:37
onPacket@resource://devtools/server/debugger-server-connection.js:380:58
receiveMessage@resource://devtools/shared/transport/child-transport.js:66:16
Actor.js:96:15
Error: unknownError

I seem to only be able to reproduce this error using the page above on Firefox stable release, Firefox DevEdition, and Nightly. Using the tool on any other website works just fine.

It looks like this also happens when using :screenshot --fullpage . This is the following error I get in the Browser Content Toolbox:

Error: "Encountered error while waiting for Helper Result: [Exception... "Failure"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://devtools/shared/screenshot/capture.js :: createScreenshotDataURL :: line 99"  data: no]"
    evaluateJSAsync resource://devtools/server/actors/webconsole.js:1066
ThreadSafeDevToolsUtils.js:90:13
    reportException resource://devtools/shared/ThreadSafeDevToolsUtils.js:90
    evaluateJSAsync resource://devtools/server/actors/webconsole.js:1066

Strong chance this is a duplicate of bug 766661.

Same error for me on long pages. I tested with a simple page like:

data:text/html,<style>html,body{margin:0}div { width: 1000px;height:7000px; background: linear-gradient(red, blue)}</style><div>

If I make the height of the div bigger and bigger, there come a point at which the screenshot fails silently with the error from comment 0.
So, this is indeed most likely a duplicate of bug 766661.
Depending on hardware capability, there is a limit to how big an image can be when using drawWindow and toDataURL, not sure which one is the bottleneck.

Bug 766661 explored a few options like stitching multiple images, or showing a warning to users.
I think a good solution would be to cap the image size to some safe maximum dimension but still take the screenshot.
A better solution would be to reuse the code from the Firefox Screenshot tool, as this one doesn't seem to have the same limitation.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.