w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
368 stars 42 forks source link

Simplify `browsingContext.contextDestroyed` event #95

Open sadym-chromium opened 3 years ago

sadym-chromium commented 3 years ago

Currently, event browsingContext.contextDestroyed contains all the BrowsingContextInfo. I suggest to keep only context, which seems to be enough.

BrowsingContextDestroyedEvent = {
  method: "browsingContext.contextDestroyed",
  params: BrowsingContextInfo
}
sadym-chromium commented 3 years ago

Current CDP implementation: an event per target. https://chromedevtools.github.io/devtools-protocol/tot/Target/#event-targetDestroyed

foolip commented 3 years ago

@jgraham @burg do you know what the debug/inspector protocols of Firefox and Safari do here? Would one event per context destroyed be simpler for you as well?

jgraham commented 3 years ago

Just returning the context ids seems fine; I don't think the URLs are necessary here. I don't know about the implementation complexity, but the problem with mutliple events for cases like this is it goes against the principle of reducing the amount of traffic over the wire; conceptually a single thing is happening (a context is being discarded along with its descendants), so representing that with one event seems at least better in principle.