whatwg / console

Console Standard
https://console.spec.whatwg.org/
Other
269 stars 67 forks source link

Add integration hooks for WebDriver-BiDi #195

Open jgraham opened 3 years ago

jgraham commented 3 years ago

WebDriver wants a hook that's called for every console API call, so that it can emit a relevant message; see https://github.com/w3c/webdriver-bidi/pull/73

The current spec draft defines the following patch:

## Console ##  {#patches-console}

The [=Printer=] operation is modified with a single required step before the
implementation defined behaviour:

1. Call any <dfn>console Printer steps</dfn> defined in external specification
   with arguments <var ignore>logLevel</var>, <var ignore>args</var> and,
   <var ignore>options</var> if the <var ignore>options</var> object was
   passed, or undefined otherwise.

Although this isn't quite right, since some operations don't go through the Printer method (e.g. grouping operations).

terinjokes commented 3 years ago

The Console specification deliberately under specifies what implementations do with calls to most API methods, to allow implementations large flexibility in surfacing this information to developers (eg, in a GUI, terminal messages, web page viewing the status of a remote agent, etc).

Agents are already free to define hooks and be compliant with this specification. Is there a need for such functionality to be defined here?

jgraham commented 3 years ago

It's not about agents as such, it's about how another spec should hook into "a method on the console object is called" and get the method name and the arguments (post-formatting).

domfarolino commented 2 years ago

This seems pretty reasonable. @jgraham are there any plans on porting over some of the WebDeriver BiDi spec to a PR over here?