Closed
Bug 1153421
Opened 11 years ago
Closed 7 years ago
Can't return an array from a WebConsoleCommands callback
Categories
(DevTools :: Console, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: canuckistani, Unassigned)
Details
Example add-on https://github.com/canuckistani/console-helpers
I found that I can return simple scalars and also complex objects from the window like document.styleSheets, but when I try to return anything else ( a filtered array containing stylesheet urls grouped by domain, for example ) all I get is an empty object.
| Reporter | ||
Comment 1•11 years ago
|
||
Panos - Brian thought you might have some idea what's going on here.
Flags: needinfo?(past)
Updated•11 years ago
|
Depends on: nsec-signing
Updated•11 years ago
|
No longer depends on: nsec-signing
Comment 2•10 years ago
|
||
My guess is that our security wrappers are not letting you use an array created in chrome-privileged code (add-on code) from content-privileged code. You could use the $x helper as inspiration, which goes through some hoops to avoid this problem:
https://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/webconsole/utils.js#1643
Flags: needinfo?(past)
| Reporter | ||
Comment 3•10 years ago
|
||
(In reply to Panos Astithas [:past] from comment #2)
> My guess is that our security wrappers are not letting you use an array
> created in chrome-privileged code (add-on code) from content-privileged
> code. You could use the $x helper as inspiration, which goes through some
> hoops to avoid this problem:
>
> https://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/webconsole/
> utils.js#1643
Makes sense, thanks.
I also noticed that my code only works on non-e10s windows, and the direct access to the document in the code you linked to probably doesn't help that?
Updated•7 years ago
|
Product: Firefox → DevTools
Comment 4•7 years ago
|
||
I don't think this is relevant anymore
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•