Closed Bug 1395276 Opened 7 years ago Closed 7 years ago

$ and $$ console commands throw system principal errors

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(firefox58 fixed)

RESOLVED FIXED
Firefox 58
Tracking Status
firefox58 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

References

Details

Attachments

(1 file, 1 obsolete file)

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.
Attachment #8902830 - Flags: review?(jimb)
Argh, I always forget the space after `catch`.
Attachment #8902830 - Attachment is obsolete: true
Attachment #8902830 - Flags: review?(jimb)
Attachment #8902837 - Flags: review?(jimb)
Attachment #8902837 - Flags: review?(jimb) → review?(nchevobbe)
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)
Jim, can you review this, please, so that bug 1394559 can be fixed?
Flags: needinfo?(jimb)
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+
Flags: needinfo?(jimb)
Keywords: checkin-needed
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
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: