Closed Bug 1780304 Opened 3 years ago Closed 1 year ago

"Unhandled error: TypeError: can't access property "documentURI", doc is null" error in JS, sometimes with notification "Whoa! Firefox Screenshots went haywire", if you take a screenshot from context menu in video doc background area

Categories

(Firefox :: Screenshots, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dholbert, Unassigned)

References

Details

(Whiteboard: [screenshots-extension])

Attachments

(2 files)

STR:

  1. Directly view some video, e.g. load this screencast that I posted on GitHub:
    https://user-images.githubusercontent.com/426803/179851098-88c9110a-7ff6-49c3-9e25-607963eed17c.webm
  2. Right-click the background area (outside the video)
  3. Choose "Take a screenshot" from the context menu.
  4. Repeat steps 2 and 3 several times.

ACTUAL RESULTS:

  • No screenshot is taken.
  • Each time you choose "Take a screenshot", this appears in your Web Console (if you have devtools open):
Unhandled error: TypeError: can't access property "documentURI", doc is null
    assertIsBlankDocument moz-extension://83b5bab2-1871-46d9-a25b-613a456e74a0/assertIsBlankDocument.js:12
    ui moz-extension://83b5bab2-1871-46d9-a25b-613a456e74a0/selector/ui.js:101
    catcher moz-extension://83b5bab2-1871-46d9-a25b-613a456e74a0/catcher.js:59
 undefined
  • Some of the time (maybe every 2-3 attempts), I get a system notification saying "Whoa! Firefox Screenshots went haywire" (see attached image)

EXPECTED RESULTS:
Either the screenshot operation should succeed, or we shouldn't show it as an available option, or we should show a more user-friendly notification about why it failed & what the user should do (e.g. they can right-click the actual video and choose "Take Snapshot" if they want, and that seems to work)

In a fresh profile, the Web Console gives me a somewhat-longer backtrace for the JS error:

Unhandled error: TypeError: can't access property "documentURI", doc is null
    assertIsBlankDocument moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/assertIsBlankDocument.js:12
    ui moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/ui.js:101
    catcher moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/catcher.js:59
    ui moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/ui.js:96
    display moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/ui.js:88
    display moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/ui.js:502
    start moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:300
    setState moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:247
    activate moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:848
    catcher moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/catcher.js:59
    uicontrol moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:1022
    <anonymous> moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:1025
undefined
    unhandled moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/catcher.js:21
    catcher moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/catcher.js:62
    (Async: EventListener.handleEvent)
    ui moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/ui.js:96
    display moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/ui.js:88
    display moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/ui.js:502
    start moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:300
    setState moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:247
    activate moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:848
    catcher moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/catcher.js:59
    uicontrol moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:1022
    <anonymous> moz-extension://5f2885b2-5edb-41e9-8c32-f78f16b01782/selector/uicontrol.js:1025

I'm using Nightly 2022-07-19 with a fresh profile on Ubuntu 22.04, BTW.

Thanks for the report. This looks like a race where the element we store a reference to is being disconnected/orphaned before the promise resolves. Its an artifact of the way the extension injects its UI into the document being screenshot. Its the kind of problem that goes away when in the browser component implementation (bug 1696573.)

Blocks: 1696573
Severity: -- → S3
Priority: -- → P3
Whiteboard: [screenshots-extension]

This is fixed with the change to enable the new component implementation by default in bug 1870127.

No longer blocks: 1696573
Status: NEW → RESOLVED
Closed: 1 year ago
Depends on: 1870127
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: