-
-
Notifications
You must be signed in to change notification settings - Fork 200
Browser
David Ortner edited this page Jan 11, 2024
·
27 revisions
Browser represents a Happy DOM Browser instance.
Signature
class Browser implements IBrowser
const browser = new Browser();
const page = browser.newPage();
await page.goto('https://github.com/capricorn86');
await browser.close();
Property | Modifiers | Type | Description |
---|---|---|---|
contexts | readonly | BrowserContext[] | A list of browser contexts. Defaults to one main context. |
defaultContext | readonly | BrowserContext | Default context. |
settings | readonly | IBrowserSettings | Settings object. The settings can be modified runtime. |
console | readonly | Console | null |
Method | Description |
---|---|
close() | Closes the browser |
waitUntilComplete() | Waits until all ongoing processes are complete. This includes async tasks such as scripts and resources in loaded pages. |
abort() | Aborts all ongoing operations. |
newIncognitoContext() | Creates a new incognito context. |
newPage() | Creates a new page. |