The default bug view has changed. See this FAQ.

WebConsole contentwindow setter and getter to allow coexistence of console objects

RESOLVED FIXED

Status

()

Firefox
Developer Tools: Console
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: ddahl, Unassigned)

Tracking

Trunk
x86
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [console-3])

(Reporter)

Description

7 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

7 years ago
Blocks: 529086
(Reporter)

Updated

7 years ago
Assignee: nobody → ddahl
(Reporter)

Updated

7 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

7 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: 568629
(Reporter)

Comment 3

7 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

7 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

7 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

7 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

6 years ago
Whiteboard: [console-3]

Comment 7

5 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
Last Resolved: 5 years ago
Component: Developer Tools → Developer Tools: Console
QA Contact: developer.tools → developer.tools.console
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.