Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

console.groupEnd not behaving correctly. #129

Closed
arilotter opened this issue Feb 1, 2019 · 4 comments
Closed

console.groupEnd not behaving correctly. #129

arilotter opened this issue Feb 1, 2019 · 4 comments

Comments

@arilotter
Copy link
Contributor

To reproduce:

  • inspect an about:blank session
  • in the console, run console.group('aGroup'); console.log('contents'); console.groupEnd(); console.log('outside group');

Expected Output:
aGroup
      contents
outside group

Actual Output:
aGroup
      contents
      outside group

This issue will cause any messages logged to the console to get caught inside a group. This is especially an issue with console.groupCollapsed, since all further logs will be caught in the group, since console.groupEnd does nothing.

@arilotter
Copy link
Contributor Author

@auchenberg I'd be happy to work on this if you could point me in the right direction, grepping the codebase for "console" didn't bring much up

@auchenberg
Copy link
Member

@arilotter Have a look at the CDP APIs which this adaptor emulates, so we have to match this output in https://chromedevtools.github.io/devtools-protocol/tot/Runtime#event-consoleAPICalled

The data from Webkit looks like http://compatibility.remotedebug.org/Console/Safari%20iOS%2010.0/events/messageAdded, so there's a bit of wrapping needed.

@arilotter
Copy link
Contributor Author

arilotter commented Feb 4, 2019

When you send any consoleAPICalled to the CDP API, if you include a stackTrace with an undefined callFrames, Chrome doesn't accept it.

endGroup is failing because Webkit doesn't provide a stackTrace for endGroup messages, and currently we expect that it always will.
I've submitted a PR to only pass the stackTrace when Webkit sends one.

@auchenberg
Copy link
Member

Interesting, good find. Let's go with it @arilotter

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants