Class BrowserControl
- java.lang.Object
-
- cz.vutbr.fit.layout.playwright.impl.BrowserControl
-
- All Implemented Interfaces:
AutoCloseable
public class BrowserControl extends Object implements AutoCloseable
Runs the browser via Playwright and gets the rendered page description.- Author:
- burgetr
-
-
Constructor Summary
Constructors Constructor Description BrowserControl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected com.microsoft.playwright.BrowserTypecreateBrowserType()protected StringgetClientScript()intgetHeight()intgetPersist()StringgetUserDir()intgetWidth()protected voidinitCurrentContext()booleanisAcquireImages()booleanisIncludeScreenshot()booleanisNoHeadless()protected com.microsoft.playwright.BrowserContextlaunchPersistent(com.microsoft.playwright.BrowserType btype, Path userDir)protected com.microsoft.playwright.BrowserContextlaunchTemporary(com.microsoft.playwright.BrowserType btype)protected static StringloadResource(String filePath)voidsetAcquireImages(boolean acquireImages)voidsetHeight(int height)voidsetIncludeScreenshot(boolean includeScreenshot)voidsetNoHeadless(boolean noHeadless)voidsetPersist(int persist)voidsetUserDir(String userDir)voidsetWidth(int width)Map<String,Object>visit(String urlstring)
-
-
-
Method Detail
-
getWidth
public int getWidth()
-
setWidth
public void setWidth(int width)
-
getHeight
public int getHeight()
-
setHeight
public void setHeight(int height)
-
getPersist
public int getPersist()
-
setPersist
public void setPersist(int persist)
-
isAcquireImages
public boolean isAcquireImages()
-
setAcquireImages
public void setAcquireImages(boolean acquireImages)
-
isIncludeScreenshot
public boolean isIncludeScreenshot()
-
setIncludeScreenshot
public void setIncludeScreenshot(boolean includeScreenshot)
-
isNoHeadless
public boolean isNoHeadless()
-
setNoHeadless
public void setNoHeadless(boolean noHeadless)
-
getUserDir
public String getUserDir()
-
setUserDir
public void setUserDir(String userDir)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
createBrowserType
protected com.microsoft.playwright.BrowserType createBrowserType()
-
initCurrentContext
protected void initCurrentContext()
-
launchTemporary
protected com.microsoft.playwright.BrowserContext launchTemporary(com.microsoft.playwright.BrowserType btype)
-
launchPersistent
protected com.microsoft.playwright.BrowserContext launchPersistent(com.microsoft.playwright.BrowserType btype, Path userDir)
-
getClientScript
protected String getClientScript()
-
-