-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify behavior for browsingContext.close
when closing the last browsing context
#187
Comments
Note that for our WebDriver classic implementation (Marionette) in Firefox we recently added a Note that under such a condition none of the WebDriver classic commands work because we run a check for an open window, and if none is available we raise a |
One can imagine other commands would make sense including any configuration commands e.g. Given that we have a clear usecase for this I think we should also support it in bidi. I think the question is whether it ends up as a configuration option in the capabilities or if we just allow you to get into the state where there are no windows open, where supported. I think my prefernce is for the latter; you can still implement the webdriver-classic behaviour by noticing that the last window closed and ending the session if the browser is still alive. |
Question specifically for browser vendors: do you typically care whether a browser host process is forceably killed? Consider the use case of a local end library that exclusively supports bidi-only sessions (no WebDriver classic to fall back on; no driver executable to manage). Such a library would be responsible for launching the browser with the proper arguments to enable WebDriver bidi communication, and starting and managing a session with that browser. When the library is through with that browser, and terminates the session, how does the library (without extensive knowledge about what processes the browser may or may not have spawned during the session) leave the target environment in the proper pre-execution state? That is to say, how does the library make sure there are no zombie or abandoned processes still running once the test is done? |
Killing the browser process can end up with an unclean shutdown, which may skip some shutdown logic (depending on the browser). That could mean e.g. not all runtime changes are written to the browser profile, or e.g. we miss out on leak logging (that example is maybe more relevant to browser vendors, but it's an example of why gecko at least will need a way to trigger a clean shutdown for our CI). |
@jgraham This, in fact, is why I bring it up. Seems to me we'd want a command in the protocol to gracefully shut down the browser. |
That's #119 |
An argument for the capability instead of always-allow is differences in WebDriver Classic and BiDi behavior, which can easily lead to uncertain state depending on the protocol via which the page was closed. From this perspective adding capability shared between Classic and BiDi with default "end session and browser if the last browsing context is closed" seems the least confusing. |
Followup to #170
There is an open issue about the behavior when closing the last browsing context.
See comments in #170 for more context, but the discussed options were:
The text was updated successfully, but these errors were encountered: