Closed Bug 989025 Opened 10 years ago Closed 10 years ago

WebConsole breaks when trying to autocomplete in objects from different domains

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(firefox30 fixed, firefox31 fixed)

RESOLVED FIXED
Firefox 31
Tracking Status
firefox30 --- fixed
firefox31 --- fixed

People

(Reporter: kats, Assigned: msucan)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

Latest Aurora (30) build on OS X.

STR:
1. Load the test case URL
2. Open the web console
3. Evaluate "window.document". Verify this outputs something like "HTMLDocument"
4. Evaluate "window[0].document". Observe this outputs nothing, presumably because it's a cross-origin iframe and access is not allowed
5. Try evaluating "window.document" again. Observe this outputs nothing.

Expected:
In step 4 some sane output should be displayed. Step 5 should be identical to step 3.
FWIW, works fine on Nightly.
I have a Nightly build from Feb 12 and yeah it works fine there. Presumably this broke and was fixed but the fix missed the 30 train?
Actually I can reproduce this in the latest nightly as well. Exact same steps on a new tab in a fresh profile. The nightly in comment 2 was just really old, probably before this broke, so the regression window is somewhere between Feb 2 and today.
Keywords: regression
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #3)
> Actually I can reproduce this in the latest nightly as well. Exact same
> steps on a new tab in a fresh profile. The nightly in comment 2 was just
> really old, probably before this broke, so the regression window is
> somewhere between Feb 2 and today.

Ahh. So autocomplete suggestions are breaking it :


error occurred while processing 'autocomplete: Error: Permission denied to access objectLine: 1063, column: 4 main.js:1007
onPacket threw an exception: Error: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"error occurred while processing 'autocomplete: Error: Permission denied to access objectLine: 1063, column: 4"}
Stack: DebuggerClient.prototype.onPacket/<@resource://gre/modules/devtools/dbg-client.jsm:683:1
resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118:11
then@resource://gre/modules/commonjs/sdk/core/promise.js:43:43
then@resource://gre/modules/commonjs/sdk/core/promise.js:153:9
DebuggerClient.prototype.onPacket@resource://gre/modules/devtools/dbg-client.jsm:733:1
LDT_send/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/server/transport.js:258:11
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:80:7
Line: 683, column: 0



The way I was able to get it work in my last comment was to :

- type "window.document" and evaluate .
- Press up to get "window.document", press Right multiple times and add "[0]" after window

:D That did not trigger autocomplete suggestions and thus worked fine. 


And yeah, the whole devtools for that tab messes up as server thinks that the tab is still connected. [Devtools still work on other tabs]
Assignee: nobody → mihai.sucan
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
Summary: Devtools console stops working after some commands → WebConsole breaks when trying to autocomplete in objects from different domains
Attached patch bug989025-1.diffSplinter Review
This patch fixes the problem reported.

I'm using makeInfaillable() because it is looking to me less than ideal to wrap more completion code in try-catches.

Try push: https://tbpl.mozilla.org/?tree=Try&rev=5f44f303c910

This is probably a regression caused by bug 842682, made more obvious by bug 943586. We should get this patch landed in aurora as well.
Attachment #8398126 - Flags: review?(past)
Comment on attachment 8398126 [details] [diff] [review]
bug989025-1.diff

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

Looks fine.
Attachment #8398126 - Flags: review?(past) → review+
Thanks!
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/76b26a67394c
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 31
Comment on attachment 8398126 [details] [diff] [review]
bug989025-1.diff

[Approval Request Comment]
Bug caused by (feature/regressing bug #): probably caused by bug 842682, made more obvious by bug 943586.
User impact if declined: the webconsole breaks if the user tries to type a JS string that points to an object from a different domain. it seems the breakage is pretty bad - devtools stop working.
Testing completed (on m-c, etc.): green try push, landed in fx-team and m-c.
Risk to taking this patch (and alternatives if risky): minimal - the patch makes any error in autocomplete code to be non-fatal.
String or IDL/UUID changes made by this patch: none.
Attachment #8398126 - Flags: approval-mozilla-aurora?
Attachment #8398126 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
QA Whiteboard: [good first verify]
Flagging in-testsuite+ since this landed with tests.
QA Whiteboard: [good first verify]
Flags: in-testsuite+
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: