-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.event.EventEmitter,ai.platon.pulsar.crawl.fetch.driver.Browser,java.lang.AutoCloseable
public abstract class AbstractBrowser extends AbstractEventEmitter<BrowserEvents> implements Browser
-
-
Field Summary
Fields Modifier and Type Field Description private final StringuserAgentprivate final List<NavigateEntry>navigateHistoryprivate final Map<String, WebDriver>driversprivate final BooleanisIdleprivate final ScriptConfuserconfuserprivate final ScriptLoaderscriptLoaderprivate final BooleanisGUIprivate final DurationidleTimeoutprivate final BrowserIdidprivate final BrowserSettingsbrowserSettingsprivate final Map<BrowserEvents, List<Function<Object>>>listeners
-
Constructor Summary
Constructors Constructor Description AbstractBrowser(BrowserId id, BrowserSettings browserSettings)
-
Method Summary
Modifier and Type Method Description StringgetUserAgent()The user agent to override, do not override if it's null. List<NavigateEntry>getNavigateHistory()Map<String, WebDriver>getDrivers()BooleangetIsIdle()final ScriptConfusergetConfuser()final ScriptLoadergetScriptLoader()final BooleangetIsGUI()final DurationgetIdleTimeout()BrowserIdgetId()The unique browser id final BrowserSettingsgetBrowserSettings()final Map<BrowserEvents, List<Function<Object>>>getListeners()Unitmaintain()Maintain the browser UnitonWillNavigate(NavigateEntry entry)Register event handler when a url is about to navigate. Unitclose()-
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.AbstractBrowser
newDriver -
Methods inherited from class ai.platon.pulsar.crawl.fetch.driver.Browser
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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AbstractBrowser
AbstractBrowser(BrowserId id, BrowserSettings browserSettings)
-
-
Method Detail
-
getUserAgent
String getUserAgent()
The user agent to override, do not override if it's null.
-
getNavigateHistory
List<NavigateEntry> getNavigateHistory()
-
getDrivers
Map<String, WebDriver> getDrivers()
-
getConfuser
final ScriptConfuser getConfuser()
-
getScriptLoader
final ScriptLoader getScriptLoader()
-
getIdleTimeout
final Duration getIdleTimeout()
-
getBrowserSettings
final BrowserSettings getBrowserSettings()
-
getListeners
final Map<BrowserEvents, List<Function<Object>>> getListeners()
-
onWillNavigate
Unit onWillNavigate(NavigateEntry entry)
Register event handler when a url is about to navigate.
-
-
-
-