Interface Browser
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.event.EventEmitter,java.lang.AutoCloseable
public interface Browser implements EventEmitter<BrowserEvents>, AutoCloseable
The Browser defines methods and events to manipulate a real browser.
-
-
Method Summary
Modifier and Type Method Description abstract WebDrivernewDriver()Create a new driver. abstract UnitclearCookies()Clear all cookies. abstract UnitdestroyDriver(WebDriver driver)Destroy the web driver, close the associated browser tabs. abstract UnitdestroyForcibly()Destroy the browser forcibly, kill the associated browser processes, release all allocated resources, regardless of whether the browser is closed or not. abstract UnitonInitialize()Initialize the browser. abstract UnitonWillNavigate(NavigateEntry entry)Register event handler before navigating to a url. abstract Unitmaintain()Maintain the browser abstract BrowserIdgetId()The unique browser id abstract StringgetUserAgent()The user agent to override, do not override if it's null. abstract NavigateHistorygetNavigateHistory()The navigation history. abstract Map<String, WebDriver>getDrivers()The created drivers by this browser. abstract Map<String, Object>getData()The associated data. abstract BooleanisIdle()Check if this browser is idle. -
Methods inherited from class ai.platon.pulsar.common.event.EventEmitter
count, emit, emit, emit, emit, emit1, emit1, emit1, emit1, hasListeners, hasNormalListeners, hasSuspendListeners, listeners, listeners, normalListeners, normalListeners, off, off, off, off, off, off1, off1, off1, off1, off1, on, on, on, on, on1, on1, on1, on1, once, once, once, once1, once1, once1, suspendListeners, suspendListeners -
Methods inherited from class java.lang.AutoCloseable
close -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
clearCookies
abstract Unit clearCookies()
Clear all cookies. Notice: even if we clear all cookies, the website still has some technology to track a session.
-
destroyDriver
abstract Unit destroyDriver(WebDriver driver)
Destroy the web driver, close the associated browser tabs.
-
destroyForcibly
abstract Unit destroyForcibly()
Destroy the browser forcibly, kill the associated browser processes, release all allocated resources, regardless of whether the browser is closed or not.
-
onInitialize
abstract Unit onInitialize()
Initialize the browser.
-
onWillNavigate
abstract Unit onWillNavigate(NavigateEntry entry)
Register event handler before navigating to a url.
-
getUserAgent
abstract String getUserAgent()
The user agent to override, do not override if it's null.
-
getNavigateHistory
abstract NavigateHistory getNavigateHistory()
The navigation history.
-
getDrivers
abstract Map<String, WebDriver> getDrivers()
The created drivers by this browser.
-
-
-
-