Package com.microsoft.playwright
Class BrowserContext.RouteFromHAROptions
- java.lang.Object
-
- com.microsoft.playwright.BrowserContext.RouteFromHAROptions
-
- Enclosing interface:
- BrowserContext
public static class BrowserContext.RouteFromHAROptions extends Object
-
-
Field Summary
Fields Modifier and Type Field Description HarNotFoundnotFoundIf set to 'abort' any request not found in the HAR file will be aborted. If set to 'fallback' falls through to the next route handler in the handler chain.BooleanupdateIf specified, updates the given HAR with the actual network information instead of serving from file.RouteFromHarUpdateContentPolicyupdateContentOptional setting to control resource content management.HarModeupdateModeWhen set tominimal, only record information necessary for routing from HAR.ObjecturlA glob pattern, regular expression or predicate to match the request URL.
-
Constructor Summary
Constructors Constructor Description RouteFromHAROptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BrowserContext.RouteFromHAROptionssetNotFound(HarNotFound notFound)If set to 'abort' any request not found in the HAR file will be aborted. If set to 'fallback' falls through to the next route handler in the handler chain.BrowserContext.RouteFromHAROptionssetUpdate(boolean update)If specified, updates the given HAR with the actual network information instead of serving from file.BrowserContext.RouteFromHAROptionssetUpdateContent(RouteFromHarUpdateContentPolicy updateContent)Optional setting to control resource content management.BrowserContext.RouteFromHAROptionssetUpdateMode(HarMode updateMode)When set tominimal, only record information necessary for routing from HAR.BrowserContext.RouteFromHAROptionssetUrl(String url)A glob pattern, regular expression or predicate to match the request URL.BrowserContext.RouteFromHAROptionssetUrl(Pattern url)A glob pattern, regular expression or predicate to match the request URL.
-
-
-
Field Detail
-
notFound
public HarNotFound notFound
- If set to 'abort' any request not found in the HAR file will be aborted.
- If set to 'fallback' falls through to the next route handler in the handler chain.
Defaults to abort.
-
update
public Boolean update
If specified, updates the given HAR with the actual network information instead of serving from file. The file is written to disk whenBrowserContext.close()is called.
-
updateContent
public RouteFromHarUpdateContentPolicy updateContent
Optional setting to control resource content management. Ifattachis specified, resources are persisted as separate files or entries in the ZIP archive. Ifembedis specified, content is stored inline the HAR file.
-
updateMode
public HarMode updateMode
When set tominimal, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults tominimal.
-
url
public Object url
A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern will be served from the HAR file. If not specified, all requests are served from the HAR file.
-
-
Method Detail
-
setNotFound
public BrowserContext.RouteFromHAROptions setNotFound(HarNotFound notFound)
- If set to 'abort' any request not found in the HAR file will be aborted.
- If set to 'fallback' falls through to the next route handler in the handler chain.
Defaults to abort.
-
setUpdate
public BrowserContext.RouteFromHAROptions setUpdate(boolean update)
If specified, updates the given HAR with the actual network information instead of serving from file. The file is written to disk whenBrowserContext.close()is called.
-
setUpdateContent
public BrowserContext.RouteFromHAROptions setUpdateContent(RouteFromHarUpdateContentPolicy updateContent)
Optional setting to control resource content management. Ifattachis specified, resources are persisted as separate files or entries in the ZIP archive. Ifembedis specified, content is stored inline the HAR file.
-
setUpdateMode
public BrowserContext.RouteFromHAROptions setUpdateMode(HarMode updateMode)
When set tominimal, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults tominimal.
-
setUrl
public BrowserContext.RouteFromHAROptions setUrl(String url)
A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern will be served from the HAR file. If not specified, all requests are served from the HAR file.
-
setUrl
public BrowserContext.RouteFromHAROptions setUrl(Pattern url)
A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern will be served from the HAR file. If not specified, all requests are served from the HAR file.
-
-