WebConsole contentwindow setter and getter to allow coexistence of console objects

RESOLVED FIXED

Status

defect
RESOLVED FIXED
9 years ago
Last year

People

(Reporter: ddahl, Unassigned)

Tracking

Trunk
x86
All
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [console-3])

Reporter

Description

9 years ago
I just spoke with jst about trying to intercept an existing console object and preserve it if possible.

If we create a setter and getter on the inner contentWindow called console, it will be triggered before (he thinks) our console is fully inited. Our init function should be able to  check if there is console.log already in place. If so, we can return undefined from the init function and preserve the existing console.

Before returning, we can then report an error to an already open WebConsole or open the WebConsole and report that there is a console api already in place.
Reporter

Updated

9 years ago
Blocks: 529086
Reporter

Updated

9 years ago
Assignee: nobody → ddahl
Reporter

Updated

9 years ago
Summary: WebConsole contentwindow setter and getter to allow interception of 3rd party consoles → WebConsole contentwindow setter and getter to allow preservation of 3rd party consoles

Comment 1

9 years ago
To differentiate between this and bug 583476, I'm setting the subject to note that this bug is about maintaining both our console object and a third party console object that gets defined so that logging could potentially go to both places.

This would be nice to have but is not critical and is potentially fraught with peril.
Summary: WebConsole contentwindow setter and getter to allow preservation of 3rd party consoles → WebConsole contentwindow setter and getter to allow coexistence of console objects
seems like this should depend on the lazy-console.
Depends on: lazy-console
Reporter

Comment 3

9 years ago
I have since talked to jst about this and this does depend on further polatform work that has not been initiated yet (pretty sure about that).
Reporter

Updated

9 years ago
Assignee: ddahl → nobody
I *think* this can be done by defining and freezing the console (if "console" can't be used, perhaps an __underscore__ object name can? I believe underscores are reserved...) object so that it can be overwritten/changed. I'm still not 100% sure why the console object has to be exposed to content, why shouldn't it be privileged (like the error console and its associated methods)?
Reporter

Comment 5

9 years ago
(In reply to comment #4)
> I'm still not
> 100% sure why the console object has to be exposed to content, why shouldn't it
> be privileged (like the error console and its associated methods)?

Are you talking about "privileged" as in chrome code? Content devs need to be able to call methods on this object from content JS.

Comment 6

9 years ago
The console object needs to be exposed to content because console.log and friends are becoming a de facto standard. Safari, Chrome, Firefox+Firebug and even, it seems, IE8+ have console.log and developers are started to expect it to be there.
Reporter

Updated

8 years ago
Whiteboard: [console-3]

Comment 7

8 years ago
Is this bug still relevant? I think this was filed before we put a solution in place to handle when Firebug's console was active.
This seems to be already fixed. Please reopen if I am mistaken. Thanks!
Status: NEW → RESOLVED
Closed: 8 years ago
Component: Developer Tools → Developer Tools: Console
QA Contact: developer.tools → developer.tools.console
Resolution: --- → FIXED

Updated

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