WebDriverBiDi: move isAlive() onto the interface

This commit is contained in:
Alex Osborne committed 2026-11-12 13:43:55 +09:00
1 parent c743cc0a78
commit 7ca3574b1b
2 files changed
+6 -3

No files matched your search

@@ -175,9 +175,7 @@ public class LocalWebDriverBiDi implements WebDriverBiDi, Closeable {
return future;
}
/**
* Returns true if the browser process is running and the WebDriver connection is still open.
*/
@Override
public boolean isAlive() {
return process.isAlive() && !webSocket.isInputClosed() && !webSocket.isOutputClosed();
}
@@ -22,6 +22,11 @@ package org.archive.net.webdriver;
public interface WebDriverBiDi {
<T extends BiDiModule> T module(Class<T> moduleClass);
/**
* Returns true if the browser is running and the WebDriver connection is still open.
*/
boolean isAlive();
default Browser browser() {
return module(Browser.class);
}