$ and $$ console commands throw system principal errors

RESOLVED FIXED in Firefox 58

Status

RESOLVED FIXED
a year ago
4 months ago

People

(Reporter: Oriol, Assigned: Oriol)

Tracking

unspecified
Firefox 58

Firefox Tracking Flags

(firefox58 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

a year ago
Go to http://example.com
Enter this code in the web console:

    try{ $$(':foo') }catch(err){ err }

Result: Object {  }
Expected: DOMException {  }

That's because the error object that is thrown belongs to a system principal, so http://example.com is not allowed to access it.
(Assignee)

Comment 1

a year ago
Created attachment 8902830 [details] [diff] [review]
console-queryselector-error.patch
Attachment #8902830 - Flags: review?(jimb)
(Assignee)

Comment 2

a year ago
Created attachment 8902837 [details] [diff] [review]
console-queryselector-error.patch

Argh, I always forget the space after `catch`.
Attachment #8902830 - Attachment is obsolete: true
Attachment #8902830 - Flags: review?(jimb)
Attachment #8902837 - Flags: review?(jimb)
(Assignee)

Updated

a year ago
Attachment #8902837 - Flags: review?(jimb) → review?(nchevobbe)

Comment 4

a year ago
Comment on attachment 8902837 [details] [diff] [review]
console-queryselector-error.patch

Passing it to Jim, I don't feel confident enough to review these changes.
Attachment #8902837 - Flags: review?(nchevobbe) → review?(jimb)
(Assignee)

Comment 5

a year ago
Jim, can you review this, please, so that bug 1394559 can be fixed?
Flags: needinfo?(jimb)

Comment 6

a year ago
Comment on attachment 8902837 [details] [diff] [review]
console-queryselector-error.patch

Review of attachment 8902837 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me. Thanks, and sorry for the delay.
Attachment #8902837 - Flags: review?(jimb) → review+

Updated

a year ago
Flags: needinfo?(jimb)
(Assignee)

Updated

a year ago
Keywords: checkin-needed

Comment 7

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/112fa91b456f
Make $ and $$ console commands throw errors created in the debuggee global. r=jimb
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/112fa91b456f
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox58: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58

Updated

4 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.