RESOLVED FIXED 67506
Web Inspector: [Extensions API] expose console API
https://bugs.webkit.org/show_bug.cgi?id=67506
Summary Web Inspector: [Extensions API] expose console API
Andrey Kosyakov
Reported 2011-09-02 10:56:16 PDT
This adds an API module to fetch and add console messages.
Attachments
patch (24.68 KB, patch)
2011-09-02 11:02 PDT, Andrey Kosyakov
pfeldman: review-
patch (22.61 KB, patch)
2011-09-05 05:54 PDT, Andrey Kosyakov
pfeldman: review-
patch (27.65 KB, patch)
2011-09-07 04:59 PDT, Andrey Kosyakov
pfeldman: review+
Andrey Kosyakov
Comment 1 2011-09-02 11:02:17 PDT
Pavel Feldman
Comment 2 2011-09-04 23:00:18 PDT
Comment on attachment 106157 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=106157&action=review Lets first agree on what is the console message for formatted console records and evaluation results. Otherwise looks good. > LayoutTests/inspector/extensions/extensions-api-expected.txt:86 > + MessageLevel : { Severity ? > Source/WebCore/inspector/front-end/ConsoleMessage.js:449 > + return this._messageText; Real text is formatted asynchronously, what text do you expect to return for console.log("Foo %s", document) ? > Source/WebCore/inspector/front-end/ConsoleMessage.js:454 > + return this._parameters; Parameters are object wrappers that are not exposed to the user.
Andrey Kosyakov
Comment 3 2011-09-05 05:54:50 PDT
Andrey Kosyakov
Comment 4 2011-09-05 05:56:34 PDT
(In reply to comment #2) > (From update of attachment 106157 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=106157&action=review > > Lets first agree on what is the console message for formatted console records and evaluation results. Otherwise looks good. > > > LayoutTests/inspector/extensions/extensions-api-expected.txt:86 > > + MessageLevel : { > > Severity ? Renamed to MessageSeverity (although we use level internally) > > > Source/WebCore/inspector/front-end/ConsoleMessage.js:449 > > + return this._messageText; > > Real text is formatted asynchronously, what text do you expect to return for console.log("Foo %s", document) ? > > > Source/WebCore/inspector/front-end/ConsoleMessage.js:454 > > + return this._parameters; > > Parameters are object wrappers that are not exposed to the user. As discussed offline, dropped parameters altogether for the first version.
Pavel Feldman
Comment 5 2011-09-06 11:48:17 PDT
Comment on attachment 106326 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=106326&action=review > LayoutTests/inspector/extensions/extensions-api-expected.txt:86 > + MessageSeverity : { I'd do simply Severity. It is in either case under console. > Source/WebCore/inspector/front-end/ExtensionServer.js:-429 > - // The networkManager is normally created after the ExtensionServer is constructed, but before initExtensions() is called. This is going against the performance effort we are currently focusing on. Specifically, this will do something upon every console message no matter whether there are extensions interested in this type of event. Probably need to resolve it for all the notifications below. r- for that.
Andrey Kosyakov
Comment 6 2011-09-07 04:59:45 PDT
Created attachment 106572 [details] patch - subscribe to front-end events only when an extension subscribes to a related event - MessageSeverity -> Severity
Pavel Feldman
Comment 7 2011-09-07 05:11:44 PDT
Comment on attachment 106572 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=106572&action=review > LayoutTests/http/tests/inspector/resources/extension-main.js:24 > else if (typeof propValue === "object") typeof === "object" && propValue !== null will make undefined and null fall to under latest else.
Balazs Kelemen
Comment 8 2011-09-07 07:40:48 PDT
The new test fails on Qt: -extensions-console.html:50console.trace()logextensions-console.html:50 console-message console-log-level +extensions-console.html:50console.trace()logextensions-console.html:50onloadextensions-console.html:57 console-message console-log-level Do you think it's normal to have platform specific results for the test? If yes, we can simply update the qt expectation.
Andrey Kosyakov
Comment 9 2011-09-07 07:43:17 PDT
(In reply to comment #8) > The new test fails on Qt: > -extensions-console.html:50console.trace()logextensions-console.html:50 console-message console-log-level > +extensions-console.html:50console.trace()logextensions-console.html:50onloadextensions-console.html:57 console-message console-log-level > > Do you think it's normal to have platform specific results for the test? If yes, we can simply update the qt expectation. I think I'd rather drop trace() from the test -- it doesn't add that much value, so we can sacrifice it to avoid custom expectations. I'll take care of this, just waiting few more minutes for runs on other platforms to complete, to see if there may be other surprises.
Andrey Kosyakov
Comment 10 2011-09-07 08:10:42 PDT
Note You need to log in before you can comment on or make changes to this bug.