-
-
Notifications
You must be signed in to change notification settings - Fork 207
BrowserFrame
David Ortner edited this page Apr 19, 2024
·
5 revisions
BrowserFrame represents a browser frame.
class BrowserFrame implements IBrowserFrame
import { Browser } from "happy-dom";
const browser = new Browser();
const page = browser.newPage();
page.mainFrame.url = "https://example.com";
Property | Modifiers | Type | Description |
---|---|---|---|
childFrames | readonly | BrowserFrame[] | Child frames. |
parentFrame | readonly | BrowserFrame | null | Parent frame. |
page | readonly | BrowserPage | Owner page. |
window | readonly | BrowserWindow | Window instance associated with the frame. |
document | readonly | Document | Document instance associated with the frame. |
content | string | Set or get the Document content HTML. | |
url | string | Set or get the Window URL without navigating the page. |
Method | Return type | Description |
---|---|---|
waitUntilComplete() | Promise<void> | Waits for all ongoing operations to complete. This includes operations such as loading resources and executing scripts. |
waitForNavigation() | Promise<void> | Waits for the page to be navigated. This is resolved when the HTML of the new URL has been loaded into the main frame. |
abort() | Promise<void> | Aborts all ongoing operations. |
evaluate() | any | Evaluates code or a VM Script in the frame's context. |
goto() | Promise<IResponse | null> | Navigate to a URL. |
reload() | Promise<IResponse | null> | Reloads the frame. |