BrowserWindowConstructorOptions Object extends BaseWindowConstructorOptions
webPreferencesWebPreferences (optional) - Settings of web page's features.devToolsboolean (опционально) - включает инструменты разработчика. Если значениеfalse, нельзя будет использоватьBrowserWindow.webContents.openDevTools(), чтобы открыть инструменты разработчика. По умолчанию -true.nodeIntegrationboolean (optional) - Whether node integration is enabled. По умолчанию -false.nodeIntegrationInWorkerboolean (опционально) - включает интеграцию NodeJS в веб-воркерах. По умолчанию -false. More about this can be found in Multithreading.nodeIntegrationInSubFramesboolean (опционально) - экспериментальная опция для включения поддержки NodeJS в подфреймах, таких как iframes и дочерних окнах. Все Ваши предварительные загрузки будут загружены для каждого iframe, Вы можете использоватьprocess.isMainFrame, чтобы определить в главном фрейме Вы или нет.preloadstring (опционально) - Определяет скрипт, который будет загружен до других скриптов загружаемых в странице. Этот скрипт будет всегда иметь доступ к API NodeJS, вне зависимости включена или выключена интеграция NodeJS. Значение должно быть абсолютным путем к файлу скрипта. Когда интеграция NodeJS отключена, предварительно загруженный скрипт может повторно ввести глобальные символы NodeJS в глобальную область. See example here.sandboxboolean (опционально) - если установлено true, то в окне будет запущена песочница, что делает ее совместимой с песочницей Chromium на уровне операционной системы, и отключает движок NodeJS. Это не тоже самое, что параметрnodeIntegration, доступные API для предзагруженных скриптов более ограничены. Read more about the option here.sessionSession (optional) - Sets the session used by the page. Вместо передачи экземпляр Session напрямую, вместо этого Вы можете также выбрать использование опцииpartition, которая принимает строку раздела. Когда обаsessionиpartitionопределены,sessionбудет предпочтительней. По умолчанию используется сессия по умолчанию.partitionstring (опционально) - устанавливает сессию, используемую на странице в соответствии со строкой раздела сессии. Еслиpartitionначинается сpersist:, страница будет использовать постоянную сессию, которая доступна всем страницам в приложении с тем жеразделом. Если нет префиксаpersist:, страница будет использовать сессию в памяти. При присваивании одинаковогораздела, разные страницы могут иметь одинаковую сессию. По умолчанию используется сессия по умолчанию.zoomFactornumber (optional) - The default zoom factor of the page,3.0represents300%. По умолчанию1.0.javascriptboolean (optional) - Enables JavaScript support. По умолчанию -true.webSecurityboolean (опционально) - Когдаfalse, отключается политика same-origin (обычно используется при тестировании вебсайтов людьми), и устанавливаетсяallowRunningInsecureContentвtrue, если параметр не был установлен пользователем. По умолчанию -true.allowRunningInsecureContentboolean (optional) - Allow an https page to run JavaScript, CSS or plugins from http URLs. По умолчанию -false.imagesboolean (optional) - Enables image support. По умолчанию -true.imageAnimationPolicystring (optional) - Specifies how to run image animations (E.g. GIFs). Can beanimate,animateOnceornoAnimation. По умолчаниюanimate.textAreasAreResizableboolean (optional) - Make TextArea elements resizable. Default istrue.webglboolean (optional) - Enables WebGL support. По умолчанию -true.pluginsboolean (optional) - Whether plugins should be enabled. По умолчанию -false.experimentalFeaturesboolean (optional) - Enables Chromium's experimental features. По умолчанию -false.scrollBounceboolean (optional) macOS - Enables scroll bounce (rubber banding) effect on macOS. По умолчанию -false.enableBlinkFeaturesstring (опционально) - список строк функций, разделенныхзапятой, которые нужно включить, напримерCSSVariables,KeyboardEventKey. Полный список поддерживаемых возможностей можно найти в файле RuntimeEnabledFeatures.json5.disableBlinkFeaturesstring (опционально) - Список функциональных возможностей для выключения, разделяются',', напримерCSSVariables,KeyboardEventKey. Полный список поддерживаемых возможностей можно найти в файле RuntimeEnabledFeatures.json5.defaultFontFamilyObject (optional) - Sets the default font for the font-family.standardstring (опционально) - По умолчаниюTimes New Roman.serifstring (опционально) - по умолчаниюTimes New Roman.sansSerifstring (опционально) - По умолчаниюArial.monospacestring (опционально) - По умолчаниюCourier New.cursivestring (опционально) - По умолчаниюScript.fantasystring (опционально) - По умолчаниюImpact.mathstring (опционально) - По умолчаниюLatin Modern Math.
defaultFontSizeInteger (опционально) - По умолчанию16.defaultMonospaceFontSizeInteger (опционально) - По умолчанию13.minimumFontSizeInteger (опционально) - По умолчанию0.defaultEncodingstring (опционально) - По умолчаниюISO-8859-1.backgroundThrottlingboolean (опционально) - Отключать ли анимацию и таймеры, когда страница становится фоновой. Влияет на API видимости страницы. When at least one webContents displayed in a single browserWindow has disabledbackgroundThrottlingthen frames will be drawn and swapped for the whole window and other webContents displayed by it. По умолчаниюtrue.offscreenObject | boolean (опционально) - рендеринг окна браузера вне экрана. По умолчаниюfalse. See the offscreen rendering tutorial for more details.useSharedTextureboolean (опционально) Экспериментальный - использование GPU общих текстур для ускорения отрисовки. По умолчаниюfalse. See the offscreen rendering tutorial for more details.
contextIsolationboolean (опционально) - Запускать или нет API Electron и определенный скриптpreloadв отдельном JavaScript-контексте. По умолчаниюtrue. The context that thepreloadscript runs in will only have access to its own dedicateddocumentandwindowglobals, 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 thepreloadscript and not the loaded page. This option should be used when loading potentially untrusted remote content to ensure the loaded content cannot tamper with thepreloadscript and any Electron APIs being used. This option uses the same technique used by Chrome Content Scripts. 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. По умолчаниюfalse. Примечание: Cкриптpreload, настроенный для<webview>, при запуске будет иметь интеграцию NodeJS, так что Вы должны убедиться, что удаленный/непроверенный контент не сможет создавать тег<webview>с возможно вредоносным скриптомpreload. You can use thewill-attach-webviewevent on webContents to strip away thepreloadscript and to validate or alter the<webview>'s initial settings.additionalArgumentsstring[] (optional) - A list of strings that will be appended toprocess.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. По умолчанию -false.safeDialogsMessagestring (опционально) - Сообщение, которое будет отображено, когда сработает последовательная защита диалогов. Если не определено, будет использовано сообщение по умолчанию, обратите внимание, что текущее сообщение по умолчанию на английском и не переведено.disableDialogsboolean (optional) - Whether to disable dialogs completely. OverridessafeDialogs. По умолчанию -false.navigateOnDragDropboolean (optional) - Whether dragging and dropping a file or link onto the page causes a navigation. По умолчанию -false.autoplayPolicystring (опционально) - политика автовоспроизведения для применения к содержимому в окне, может бытьno-user-gesture-required,user-gesture-requiredилиdocument-user-activation-required. По умолчаниюno-user-gesture-required.disableHtmlFullscreenWindowResizeboolean (optional) - Whether to prevent the window from resizing when entering HTML Fullscreen. Default isfalse.accessibleTitlestring (optional) - An alternative title string provided only to accessibility tools such as screen readers. This string is not directly visible to users.spellcheckboolean (optional) - Whether to enable the builtin spellchecker. По умолчанию -true.enableWebSQLboolean (optional) - Whether to enable the WebSQL api. По умолчанию -true.v8CacheOptionsstring (optional) - Enforces the v8 code caching policy used by blink. Accepted values arenone- Disables code cachingcode- Heuristic based code cachingbypassHeatCheck- Bypass code caching heuristics but with lazy compilationbypassHeatCheckAndEagerCompile- Same as above except compilation is eager. Default policy iscode.
enablePreferredSizeModeboolean (optional) - Whether to enable preferred size mode. The preferred size is the minimum size needed to contain the layout of the document—without requiring scrolling. Enabling this will cause thepreferred-size-changedevent to be emitted on theWebContentswhen the preferred size changes. По умолчанию -false.transparentboolean (optional) - Whether to enable background transparency for the guest page. По умолчанию -true. Note: The guest page's text and background colors are derived from the color scheme of its root element. When transparency is enabled, the text color will still change accordingly but the background will remain transparent.
paintWhenInitiallyHiddenboolean (опционально) - Должен ли рендерер быть активным, когдаshowравенfalseи он только что создан. Дляdocument.visibilityStateдля корректной работы при первой загрузке сshow: falseнеобходимо установить значениеfalse. Установка этого вfalseприведёт к тому, что событияready-to-showне будут запускаться. По умолчанию -true.