WebPreferences Objekt
- devToolsboolean (optional) - Gibt an ob die Entwicklerwerkzeuge aktiviert sind. Falls dies auf- falsegesetzt ist, kann- BrowserWindow.webContents.openDevTools()nicht verwendet werden um die Entwicklerwerkzeuge zu öffnen. Standard ist- true.
- nodeIntegrationboolesche (optional) - Ob Knotenintegration aktiviert ist. Standard ist- false.
- nodeIntegrationsInWorkerboolean (optional) - Gibt an ob die Node Integration in Web Workern aktiviert ist. Standard ist- false. Mehr dazu finden Sie in Multithreading.
- nodeIntegrationInSubFramesboolean (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 use- process.isMainFrameto determine if you are in the main frame or not.
- preloadstring (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.
- sandboxboolean (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 wie- nodeIntegration, da die APIs die dem Preload Skript zur Verfügung stehen stärker limitiert sind. Default is- truesince Electron 20. The sandbox will automatically be disabled when- nodeIntegrationis set to- true. Lesen Sie mehr über die Option hier.
- sessionSession (optional) - Sets the session used by the page. Instead of passing the Session object directly, you can also choose to use the- partitionoption instead, which accepts a partition string. When both- sessionand- partitionare provided,- sessionwill be preferred. Standard ist die Standardsitzung.
- partitionstring (optional) - Sets the session used by the page according to the session's partition string. If- partitionstarts with- persist:, the page will use a persistent session available to all pages in the app with the same- partition. If there is no- persist:prefix, the page will use an in-memory session. By assigning the same- partition, multiple pages can share the same session. Standard ist die Standardsitzung.
- zoomFactornumber (optional) - The default zoom factor of the page,- 3.0represents- 300%. Standard ist- 1.0.
- javascriptboolean (optional) - Aktiviert die JavaScript-Unterstützung. Standard ist- true.
- webSecurityboolean (optional) - Wenn- false, wird die Same-Origin-Richtlinie deaktiviert (meistens verwendet zum Testen von Websites) und- allowRunningInsecureContentwird auf- truegesetzt, wenn diese Option nicht vom Benutzer festgelegt wurde. Standard ist- true.
- allowRunningInsecureContentboolean (optional) - Erlaubt einer https-Seite das Ausführen von JavaScript, CSS oder Plugins von http-URLs. Standard ist- false.
- imagesboolean (optional) - Aktiviert die Bildunterstützung. Standard ist- true.
- imageAnimationPolicystring (optional) - Bestimmt, wie Bildanimationen ausgeführt werden sollen (z. B. GIFs). Kann- animate,- animateOnceoder- noAnimationsein. Standard ist- animate.
- textAreasAreResizableboolean (optional) - TextArea Elemente skalierbar machen. Standard ist- true.
- webglboolean (optional) - Aktiviert WebGL Unterstützung. Standard ist- true.
- pluginsboolean (optional) - Ob Plugins aktiviert werden sollen. Standard ist- false.
- experimentalFeaturesboolean (optional) - Aktiviert Chromiums experimentelle Funktionen. Standard ist- false.
- scrollBounceboolean (optional) macOS - Aktiviert den Bounce (Gummiband) Effekt auf macOS. Standard ist- false.
- enableBlinkFeaturesstring (optional) - Eine Liste von Zeichenketten getrennt durch- ,, wie- CSSVariables,KeyboardEventKeyzum Aktivieren. Die vollständige Liste der unterstützten Funktions-strings finden Sie in der RuntimeEnabledFeatures.json5 Datei.
- disableBlinkFeaturesstring (optional) - Eine Liste von Zeichenketten getrennt durch- ,, wie- CSSVariables,KeyboardEventKeyzum deaktivieren. Die vollständige Liste der unterstützten Funktions-strings finden Sie in der RuntimeEnabledFeatures.json5 Datei.
- defaultFontFamilyObject (optional) - Legt die Standardschriftart für die font-family fest.- standardstring (optional) - Standard- Times New Roman.
- serifstring (optional) - Standard- Times New Roman.
- sansSerifstring (optional) - Standard- Arial.
- monospacestring (optional) - Standard- Courier New.
- cursivestring (optional) - Standard- Script.
- fantasystring (optional) - Standard- Impact.
- mathString (optional) - Standardmäßig auf- Latin Modern Math.
 
- defaultFontSizeInteger (optional) - Standart ist- 16.
- defaultMonospaceFontSizeInteger (optional) - Standart ist- 13.
- minimumFontSizeInteger (optional) - Standart ist- 0.
- defaultEncodingstring (optional) - Standard- ISO-8859-1.
- backgroundThrottlingboolean (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 das- backgroundThrottlingdeaktiviert hat angezeigt wird, dann werden Rahmen für das gesamte Fenster und andere webContents, die von diesem dargestellt werden, gezeichnet und ausgetauscht. Standardwert ist- true.
- offscreenObject | boolean (optional) - Whether to enable offscreen rendering for the browser window. Standardwert ist- false. See the offscreen rendering tutorial for more details.- useSharedTextureboolean (optional) Experimental - Whether to use GPU shared texture for accelerated paint event. Standardwert ist- false. See the offscreen rendering tutorial for more details.
- sharedTexturePixelFormatstring (optional) Experimental - The requested output format of the shared texture. Standard ist- argb. The name is originated from Chromium- media::VideoPixelFormatenum suffix and only subset of them are supported. The actual output pixel format and color space of the texture should refer to OffscreenSharedTexture object in the- paintevent.- argb- The requested output texture format is 8-bit unorm RGBA, with SRGB SDR color space.
- rgbaf16- The requested output texture format is 16-bit float RGBA, with scRGB HDR color space.
 
 
- contextIsolationboolean (optional) - Whether to run Electron APIs and the specified- preloadscript in a separate JavaScript context. Defaults to- true. The context that the- preloadscript runs in will only have access to its own dedicated- documentand- windowglobals, 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 the- preloadscript and not the loaded page. This option should be used when loading potentially untrusted remote content to ensure the loaded content cannot tamper with the- preloadscript 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.
- webviewTagboolean (optional) - Whether to enable the- <webview>tag. Standardwert ist- false. Note: The- preloadscript 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 malicious- preloadscript. You can use the- will-attach-webviewevent on webContents to strip away the- preloadscript and to validate or alter the- <webview>'s initial settings.
- additionalArgumentsstring[] (optional) - A list of strings that will be appended to- process.argvin the renderer process of this app. Useful for passing small bits of data down to renderer process preload scripts.
- safeDialogsboolean (optional) - Whether to enable browser style consecutive dialog protection. Standard ist- false.
- safeDialogsMessagestring (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.
- disableDialogsboolean (optional) - Whether to disable dialogs completely. Overrides- safeDialogs. Standard ist- false.
- navigateOnDragDropboolean (optional) - Whether dragging and dropping a file or link onto the page causes a navigation. Standard ist- false.
- autoplayPolicystring (optional) - Autoplay policy to apply to content in the window, can be- no-user-gesture-required,- user-gesture-required,- document-user-activation-required. Defaults to- no-user-gesture-required.
- disableHtmlFullscreenWindowResizeboolean (optional) - Whether to prevent the window from resizing when entering HTML Fullscreen. Default is- false.
- accessibleTitlestring (optional) - Eine alternative Titelzeichenfolge nur für Zugänglichkeitswerkzeuge wie Bildschirmleser zur Verfügung gestellt. This string is not directly visible to users.
- spellcheckboolean (optional) - Ob die eingebaute Rechtschreibprüfung aktiviert werden soll. Standard ist- true.
- enableWebSQLboolean (optional) - Ob die WebSQL API aktiviert werden soll. Standard ist- true.
- v8CacheOptionsstring (optional) - Erzwingt die v8 Code Caching Richtlinie die von Blink verwendet wird. Akzeptierte Werte sind- none- Deaktiviert Code-Caching
- code- Heuristisches Code-Caching
- bypassHeatCheck- Umgehe Code Cache Heuristik aber mit lazy Kompilierung
- bypassHeatCheckAndEagerCompile- Dasselbe wie oben, außer, dass die Kompilierung eager ist. Standardrichtlinie ist- code.
 
- enablePreferredSizeModeboolean (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 das- preferred-size-changed-Ereignis auf- WebContentsausgeführt wird, wenn sich die bevorzugte Größe ändert. Standard ist- false.
- transparentboolean (optional) - Gibt an, ob die Hintergrundtransparenz für die Gastseite aktiviert werden soll. Standard ist- true. 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.
- enableDeprecatedPasteboolean (optional) Veraltet - Ob das- pasteexecCommand aktiviert werden soll. Standard ist- false.