BrowserWindowConstructorOptions Object extends BaseWindowConstructorOptions
webPreferences
WebPreferences (optional) - Einstellungen der Funktionen der Webseite.devTools
boolean (optional) - Gibt an ob die Entwicklerwerkzeuge aktiviert sind. Falls dies auffalse
gesetzt ist, kannBrowserWindow.webContents.openDevTools()
nicht verwendet werden um die Entwicklerwerkzeuge zu öffnen. Standard isttrue
.nodeIntegration
boolesche (optional) - Ob Knotenintegration aktiviert ist. Standard istfalse
.nodeIntegrationsInWorker
boolean (optional) - Gibt an ob die Node Integration in Web Workern aktiviert ist. Standard istfalse
. Mehr dazu finden Sie in Multithreading.nodeIntegrationInSubFrames
boolean (optional) - Experimental option for enabling Node.js support in sub-frames such as iframes and child windows. All your preloads will load for every iframe, you can useprocess.isMainFrame
to determine if you are in the main frame or not.preload
string (optional) - Gibt ein Skript an das vor allen anderen Skripten geladen wird bevor andere Skripte der Seite ausgeführt werden. Dieses Skript hat immer Zugriff auf die Node APIs, unabhängig davon ob die Node Integration aktiviert ist oder nicht. Der Wert sollte der absolute Pfad zum Skript sein. Wenn die Node Integration ausgeschaltet ist, kann das Preload Skript globale Node Symbole in den Globalen Scope zurückbringen. Siehe Beispiel hier.sandbox
boolean (optional) - Wenn gesetzt, wird der Renderer des Fensters in einer Sandbox ausgeführt, wodurch es kompatibel mit der Chromium Sandbox wird und die Node.js Integration deaktiviert wird. Dies ist nicht das gleiche wienodeIntegration
, da die APIs die dem Preload Skript zur Verfügung stehen stärker limitiert sind. Lesen Sie mehr über die Option hier.session
Session (optional) - Sets the session used by the page. Instead of passing the Session object directly, you can also choose to use thepartition
option instead, which accepts a partition string. When bothsession
andpartition
are provided,session
will be preferred. Standard ist die Standardsitzung.partition
string (optional) - Sets the session used by the page according to the session's partition string. Ifpartition
starts withpersist:
, the page will use a persistent session available to all pages in the app with the samepartition
. If there is nopersist:
prefix, the page will use an in-memory session. By assigning the samepartition
, multiple pages can share the same session. Standard ist die Standardsitzung.zoomFactor
number (optional) - The default zoom factor of the page,3.0
represents300%
. Standard ist1.0
.javascript
boolean (optional) - Aktiviert die JavaScript-Unterstützung. Standard isttrue
.webSecurity
boolean (optional) - Wennfalse
, wird die Same-Origin-Richtlinie deaktiviert (meistens verwendet zum Testen von Websites) undallowRunningInsecureContent
wird auftrue
gesetzt, wenn diese Option nicht vom Benutzer festgelegt wurde. Standard isttrue
.allowRunningInsecureContent
boolean (optional) - Erlaubt einer https-Seite das Ausführen von JavaScript, CSS oder Plugins von http-URLs. Standard istfalse
.images
boolean (optional) - Aktiviert die Bildunterstützung. Standard isttrue
.imageAnimationPolicy
string (optional) - Bestimmt, wie Bildanimationen ausgeführt werden sollen (z. B. GIFs). Kannanimate
,animateOnce
odernoAnimation
sein. Standard istanimate
.textAreasAreResizable
boolean (optional) - TextArea Elemente skalierbar machen. Standard isttrue
.webgl
boolean (optional) - Aktiviert WebGL Unterstützung. Standard isttrue
.plugins
boolean (optional) - Ob Plugins aktiviert werden sollen. Standard istfalse
.experimentalFeatures
boolean (optional) - Aktiviert Chromiums experimentelle Funktionen. Standard istfalse
.scrollBounce
boolean (optional) macOS - Aktiviert den Bounce (Gummiband) Effekt auf macOS. Standard istfalse
.enableBlinkFeatures
string (optional) - Eine Liste von Zeichenketten getrennt durch,
, wieCSSVariables,KeyboardEventKey
zum Aktivieren. Die vollständige Liste der unterstützten Funktions-strings finden Sie in der RuntimeEnabledFeatures.json5 Datei.disableBlinkFeatures
string (optional) - Eine Liste von Zeichenketten getrennt durch,
, wieCSSVariables,KeyboardEventKey
zum deaktivieren. Die vollständige Liste der unterstützten Funktions-strings finden Sie in der RuntimeEnabledFeatures.json5 Datei.defaultFontFamily
Object (optional) - Legt die Standardschriftart für die font-family fest.standard
string (optional) - StandardTimes New Roman
.serif
string (optional) - StandardTimes New Roman
.sansSerif
string (optional) - StandardArial
.monospace
string (optional) - StandardCourier New
.cursive
string (optional) - StandardScript
.fantasy
string (optional) - StandardImpact
.math
String (optional) - Standardmäßig aufLatin Modern Math
.
defaultFontSize
Integer (optional) - Standart ist16
.defaultMonospaceFontSize
Integer (optional) - Standart ist13
.minimumFontSize
Integer (optional) - Standart ist0
.defaultEncoding
string (optional) - StandardISO-8859-1
.backgroundThrottling
boolean (optional) - Ob Animationen und Timer gedrosselt werden sollen, wenn die Seite in den Hintergrund rückt. This also affects the Page Visibility API. Wenn mindestens ein webContents in einem einzelnen browserWindow dasbackgroundThrottling
deaktiviert hat angezeigt wird, dann werden Rahmen für das gesamte Fenster und andere webContents, die von diesem dargestellt werden, gezeichnet und ausgetauscht. Standardwert isttrue
.offscreen
Object | boolean (optional) - Whether to enable offscreen rendering for the browser window. Standardwert istfalse
. See the offscreen rendering tutorial for more details.useSharedTexture
boolean (optional) Experimental - Whether to use GPU shared texture for accelerated paint event. Standardwert istfalse
. See the offscreen rendering tutorial for more details.
contextIsolation
boolean (optional) - Whether to run Electron APIs and the specifiedpreload
script in a separate JavaScript context. Defaults totrue
. The context that thepreload
script runs in will only have access to its own dedicateddocument
andwindow
globals, as well as its own set of JavaScript builtins (Array
,Object
,JSON
, etc.), which are all invisible to the loaded content. The Electron API will only be available in thepreload
script and not the loaded page. This option should be used when loading potentially untrusted remote content to ensure the loaded content cannot tamper with thepreload
script and any Electron APIs being used. Diese Option verwendet die gleiche Technik, wie sie von Chrome Content Scripts verwendet wird. You can access this context in the dev tools by selecting the 'Electron Isolated Context' entry in the combo box at the top of the Console tab.webviewTag
boolean (optional) - Whether to enable the<webview>
tag. Standardwert istfalse
. Note: Thepreload
script configured for the<webview>
will have node integration enabled when it is executed so you should ensure remote/untrusted content is not able to create a<webview>
tag with a possibly maliciouspreload
script. You can use thewill-attach-webview
event on webContents to strip away thepreload
script and to validate or alter the<webview>
's initial settings.additionalArguments
string[] (optional) - A list of strings that will be appended toprocess.argv
in the renderer process of this app. Useful for passing small bits of data down to renderer process preload scripts.safeDialogs
boolean (optional) - Whether to enable browser style consecutive dialog protection. Standard istfalse
.safeDialogsMessage
string (optional) - The message to display when consecutive dialog protection is triggered. If not defined the default message would be used, note that currently the default message is in English and not localized.disableDialogs
boolean (optional) - Whether to disable dialogs completely. OverridessafeDialogs
. Standard istfalse
.navigateOnDragDrop
boolean (optional) - Whether dragging and dropping a file or link onto the page causes a navigation. Standard istfalse
.autoplayPolicy
string (optional) - Autoplay policy to apply to content in the window, can beno-user-gesture-required
,user-gesture-required
,document-user-activation-required
. Defaults tono-user-gesture-required
.disableHtmlFullscreenWindowResize
boolean (optional) - Whether to prevent the window from resizing when entering HTML Fullscreen. Default isfalse
.accessibleTitle
string (optional) - Eine alternative Titelzeichenfolge nur für Zugänglichkeitswerkzeuge wie Bildschirmleser zur Verfügung gestellt. This string is not directly visible to users.spellcheck
boolean (optional) - Ob die eingebaute Rechtschreibprüfung aktiviert werden soll. Standard isttrue
.enableWebSQL
boolean (optional) - Ob die WebSQL API aktiviert werden soll. Standard isttrue
.v8CacheOptions
string (optional) - Erzwingt die v8 Code Caching Richtlinie die von Blink verwendet wird. Akzeptierte Werte sindnone
- Deaktiviert Code-Cachingcode
- Heuristisches Code-CachingbypassHeatCheck
- Umgehe Code Cache Heuristik aber mit lazy KompilierungbypassHeatCheckAndEagerCompile
- Dasselbe wie oben, außer, dass die Kompilierung eager ist. Standardrichtlinie istcode
.
enablePreferredSizeMode
boolean (optional) - Ob bevorzugte size mode aktiviert werden soll. Die bevorzugte Größe ist die minimale Größe, die benötigt wird um das Layout der documents zu beinhalten ohne scrollen zu müssen. Dies zu aktivieren, führt dazu, dass daspreferred-size-changed
-Ereignis aufWebContents
ausgeführt wird, wenn sich die bevorzugte Größe ändert. Standard istfalse
.transparent
boolean (optional) - Gibt an, ob die Hintergrundtransparenz für die Gastseite aktiviert werden soll. Standard isttrue
. Hinweis: Die Text- und Hintergrundfarben der Gastseite werden aus dem Farbschema des Stammelements abgeleitet. Wenn die Transparenz aktiviert ist, ändert sich zwar die Textfarbe entsprechend, der Hintergrund bleibt jedoch transparent.enableDeprecatedPaste
boolean (optional) Veraltet - Ob daspaste
execCommand aktiviert werden soll. Standard istfalse
.
paintWhenInitiallyHidden
boolean (optional) - Gibt an, ob der Renderer aktiv sein soll, wennshow
false
ist und das Fenster gerade erstellt wurde. Damitdocument.visibilityState
beim ersten Laden mitshow: false
korrekt funktioniert, sollten Sie diesen Wert auffalse
setzen. Wenn Sie diese Einstellung auffalse
festlegen, wird dasready-to-show
-Ereignis nicht ausgelöst. Standard isttrue
.