Closed Bug 1541465 Opened 6 years ago Closed 4 years ago

Firefox Screenshot tool crashes on pages with IPv6 Address

Categories

(Firefox :: Screenshots, defect, P3)

66 Branch
defect

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: dev, Assigned: niklas)

References

Details

Attachments

(2 files)

Attached image Error_notification.png

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

I opened a page using its IPv6 Address (e.g. http://[::1]:8080/) and tried to take a screenshot (using right click > Take a screenshot)

Actual results:

The tool did not take a screenshot but the notification I attached popped up.

An exception is thrown in shot.js in assertUrl, because originFromUrl returns a broken URL. The regex in originFromUrl (const match = (/^https?://[^/:]{1,4000}/i).exec(url);) cannot handle the ':' in IPv6 Addresses. I'm not sure, but why don't you use (window.)location.origin instead of parsing the URL?

Expected results:

The screenshot tool should be able to handle IPv6 Addresses.

The priority flag is not set for this bug.
:ianbicking, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ianb)
Flags: needinfo?(ianb)
Priority: -- → P3

This still happens in Firefox 88.
The following error appears in the browser console:

Unhandled error: Error: Not a URL
    assertUrl moz-extension://1ee5ddd0-0b25-4a5a-9d8a-9edcc7dfa94f/build/shot.js:45
    assertOrigin moz-extension://1ee5ddd0-0b25-4a5a-9d8a-9edcc7dfa94f/build/shot.js:56
    set origin moz-extension://1ee5ddd0-0b25-4a5a-9d8a-9edcc7dfa94f/build/shot.js:334
    AbstractShot moz-extension://1ee5ddd0-0b25-4a5a-9d8a-9edcc7dfa94f/build/shot.js:183
    <anonymous> moz-extension://1ee5ddd0-0b25-4a5a-9d8a-9edcc7dfa94f/selector/shooter.js:135
    catcher moz-extension://1ee5ddd0-0b25-4a5a-9d8a-9edcc7dfa94f/catcher.js:59
    shooter moz-extension://1ee5ddd0-0b25-4a5a-9d8a-9edcc7dfa94f/selector/shooter.js:143
    <anonymous> moz-extension://1ee5ddd0-0b25-4a5a-9d8a-9edcc7dfa94f/selector/shooter.js:146
 undefined catcher.js:21:11
Assignee: nobody → nbaumgardner
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by nbaumgardner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/57dd75cfb7aa Firefox Screenshot tool crashes on pages with IPv6 Address. r=sfoster
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: