-
-
Notifications
You must be signed in to change notification settings - Fork 179
IOptionalBrowserSettings
David Ortner edited this page Jan 12, 2024
·
6 revisions
IOptionalBrowserSettings represents the settings of the browser sent to the constructor.
interface IOptionalBrowserSettings
import { Browser } from "happy-dom";
const browser = new Browser({
settings: {
navigator: "Mozilla/5.0 (X11; Linux x64) AppleWebKit/537.36 (KHTML, like Gecko) HappyDOM/2.0.0"
}
});
Property | Type | Description |
---|---|---|
disableJavaScriptEvaluation? | boolean | Disables JavaScript evaluation. |
disableJavaScriptFileLoading? | boolean | Disables JavaScript file loading. |
disableCSSFileLoading? | boolean | Disables CSS file loading. |
disableComputedStyleRendering? | boolean | Disables computed style rendering. |
errorCapture? | BrowserErrorCaptureEnum | Error capturing policy. |
navigation.disableMainFrameNavigation? | boolean | Disables navigation to other pages in the main frame or a page. |
navigation.disableChildFrameNavigation? | boolean | Disables navigation to other pages in child frames (such as iframes). |
navigation.disableChildPageNavigation? | boolean | Disables navigation to other pages in child pages (such as popup windows). |
navigation.disableFallbackToSetURL? | boolean | Disables the fallback to setting the URL when navigating to a page is disabled or when inside a detached browser frame. |
navigation.crossOriginPolicy? | BrowserNavigationCrossOriginPolicyEnum | Sets the policy for cross-origin navigation. |
navigator.userAgent? | string | User agent. |
navigator.maxTouchPoints? | number | Max touch points. |
device.prefersColorScheme? | string | Prefers color scheme. |
device.mediaType? | string | Media type. |