happy-dom
Version:
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
49 lines (47 loc) • 1.48 kB
text/typescript
import PackageVersion from '../version.js';
import BrowserErrorCaptureEnum from './enums/BrowserErrorCaptureEnum.js';
import BrowserNavigationCrossOriginPolicyEnum from './enums/BrowserNavigationCrossOriginPolicyEnum.js';
import IBrowserSettings from './types/IBrowserSettings.js';
export default <IBrowserSettings>{
disableJavaScriptEvaluation: false,
disableJavaScriptFileLoading: false,
disableCSSFileLoading: false,
disableIframePageLoading: false,
disableComputedStyleRendering: false,
disableErrorCapturing: false,
errorCapture: BrowserErrorCaptureEnum.tryAndCatch,
enableFileSystemHttpRequests: false,
timer: {
maxTimeout: -1,
maxIntervalTime: -1,
maxIntervalIterations: -1,
preventTimerLoops: false
},
fetch: {
disableSameOriginPolicy: false,
interceptor: null,
virtualServers: null
},
navigation: {
disableMainFrameNavigation: false,
disableChildFrameNavigation: false,
disableChildPageNavigation: false,
disableFallbackToSetURL: false,
crossOriginPolicy: BrowserNavigationCrossOriginPolicyEnum.anyOrigin
},
navigator: {
userAgent: `Mozilla/5.0 (X11; ${
process.platform.charAt(0).toUpperCase() + process.platform.slice(1) + ' ' + process.arch
}) AppleWebKit/537.36 (KHTML, like Gecko) HappyDOM/${PackageVersion.version}`,
maxTouchPoints: 0
},
device: {
prefersColorScheme: 'light',
prefersReducedMotion: 'no-preference',
mediaType: 'screen',
forcedColors: 'none'
},
debug: {
traceWaitUntilComplete: -1
}
};