From ccf9aaa0cb040866a5624c184822c5fe3a543d3a Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 31 Aug 2021 14:04:59 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20New=20Crowdin=20translations=20(auto-me?= =?UTF-8?q?rged=20=F0=9F=A4=96)=20(#2009)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/de-DE/docs/api/app.md | 70 +-- content/de-DE/docs/api/auto-updater.md | 95 ++-- content/de-DE/docs/api/browser-window.md | 62 +-- content/de-DE/docs/api/clipboard.md | 99 ++--- .../de-DE/docs/api/command-line-switches.md | 39 +- content/de-DE/docs/api/dialog.md | 2 - .../de-DE/docs/api/environment-variables.md | 12 +- content/de-DE/docs/api/extensions.md | 1 + content/de-DE/docs/api/frameless-window.md | 37 +- content/de-DE/docs/api/ipc-main.md | 2 + content/de-DE/docs/api/menu-item.md | 4 +- content/de-DE/docs/api/menu.md | 2 +- content/de-DE/docs/api/power-monitor.md | 4 +- content/de-DE/docs/api/session.md | 21 +- .../docs/api/structures/overlay-options.md | 4 + .../docs/api/structures/user-default-types.md | 12 + content/de-DE/docs/api/system-preferences.md | 6 +- content/de-DE/docs/api/touch-bar-scrubber.md | 2 +- content/de-DE/docs/api/web-contents.md | 136 +++--- content/de-DE/docs/api/web-frame-main.md | 6 + content/de-DE/docs/api/web-request.md | 48 +-- content/de-DE/docs/api/webview-tag.md | 90 ++-- content/de-DE/docs/api/window-open.md | 11 +- content/de-DE/docs/breaking-changes.md | 158 ++++--- .../de-DE/docs/development/pull-requests.md | 1 - .../source-code-directory-structure.md | 2 - .../docs/tutorial/application-debugging.md | 2 +- content/de-DE/docs/tutorial/code-signing.md | 3 +- content/de-DE/docs/tutorial/dark-mode.md | 10 +- .../de-DE/docs/tutorial/in-app-purchases.md | 2 +- content/de-DE/docs/tutorial/installation.md | 2 +- .../launch-app-from-url-in-another-app.md | 46 +- .../docs/tutorial/linux-desktop-actions.md | 2 +- content/de-DE/docs/tutorial/macos-dock.md | 2 +- content/de-DE/docs/tutorial/notifications.md | 2 +- content/de-DE/docs/tutorial/progress-bar.md | 2 +- .../de-DE/docs/tutorial/represented-file.md | 2 +- content/de-DE/docs/tutorial/security.md | 67 +-- content/de-DE/docs/tutorial/snapcraft.md | 2 +- content/de-DE/docs/tutorial/support.md | 2 +- content/de-DE/docs/tutorial/updates.md | 8 +- .../tutorial/using-native-node-modules.md | 4 +- .../tutorial/using-pepper-flash-plugin.md | 2 +- .../tutorial/using-selenium-and-webdriver.md | 2 +- content/de-DE/docs/tutorial/web-embeds.md | 2 +- content/de-DE/docs/tutorial/windows-arm.md | 2 +- .../de-DE/docs/tutorial/windows-taskbar.md | 2 +- content/de-DE/website/blog/webview2.md | 81 ++++ content/de-DE/website/i18n/code.json | 42 +- .../options.json | 14 + .../i18n/docusaurus-theme-classic/footer.json | 34 +- .../i18n/docusaurus-theme-classic/navbar.json | 6 +- content/de-DE/website/locale.yml | 318 +++++++------- content/es-ES/docs/api/app.md | 60 +-- content/es-ES/docs/api/auto-updater.md | 2 + content/es-ES/docs/api/browser-window.md | 296 ++++++------- content/es-ES/docs/api/clipboard.md | 120 +++--- .../es-ES/docs/api/command-line-switches.md | 39 +- content/es-ES/docs/api/dialog.md | 2 - .../es-ES/docs/api/environment-variables.md | 12 +- content/es-ES/docs/api/extensions.md | 1 + content/es-ES/docs/api/frameless-window.md | 37 +- content/es-ES/docs/api/ipc-main.md | 2 + content/es-ES/docs/api/menu-item.md | 4 +- content/es-ES/docs/api/menu.md | 2 +- content/es-ES/docs/api/power-monitor.md | 4 +- content/es-ES/docs/api/session.md | 16 +- .../docs/api/structures/overlay-options.md | 4 + .../docs/api/structures/user-default-types.md | 12 + content/es-ES/docs/api/system-preferences.md | 6 +- content/es-ES/docs/api/touch-bar-scrubber.md | 2 +- content/es-ES/docs/api/web-contents.md | 70 +-- content/es-ES/docs/api/web-frame-main.md | 6 + content/es-ES/docs/api/web-request.md | 16 +- content/es-ES/docs/api/webview-tag.md | 35 +- content/es-ES/docs/api/window-open.md | 13 +- content/es-ES/docs/breaking-changes.md | 84 +++- .../es-ES/docs/development/pull-requests.md | 1 - .../source-code-directory-structure.md | 2 - .../docs/tutorial/application-debugging.md | 2 +- content/es-ES/docs/tutorial/code-signing.md | 3 +- content/es-ES/docs/tutorial/dark-mode.md | 6 +- .../es-ES/docs/tutorial/in-app-purchases.md | 2 +- content/es-ES/docs/tutorial/installation.md | 2 +- .../launch-app-from-url-in-another-app.md | 46 +- .../docs/tutorial/linux-desktop-actions.md | 2 +- content/es-ES/docs/tutorial/macos-dock.md | 2 +- content/es-ES/docs/tutorial/notifications.md | 2 +- content/es-ES/docs/tutorial/progress-bar.md | 2 +- .../es-ES/docs/tutorial/represented-file.md | 2 +- content/es-ES/docs/tutorial/security.md | 67 +-- content/es-ES/docs/tutorial/snapcraft.md | 2 +- content/es-ES/docs/tutorial/support.md | 2 +- content/es-ES/docs/tutorial/updates.md | 8 +- .../tutorial/using-native-node-modules.md | 4 +- .../tutorial/using-pepper-flash-plugin.md | 2 +- .../tutorial/using-selenium-and-webdriver.md | 2 +- content/es-ES/docs/tutorial/web-embeds.md | 2 +- content/es-ES/docs/tutorial/windows-arm.md | 2 +- .../es-ES/docs/tutorial/windows-taskbar.md | 2 +- content/es-ES/website/blog/webview2.md | 81 ++++ content/es-ES/website/i18n/code.json | 122 +++--- .../options.json | 14 + .../i18n/docusaurus-theme-classic/footer.json | 36 +- .../i18n/docusaurus-theme-classic/navbar.json | 6 +- content/es-ES/website/locale.yml | 392 ++++++++--------- content/fr-FR/docs/api/app.md | 92 +--- content/fr-FR/docs/api/auto-updater.md | 2 + content/fr-FR/docs/api/browser-window.md | 286 ++++++------ content/fr-FR/docs/api/clipboard.md | 127 +++--- .../fr-FR/docs/api/command-line-switches.md | 39 +- content/fr-FR/docs/api/dialog.md | 10 +- .../fr-FR/docs/api/environment-variables.md | 12 +- content/fr-FR/docs/api/extensions.md | 1 + content/fr-FR/docs/api/frameless-window.md | 37 +- content/fr-FR/docs/api/ipc-main.md | 2 + content/fr-FR/docs/api/menu-item.md | 4 +- content/fr-FR/docs/api/menu.md | 2 +- content/fr-FR/docs/api/power-monitor.md | 4 +- content/fr-FR/docs/api/session.md | 18 +- .../docs/api/structures/overlay-options.md | 4 + .../docs/api/structures/user-default-types.md | 12 + content/fr-FR/docs/api/system-preferences.md | 6 +- content/fr-FR/docs/api/touch-bar-scrubber.md | 2 +- content/fr-FR/docs/api/web-contents.md | 72 ++-- content/fr-FR/docs/api/web-frame-main.md | 6 + content/fr-FR/docs/api/web-request.md | 16 +- content/fr-FR/docs/api/webview-tag.md | 35 +- content/fr-FR/docs/api/window-open.md | 7 +- content/fr-FR/docs/breaking-changes.md | 78 +++- .../fr-FR/docs/development/pull-requests.md | 1 - .../source-code-directory-structure.md | 2 - .../docs/tutorial/application-debugging.md | 2 +- content/fr-FR/docs/tutorial/code-signing.md | 7 +- content/fr-FR/docs/tutorial/dark-mode.md | 8 +- .../fr-FR/docs/tutorial/in-app-purchases.md | 6 +- content/fr-FR/docs/tutorial/installation.md | 2 +- .../launch-app-from-url-in-another-app.md | 46 +- .../docs/tutorial/linux-desktop-actions.md | 2 +- content/fr-FR/docs/tutorial/macos-dock.md | 2 +- content/fr-FR/docs/tutorial/notifications.md | 2 +- content/fr-FR/docs/tutorial/progress-bar.md | 2 +- .../fr-FR/docs/tutorial/represented-file.md | 2 +- content/fr-FR/docs/tutorial/security.md | 75 ++-- content/fr-FR/docs/tutorial/snapcraft.md | 2 +- content/fr-FR/docs/tutorial/support.md | 2 +- content/fr-FR/docs/tutorial/updates.md | 8 +- .../tutorial/using-native-node-modules.md | 4 +- .../tutorial/using-pepper-flash-plugin.md | 2 +- .../tutorial/using-selenium-and-webdriver.md | 2 +- content/fr-FR/docs/tutorial/web-embeds.md | 2 +- content/fr-FR/docs/tutorial/windows-arm.md | 2 +- .../fr-FR/docs/tutorial/windows-taskbar.md | 2 +- content/fr-FR/website/blog/webview2.md | 81 ++++ content/fr-FR/website/i18n/code.json | 52 ++- .../options.json | 14 + .../i18n/docusaurus-theme-classic/footer.json | 34 +- .../i18n/docusaurus-theme-classic/navbar.json | 6 +- content/fr-FR/website/locale.yml | 390 ++++++++--------- content/ja-JP/docs/api/app.md | 60 +-- content/ja-JP/docs/api/auto-updater.md | 2 + content/ja-JP/docs/api/browser-window.md | 306 ++++++------- content/ja-JP/docs/api/clipboard.md | 110 ++--- .../ja-JP/docs/api/command-line-switches.md | 39 +- content/ja-JP/docs/api/dialog.md | 2 - .../ja-JP/docs/api/environment-variables.md | 10 +- content/ja-JP/docs/api/extensions.md | 1 + content/ja-JP/docs/api/frameless-window.md | 37 +- content/ja-JP/docs/api/ipc-main.md | 2 + content/ja-JP/docs/api/menu-item.md | 4 +- content/ja-JP/docs/api/menu.md | 2 +- content/ja-JP/docs/api/power-monitor.md | 4 +- content/ja-JP/docs/api/session.md | 16 +- .../docs/api/structures/overlay-options.md | 4 + .../docs/api/structures/user-default-types.md | 12 + content/ja-JP/docs/api/system-preferences.md | 6 +- content/ja-JP/docs/api/touch-bar-scrubber.md | 2 +- content/ja-JP/docs/api/web-contents.md | 70 +-- content/ja-JP/docs/api/web-frame-main.md | 6 + content/ja-JP/docs/api/web-request.md | 121 ++---- content/ja-JP/docs/api/webview-tag.md | 35 +- content/ja-JP/docs/api/window-open.md | 7 +- content/ja-JP/docs/breaking-changes.md | 66 ++- .../ja-JP/docs/development/pull-requests.md | 1 - .../source-code-directory-structure.md | 2 - .../docs/tutorial/application-debugging.md | 2 +- content/ja-JP/docs/tutorial/code-signing.md | 3 +- content/ja-JP/docs/tutorial/dark-mode.md | 6 +- .../ja-JP/docs/tutorial/in-app-purchases.md | 2 +- content/ja-JP/docs/tutorial/installation.md | 2 +- .../launch-app-from-url-in-another-app.md | 46 +- .../docs/tutorial/linux-desktop-actions.md | 2 +- content/ja-JP/docs/tutorial/macos-dock.md | 2 +- content/ja-JP/docs/tutorial/notifications.md | 2 +- content/ja-JP/docs/tutorial/progress-bar.md | 2 +- .../ja-JP/docs/tutorial/represented-file.md | 2 +- content/ja-JP/docs/tutorial/security.md | 67 +-- content/ja-JP/docs/tutorial/snapcraft.md | 2 +- content/ja-JP/docs/tutorial/support.md | 2 +- content/ja-JP/docs/tutorial/updates.md | 8 +- .../tutorial/using-native-node-modules.md | 4 +- .../tutorial/using-pepper-flash-plugin.md | 2 +- .../tutorial/using-selenium-and-webdriver.md | 2 +- content/ja-JP/docs/tutorial/windows-arm.md | 2 +- .../ja-JP/docs/tutorial/windows-taskbar.md | 2 +- content/ja-JP/website/blog/webview2.md | 81 ++++ content/ja-JP/website/i18n/code.json | 122 +++--- .../options.json | 14 + .../i18n/docusaurus-theme-classic/footer.json | 38 +- .../i18n/docusaurus-theme-classic/navbar.json | 6 +- content/ja-JP/website/locale.yml | 406 ++++++++--------- content/pt-BR/docs/api/app.md | 60 +-- content/pt-BR/docs/api/auto-updater.md | 2 + content/pt-BR/docs/api/browser-window.md | 66 +-- content/pt-BR/docs/api/clipboard.md | 10 +- .../pt-BR/docs/api/command-line-switches.md | 39 +- content/pt-BR/docs/api/dialog.md | 2 - .../pt-BR/docs/api/environment-variables.md | 12 +- content/pt-BR/docs/api/extensions.md | 1 + content/pt-BR/docs/api/frameless-window.md | 37 +- content/pt-BR/docs/api/ipc-main.md | 2 + content/pt-BR/docs/api/menu-item.md | 4 +- content/pt-BR/docs/api/menu.md | 2 +- content/pt-BR/docs/api/power-monitor.md | 4 +- content/pt-BR/docs/api/session.md | 16 +- .../docs/api/structures/overlay-options.md | 4 + .../docs/api/structures/user-default-types.md | 12 + content/pt-BR/docs/api/system-preferences.md | 6 +- content/pt-BR/docs/api/touch-bar-scrubber.md | 2 +- content/pt-BR/docs/api/web-contents.md | 70 +-- content/pt-BR/docs/api/web-frame-main.md | 6 + content/pt-BR/docs/api/web-request.md | 16 +- content/pt-BR/docs/api/webview-tag.md | 35 +- content/pt-BR/docs/api/window-open.md | 7 +- content/pt-BR/docs/breaking-changes.md | 68 ++- .../pt-BR/docs/development/pull-requests.md | 1 - .../source-code-directory-structure.md | 2 - .../docs/tutorial/application-debugging.md | 2 +- content/pt-BR/docs/tutorial/code-signing.md | 3 +- content/pt-BR/docs/tutorial/dark-mode.md | 6 +- .../pt-BR/docs/tutorial/in-app-purchases.md | 2 +- content/pt-BR/docs/tutorial/installation.md | 12 +- .../launch-app-from-url-in-another-app.md | 46 +- .../docs/tutorial/linux-desktop-actions.md | 2 +- content/pt-BR/docs/tutorial/macos-dock.md | 2 +- content/pt-BR/docs/tutorial/notifications.md | 2 +- content/pt-BR/docs/tutorial/progress-bar.md | 2 +- .../pt-BR/docs/tutorial/represented-file.md | 2 +- content/pt-BR/docs/tutorial/security.md | 67 +-- content/pt-BR/docs/tutorial/snapcraft.md | 2 +- content/pt-BR/docs/tutorial/support.md | 2 +- content/pt-BR/docs/tutorial/updates.md | 8 +- .../tutorial/using-native-node-modules.md | 4 +- .../tutorial/using-pepper-flash-plugin.md | 2 +- .../tutorial/using-selenium-and-webdriver.md | 2 +- content/pt-BR/docs/tutorial/web-embeds.md | 2 +- content/pt-BR/docs/tutorial/windows-arm.md | 2 +- .../pt-BR/docs/tutorial/windows-taskbar.md | 2 +- content/pt-BR/website/blog/webview2.md | 81 ++++ content/pt-BR/website/i18n/code.json | 44 +- .../options.json | 14 + .../i18n/docusaurus-theme-classic/footer.json | 36 +- .../i18n/docusaurus-theme-classic/navbar.json | 6 +- content/pt-BR/website/locale.yml | 386 ++++++++--------- content/ru-RU/docs/api/app.md | 96 +---- content/ru-RU/docs/api/auto-updater.md | 2 + content/ru-RU/docs/api/browser-window.md | 280 ++++++------ content/ru-RU/docs/api/clipboard.md | 112 ++--- .../ru-RU/docs/api/command-line-switches.md | 39 +- content/ru-RU/docs/api/dialog.md | 2 - .../ru-RU/docs/api/environment-variables.md | 12 +- content/ru-RU/docs/api/extensions.md | 1 + content/ru-RU/docs/api/frameless-window.md | 41 +- content/ru-RU/docs/api/ipc-main.md | 2 + content/ru-RU/docs/api/menu-item.md | 4 +- content/ru-RU/docs/api/menu.md | 2 +- content/ru-RU/docs/api/power-monitor.md | 4 +- content/ru-RU/docs/api/session.md | 16 +- .../docs/api/structures/overlay-options.md | 4 + .../docs/api/structures/user-default-types.md | 12 + content/ru-RU/docs/api/system-preferences.md | 6 +- content/ru-RU/docs/api/touch-bar-scrubber.md | 2 +- content/ru-RU/docs/api/web-contents.md | 70 +-- content/ru-RU/docs/api/web-frame-main.md | 6 + content/ru-RU/docs/api/web-request.md | 16 +- content/ru-RU/docs/api/webview-tag.md | 35 +- content/ru-RU/docs/api/window-open.md | 7 +- content/ru-RU/docs/breaking-changes.md | 66 ++- .../ru-RU/docs/development/pull-requests.md | 1 - .../source-code-directory-structure.md | 2 - .../docs/tutorial/application-debugging.md | 2 +- content/ru-RU/docs/tutorial/code-signing.md | 15 +- content/ru-RU/docs/tutorial/dark-mode.md | 6 +- .../ru-RU/docs/tutorial/in-app-purchases.md | 2 +- content/ru-RU/docs/tutorial/installation.md | 2 +- .../launch-app-from-url-in-another-app.md | 46 +- .../docs/tutorial/linux-desktop-actions.md | 2 +- content/ru-RU/docs/tutorial/macos-dock.md | 2 +- content/ru-RU/docs/tutorial/notifications.md | 2 +- content/ru-RU/docs/tutorial/progress-bar.md | 2 +- .../ru-RU/docs/tutorial/represented-file.md | 2 +- content/ru-RU/docs/tutorial/security.md | 67 +-- content/ru-RU/docs/tutorial/snapcraft.md | 2 +- content/ru-RU/docs/tutorial/support.md | 2 +- content/ru-RU/docs/tutorial/updates.md | 8 +- .../tutorial/using-native-node-modules.md | 4 +- .../tutorial/using-pepper-flash-plugin.md | 2 +- .../tutorial/using-selenium-and-webdriver.md | 2 +- content/ru-RU/docs/tutorial/web-embeds.md | 2 +- content/ru-RU/docs/tutorial/windows-arm.md | 2 +- .../ru-RU/docs/tutorial/windows-taskbar.md | 2 +- content/ru-RU/website/blog/webview2.md | 81 ++++ content/ru-RU/website/i18n/code.json | 42 +- .../options.json | 14 + .../i18n/docusaurus-theme-classic/footer.json | 34 +- .../i18n/docusaurus-theme-classic/navbar.json | 6 +- content/ru-RU/website/locale.yml | 400 ++++++++--------- content/zh-CN/docs/api/app.md | 74 +--- content/zh-CN/docs/api/auto-updater.md | 2 + content/zh-CN/docs/api/browser-window.md | 300 ++++++------- content/zh-CN/docs/api/clipboard.md | 10 +- .../zh-CN/docs/api/command-line-switches.md | 39 +- content/zh-CN/docs/api/dialog.md | 2 - .../zh-CN/docs/api/environment-variables.md | 12 +- content/zh-CN/docs/api/extensions.md | 1 + content/zh-CN/docs/api/frameless-window.md | 37 +- content/zh-CN/docs/api/ipc-main.md | 2 + content/zh-CN/docs/api/menu-item.md | 4 +- content/zh-CN/docs/api/menu.md | 2 +- content/zh-CN/docs/api/power-monitor.md | 4 +- content/zh-CN/docs/api/session.md | 16 +- .../docs/api/structures/overlay-options.md | 4 + .../docs/api/structures/user-default-types.md | 12 + content/zh-CN/docs/api/system-preferences.md | 6 +- content/zh-CN/docs/api/touch-bar-scrubber.md | 2 +- content/zh-CN/docs/api/web-contents.md | 70 +-- content/zh-CN/docs/api/web-frame-main.md | 18 +- content/zh-CN/docs/api/web-request.md | 16 +- content/zh-CN/docs/api/webview-tag.md | 35 +- content/zh-CN/docs/api/window-open.md | 15 +- content/zh-CN/docs/breaking-changes.md | 246 ++++++----- .../zh-CN/docs/development/pull-requests.md | 5 +- .../source-code-directory-structure.md | 2 - .../docs/tutorial/application-debugging.md | 2 +- content/zh-CN/docs/tutorial/code-signing.md | 3 +- content/zh-CN/docs/tutorial/dark-mode.md | 6 +- .../zh-CN/docs/tutorial/in-app-purchases.md | 2 +- content/zh-CN/docs/tutorial/installation.md | 2 +- .../launch-app-from-url-in-another-app.md | 104 +++-- .../docs/tutorial/linux-desktop-actions.md | 2 +- content/zh-CN/docs/tutorial/macos-dock.md | 2 +- content/zh-CN/docs/tutorial/notifications.md | 2 +- content/zh-CN/docs/tutorial/progress-bar.md | 2 +- .../zh-CN/docs/tutorial/represented-file.md | 2 +- content/zh-CN/docs/tutorial/security.md | 67 +-- content/zh-CN/docs/tutorial/snapcraft.md | 2 +- content/zh-CN/docs/tutorial/support.md | 2 +- content/zh-CN/docs/tutorial/updates.md | 8 +- .../tutorial/using-native-node-modules.md | 6 +- .../tutorial/using-pepper-flash-plugin.md | 2 +- .../tutorial/using-selenium-and-webdriver.md | 2 +- content/zh-CN/docs/tutorial/web-embeds.md | 2 +- content/zh-CN/docs/tutorial/windows-arm.md | 2 +- .../zh-CN/docs/tutorial/windows-taskbar.md | 2 +- content/zh-CN/website/blog/webview2.md | 81 ++++ content/zh-CN/website/i18n/code.json | 122 +++--- .../options.json | 14 + .../i18n/docusaurus-theme-classic/footer.json | 36 +- .../i18n/docusaurus-theme-classic/navbar.json | 6 +- content/zh-CN/website/locale.yml | 408 +++++++++--------- 370 files changed, 6338 insertions(+), 4953 deletions(-) create mode 100644 content/de-DE/docs/api/structures/overlay-options.md create mode 100644 content/de-DE/docs/api/structures/user-default-types.md create mode 100644 content/de-DE/website/blog/webview2.md create mode 100644 content/de-DE/website/i18n/docusaurus-plugin-content-blog/options.json create mode 100644 content/es-ES/docs/api/structures/overlay-options.md create mode 100644 content/es-ES/docs/api/structures/user-default-types.md create mode 100644 content/es-ES/website/blog/webview2.md create mode 100644 content/es-ES/website/i18n/docusaurus-plugin-content-blog/options.json create mode 100644 content/fr-FR/docs/api/structures/overlay-options.md create mode 100644 content/fr-FR/docs/api/structures/user-default-types.md create mode 100644 content/fr-FR/website/blog/webview2.md create mode 100644 content/fr-FR/website/i18n/docusaurus-plugin-content-blog/options.json create mode 100644 content/ja-JP/docs/api/structures/overlay-options.md create mode 100644 content/ja-JP/docs/api/structures/user-default-types.md create mode 100644 content/ja-JP/website/blog/webview2.md create mode 100644 content/ja-JP/website/i18n/docusaurus-plugin-content-blog/options.json create mode 100644 content/pt-BR/docs/api/structures/overlay-options.md create mode 100644 content/pt-BR/docs/api/structures/user-default-types.md create mode 100644 content/pt-BR/website/blog/webview2.md create mode 100644 content/pt-BR/website/i18n/docusaurus-plugin-content-blog/options.json create mode 100644 content/ru-RU/docs/api/structures/overlay-options.md create mode 100644 content/ru-RU/docs/api/structures/user-default-types.md create mode 100644 content/ru-RU/website/blog/webview2.md create mode 100644 content/ru-RU/website/i18n/docusaurus-plugin-content-blog/options.json create mode 100644 content/zh-CN/docs/api/structures/overlay-options.md create mode 100644 content/zh-CN/docs/api/structures/user-default-types.md create mode 100644 content/zh-CN/website/blog/webview2.md create mode 100644 content/zh-CN/website/i18n/docusaurus-plugin-content-blog/options.json diff --git a/content/de-DE/docs/api/app.md b/content/de-DE/docs/api/app.md index 56f2e46c67561..0e9bf18c44d72 100644 --- a/content/de-DE/docs/api/app.md +++ b/content/de-DE/docs/api/app.md @@ -91,11 +91,9 @@ In Windows musst du `process.argv` (im Main-Prozess) parsen, um den Dateipfad zu Kehrt zurück: * `event` Event -* ` URL Zeichenfolge - +* `url` String -

Wird ausgelöst wenn der Nutzer versucht, eine URL mit der App zu öffnen. Your application's -Info.plist` file must define the URL scheme within the `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`.

+Wird ausgelöst wenn der Nutzer versucht, eine URL mit der App zu öffnen. Your application's `Info.plist` file must define the URL scheme within the `CFBundleURLTypes` key, and set `NSPrincipalClass` to `AtomApplication`. Du musst `event.preventDefault()` aufrufen um dieses Event selbst zu nutzen. @@ -217,8 +215,8 @@ Kehrt zurück: * `event` Event * `webContents` [WebContents](web-contents.md) -* ` URL Zeichenfolge -
  • error` String - Der error code +* `url` String +* `error` String - Der error code * `certificate` [Certificate](structures/certificate.md) * `callback` Function * `isTrusted` Boolean - Gibt an ob das Zertifikat als vertrauenswürdig angesehen werden soll @@ -422,54 +420,6 @@ Kehrt zurück: Emitted when `desktopCapturer.getSources()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will make it return empty sources. -### Event: 'remote-require' _Deprecated_ - -Kehrt zurück: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -Emitted when `remote.require()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the module from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - -### Event: 'remote-get-global' _Deprecated_ - -Kehrt zurück: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `globalName` String - -Emitted when `remote.getGlobal()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the global from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - -### Event: 'remote-get-builtin' _Deprecated_ - -Kehrt zurück: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -Emitted when `remote.getBuiltin()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the module from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - -### Event: 'remote-get-current-window' _Deprecated_ - -Kehrt zurück: - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -Emitted when `remote.getCurrentWindow()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the object from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - -### Event: 'remote-get-current-web-contents' _Deprecated_ - -Kehrt zurück: - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -Emitted when `remote.getCurrentWebContents()` is called in the renderer process of `webContents`. Calling `event.preventDefault()` will prevent the object from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - ## Methoden Das `app` Objekt enthält die folgenden Methoden: @@ -983,7 +933,7 @@ Sets the counter badge for current app. Setting the count to `0` will hide the b On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher. -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**Note:** Unity launcher requires a `.desktop` file to work. For more information, please read the [Unity integration documentation][unity-requirement]. ### `app.getBadgeCount()` _Linux_ _macOS_ @@ -1185,7 +1135,7 @@ An `Integer` property that returns the badge count for current app. Setting the On macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher. -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**Note:** Unity launcher requires a `.desktop` file to work. For more information, please read the [Unity integration documentation][unity-requirement]. **Note:** On macOS, you need to ensure that your application has the permission to display notifications for this property to take effect. @@ -1213,12 +1163,6 @@ A `String` which is the user agent string Electron will use as a global fallback This is the user agent that will be used when no user agent is set at the `webContents` or `session` level. It is useful for ensuring that your entire app has the same user agent. Set to a custom value as early as possible in your app's initialization to ensure that your overridden value is used. -### `app.allowRendererProcessReuse` - -A `Boolean` which when `true` disables the overrides that Electron has in place to ensure renderer processes are restarted on every navigation. The current default value for this property is `true`. - -The intention is for these overrides to become disabled by default and then at some point in the future this property will be removed. This property impacts which native modules you can use in the renderer process. For more information on the direction Electron is going with renderer process restarts and usage of native modules in the renderer process please check out this [Tracking Issue](https://github.com/electron/electron/issues/18397). - ### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ A `Boolean` which when `true` indicates that the app is currently running under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)). @@ -1233,7 +1177,7 @@ You can use this property to prompt users to download the arm64 version of your [LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType -[unity-requirement]: ../tutorial/desktop-environment-integration.md#unity-launcher +[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher [mas-builds]: ../tutorial/mac-app-store-submission-guide.md [Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows [JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx diff --git a/content/de-DE/docs/api/auto-updater.md b/content/de-DE/docs/api/auto-updater.md index df5dcef39e115..af67e7abf504c 100644 --- a/content/de-DE/docs/api/auto-updater.md +++ b/content/de-DE/docs/api/auto-updater.md @@ -16,102 +16,88 @@ Außerdem gibt es auf jeder Plattform einige subtile Unterschiede: ### macOS -Unter MacOS basiert das `autoUpdater` Modul auf [ Squirrel.Mac][squirrel-mac], was bedeutet daß keine spezifische Konfiguration vonnöten ist. Für serverseitige Anforderungen können Sie [Serverunterstützung][server-support] lesen. Beachten Sie, dass - - App-Transportsicherheit (ATS) für alle Anforderungen gilt, die im Rahmen des Aktualisierungsprozesses vorgenommen werden. Apps, die ATS deaktivieren müssen, können den Schlüssel ` NSAllowsArbitraryLoads zu ihrer App hinzufügen - .

    - -

    Notiz: Eine App muss zuerst signiert werden, um automatisch auf macOS updatet zu werden. -Dies ist eine Voraussetzung von Squirrel.Mac`.

    - +Unter MacOS basiert das `autoUpdater` Modul auf [ Squirrel.Mac][squirrel-mac], was bedeutet daß keine spezifische Konfiguration vonnöten ist. Für serverseitige Anforderungen können Sie [Serverunterstützung][server-support] lesen. Beachten Sie, dass [App-Transportsicherheit](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW35) (ATS) für alle Anforderungen gilt, die im Rahmen des Aktualisierungsprozesses vorgenommen werden. Apps, die ATS deaktivieren müssen, können den Schlüssel `NSAllowsArbitraryLoads` zu ihrer App hinzufügen. +**Notiz**: Eine App muss zuerst signiert werden, um automatisch auf macOS updatet zu werden. Dies ist eine Voraussetzung von `Squirrel.Mac`. ### Windows Unter Windows muss die App zuerst auf dem Gerät des Benutzers installiert werden, bevor `autoUpdater` genutzt werden kann. Deswegen wird empfohlen [electron-winstaller][installer-lib], [electron-forge][electron-forge-lib] oder [grunt-electron-installer][installer] zu verwenden, um einen Installer zu generieren. -Bei der Benutzung von [electron-winstaller][installer-lib] oder [electron-forge][electron-forge-lib] ist zu Beachten, dass die App nicht versucht, sich selbst zu update, wenn sie [zum Ersten mal ausgeführt wird](https://github.com/electron/windows-installer#handling-squirrel-events) (Weitere Informationen in diesem [issue](https://github.com/electron/electron/issues/7155)). Es wird auch empfohlen, electron-squirrel-startup zu verwenden, um Desktop-Verknüpfungen für Ihre App zu erhalten.

    +Bei der Benutzung von [electron-winstaller][installer-lib] oder [electron-forge][electron-forge-lib] ist zu Beachten, dass die App nicht versucht, sich selbst zu update, wenn sie [zum Ersten mal ausgeführt wird](https://github.com/electron/windows-installer#handling-squirrel-events) (Weitere Informationen in diesem [issue](https://github.com/electron/electron/issues/7155)). Es wird auch empfohlen, [electron-squirrel-startup](https://github.com/mongodb-js/electron-squirrel-startup) zu verwenden, um Desktop-Verknüpfungen für Ihre App zu erhalten. -Der Squirrel-Installer wird eine Desktop-Verknüpfung erstellen mit der [Application User Model ID][app-user-model-id] im Format `com.squirrel.PACKAGE_ID.YOUR_EXE_WITHOUT_DOT_EXE`, zum Beispiel: `com.squirrel.slack.Slack` oder `com.squirrel.code.Code`. Sie müssen dieselbe ID für Ihre App mit der ` app.setAppUserModelId API verwenden , da Windows sonst Ihre App nicht ordnungsgemäß in der Taskleiste anheften kann .

    +Der Squirrel-Installer wird eine Desktop-Verknüpfung erstellen mit der [Application User Model ID][app-user-model-id] im Format `com.squirrel.PACKAGE_ID.YOUR_EXE_WITHOUT_DOT_EXE`, zum Beispiel: `com.squirrel.slack.Slack` oder `com.squirrel.code.Code`. Sie müssen dieselbe ID für Ihre App mit der `app.setAppUserModelId` API verwenden, da Windows sonst Ihre App nicht ordnungsgemäß in der Taskleiste anheften kann. -

    Im Gegensatz zu Squirrel.Mac kann Windows Updates auf S3 oder einem anderen statischen Dateihost hosten. -Weitere Informationen können in der Dokumentation von Squirrel.Windows gefunden werden.

    +Im Gegensatz zu Squirrel.Mac kann Windows Updates auf S3 oder einem anderen statischen Dateihost hosten. Weitere Informationen können in der Dokumentation von [Squirrel.Windows][squirrel-windows] gefunden werden. -

    Ereignisse

    +## Ereignisse -

    Das autoUpdater -Objekt gibt die folgenden Ereignisse aus:

    +Das `autoUpdater` - Object gibt die folgenden Ereignisse aus: -

    Ereignis : "Fehler

    +### Event: 'error' -

    Kehrt zurück:

    +Kehrt zurück: -
      -
    • Fehler Fehler
    • -
    +* `error` Fehler -

    Wird gesendet, wenn beim Aktualisieren ein Fehler auftritt.

    +Wird gesendet, wenn beim Aktualisieren ein Fehler auftritt. -

    Ereignis : "Nach Updates suchen"

    +### Ereignis : "Nach Updates suchen" -

    Wird gesendet, wenn geprüft wird, ob ein Update gestartet wurde.

    +Wird gesendet, wenn geprüft wird, ob ein Update gestartet wurde. -

    Ereignis : 'Update-verfügbar'

    +### Ereignis : 'Update-verfügbar' -

    Wird ausgelöst, wenn ein Update verfügbar ist. Das Update wird -automatisch heruntergeladen.

    +Wird ausgelöst, wenn ein Update verfügbar ist. Das Update wird automatisch heruntergeladen. -

    Ereignis : "Update nicht verfügbar"

    +### Ereignis : "Update nicht verfügbar" -

    Wird gesendet, wenn kein Update verfügbar ist.

    +Wird gesendet, wenn kein Update verfügbar ist. -

    Ereignis : 'Update-Download'

    +### Ereignis : 'Update-Download' -

    Kehrt zurück:

    +Kehrt zurück: -
      -
    • event` Event
    • +* `event` Event +* `releaseNotes` String +* `releaseName` String +* `releaseDate` Date +* `updateURL` String -* ` Release Notes String -
    • releaseName String
    • -
    • releaseDate Datum
    • -
    • updateURL String
    • -
    +Wird gesendet, wenn ein Update heruntergeladen wurde. -

    Wird gesendet, wenn ein Update heruntergeladen wurde.

    +Unter Windows ist nur `releaseName` verfügbar. -

    Unter Windows ist nur releaseName verfügbar.

    +**Hinweis:** Es ist nicht unbedingt notwendig, dieses Ereignis zu behandeln. Ein fehlerfreie Heruntergeladenes Update wird automatisch übernommen, wenn die App das nächste mal gestartet wird. -

    Hinweis: Es ist nicht unbedingt notwendig, dieses Ereignis zu behandeln. Ein fehlerfreie Heruntergeladenes Update wird automatisch übernommen, wenn die App das nächste mal gestartet wird.

    +### Ereignis: 'before-quit-for-update' -

    Ereignis: 'before-quit-for-update'

    +Dieses Event wird ausgelöst, wenn die Funktion `quitAndInstall()` aufgerufen wird. -

    Dieses Event wird ausgelöst, wenn die Funktion quitAndInstall()` aufgerufen wird.

    - Das `before-quit` Event wird erst ausgelöst nachdem alle Fenster geschlossen sind. Daher sollten Sie Aktionen, die Sie vor dem Beenden Ihrer Anwendung ausführen möchten, sowohl in diesem Event als auch im `before-quit` Event einbauen. - - +Das `before-quit` Event wird erst ausgelöst nachdem alle Fenster geschlossen sind. Daher sollten Sie Aktionen, die Sie vor dem Beenden Ihrer Anwendung ausführen möchten, sowohl in diesem Event als auch im `before-quit` Event einbauen. ## Methoden -Das Objekt ` autoUpdater verfügt über die folgenden Methoden:

    +Das Objekt `autoUpdater` verfügt über die folgenden Methoden: -

    autoUpdater.setFeedURL(optionen)`

    +### `autoUpdater.setFeedURL(optionen)` -* `options` Objekt - * ` URL Zeichenfolge
  • -
  • headers` Record (optional) _macOS_ - HTTP-Anfrage-Header. +* `options` Objekt + * `url` String + * `headers` Record (optional) _macOS_ - HTTP-Anfrage-Header. * `serverType` String (optional) _macOS_ - Kann `json` oder `default` sein, siehe dazu [Squirrel.Mac][squirrel-mac] README für weitere informationen. -Setzt die ` URL und initialisiert den automatischen Updater.

    +Setzt die `url` und initialisiert den automatischen Updater. -

    autoUpdater.getFeedURL ()`

    +### `autoUpdater.getFeedURL()` -Gibt ` String zurück - Die aktuelle URL des Aktualisierungsfeeds.

    +Gibt `String` - Die aktuelle URL des Aktualisierungsfeeds. -

    autoUpdater.checkForUpdates ()`

    +### `autoUpdater.checkForUpdates()` Fragt den Server, ob es ein Update gibt. Es muss zuerst `setFeedURL` aufrufen werden, bevor diese API verwendet werden kann. - +**Note:** If an update is available it will be downloaded automatically. Calling `autoUpdater.checkForUpdates()` twice will download the update two times. ### `autoUpdater.quitAndInstall()` @@ -125,6 +111,7 @@ Unter der Haube schließt `autoUpdater.quitAndInstall()` zuerst alle Fenster und [squirrel-mac]: https://github.com/Squirrel/Squirrel.Mac [server-support]: https://github.com/Squirrel/Squirrel.Mac#server-support +[squirrel-windows]: https://github.com/Squirrel/Squirrel.Windows [installer]: https://github.com/electron/grunt-electron-installer [installer-lib]: https://github.com/electron/windows-installer [electron-forge-lib]: https://github.com/electron-userland/electron-forge diff --git a/content/de-DE/docs/api/browser-window.md b/content/de-DE/docs/api/browser-window.md index 3308eb656a199..3a59a5db864e3 100644 --- a/content/de-DE/docs/api/browser-window.md +++ b/content/de-DE/docs/api/browser-window.md @@ -14,7 +14,7 @@ const win = new BrowserWindow({ width: 800, height: 600 }) win.loadURL('https://github.com') // Or load a local HTML file -win.loadURL(`file://${__dirname}/app/index.html`) +win.loadFile('index.html') ``` ## Rahmenloses Fenster @@ -143,7 +143,7 @@ Es erzeugt ein neues `BrowserWindow` mit nativen Eigenschaften die durch `option * `frame` Boolean (optional) - Geben Sie `false` an, um ein [Frameless Window](frameless-window.md)zu erstellen. Standard ist `true`. * `parent` BrowserWindow (optional) - Geben Sie das übergeordnete Fenster an. Standard ist `null`. * `modal` Boolean (optional) - Gibt an, ob es das Fenster ein modales Fenster sein soll. Diese Funktion funktioniert nur, wenn das Fenster ein untergeordnetes Fenster ist. Standard ist `false`. - * `acceptFirstMouse` Boolean (optional) - Gibt an, ob die Webansicht ein einzelnes Maus-Down-Ereignis akzeptiert, das gleichzeitig das Fenster aktiviert. Standard ist `false`. + * `acceptFirstMouse` Boolean (optional) - Whether clicking an inactive window will also click through to the web contents. Default is `false` on macOS. This option is not configurable on other platforms. * `disableAutoHideCursor` Boolean (optional) - Ob der Cursor ausgeblendet werden soll, wenn der Benutzer tippt. Standard ist `false`. * `autoHideMenuBar` Boolean (optional) - Blendet die Menüleiste automatisch aus, es sei denn, die `Alt` Taste wird gedrückt. Standard ist `false`. * `enableLargerThanScreen` Boolean (optional) - Dieser Wert gibt an, ob das Fenster größer als der Bildschirm sein kann. Nur relevant für macOS, da andere Betriebssysteme standardmäßig Fenster erlauben, die größer als der Bildschirm sind. Standard ist `false`. @@ -157,11 +157,11 @@ Es erzeugt ein neues `BrowserWindow` mit nativen Eigenschaften die durch `option * `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default. * `active` - The backdrop should always appear active. * `inactive` - The backdrop should always appear inactive. - * `titleBarStyle` String (optional) - The style of window title bar. Standard ist `default`. Mögliche Werte sind: - * `default` - Resultiert in der opaken, grauen Standardfenstertitelleiste von Mac. - * `hidden` - Resultiert in einer versteckten Titelleiste und einem Fenster mit voller Inhaltsgröße. Das Fenster hat noch immer die standardmäßigen Steuerelemente ("Ampelleuchten") in der oberen linken Ecke. - * `hiddenInset` - Resultiert in einer versteckten Titelleiste mit einem alternativem Aussehen, bei dem die Ampelleuchten Buttons vom Fensterrand etwas weiter nach innen gerückt wurden. - * `customButtonsOnHover` - Results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. **Note:** This option is currently experimental. + * `titleBarStyle` String (optional) _macOS_ _Windows_ - The style of window title bar. Standard ist `default`. Mögliche Werte sind: + * `default` - Results in the standard title bar for macOS or Windows respectively. + * `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown. + * `hiddenInset` - Only on macOS, results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge. + * `customButtonsOnHover` - Only on macOS, results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. **Note:** This option is currently experimental. * `trafficLightPosition` [Point](structures/point.md) (optional) - Set a custom position for the traffic light buttons in frameless windows. * `roundedCorners` Boolean (optional) - Whether frameless window should have rounded corners on macOS. Standard ist `true`. * `fullscreenWindowTitle` Boolean (optional) _Deprecated_ - Shows the title in the title bar in full screen mode on macOS for `hiddenInset` titleBarStyle. Standard ist `false`. @@ -176,10 +176,8 @@ Es erzeugt ein neues `BrowserWindow` mit nativen Eigenschaften die durch `option * `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 use `process.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 [dieses Beispiel](context-bridge.md#exposing-node-global-symbols). * `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 wie `nodeIntegration`, da die APIs die dem Preload Skript zur Verfügung stehen stärker limitiert sind. Lesen sie [hier](../tutorial/sandbox.md) mehr über diese Option. - * `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module. Standard ist `false`. * `session` [Session](session.md#class-session) (optional) - Sets the session used by the page. Instead of passing the Session object directly, you can also choose to use the `partition` option instead, which accepts a partition string. When both `session` and `partition` are provided, `session` will be preferred. Default is the default session. * `partition` String (optional) - Sets the session used by the page according to the session's partition string. If `partition` starts 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. Default is the default session. - * `affinity` String (optional) - When specified, web pages with the same `affinity` will run in the same renderer process. Note that due to reusing the renderer process, certain `webPreferences` options will also be shared between the web pages even when you specified different values for them, including but not limited to `preload`, `sandbox` and `nodeIntegration`. So it is suggested to use exact same `webPreferences` for web pages with the same `affinity`. _Deprecated_ * `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents `300%`. Standard ist `1.0`. * `javascript` Boolean (optional) - Enables JavaScript support. Standard ist `true`. * `webSecurity` Boolean (optional) - When `false`, it will disable the same-origin policy (usually using testing websites by people), and set `allowRunningInsecureContent` to `true` if this options has not been set by user. Standard ist `true`. @@ -206,8 +204,7 @@ Es erzeugt ein neues `BrowserWindow` mit nativen Eigenschaften die durch `option * `backgroundThrottling` Boolean (optional) - Whether to throttle animations and timers when the page becomes background. This also affects the [Page Visibility API](#page-visibility). Defaults to `true`. * `offscreen` Boolean (optional) - Whether to enable offscreen rendering for the browser window. Defaults to `false`. See the [offscreen rendering tutorial](../tutorial/offscreen-rendering.md) for more details. * `contextIsolation` Boolean (optional) - Whether to run Electron APIs and the specified `preload` script in a separate JavaScript context. Defaults to `true`. The context that the `preload` script runs in will only have access to its own dedicated `document` and `window` 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 the `preload` 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 the `preload` script and any Electron APIs being used. This option uses the same technique used by [Chrome Content Scripts][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. - * `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values can't unsafely cross between worlds when using `contextIsolation`. Defaults to `true`. _Deprecated_ - * `nativeWindowOpen` Boolean (optional) - Whether to use native `window.open()`. Defaults to `false`. Child windows will always have node integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently experimental. + * `nativeWindowOpen` Boolean (optional) - Whether to use native `window.open()`. Defaults to `false`. Child windows will always have node integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** The default value will be changing to `true` in Electron 15. * `webviewTag` Boolean (optional) - Whether to enable the [`` tag](webview-tag.md). Defaults to `false`. **Note:** The `preload` script configured for the `` will have node integration enabled when it is executed so you should ensure remote/untrusted content is not able to create a `` tag with a possibly malicious `preload` script. You can use the `will-attach-webview` event on [webContents](web-contents.md) to strip away the `preload` script and to validate or alter the ``'s initial settings. * `additionalArguments` String[] (optional) - A list of strings that will be appended to `process.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 ist `false`. @@ -225,6 +222,7 @@ Es erzeugt ein neues `BrowserWindow` mit nativen Eigenschaften die durch `option * `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation * `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager. Default policy is `code`. * `enablePreferredSizeMode` Boolean (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 the `preferred-size-changed` event to be emitted on the `WebContents` when the preferred size changes. Standard ist `false`. + * `titleBarOverlay` [OverlayOptions](structures/overlay-options.md) | Boolean (optional) - When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Standard ist `false`. On Windows, the [OverlayOptions](structures/overlay-options.md) can be used instead of a boolean to specify colors for the overlay. When setting minimum or maximum window size with `minWidth`/`maxWidth`/ `minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from passing a size that does not follow size constraints to `setBounds`/`setSize` or to the constructor of `BrowserWindow`. @@ -544,6 +542,10 @@ A `Boolean` property that determines whether the window is in simple (pre-Lion) A `Boolean` property that determines whether the window is in fullscreen mode. +#### `win.focusable` _Windows_ _macOS_ + +A `Boolean` property that determines whether the window is focusable. + #### `win.visibleOnAllWorkspaces` A `Boolean` property that determines whether the window is visible on all workspaces. @@ -1100,15 +1102,15 @@ Captures a snapshot of the page within `rect`. Omitting `rect` will capture the #### `win.loadURL(url[, options])` -* ` URL Zeichenfolge
  • -
  • options` Object (optional) +* `url` String +* `options` Object (optional) * `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL. * `userAgent` String (optional) - A user agent originating the request. * `extraHeaders` String (optional) - Extra headers separated by "\n" * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional) * `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Gibt `Promise` zurück - das Versprechen wird aufgelöst, wenn die Seite das Laden beendet hat (siehe [`did-finish-load`](web-contents.md#event-did-finish-load)), und lehnt ab, wenn die Seite nicht geladen wird (siehe [`did-fail-load`](web-contents.md#event-did-fail-load)). Same as [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options). @@ -1146,7 +1148,7 @@ win.loadURL('http://localhost:8000/post', { * `search` String (optional) - Passed to `url.format()`. * `hash` String (optional) - Passed to `url.format()`. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Gibt `Promise` zurück - das Versprechen wird aufgelöst, wenn die Seite das Laden beendet hat (siehe [`did-finish-load`](web-contents.md#event-did-finish-load)), und lehnt ab, wenn die Seite nicht geladen wird (siehe [`did-fail-load`](web-contents.md#event-did-fail-load)). Same as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information. @@ -1221,22 +1223,22 @@ Add a thumbnail toolbar with a specified set of buttons to the thumbnail image o The number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform's limitation. But you can call the API with an empty array to clean the buttons. -The `buttons` is an array of `Button` objects: +`buttons` ist ein Array mit `Button` Objekten: * `Button` Object - * `icon` [NativeImage](native-image.md) - The icon showing in thumbnail toolbar. - * `click` Function - * `tooltip` String (optional) - The text of the button's tooltip. - * `flags` String[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`. + * ` Icon ` [ NativeImage ](native-image.md)-das Symbol zeigt in Thumbnail Leiste. + * ` Klicken Sie auf ` Funktion + * ` Tooltip ` String (optional)-der Text der Tooltip der Schaltfläche. + * `flags` String[] (optional) - Kontrollieren Sie bestimmte Zustände und Verhaltensweisen des Buttons. Standardmäßig ist es `['enabled']`. -The `flags` is an array that can include following `String`s: +Die ` Flags ` ist ein Array, das folgende ` Zeichenfolge ` s enthalten kann: -* `enabled` - The button is active and available to the user. -* `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action. -* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately. -* `nobackground` - Do not draw a button border, use only the image. -* `hidden` - The button is not shown to the user. -* `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification. +* ` Enabled `-die Schaltfläche ist aktiv und für den Benutzer verfügbar. +* `disabled` - Der Button ist deaktiviert. Er ist vorhanden, zeigt aber visuell, dass er nicht auf Nutzeraktionen reagiert. +* ` dismissonclick `-wenn auf die Schaltfläche geklickt wird, wird das Thumbnail-Fenster geschlossen sofort. +* ` nobackground `-zeichnen Sie keinen Schaltflächenrahmen, sondern verwenden Sie nur das Bild. +* ` Hidden `-die Schaltfläche wird dem Benutzer nicht angezeigt. +* `noninteractive` - Der Button ist aktiviert aber nicht interaktiv. Es wird kein gedrückter Button angezeigt. Dieser Wert ist für Instanzen bestimmt, in denen der Button in einer Benachrichtigung verwendet wird. #### `win.setThumbnailClip(region)` _Windows_ @@ -1344,6 +1346,10 @@ Changes whether the window can be focused. On macOS it does not remove the focus from the window. +#### `win.isFocusable()` _macOS_ _Windows_ + +Returns whether the window can be focused. + #### `win.setParentWindow(parent)` * `parent` BrowserWindow | null @@ -1453,3 +1459,5 @@ Returns `BrowserView[]` - an array of all BrowserViews that have been attached w [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/de-DE/docs/api/clipboard.md b/content/de-DE/docs/api/clipboard.md index 0b213fbe6f965..c1b4043e39140 100644 --- a/content/de-DE/docs/api/clipboard.md +++ b/content/de-DE/docs/api/clipboard.md @@ -1,10 +1,10 @@ # clipboard -> Perform copy and paste operations on the system clipboard. +> Ausführung von Kopier- und Einfüge-Operationen von der Zwischenablage des Betriebssystems. -Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) +Prozess: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) -On Linux, there is also a `selection` clipboard. To manipulate it you need to pass `selection` to each method: +Unter Linux gibt es auch eine `selection` Zwischenablage. Zum Bearbeiten müssen Sie `selection` an jede Methode übergeben: ```javascript const { clipboard } = require('electron') @@ -15,15 +15,15 @@ console.log(clipboard.readText('selection')) ## Methoden -The `clipboard` module has the following methods: +Das `clipboard` Modul besitzt die folgenden Methoden: -**Note:** Experimental APIs are marked as such and could be removed in future. +**Notiz:** Experimentelle Schnittstellen sind mit "Experimentell" markiert und könnten in der Zukunft wegfallen. ### `clipboard.readText([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Returns `String` - The content in the clipboard as plain text. +Gibt einen `String` zurück - Der Inhalt der Zwischenablage liegt in Klartext vor. ```js const { clipboard } = require('electron') @@ -38,9 +38,9 @@ console.log(text) ### `clipboard.writeText(text[, type])` * `text` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Writes the `text` into the clipboard as plain text. +Schreibt den `text` als Klartext in die Zwischenablage. ```js const { clipboard } = require('electron') @@ -51,9 +51,9 @@ clipboard.writeText(text) ### `clipboard.readHTML([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Returns `String` - The content in the clipboard as markup. +Gibt einen `String` zurück - Der Inhalt der Zwischenablage liegt in Auszeichnungssprache (markup language) vor. ```js const { clipboard } = require('electron') @@ -68,9 +68,9 @@ console.log(html) ### `clipboard.writeHTML(markup[, type])` * `markup` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Writes `markup` to the clipboard. +Schreibt `markup` in die Zwischenablage. ```js const { clipboard } = require('electron') @@ -80,22 +80,22 @@ clipboard.writeHTML('Hi Zeichenfolge
  • - +* `url` String -

    Returns an Object containing title` and `url` keys representing the bookmark in the clipboard. The `title` and `url` values will be empty strings when the bookmark is unavailable.

    +Gibt ein Objekt, dass die Keys `title` und `url` enthält zurück. Diese Keys repräsentieren das Lesezeichen in der Zwischenablage. Wenn das Lesezeichen nicht verfügbar ist, sind die Werte `title` und `url` leer. ### `clipboard.writeBookmark(title, url[, type])` _macOS_ _Windows_ * `title` String -* ` URL Zeichenfolge -
  • type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `url` String +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Writes the `title` and `url` into the clipboard as a bookmark. +Schreibt den `title` und die `url` als Lesezeichen in die Zwischenablage. -**Note:** Most apps on Windows don't support pasting bookmarks into them so you can use `clipboard.write` to write both a bookmark and fallback text to the clipboard. +**Hinweis:** Die meisten Apps unter Windows unterstützen das Einfügen von Lesezeichen nicht in sie, sodass Sie `clipboard.write` verwenden können, um sowohl ein Lesezeichen als auch einen Fallbacktext in die Zwischenablage zu schreiben. ```js const { clipboard } = require('electron') @@ -164,15 +163,15 @@ Writes the `text` into the find pasteboard (the pasteboard that holds informatio ### `clipboard.clear([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Clears the clipboard content. +Löscht den Inhalt aus der Zwischenablage. ### `clipboard.availableFormats([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Returns `String[]` - An array of supported formats for the clipboard `type`. +Gibt ein `String[]` zurück - Ein Array mit allen von der Zwischenablage unterstützten Formattypen `type`. ```js const { clipboard } = require('electron') @@ -182,58 +181,60 @@ console.log(formats) // [ 'text/plain', 'text/html' ] ``` -### `clipboard.has(format[, type])` _Experimental_ +### `clipboard.has(format[, type])` _Experimentell_ * `format` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Returns `Boolean` - Whether the clipboard supports the specified `format`. +Gibt einen `Boolean` zurück - Prüft, ob die Zwischenablage das angegebene `format` unterstützt. ```js const { clipboard } = require('electron') const hasFormat = clipboard.has('

    selection

    ') console.log(hasFormat) -// 'true' or 'false +// 'true' or 'false' ``` -### `clipboard.read(format)` _Experimental_ +### `clipboard.read(format)` _Experimentell_ * `format` String -Returns `String` - Reads `format` type from the clipboard. +Gibt den `String` zurück - Liest den `format` Typ von der Zwischenablage. -### `clipboard.readBuffer(format)` _Experimental_ +`format` should contain valid ASCII characters and have `/` separator. `a/c`, `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid. + +### `clipboard.readBuffer(format)` _Experimentell_ * `format` String -Returns `Buffer` - Reads `format` type from the clipboard. +Gibt den `Buffer` zurück - Liest den `format` Typ von der Zwischenablage. ```js const { clipboard } = require('electron') const buffer = Buffer.from('this is binary', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) -const ret = clipboard.readBuffer('public.utf8-plain-text') +const ret = clipboard.readBuffer('public/utf8-plain-text') console.log(buffer.equals(out)) // true ``` -### `clipboard.writeBuffer(format, buffer[, type])` _Experimental_ +### `clipboard.writeBuffer(format, buffer[, type])` _Experimentell_ * `format` String -* `buffer` Buffer -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `buffer` Puffer +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Writes the `buffer` into the clipboard as `format`. +Schreibt den `buffer` mit dem angegebenen `format` in die Zwischenablage. ```js const { clipboard } = require('electron') const buffer = Buffer.from('writeBuffer', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) ``` ### `clipboard.write(data[, type])` @@ -244,9 +245,9 @@ clipboard.writeBuffer('public.utf8-plain-text', buffer) * `image` [NativeImage](native-image.md) (optional) * `rtf` String (optional) * `bookmark` String (optional) - The title of the URL at `text`. -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` ist nur unter Linux verfügbar. -Writes `data` to the clipboard. +Schreibt `data` in die Zwischenablage. ```js const { clipboard } = require('electron') diff --git a/content/de-DE/docs/api/command-line-switches.md b/content/de-DE/docs/api/command-line-switches.md index c684722494423..656793fc73fec 100644 --- a/content/de-DE/docs/api/command-line-switches.md +++ b/content/de-DE/docs/api/command-line-switches.md @@ -59,17 +59,18 @@ Forces the maximum disk space to be used by the disk cache, in bytes. Enables caller stack logging for the following APIs (filtering events): * `desktopCapturer.getSources()` / `desktop-capturer-get-sources` -* `remote.require()` / `remote-require` -* `remote.getGlobal()` / `remote-get-builtin` -* `remote.getBuiltin()` / `remote-get-global` -* `remote.getCurrentWindow()` / `remote-get-current-window` -* `remote.getCurrentWebContents()` / `remote-get-current-web-contents` -### --enable-logging +### --enable-logging[=file] -Prints Chromium's logging into console. +Prints Chromium's logging to stderr (or a log file). -This switch can not be used in `app.commandLine.appendSwitch` since it is parsed earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING` environment variable to achieve the same effect. +The `ELECTRON_ENABLE_LOGGING` environment variable has the same effect as passing `--enable-logging`. + +Passing `--enable-logging` will result in logs being printed on stderr. Passing `--enable-logging=file` will result in logs being saved to the file specified by `--log-file=...`, or to `electron_debug.log` in the user-data directory if `--log-file` is not specified. + +> **Note:** On Windows, logs from child processes cannot be sent to stderr. Logging to a file is the most reliable way to collect logs on Windows. + +See also `--log-file`, `--log-level`, `--v`, and `--vmodule`. ### --force-fieldtrials=`trials` @@ -116,10 +117,26 @@ See the [Node.js documentation][node-cli] or run `node --help` in your terminal Set a custom locale. +### --log-file=`path` + +If `--enable-logging` is specified, logs will be written to the given path. The parent directory must exist. + +Setting the `ELECTRON_LOG_FILE` environment variable is equivalent to passing this flag. If both are present, the command-line switch takes precedence. + ### --log-net-log=`path` Enables net log events to be saved and writes them to `path`. +### --log-level=`N` + +Sets the verbosity of logging when used together with `--enable-logging`. `N` should be one of [Chrome's LogSeverities][severities]. + +Note that two complimentary logging mechanisms in Chromium -- `LOG()` and `VLOG()` -- are controlled by different switches. `--log-level` controls `LOG()` messages, while `--v` and `--vmodule` control `VLOG()` messages. So you may want to use a combination of these three switches depending on the granularity you want and what logging calls are made by the code you're trying to watch. + +See [Chromium Logging source][logging] for more information on how `LOG()` and `VLOG()` interact. Loosely speaking, `VLOG()` can be thought of as sub-levels / per-module levels inside `LOG(INFO)` to control the firehose of `LOG(INFO)` data. + +See also `--enable-logging`, `--log-level`, `--v`, and `--vmodule`. + ### --no-proxy-server Don't use a proxy server and always make direct connections. Overrides any other proxy server flags that are passed. @@ -159,6 +176,8 @@ Gives the default maximal active V-logging level; 0 is the default. Normally pos This switch only works when `--enable-logging` is also passed. +See also `--enable-logging`, `--log-level`, and `--vmodule`. + ### --vmodule=`pattern` Gives the per-module maximal V-logging levels to override the value given by `--v`. z.B. `my_module=2,foo*=3` would change the logging level for all code in source files `my_module.*` and `foo*.*`. @@ -167,6 +186,8 @@ Any pattern containing a forward or backward slash will be tested against the wh This switch only works when `--enable-logging` is also passed. +See also `--enable-logging`, `--log-level`, and `--v`. + ### --force_high_performance_gpu Force using discrete GPU when there are multiple GPUs available. @@ -214,5 +235,7 @@ By default inspector websocket url is available in stderr and under /json/list e [ready]: app.md#event-ready [play-silent-audio]: https://github.com/atom/atom/pull/9485/files [debugging-main-process]: ../tutorial/debugging-main-process.md +[logging]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h [node-cli]: https://nodejs.org/api/cli.html [node-cli]: https://nodejs.org/api/cli.html +[severities]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h?q=logging::LogSeverity&ss=chromium diff --git a/content/de-DE/docs/api/dialog.md b/content/de-DE/docs/api/dialog.md index 415a2a34692c2..075a19433f182 100644 --- a/content/de-DE/docs/api/dialog.md +++ b/content/de-DE/docs/api/dialog.md @@ -186,8 +186,6 @@ The `filters` specifies an array of file types that can be displayed, see `dialo * `defaultId` Integer (optional) - Index of the button in the buttons array which will be selected by default when the message box opens. * `title` String (optional) - Title of the message box, some platforms will not show it. * `detail` String (optional) - Extra information of the message. - * `checkboxLabel` String (optional) - If provided, the message box will include a checkbox with the given label. - * `checkboxChecked` Boolean (optional) - Initial checked state of the checkbox. Automatisch `false`. * `icon` ([NativeImage](native-image.md) | String) (optional) * `cancelId` Integer (optional) - The index of the button to be used to cancel the dialog, via the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the label. If no such labeled buttons exist and this option is not set, `0` will be used as the return value. * `noLink` Boolean (optional) - On Windows Electron will try to figure out which one of the `buttons` are common buttons (like "Cancel" or "Yes"), and show the others as command links in the dialog. This can make the dialog appear in the style of modern Windows apps. If you don't like this behavior, you can set `noLink` to `true`. diff --git a/content/de-DE/docs/api/environment-variables.md b/content/de-DE/docs/api/environment-variables.md index f2a013f98851f..77aa055308ca2 100644 --- a/content/de-DE/docs/api/environment-variables.md +++ b/content/de-DE/docs/api/environment-variables.md @@ -104,7 +104,15 @@ The following environment variables are intended primarily for development and d ### `ELECTRON_ENABLE_LOGGING` -Prints Chrome's internal logging to the console. +Prints Chromium's internal logging to the console. + +Setting this variable is the same as passing `--enable-logging` on the command line. For more info, see `--enable-logging` in [command-line switches](./command-line-switches.md#enable-loggingfile). + +### `ELECTRON_LOG_FILE` + +Sets the file destination for Chromium's internal logging. + +Setting this variable is the same as passing `--log-file` on the command line. For more info, see `--log-file` in [command-line switches](./command-line-switches.md#log-filepath). ### `ELECTRON_DEBUG_DRAG_REGIONS` @@ -112,7 +120,7 @@ Adds coloration to draggable regions on [`BrowserView`](./browser-view.md)s on m ### `ELECTRON_DEBUG_NOTIFICATIONS` -Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common actions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. +Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common a tions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. Sample output: diff --git a/content/de-DE/docs/api/extensions.md b/content/de-DE/docs/api/extensions.md index 5cec82018d9f2..e2ababb0bdb6f 100644 --- a/content/de-DE/docs/api/extensions.md +++ b/content/de-DE/docs/api/extensions.md @@ -64,6 +64,7 @@ The following methods of `chrome.runtime` are supported: - `chrome.runtime.getURL` - `chrome.runtime.connect` - `chrome.runtime.sendMessage` +- `chrome.runtime.reload` The following events of `chrome.runtime` are supported: diff --git a/content/de-DE/docs/api/frameless-window.md b/content/de-DE/docs/api/frameless-window.md index 747688828d10f..ca79b7bfc8971 100644 --- a/content/de-DE/docs/api/frameless-window.md +++ b/content/de-DE/docs/api/frameless-window.md @@ -14,13 +14,13 @@ const win = new BrowserWindow({ width: 800, height: 600, frame: false }) win.show() ``` -### Alternativen auf macOS +### Alternatives -Es gibt eine Alternative, um ein rahmenloses Fenster zu erhalten. Statt `frame` auf `false` zu setzen, welches sowohl die Titelleiste als auch die Schaltflächen entfernt, möchtest Du möglicherweise nur die Titelleiste entfernen, aber die Standard-Schaltflächen ("Amplelichter") behalten. Das kannst du erreichen indem du folgende `titleBarStyle`-Optionen verwendest: +There's an alternative way to specify a chromeless window on macOS and Windows. Instead of setting `frame` to `false` which disables both the titlebar and window controls, you may want to have the title bar hidden and your content extend to the full window size, yet still preserve the window controls ("traffic lights" on macOS) for standard window actions. Das kannst du erreichen indem du folgende `titleBarStyle`-Optionen verwendest: #### `hidden` -Resultiert in eine versteckte Titelleiste und ein Inhaltsfenster der vollen Größe. Dennoch sind die Standard-Fensterkontrollen (Ampel) weiterhin vorhanden. +Results in a hidden title bar and a full size content window. On macOS, the title bar still has the standard window controls (“traffic lights”) in the top left. ```javascript const { BrowserWindow } = require('electron') @@ -28,6 +28,8 @@ const win = new BrowserWindow({ titleBarStyle: 'hidden' }) win.show() ``` +### Alternativen auf macOS + #### `hiddenInset` Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge. @@ -48,6 +50,33 @@ const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: fa win.show() ``` +## Windows Control Overlay + +When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS, using one of the `titleBarStyle`s as described above so that the traffic lights are visible, or using `titleBarStyle: hidden` on Windows, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true. Specifying `true` will result in an overlay with default system colors. + +On Windows, you can also specify the color of the overlay and its symbols by setting `titleBarOverlay` to an object with the options `color` and `symbolColor`. If an option is not specified, the color will default to its system color for the window control buttons: + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: true +}) +win.show() +``` + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: { + color: '#2f3241', + symbolColor: '#74b1be' + } +}) +win.show() +``` + ## Transparent window By setting the `transparent` option to `true`, you can also make the frameless window transparent: @@ -142,3 +171,5 @@ In a frameless window the dragging behavior may conflict with selecting text. Fo On some platforms, the draggable area will be treated as a non-client frame, so when you right click on it a system menu will pop up. To make the context menu behave correctly on all platforms you should never use a custom context menu on draggable areas. [ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/de-DE/docs/api/ipc-main.md b/content/de-DE/docs/api/ipc-main.md index 8fcf40369287c..28621c0b5de95 100644 --- a/content/de-DE/docs/api/ipc-main.md +++ b/content/de-DE/docs/api/ipc-main.md @@ -32,6 +32,8 @@ ipcMain.on('synchronous-message', (event, arg) => { ```javascript // In renderer process (web page). +// NB. Electron APIs are only accessible from preload, unless contextIsolation is disabled. +// See https://www.electronjs.org/docs/tutorial/process-model#preload-scripts for more details. const { ipcRenderer } = require('electron') console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints "pong" diff --git a/content/de-DE/docs/api/menu-item.md b/content/de-DE/docs/api/menu-item.md index 1e90e4dbcd662..67f389a37326c 100644 --- a/content/de-DE/docs/api/menu-item.md +++ b/content/de-DE/docs/api/menu-item.md @@ -13,7 +13,7 @@ See [`Menu`](menu.md) for examples. * `menuItem` MenuItem * `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open. * `event` [KeyboardEvent](structures/keyboard-event.md) - * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. See [roles](#roles). + * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. See [roles](#roles). * `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or `radio`. * `label` String (optional) * `sublabel` String (optional) @@ -128,7 +128,7 @@ A `String` indicating the type of the item. Can be `normal`, `separator`, `subme #### `menuItem.role` -A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` +A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` #### `menuItem.accelerator` diff --git a/content/de-DE/docs/api/menu.md b/content/de-DE/docs/api/menu.md index 410cbcd7cf149..15de0240c0187 100644 --- a/content/de-DE/docs/api/menu.md +++ b/content/de-DE/docs/api/menu.md @@ -143,7 +143,7 @@ const template = [ { role: 'services' }, { type: 'separator' }, { role: 'hide' }, - { role: 'hideothers' }, + { role: 'hideOthers' }, { role: 'unhide' }, { type: 'separator' }, { role: 'quit' } diff --git a/content/de-DE/docs/api/power-monitor.md b/content/de-DE/docs/api/power-monitor.md index 4ad2a3ec896f2..7dc4228278273 100644 --- a/content/de-DE/docs/api/power-monitor.md +++ b/content/de-DE/docs/api/power-monitor.md @@ -8,11 +8,11 @@ Prozess: [Haupt](../glossary.md#main-process) Das `powerMonitor` Modul sendet folgende Ereignisse aus: -### Event: 'suspend' _macOS_ _Windows_ +### Event: 'suspend' Emitted when the system is suspending. -### Event: 'resume' _macOS_ _Windows_ +### Event: 'resume' Emitted when system is resuming. diff --git a/content/de-DE/docs/api/session.md b/content/de-DE/docs/api/session.md index 40b6d0aa5ca99..fc4e7230d7a8e 100644 --- a/content/de-DE/docs/api/session.md +++ b/content/de-DE/docs/api/session.md @@ -160,7 +160,7 @@ Kehrt zurück: Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request. -#### Event: 'select-serial-port' _Experimental_ +#### Event: 'select-serial-port' Kehrt zurück: @@ -172,21 +172,15 @@ Kehrt zurück: Emitted when a serial port needs to be selected when a call to `navigator.serial.requestPort` is made. `callback` should be called with `portId` to be selected, passing an empty string to `callback` will cancel the request. Additionally, permissioning on `navigator.serial` can be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler) with the `serial` permission. -Because this is an experimental feature it is disabled by default. To enable this feature, you will need to use the `--enable-features=ElectronSerialChooser` command line switch. Additionally because this is an experimental Chromium feature you will need to set `enableBlinkFeatures: 'Serial'` on the `webPreferences` property when opening a BrowserWindow. - ```javascript const { app, BrowserWindow } = require('electron') let win = null -app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser') app.whenReady().then(() => { win = new BrowserWindow({ width: 800, - height: 600, - webPreferences: { - enableBlinkFeatures: 'Serial' - } + height: 600 }) win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => { event.preventDefault() @@ -202,7 +196,7 @@ app.whenReady().then(() => { }) ``` -#### Event: 'serial-port-added' _Experimental_ +#### Event: 'serial-port-added' Kehrt zurück: @@ -212,7 +206,7 @@ Kehrt zurück: Emitted after `navigator.serial.requestPort` has been called and `select-serial-port` has fired if a new serial port becomes available. For example, this event will fire when a new USB device is plugged in. -#### Event: 'serial-port-removed' _Experimental_ +#### Event: 'serial-port-removed' Kehrt zurück: @@ -452,7 +446,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents #### `ses.setPermissionCheckHandler(handler)` * `handler` Funktion\ | null - * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. Cross origin sub frames making permission checks will pass a `null` webContents to this handler. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. + * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. All cross origin sub frames making permission checks will pass a `null` webContents to this handler, while certain other permission checks such as `notifications` checks will always pass `null`. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. * `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, or `serial`. * `requestingOrigin` String - The origin URL of the permission check * `details` Object - Some properties are only available on certain permission types. @@ -534,10 +528,9 @@ Returns `Promise` - resolves with blob data. #### `ses.downloadURL(url)` -* ` URL Zeichenfolge
  • - +* `url` String -

    Initiates a download of the resource at url`. The API will generate a [DownloadItem](download-item.md) that can be accessed with the [will-download](#event-will-download) event.

    +Initiates a download of the resource at `url`. The API will generate a [DownloadItem](download-item.md) that can be accessed with the [will-download](#event-will-download) event. **Note:** This does not perform any security checks that relate to a page's origin, unlike [`webContents.downloadURL`](web-contents.md#contentsdownloadurlurl). diff --git a/content/de-DE/docs/api/structures/overlay-options.md b/content/de-DE/docs/api/structures/overlay-options.md new file mode 100644 index 0000000000000..9e0e4815ea59c --- /dev/null +++ b/content/de-DE/docs/api/structures/overlay-options.md @@ -0,0 +1,4 @@ +# OverlayOptions Object + +* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color. +* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color. diff --git a/content/de-DE/docs/api/structures/user-default-types.md b/content/de-DE/docs/api/structures/user-default-types.md new file mode 100644 index 0000000000000..8b39e80514da0 --- /dev/null +++ b/content/de-DE/docs/api/structures/user-default-types.md @@ -0,0 +1,12 @@ +# UserDefaultTypes Object + +* `string` Zeichenkette +* `boolean` Boolean +* `integer` Number +* `float` Number +* `double` Number +* `url` String +* `array` Array\ +* `dictionary` Record\ + +This type is a helper alias, no object will never exist of this type. diff --git a/content/de-DE/docs/api/system-preferences.md b/content/de-DE/docs/api/system-preferences.md index f98cf30f1b1ca..01f9ed24582d5 100644 --- a/content/de-DE/docs/api/system-preferences.md +++ b/content/de-DE/docs/api/system-preferences.md @@ -147,12 +147,12 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace. Add the specified defaults to your application's `NSUserDefaults`. -### `systemPreferences.getUserDefault(key, type)` _macOS_ +### `systemPreferences.getUserDefault(key, type)` _macOS_ * `key` String -* `type` String - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. +* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. -Returns `any` - The value of `key` in `NSUserDefaults`. +Returns [`UserDefaultTypes[Type]`](structures/user-default-types.md) - The value of `key` in `NSUserDefaults`. Some popular `key` and `type`s are: diff --git a/content/de-DE/docs/api/touch-bar-scrubber.md b/content/de-DE/docs/api/touch-bar-scrubber.md index e9f63a9488aa8..a62069515c04a 100644 --- a/content/de-DE/docs/api/touch-bar-scrubber.md +++ b/content/de-DE/docs/api/touch-bar-scrubber.md @@ -14,7 +14,7 @@ Prozess: [Haupt](../glossary.md#main-process) * `highlightedIndex` Integer - The index of the item the user touched. * `selectedStyle` String (optional) - Selected item style. Can be `background`, `outline` or `none`. Standardwert ist `none`. * `overlayStyle` String (optional) - Selected overlay item style. Can be `background`, `outline` or `none`. Standardwert ist `none`. - * `showArrowButtons` Boolean (optional) - Defaults to `false`. + * `showArrowButtons` Boolean (optional) - Whether to show arrow buttons. Defaults to `false` and is only shown if `items` is non-empty. * `mode` String (optional) - Kann `fixed` oder `free` sein. The default is `free`. * `continuous` Boolean (optional) - Defaults to `true`. diff --git a/content/de-DE/docs/api/web-contents.md b/content/de-DE/docs/api/web-contents.md index cc89dd4062d0f..a39f489d76890 100644 --- a/content/de-DE/docs/api/web-contents.md +++ b/content/de-DE/docs/api/web-contents.md @@ -39,6 +39,24 @@ Returns `WebContents` - The web contents that is focused in this application, ot Returns `WebContents` | undefined - A WebContents instance with the given ID, or `undefined` if there is no WebContents associated with the given ID. +### `webContents.fromDevToolsTargetId(targetId)` + +* `targetId` String - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance. + +Returns `WebContents` | undefined - A WebContents instance with the given TargetID, or `undefined` if there is no WebContents associated with the given TargetID. + +When communicating with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), it can be useful to lookup a WebContents instance based on its assigned TargetID. + +```js +async function lookupTargetId (browserWindow) { + const wc = browserWindow.webContents + await wc.debugger.attach('1.3') + const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo') + const { targetId } = targetInfo + const targetWebContents = await webContents.fromDevToolsTargetId(targetId) +} +``` + ## Class: WebContents > Rendert und steuert den Inhalt einer BrowserWindow Instanze. @@ -130,11 +148,11 @@ Emitted when page receives favicon urls. Kehrt zurück: * `event` NewWindowWebContentsEvent -* ` URL Zeichenfolge -
  • frameName` String +* `url` String +* `frameName` String * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. * `options` BrowserWindowConstructorOptions - The options which will be used for creating the new [`BrowserWindow`](browser-window.md). -* `additionalFeatures` String[] - The non-standard features (features not handled by Chromium or Electron) given to `window.open()`. +* `additionalFeatures` String[] - The non-standard features (features not handled by Chromium or Electron) given to `window.open()`. Deprecated, and will now always be the empty array `[]`. * `referrer` [Referrer](structures/referrer.md) - The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. @@ -178,8 +196,7 @@ Kehrt zurück: * `details` Objekt * `url` String - URL for the created window. * `frameName` String - Name given to the created window in the `window.open()` call. - * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: options inherited from the parent, parsed options from the `features` string from `window.open()`, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. - * `additionalFeatures` String[] - The non-standard features (features not handled Chromium or Electron) _Deprecated_ + * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. * `referrer` [Referrer](structures/referrer.md) - The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. @@ -193,11 +210,9 @@ See [`window.open()`](window-open.md) for more details and how to use this in co Kehrt zurück: * `event` Event -* ` URL Zeichenfolge
  • - +* `url` String -

    Emitted when a user or the page wants to start navigation. It can happen when -the window.location` object is changed or a user clicks a link in the page.

    +Emitted when a user or the page wants to start navigation. It can happen when the `window.location` object is changed or a user clicks a link in the page. This event will not emit when the navigation is started programmatically with APIs like `webContents.loadURL` and `webContents.back`. @@ -210,8 +225,8 @@ Calling `event.preventDefault()` will prevent the navigation. Kehrt zurück: * `event` Event -* ` URL Zeichenfolge -
  • isInPlace` Boolean +* `url` String +* `isInPlace` Boolean * `isMainFrame` Boolean * `frameProcessId` Integer * `frameRoutingId` Integer @@ -223,8 +238,8 @@ Emitted when any frame (including main) starts navigating. `isInPlace` will be ` Kehrt zurück: * `event` Event -* ` URL Zeichenfolge
  • -
  • isInPlace` Boolean +* `url` String +* `isInPlace` Boolean * `isMainFrame` Boolean * `frameProcessId` Integer * `frameRoutingId` Integer @@ -240,8 +255,8 @@ Calling `event.preventDefault()` will prevent the navigation (not just the redir Kehrt zurück: * `event` Event -* ` URL Zeichenfolge
  • -
  • isInPlace` Boolean +* `url` String +* `isInPlace` Boolean * `isMainFrame` Boolean * `frameProcessId` Integer * `frameRoutingId` Integer @@ -255,8 +270,8 @@ This event cannot be prevented, if you want to prevent redirects you should chec Kehrt zurück: * `event` Event -* ` URL Zeichenfolge
  • -
  • httpResponseCode` Integer - -1 for non HTTP navigations +* `url` String +* `httpResponseCode` Integer - -1 for non HTTP navigations * `httpStatusText` String - empty for non HTTP navigations Emitted when a main frame navigation is done. @@ -268,8 +283,8 @@ This event is not emitted for in-page navigations, such as clicking anchor links Kehrt zurück: * `event` Event -* ` URL Zeichenfolge
  • -
  • httpResponseCode` Integer - -1 for non HTTP navigations +* `url` String +* `httpResponseCode` Integer - -1 for non HTTP navigations * `httpStatusText` String - empty for non HTTP navigations, * `isMainFrame` Boolean * `frameProcessId` Integer @@ -284,8 +299,8 @@ This event is not emitted for in-page navigations, such as clicking anchor links Kehrt zurück: * `event` Event -* ` URL Zeichenfolge
  • -
  • isMainFrame` Boolean +* `url` String +* `isMainFrame` Boolean * `frameProcessId` Integer * `frameRoutingId` Integer @@ -322,6 +337,8 @@ win.webContents.on('will-prevent-unload', (event) => { }) ``` +**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the [specification](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). + #### Event: 'crashed' _Deprecated_ Kehrt zurück: @@ -439,8 +456,8 @@ Emitted when DevTools is focused / opened. Kehrt zurück: * `event` Event -* ` URL Zeichenfolge
  • -
  • error` String - Der error code. +* `url` String +* `error` String - Der error code. * `certificate` [Certificate](structures/certificate.md) * `callback` Function * `isTrusted` Boolean - Indicates whether the certificate can be considered trusted. @@ -524,17 +541,15 @@ Emitted when a page's theme color changes. This is usually due to encountering a Kehrt zurück: * `event` Event -* ` URL Zeichenfolge
  • - +* `url` String -

    Emitted when mouse moves over a link or the keyboard moves the focus to a link.

    +Emitted when mouse moves over a link or the keyboard moves the focus to a link. -

    Event: 'cursor-changed'

    +#### Event: 'cursor-changed' -

    Kehrt zurück:

    +Kehrt zurück: -
      -
    • event` Event +* `event` Event * `type` String * `image` [NativeImage](native-image.md) (optional) * `scale` Float (optional) - scaling factor for the custom cursor. @@ -698,10 +713,9 @@ Kehrt zurück: * `event` Event * `preloadPath` String -* ` Fehler Fehler
    • -
    +* `error` Fehler -

    Emitted when the preload script preloadPath` throws an unhandled exception `error`.

    +Emitted when the preload script `preloadPath` throws an unhandled exception `error`. #### Event: 'ipc-message' @@ -731,49 +745,6 @@ Kehrt zurück: Emitted when `desktopCapturer.getSources()` is called in the renderer process. Calling `event.preventDefault()` will make it return empty sources. -#### Event: 'remote-require' _Deprecated_ - -Kehrt zurück: - -* `event` IpcMainEvent -* `moduleName` String - -Emitted when `remote.require()` is called in the renderer process. Calling `event.preventDefault()` will prevent the module from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - -#### Event: 'remote-get-global' _Deprecated_ - -Kehrt zurück: - -* `event` IpcMainEvent -* `globalName` String - -Emitted when `remote.getGlobal()` is called in the renderer process. Calling `event.preventDefault()` will prevent the global from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - -#### Event: 'remote-get-builtin' _Deprecated_ - -Kehrt zurück: - -* `event` IpcMainEvent -* `moduleName` String - -Emitted when `remote.getBuiltin()` is called in the renderer process. Calling `event.preventDefault()` will prevent the module from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - -#### Event: 'remote-get-current-window' _Deprecated_ - -Kehrt zurück: - -* `event` IpcMainEvent - -Emitted when `remote.getCurrentWindow()` is called in the renderer process. Calling `event.preventDefault()` will prevent the object from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - -#### Event: 'remote-get-current-web-contents' _Deprecated_ - -Kehrt zurück: - -* `event` IpcMainEvent - -Emitted when `remote.getCurrentWebContents()` is called in the renderer process. Calling `event.preventDefault()` will prevent the object from being returned. Ein eigener Wert kann zurückgegeben werden durch Setzen von `event.returnValue`. - #### Event: 'preferred-size-changed' Kehrt zurück: @@ -789,8 +760,8 @@ This event will only be emitted when `enablePreferredSizeMode` is set to `true` #### `contents.loadURL(url[, options])` -* ` URL Zeichenfolge -
  • options` Object (optional) +* `url` String +* `options` Object (optional) * `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer url. * `userAgent` String (optional) - A user agent originating the request. * `extraHeaders` String (optional) - Extra headers separated by "\n". @@ -815,7 +786,7 @@ webContents.loadURL('https://github.com', options) * `search` String (optional) - Passed to `url.format()`. * `hash` String (optional) - Passed to `url.format()`. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Gibt `Promise` zurück - das Versprechen wird aufgelöst, wenn die Seite das Laden beendet hat (siehe [`did-finish-load`](web-contents.md#event-did-finish-load)), und lehnt ab, wenn die Seite nicht geladen wird (siehe [`did-fail-load`](web-contents.md#event-did-fail-load)). Loads the given file in the window, `filePath` should be a path to an HTML file relative to the root of your application. For instance an app structure like this: @@ -835,10 +806,9 @@ win.loadFile('src/index.html') #### `contents.downloadURL(url)` -* ` URL Zeichenfolge
  • - +* `url` String -

    Initiates a download of the resource at url` without navigating. The `will-download` event of `session` will be triggered.

    +Initiates a download of the resource at `url` without navigating. The `will-download` event of `session` will be triggered. #### `contents.getURL()` @@ -1046,7 +1016,7 @@ Ignore application menu shortcuts while this web contents is focused. Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window. Returning an unrecognized value such as a null, undefined, or an object without a recognized 'action' value will result in a console error and have the same effect as returning `{action: 'deny'}`. -Called before creating a window when `window.open()` is called from the renderer. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. +Called before creating a window a new window is requested by the renderer, e.g. by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or submitting a form with `
    `. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. #### `contents.setAudioMuted(muted)` diff --git a/content/de-DE/docs/api/web-frame-main.md b/content/de-DE/docs/api/web-frame-main.md index 019f4c9d7c988..a56af8ed00fcc 100644 --- a/content/de-DE/docs/api/web-frame-main.md +++ b/content/de-DE/docs/api/web-frame-main.md @@ -154,3 +154,9 @@ An `Integer` representing the Chromium internal `pid` of the process which owns #### `frame.routingId` _Readonly_ An `Integer` representing the unique frame id in the current renderer process. Distinct `WebFrameMain` instances that refer to the same underlying frame will have the same `routingId`. + +#### `frame.visibilityState` _Readonly_ + +A `string` representing the [visibility state](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) of the frame. + +See also how the [Page Visibility API](browser-window.md#page-visibility) is affected by other Electron APIs. diff --git a/content/de-DE/docs/api/web-request.md b/content/de-DE/docs/api/web-request.md index 563bf0a1db390..5cf62738911d3 100644 --- a/content/de-DE/docs/api/web-request.md +++ b/content/de-DE/docs/api/web-request.md @@ -41,12 +41,12 @@ Die folgenden Methoden sind verfügbar in Instanzen von `WebRequest`: * `listener` Function | null * `details` Objekt * `id` Integer - * ` URL Zeichenfolge -
  • method` String + * `url` String + * `method` String * `webContentsId` Integer (optional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `uploadData` [UploadData[]](structures/upload-data.md) @@ -83,12 +83,12 @@ Some examples of valid `urls`: * `listener` Function | null * `details` Objekt * `id` Integer - * ` URL Zeichenfolge
  • -
  • method` String + * `url` String + * `method` String * `webContentsId` Integer (optional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `requestHeaders` Record @@ -108,12 +108,12 @@ The `callback` has to be called with a `response` object. * `listener` Function | null * `details` Objekt * `id` Integer - * ` URL Zeichenfolge
  • -
  • method` String + * `url` String + * `method` String * `webContentsId` Integer (optional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `requestHeaders` Record @@ -127,12 +127,12 @@ The `listener` will be called with `listener(details)` just before a request is * `listener` Function | null * `details` Objekt * `id` Integer - * ` URL Zeichenfolge
  • -
  • method` String + * `url` String + * `method` String * `webContentsId` Integer (optional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `statusLine` String @@ -155,12 +155,12 @@ The `callback` has to be called with a `response` object. * `listener` Function | null * `details` Objekt * `id` Integer - * ` URL Zeichenfolge
  • -
  • method` String + * `url` String + * `method` String * `webContentsId` Integer (optional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -177,12 +177,12 @@ The `listener` will be called with `listener(details)` when first byte of the re * `listener` Function | null * `details` Objekt * `id` Integer - * ` URL Zeichenfolge
  • -
  • method` String + * `url` String + * `method` String * `webContentsId` Integer (optional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `redirectURL` String @@ -201,12 +201,12 @@ The `listener` will be called with `listener(details)` when a server initiated r * `listener` Function | null * `details` Objekt * `id` Integer - * ` URL Zeichenfolge
  • -
  • method` String + * `url` String + * `method` String * `webContentsId` Integer (optional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -224,12 +224,12 @@ The `listener` will be called with `listener(details)` when a request is complet * `listener` Function | null * `details` Objekt * `id` Integer - * ` URL Zeichenfolge
  • -
  • method` String + * `url` String + * `method` String * `webContentsId` Integer (optional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `fromCache` Boolean diff --git a/content/de-DE/docs/api/webview-tag.md b/content/de-DE/docs/api/webview-tag.md index 9f36aa26e4434..edfb60a78c266 100644 --- a/content/de-DE/docs/api/webview-tag.md +++ b/content/de-DE/docs/api/webview-tag.md @@ -94,15 +94,7 @@ A `Boolean`. When this attribute is present the guest page in `webview` will hav A `Boolean` for the experimental option for enabling NodeJS support in sub-frames such as iframes inside the `webview`. All your preloads will load for every iframe, you can use `process.isMainFrame` to determine if you are in the main frame or not. This option is disabled by default in the guest page. -### `enableremotemodule` - -```html - -``` - -A `Boolean`. When this attribute is `false` the guest page in `webview` will not have access to the [`remote`](remote.md) module. The remote module is unavailable by default. - -### `plug-ins` +### `plugins` ```html @@ -222,10 +214,9 @@ Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g. ### `.downloadURL(url)` -* ` URL Zeichenfolge
  • - +* `url` String -

    Initiates a download of the resource at url` without navigating.

    +Initiates a download of the resource at `url` without navigating. ### `.getURL()` @@ -587,8 +578,8 @@ The following DOM events are available to the `webview` tag: Kehrt zurück: -* ` URL Zeichenfolge -
  • isMainFrame` Boolean +* `url` String +* `isMainFrame` Boolean Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. @@ -703,8 +694,8 @@ console.log(requestId) Kehrt zurück: -* ` URL Zeichenfolge
  • -
  • frameName` String +* `url` String +* `frameName` String * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. * `options` BrowserWindowConstructorOptions - The options which should be used for creating the new [`BrowserWindow`](browser-window.md). @@ -728,11 +719,9 @@ webview.addEventListener('new-window', async (e) => { Kehrt zurück: -* ` URL Zeichenfolge
  • - +* `url` String -

    Emitted when a user or the page wants to start navigation. It can happen when -the window.location` object is changed or a user clicks a link in the page.

    +Emitted when a user or the page wants to start navigation. It can happen when the `window.location` object is changed or a user clicks a link in the page. This event will not emit when the navigation is started programmatically with APIs like `.loadURL` and `.back`. @@ -740,31 +729,53 @@ It is also not emitted during in-page navigation, such as clicking anchor links Calling `event.preventDefault()` does __NOT__ have any effect. +### Event: 'did-start-navigation' + +Kehrt zurück: + +* `url` String +* `isInPlace` Boolean +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitted when any frame (including main) starts navigating. `isInPlace` will be `true` for in-page navigations. + ### Event: 'did-navigate' Kehrt zurück: -* ` URL Zeichenfolge - +* `url` String + +Emitted when a navigation is done. + +This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. + +### Event: 'did-frame-navigate' + +Kehrt zurück: + +* `url` String +* `httpResponseCode` Integer - -1 for non HTTP navigations +* `httpStatusText` String - empty for non HTTP navigations, +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer -

    Emitted when a navigation is done.

    +Emitted when any frame navigation is done. -

    This event is not emitted for in-page navigations, such as clicking anchor links -or updating the window.location.hash`. Use `did-navigate-in-page` event for this purpose.

    +This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. ### Event: 'did-navigate-in-page' Kehrt zurück: * `isMainFrame` Boolean -* ` URL Zeichenfolge - +* `url` String -

    Emitted when an in-page navigation happened.

    +Emitted when an in-page navigation happened. -

    When in-page navigation happens, the page URL changes but does not cause -navigation outside of the page. Examples of this occurring are when anchor links -are clicked or when the DOM hashchange` event is triggered.

    +When in-page navigation happens, the page URL changes but does not cause navigation outside of the page. Examples of this occurring are when anchor links are clicked or when the DOM `hashchange` event is triggered. ### Event: 'close' @@ -849,22 +860,21 @@ Emitted when a page's theme color changes. This is usually due to encountering a Kehrt zurück: -* URL Zeichenfolge - +* `url` String -

    Emitted when mouse moves over a link or the keyboard moves the focus to a link.

    +Emitted when mouse moves over a link or the keyboard moves the focus to a link. -

    Event: 'devtools-opened'

    +### Event: 'devtools-opened' -

    Emittiert wenn die DevTools geöffnet wurden.

    +Emittiert wenn die DevTools geöffnet wurden. -

    Event: 'devtools-closed'

    +### Event: 'devtools-closed' -

    Emittiert wenn die DevTools geschlossen wurden.

    +Emittiert wenn die DevTools geschlossen wurden. -

    Event: 'devtools-focused'

    +### Event: 'devtools-focused' -

    Emitted when DevTools is focused / opened.

    +Emitted when DevTools is focused / opened. [runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 [chrome-webview]: https://developer.chrome.com/docs/extensions/reference/webviewTag/ diff --git a/content/de-DE/docs/api/window-open.md b/content/de-DE/docs/api/window-open.md index 9859a8b57043e..96265e73eeb4e 100644 --- a/content/de-DE/docs/api/window-open.md +++ b/content/de-DE/docs/api/window-open.md @@ -11,12 +11,12 @@ However, when the `sandbox` (or directly, `nativeWindowOpen`) option is set, a ` Electron pairs this native Chrome `Window` with a BrowserWindow under the hood. You can take advantage of all the customization available when creating a BrowserWindow in the main process by using `webContents.setWindowOpenHandler()` for renderer-created windows. -BrowserWindow constructor options are set by, in increasing precedence order: options inherited from the parent, parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. +BrowserWindow constructor options are set by, in increasing precedence order: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. ### `window.open(url[, frameName][, features])` -* ` URL Zeichenfolge -
  • frameName` String (optional) +* `url` String +* `frameName` String (optional) * `features` String (optional) Returns [`BrowserWindowProxy`](browser-window-proxy.md) | [`Window`](https://developer.mozilla.org/en-US/docs/Web/API/Window) @@ -36,7 +36,8 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn * Node integration will always be disabled in the opened `window` if it is disabled on the parent window. * Context isolation will always be enabled in the opened `window` if it is enabled on the parent window. * JavaScript will always be disabled in the opened `window` if it is disabled on the parent window. -* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `additionalFeatures` argument. +* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `options` argument. +* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters). To customize or cancel the creation of the window, you can optionally set an override handler with `webContents.setWindowOpenHandler()` from the main process. Returning `false` cancels the window, while returning an object sets the `BrowserWindowConstructorOptions` used when creating the window. Note that this is more powerful than passing options through the feature string, as the renderer has more limited privileges in deciding security preferences than the main process. @@ -56,7 +57,7 @@ mainWindow.webContents.setWindowOpenHandler(({ url }) => { mainWindow.webContents.on('did-create-window', (childWindow) => { // For example... - childWindow.webContents('will-navigate', (e) => { + childWindow.webContents.on('will-navigate', (e) => { e.preventDefault() }) }) diff --git a/content/de-DE/docs/breaking-changes.md b/content/de-DE/docs/breaking-changes.md index 3308276008a1f..148c8980d2ddd 100644 --- a/content/de-DE/docs/breaking-changes.md +++ b/content/de-DE/docs/breaking-changes.md @@ -2,19 +2,39 @@ Breaking-Änderungen werden hier dokumentiert, und Veraltungswarnungen werden js-Code nach Möglichkeit hinzugefügt, mindestens [eine Hauptversion](tutorial/electron-versioning.md#semver), bevor die Änderung vorgenommen wird. -### Types of Breaking Changes +### Typen von Breaking-Änderungen -This document uses the following convention to categorize breaking changes: +In diesem Dokument wird die folgende Konvention zur Kategorisierung von Breaking-Änderungen verwendet: -* **API Changed:** An API was changed in such a way that code that has not been updated is guaranteed to throw an exception. -* **Behavior Changed:** The behavior of Electron has changed, but not in such a way that an exception will necessarily be thrown. -* **Default Changed:** Code depending on the old default may break, not necessarily throwing an exception. The old behavior can be restored by explicitly specifying the value. -* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release. -* **Removed:** An API or feature was removed, and is no longer supported by Electron. +* **API geändert:** Die API wurde so geändert, dass Code, der nicht aktualisiert wurde, garantiert eine Ausnahme wirft. +* **Verhalten geändert:** Das Verhalten von Electron hat sich geändert, aber nicht so, dass eine Ausnahme unbedingt geworfen wird. +* **Standard geändert:** Code, der vom alten Standardwert abhängig ist, funktioniert möglicherweise nicht mehr und wirft nicht notwendigerweise eine Ausnahme. Das alte Verhalten kann durch explizite Angabe des Wertes wiederhergestellt werden. +* **Veraltet:** Eine API wurde als veraltet markiert. Die API wird weiterhin funktionieren, sendet aber eine Veraltungswarnung aus und wird in einer zukünftigen Version entfernt. +* **Entfernt:** Eine API oder Funktion wurde entfernt und wird von Electron nicht mehr unterstützt. + +## Geplante Bruch-API-Änderungen (15.0) + +### Standardwert geändert: `nativeWindowOpen` ist standardmäßig auf `true` eingestellt + +Prior to Electron 15, `window.open` was by default shimmed to use `BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work to open synchronously scriptable child windows, among other incompatibilities. `nativeWindowOpen: true` is no longer experimental, and is now the default. + +See the documentation for [window.open in Electron](api/window-open.md) for more details. ## Geplante Bruch-API-Änderungen (14.0) -### API geändert: `window.(offen)` +### Entfernt: `app.allowRendererProcessReuse` + +The `app.allowRendererProcessReuse` property will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. + +Weitere Informationen findest du unter [#18397](https://github.com/electron/electron/issues/18397). + +### Entfernt: Browserfenster-Affinität + +Die Einstellung `Affinität` beim Erstellen eines neuen `BrowserWindow` wird entfernt als Teil unseres Plans, sich stärker an das Prozessmodell von Chromium für Sicherheit, Leistung und Wartbarkeit anzupassen. + +Weitere Informationen findest du unter [#18397](https://github.com/electron/electron/issues/18397). + +### API geändert: `window.open()` Der optionale Parameter `FrameName` legt nicht mehr den Titel des Fensters fest. Dies folgt nun der Spezifikation, die in der [nativen Dokumentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) unter dem zugehörigen Parameter `windowName` beschrieben wird. @@ -27,6 +47,44 @@ In Electron 14 wird `worldSafeExecuteJavaScript` entfernt. Es gibt keine Altern Sie werden von dieser Änderung betroffen sein, wenn Sie entweder `webFrame.executeJavaScript` oder `webFrame.executeJavaScriptInIsolatedWorld` verwenden. Sie müssen sicherstellen, dass die von einer dieser Methoden zurückgegebenen Werte von der [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) unterstützt werden, da diese Methoden denselben Wert verwenden, der die Semantik übergeht. +### Removed: BrowserWindowConstructorOptions inheriting from parent windows + +Prior to Electron 14, windows opened with `window.open` would inherit BrowserWindow constructor options such as `transparent` and `resizable` from their parent window. Beginning with Electron 14, this behavior is removed, and windows will not inherit any BrowserWindow constructor options from their parents. + +Instead, explicitly set options for the new window with `setWindowOpenHandler`: + +```js +webContents.setWindowOpenHandler((details) => { + return { + action: 'allow', + overrideBrowserWindowOptions: { + // ... + } + } +}) +``` + +### Entfernt: `additionalFeatures` + +The deprecated `additionalFeatures` property in the `new-window` and `did-create-window` events of WebContents has been removed. Since `new-window` uses positional arguments, the argument is still present, but will always be the empty array `[]`. (Though note, the `new-window` event itself is deprecated, and is replaced by `setWindowOpenHandler`.) Bare keys in window features will now present as keys with the value `true` in the options object. + +```js +// Removed in Electron 14 +// Triggered by window.open('...', '', 'my-key') +webContents.on('did-create-window', (window, details) => { + if (details.additionalFeatures.includes('my-key')) { + // ... + } +}) + +// Replace with +webContents.on('did-create-window', (window, details) => { + if (details.options['my-key']) { + // ... + } +}) +``` + ## Geplante Bruch-API-Änderungen (13.0) ### API geändert: `session.setPermissionCheckHandler(handler)` @@ -34,7 +92,7 @@ Sie werden von dieser Änderung betroffen sein, wenn Sie entweder `webFrame.exec Die `Handler` Methoden ersten Parameters waren zuvor immer ein `webContents`, es kann jetzt manchmal `null` sein. Sie sollten die `requestingOrigin`, `einbettenOrigin` und `securityOrigin` Eigenschaften verwenden, um auf die Berechtigungsprüfung korrekt zu reagieren. Da der `Webcontent` `null sein kann` nicht mehr auf ihn angewiesen werden. ```js -// Old code +// Alter Code session.setPermissionCheckHandler((webContents, permission) => { if (webContents.getURL().startsWith('https://google.com/') && permission === 'notification') { return true @@ -42,7 +100,7 @@ session.setPermissionCheckHandler((webContents, permission) => { return false }) -// Replace with +// Ersetzen mit session.setPermissionCheckHandler((webContents, permission, requestingOrigin) => { if (new URL(requestingOrigin).hostname === 'google.com' && permission === 'notification') { return true @@ -53,18 +111,18 @@ session.setPermissionCheckHandler((webContents, permission, requestingOrigin) => ### Entfernt: `shell.moveItemToTrash()` -The deprecated synchronous `shell.moveItemToTrash()` API has been removed. Use the asynchronous `shell.trashItem()` instead. +Die veraltete synchrone `shell.moveItemToTrash()` API wurde entfernt. Verwende stattdessen die asynchrone `shell.trashItem()`. ```js -// Removed in Electron 13 -shell.moveItemToTrash(path) -// Replace with +// Entfernt in Electron 13 +shell.moveItemTosh(path) +// Ersetzen durch shell.trashItem(path).then(/* ... */) ``` ### Entfernt: `BrowserWindow` Erweiterungs-APIs -The deprecated extension APIs have been removed: +Die veralteten Erweiterungs-APIs wurden entfernt: * `BrowserWindow.addExtension(path)` * `BrowserWindow.addDevToolsExtension(path)` @@ -80,71 +138,71 @@ Use the session APIs instead: * `ses.getAllExtensions()` ```js -// Removed in Electron 13 +// In Electron 13 entfernt BrowserWindow.addExtension(path) BrowserWindow.addDevToolsExtension(path) -// Replace with +// Ersetzen durch session.defaultSession.loadExtension(path) ``` ```js -// Removed in Electron 13 -BrowserWindow.removeExtension(name) -BrowserWindow.removeDevToolsExtension(name) -// Replace with -session.defaultSession.removeExtension(extension_id) +// In Electron 13 entfernt +BrowserWindow.addExtension(path) +BrowserWindow.addDevToolsExtension(path) +// Ersetzen durch +session.defaultSession.loadExtension(path) ``` ```js -// Removed in Electron 13 +// In Electron 13 entfernt BrowserWindow.getExtensions() BrowserWindow.getDevToolsExtensions() -// Replace with +// Ersetzen durch session.defaultSession.getAllExtensions() ``` ### Eliminado: métodos en `systemPreferences` -The following `systemPreferences` methods have been deprecated: +Die folgenden `systemPreferences` Methoden wurden veraltet: * `systemPreferences.isDarkMode()` * `systemPreferences.isInvertedColorScheme()` * `systemPreferences.isHighContrastColorScheme()` -Use the following `nativeTheme` properties instead: +Verwende stattdessen die folgenden `nativeTheme` Eigenschaften: * `nativeTheme.shouldUseDarkColors` * `nativeTheme.shouldUseInvertedColorScheme` * `nativeTheme.shouldUseHighContrastColors` ```js -// Removed in Electron 13 +// Entfernt in Electron 13 systemPreferences.isDarkMode() -// Replace with +// Ersetzen durch nativeTheme.shouldUseDarkColors -// Removed in Electron 13 -systemPreferences.isInvertedColorScheme() -// Replace with +// Entfernt in Electron 13 +systemPreferences. sInvertedColorScheme() +// Ersetzen durch nativeTheme.shouldUseInvertedColorScheme -// Removed in Electron 13 +// In Electron 13 entfernt systemPreferences.isHighContrastColorScheme() -// Replace with -nativeTheme.shouldUseHighContrastColors +// Ersetzen durch +nativeTheme.shouldUseHighContrastColorColorScheme ``` -### Deprecated: WebContents `new-window` event +### Veraltet: WebContents `new-window` Ereignis -The `new-window` event of WebContents has been deprecated. It is replaced by [`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler). +Das `new-window` Ereignis von WebContents wurde veraltet. It is replaced by [`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler). ```js -// Deprecated in Electron 13 +// Veraltet in Electron 13 webContents.on('new-window', (event) => { - event.preventDefault() + event. reventDefault() }) -// Replace with +// Ersetzen durch webContents.setWindowOpenHandler((details) => { return { action: 'deny' } }) @@ -152,15 +210,15 @@ webContents.setWindowOpenHandler((details) => { ## Geplante Bruch-API-Änderungen (12.0) -### Removed: Pepper Flash support +### Entfernt: Pepper Flash Unterstützung -Chromium has removed support for Flash, and so we must follow suit. See Chromium's [Flash Roadmap](https://www.chromium.org/flash-roadmap) for more details. +Chromium hat die Unterstützung für Flash entfernt, und deshalb müssen wir diesem Beispiel folgen. Weitere Details findest du in der [Flash-Roadmap](https://www.chromium.org/flash-roadmap) von Chromium. -### Default Changed: `worldSafeExecuteJavaScript` defaults to `true` +### Standardwert geändert: `worldSafeExecuteJavaScript` ist standardmäßig auf `true` eingestellt -In Electron 12, `worldSafeExecuteJavaScript` will be enabled by default. To restore the previous behavior, `worldSafeExecuteJavaScript: false` must be specified in WebPreferences. Please note that setting this option to `false` is **insecure**. +In Electron 12, `worldSafeExecuteJavaScript` wird standardmäßig aktiviert. Um das vorherige Verhalten wiederherzustellen, muss `worldSafeExecuteJavaScript: false` in WebPreferences angegeben werden. Bitte beachte, dass die Einstellung dieser Option auf `false` **unsicher** ist. -This option will be removed in Electron 14 so please migrate your code to support the default value. +Diese Einstellung wird in Electron 14 entfernt, also migriere bitte deinen Code um den Standardwert zu unterstützen. ### Default Changed: `contextIsolation` defaults to `true` @@ -285,12 +343,6 @@ See [#23265](https://github.com/electron/electron/pull/23265) for more details. Setting `{ compress: false }` in `crashReporter.start` is deprecated. Nearly all crash ingestion servers support gzip compression. This option will be removed in a future version of Electron. -### Removed: Browser Window Affinity - -The `affinity` option when constructing a new `BrowserWindow` will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. - -For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). - ### Default Changed: `enableRemoteModule` defaults to `false` In Electron 9, using the remote module without explicitly enabling it via the `enableRemoteModule` WebPreferences option began emitting a warning. In Electron 10, the remote module is now disabled by default. To use the remote module, `enableRemoteModule: true` must be specified in WebPreferences: @@ -369,7 +421,7 @@ As of Electron 9 we do not allow loading of non-context-aware native modules in If this impacts you, you can temporarily set `app.allowRendererProcessReuse` to `false` to revert to the old behavior. This flag will only be an option until Electron 11 so you should plan to update your native modules to be context aware. -For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). +Weitere Informationen findest du unter [#18397](https://github.com/electron/electron/issues/18397). ### Deprecated: `BrowserWindow` extension APIs @@ -535,13 +587,13 @@ nativeTheme.on('updated', () => { /* ... */ }) ### Deprecated: methods in `systemPreferences` -The following `systemPreferences` methods have been deprecated: +Die folgenden `systemPreferences` Methoden wurden veraltet: * `systemPreferences.isDarkMode()` * `systemPreferences.isInvertedColorScheme()` * `systemPreferences.isHighContrastColorScheme()` -Use the following `nativeTheme` properties instead: +Verwende stattdessen die folgenden `nativeTheme` Eigenschaften: * `nativeTheme.shouldUseDarkColors` * `nativeTheme.shouldUseInvertedColorScheme` diff --git a/content/de-DE/docs/development/pull-requests.md b/content/de-DE/docs/development/pull-requests.md index 340608ffc252a..b29bf09f2ed68 100644 --- a/content/de-DE/docs/development/pull-requests.md +++ b/content/de-DE/docs/development/pull-requests.md @@ -92,7 +92,6 @@ Common prefixes: * perf: A code change that improves performance * refactor: A code change that neither fixes a bug nor adds a feature * style: Changes that do not affect the meaning of the code (linting) -* vendor: Bumping a dependency like libchromiumcontent or node Other things to keep in mind when writing a commit message: diff --git a/content/de-DE/docs/development/source-code-directory-structure.md b/content/de-DE/docs/development/source-code-directory-structure.md index 7a32e69093442..e1ecd622780f3 100644 --- a/content/de-DE/docs/development/source-code-directory-structure.md +++ b/content/de-DE/docs/development/source-code-directory-structure.md @@ -79,7 +79,6 @@ Electron * **.circleci** - Config file for CI with CircleCI. * **.github** - GitHub-specific config files including issues templates and CODEOWNERS. * **dist** - Temporary directory created by `script/create-dist.py` script when creating a distribution. -* **external_binaries** - Downloaded binaries of third-party frameworks which do not support building with `gn`. * **node_modules** - Third party node modules used for building. * **npm** - Logic for installation of Electron via npm. * **out** - Temporary output directory of `ninja`. @@ -95,4 +94,3 @@ script/ - The set of all scripts Electron runs for a variety of purposes. ``` * **typings** - TypeScript typings for Electron's internal code. -* **vendor** - Source code for some third party dependencies. diff --git a/content/de-DE/docs/tutorial/application-debugging.md b/content/de-DE/docs/tutorial/application-debugging.md index 77db0dca5c3cb..639e3e6f87b03 100644 --- a/content/de-DE/docs/tutorial/application-debugging.md +++ b/content/de-DE/docs/tutorial/application-debugging.md @@ -29,7 +29,7 @@ Wenn der V8-Kontext abstützen sollte, wird folgende Nachricht in DevTools angez Chromium Logs können durch das Einstellen der Umgebungsvariabel `ELECTRON_ENABLE_LOGGING` aktiviert werden. Weitere Informationen könenn in der [Dokumentation zu den Umgebungsvariablen](../api/environment-variables.md#electron_enable_logging) gefunden werden. -Alternativ kann dies aber auch durch das Argument `--enable-logging` im Terminal aktiviert werden. Weitere Informationen hierzu kann in der [Dokumentation der Konsolen-Argumente](../api/command-line-switches.md#--enable-logging) gefunden werden. +Alternativ kann dies aber auch durch das Argument `--enable-logging` im Terminal aktiviert werden. Weitere Informationen hierzu kann in der [Dokumentation der Konsolen-Argumente](../api/command-line-switches.md#--enable-loggingfile) gefunden werden. [node-inspect]: https://nodejs.org/en/docs/inspector/ [devtools]: https://developer.chrome.com/devtools diff --git a/content/de-DE/docs/tutorial/code-signing.md b/content/de-DE/docs/tutorial/code-signing.md index 3d8e7b1ea08f6..0406f01775fb6 100644 --- a/content/de-DE/docs/tutorial/code-signing.md +++ b/content/de-DE/docs/tutorial/code-signing.md @@ -103,7 +103,7 @@ Electron Builder comes with a custom solution for signing your application. You If you're not using an integrated build pipeline like Forge or Builder, you are likely using [`electron-packager`][], which includes [`electron-osx-sign`][] and [`electron-notarize`][]. -If you're using Packager's API, you can pass [in configuration that both signs and notarizes your application](https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html). +If you're using Packager's API, you can pass [in configuration that both signs and notarizes your application](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html). ```js const packager = require('electron-packager') @@ -156,7 +156,6 @@ You can get a code signing certificate from a lot of resellers. Prices vary, so * [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm) * [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing) -* [GoDaddy](https://au.godaddy.com/web-security/code-signing-certificate) * Amongst others, please shop around to find one that suits your needs, Google is your friend 😄 There are a number of tools for signing your packaged app: diff --git a/content/de-DE/docs/tutorial/dark-mode.md b/content/de-DE/docs/tutorial/dark-mode.md index 222f05592a73b..b537de208f249 100644 --- a/content/de-DE/docs/tutorial/dark-mode.md +++ b/content/de-DE/docs/tutorial/dark-mode.md @@ -1,4 +1,4 @@ -# Dark Mode +# Nachtmodus ## Übersicht @@ -56,9 +56,9 @@ Starting with the `index.html` file: ``` -And the `style.css` file: +And the `styles.css` file: -```css title='style.css' +```css title='styles.css' @media (prefers-color-scheme: dark) { body { background: #333; color: white; } } @@ -155,11 +155,11 @@ The `'dark-mode:system'` IPC channel handler method assigns the string `'system' Run the example using Electron Fiddle and then click the "Toggle Dark Mode" button; the app should start alternating between a light and dark background color. -![Dark Mode](../images/dark_mode.gif) +![Nachtmodus](../images/dark_mode.gif) [system-wide-dark-mode]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/ [electron-forge]: https://www.electronforge.io/ [electron-packager]: https://github.com/electron/electron-packager -[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport +[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#darwindarkmodesupport [prefers-color-scheme]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme [event-listeners]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener diff --git a/content/de-DE/docs/tutorial/in-app-purchases.md b/content/de-DE/docs/tutorial/in-app-purchases.md index f9c2e9381ecb8..a49ad6972df0b 100644 --- a/content/de-DE/docs/tutorial/in-app-purchases.md +++ b/content/de-DE/docs/tutorial/in-app-purchases.md @@ -1,4 +1,4 @@ -# In-App Purchase (macOS) +# In-App Purchases (macOS) ## Preparing diff --git a/content/de-DE/docs/tutorial/installation.md b/content/de-DE/docs/tutorial/installation.md index d957fdef8311a..0eff68c4b1be1 100644 --- a/content/de-DE/docs/tutorial/installation.md +++ b/content/de-DE/docs/tutorial/installation.md @@ -1,4 +1,4 @@ -# Installation +# Advanced Installation Instructions To install prebuilt Electron binaries, use [`npm`][npm]. The preferred method is to install Electron as a development dependency in your app: diff --git a/content/de-DE/docs/tutorial/launch-app-from-url-in-another-app.md b/content/de-DE/docs/tutorial/launch-app-from-url-in-another-app.md index 809b2e2ddd411..d2b01a84160f5 100644 --- a/content/de-DE/docs/tutorial/launch-app-from-url-in-another-app.md +++ b/content/de-DE/docs/tutorial/launch-app-from-url-in-another-app.md @@ -1,5 +1,5 @@ --- -title: launch-app-from-URL-in-another-app +title: Launching Your Electron App From A URL In Another App description: This guide will take you through the process of setting your electron app as the default handler for a specific protocol. slug: launch-app-from-url-in-another-app hide_title: true @@ -123,31 +123,25 @@ This feature will only work on macOS when your app is packaged. It will not work ### Plist ```XML -

    -

    macOS plist
    -
    
    -    
    -        
    -            
    -                
    -                    CFBundleURLTypes
    -                    
    -                        
    -                            CFBundleURLSchemes
    -                            
    -                                electron-api-demos
    -                            
    -                            CFBundleURLName
    -                            Electron API Demos Protocol
    -                        
    -                    
    -                    ElectronTeamID
    -                    VEKTX9H2N7
    -                
    -            
    -        
    -    
    -

    + + + + + CFBundleURLTypes + + + CFBundleURLSchemes + + electron-api-demos + + CFBundleURLName + Electron API Demos Protocol + + + ElectronTeamID + VEKTX9H2N7 + + ``` ## Fazit diff --git a/content/de-DE/docs/tutorial/linux-desktop-actions.md b/content/de-DE/docs/tutorial/linux-desktop-actions.md index 637c285b6ea5a..fc875c3591048 100644 --- a/content/de-DE/docs/tutorial/linux-desktop-actions.md +++ b/content/de-DE/docs/tutorial/linux-desktop-actions.md @@ -1,4 +1,4 @@ -# Custom Linux Desktop Launcher Actions +# Desktop Launcher Actions (Linux) ## Übersicht diff --git a/content/de-DE/docs/tutorial/macos-dock.md b/content/de-DE/docs/tutorial/macos-dock.md index 1c6d97aeb3a72..be7350b4a0627 100644 --- a/content/de-DE/docs/tutorial/macos-dock.md +++ b/content/de-DE/docs/tutorial/macos-dock.md @@ -1,4 +1,4 @@ -# Configuring the macOS Dock +# Dock (macOS) Electron has APIs to configure the app's icon in the macOS Dock. A macOS-only API exists to create a custom dock menu, but Electron also uses the app dock icon as the entry point for cross-platform features like [recent documents][recent-documents] and [application progress][progress-bar]. diff --git a/content/de-DE/docs/tutorial/notifications.md b/content/de-DE/docs/tutorial/notifications.md index 11fcb85212bd0..96f6062d7170b 100644 --- a/content/de-DE/docs/tutorial/notifications.md +++ b/content/de-DE/docs/tutorial/notifications.md @@ -1,4 +1,4 @@ -# Benachrichtigungen (Windows, Linux, MacOS) +# Benachrichtigungen ## Übersicht diff --git a/content/de-DE/docs/tutorial/progress-bar.md b/content/de-DE/docs/tutorial/progress-bar.md index 434574cb8d6cb..d1661a4fcbf64 100644 --- a/content/de-DE/docs/tutorial/progress-bar.md +++ b/content/de-DE/docs/tutorial/progress-bar.md @@ -1,4 +1,4 @@ -# Fortschrittsanzeige in der Taskleiste (Windows, macOS, Unity) +# Taskbar Progress Bar (Windows & macOS) ## Übersicht diff --git a/content/de-DE/docs/tutorial/represented-file.md b/content/de-DE/docs/tutorial/represented-file.md index 5bb5a9349d1fe..53330f3443699 100644 --- a/content/de-DE/docs/tutorial/represented-file.md +++ b/content/de-DE/docs/tutorial/represented-file.md @@ -1,4 +1,4 @@ -# Repräsentative Datei für macOS BrowserWindows +# Representing Files in a BrowserWindow (macOS) ## Übersicht diff --git a/content/de-DE/docs/tutorial/security.md b/content/de-DE/docs/tutorial/security.md index 12911c4f4303c..c57a02fdcf226 100644 --- a/content/de-DE/docs/tutorial/security.md +++ b/content/de-DE/docs/tutorial/security.md @@ -18,7 +18,7 @@ Electron keeps up to date with alternating Chromium releases. For more informati It is important to remember that the security of your Electron application is the result of the overall security of the framework foundation (*Chromium*, *Node.js*), Electron itself, all NPM dependencies and your code. As such, it is your responsibility to follow a few important best practices: -* **Keep your application up-to-date with the latest Electron framework release.** When releasing your product, you’re also shipping a bundle composed of Electron, Chromium shared library and Node.js. Vulnerabilities affecting these components may impact the security of your application. By updating Electron to the latest version, you ensure that critical vulnerabilities (such as *nodeIntegration bypasses*) are already patched and cannot be exploited in your application. For more information, see "[Use a current version of Electron](#15-use-a-current-version-of-electron)". +* **Keep your application up-to-date with the latest Electron framework release.** When releasing your product, you’re also shipping a bundle composed of Electron, Chromium shared library and Node.js. Vulnerabilities affecting these components may impact the security of your application. By updating Electron to the latest version, you ensure that critical vulnerabilities (such as *nodeIntegration bypasses*) are already patched and cannot be exploited in your application. For more information, see "[Use a current version of Electron](#16-use-a-current-version-of-electron)". * **Evaluate your dependencies.** While NPM provides half a million reusable packages, it is your responsibility to choose trusted 3rd-party libraries. If you use outdated libraries affected by known vulnerabilities or rely on poorly maintained code, your application security could be in jeopardy. @@ -43,18 +43,19 @@ You should at least follow these steps to improve the security of your applicati 1. [Only load secure content](#1-only-load-secure-content) 2. [Disable the Node.js integration in all renderers that display remote content](#2-do-not-enable-nodejs-integration-for-remote-content) 3. [Enable context isolation in all renderers that display remote content](#3-enable-context-isolation-for-remote-content) -4. [Use `ses.setPermissionRequestHandler()` in all sessions that load remote content](#4-handle-session-permission-requests-from-remote-content) -5. [Do not disable `webSecurity`](#5-do-not-disable-websecurity) -6. [Define a `Content-Security-Policy`](#6-define-a-content-security-policy) and use restrictive rules (i.e. `script-src 'self'`) -7. [Do not set `allowRunningInsecureContent` to `true`](#7-do-not-set-allowrunninginsecurecontent-to-true) -8. [Do not enable experimental features](#8-do-not-enable-experimental-features) -9. [Do not use `enableBlinkFeatures`](#9-do-not-use-enableblinkfeatures) -10. [``: Do not use `allowpopups`](#10-do-not-use-allowpopups) -11. [``: Verify options and params](#11-verify-webview-options-before-creation) -12. [Disable or limit navigation](#12-disable-or-limit-navigation) -13. [Disable or limit creation of new windows](#13-disable-or-limit-creation-of-new-windows) -14. [Do not use `openExternal` with untrusted content](#14-do-not-use-openexternal-with-untrusted-content) -15. [Use a current version of Electron](#15-use-a-current-version-of-electron) +4. [Enable sandboxing](#4-enable-sandboxing) +5. [Use `ses.setPermissionRequestHandler()` in all sessions that load remote content](#5-handle-session-permission-requests-from-remote-content) +6. [Do not disable `webSecurity`](#6-do-not-disable-websecurity) +7. [Define a `Content-Security-Policy`](#7-define-a-content-security-policy) and use restrictive rules (i.e. `script-src 'self'`) +8. [Do not set `allowRunningInsecureContent` to `true`](#8-do-not-set-allowrunninginsecurecontent-to-true) +9. [Do not enable experimental features](#9-do-not-enable-experimental-features) +10. [Do not use `enableBlinkFeatures`](#10-do-not-use-enableblinkfeatures) +11. [``: Do not use `allowpopups`](#11-do-not-use-allowpopups) +12. [``: Verify options and params](#12-verify-webview-options-before-creation) +13. [Disable or limit navigation](#13-disable-or-limit-navigation) +14. [Disable or limit creation of new windows](#14-disable-or-limit-creation-of-new-windows) +15. [Do not use `openExternal` with untrusted content](#15-do-not-use-openexternal-with-untrusted-content) +16. [Use a current version of Electron](#16-use-a-current-version-of-electron) To automate the detection of misconfigurations and insecure patterns, it is possible to use [electronegativity](https://github.com/doyensec/electronegativity). For additional details on potential weaknesses and implementation bugs when developing applications using Electron, please refer to this [guide for developers and auditors](https://doyensec.com/resources/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf) @@ -158,7 +159,23 @@ Even when `nodeIntegration: false` is used, to truly enforce strong isolation an For more information on what `contextIsolation` is and how to enable it please see our dedicated [Context Isolation](context-isolation.md) document. -## 4) Handle Session Permission Requests From Remote Content +## 4) Enable Sandboxing + +[Sandboxing](sandbox.md) is a Chromium feature that uses the operating system to significantly limit what renderer processes have access to. You should enable the sandbox in all renderers. Loading, reading or processing any untrusted content in an unsandboxed process, including the main process, is not advised. + +### How? + +When creating a window, pass the `sandbox: true` option in `webPreferences`: + +```js +const win = new BrowserWindow({ + webPreferences: { + sandbox: true + } +}) +``` + +## 5) Handle Session Permission Requests From Remote Content You may have seen permission requests while using Chrome: They pop up whenever the website attempts to use a feature that the user has to manually approve ( like notifications). @@ -191,7 +208,7 @@ session }) ``` -## 5) Do Not Disable WebSecurity +## 6) Do Not Disable WebSecurity _Recommendation is Electron's default_ @@ -227,7 +244,7 @@ const mainWindow = new BrowserWindow() ``` -## 6) Define a Content Security Policy +## 7) Define a Content Security Policy A Content Security Policy (CSP) is an additional layer of protection against cross-site-scripting attacks and data injection attacks. We recommend that they be enabled by any website you load inside Electron. @@ -270,7 +287,7 @@ CSP's preferred delivery mechanism is an HTTP header, however it is not possible ``` -## 7) Setze `allowRunningInsecureContent` nicht auf `true` +## 8) Setze `allowRunningInsecureContent` nicht auf `true` _Recommendation is Electron's default_ @@ -298,7 +315,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 8) Do Not Enable Experimental Features +## 9) Do Not Enable Experimental Features _Recommendation is Electron's default_ @@ -326,7 +343,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 9) Do Not Use `enableBlinkFeatures` +## 10) Do Not Use `enableBlinkFeatures` _Recommendation is Electron's default_ @@ -352,7 +369,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow() ``` -## 10) Do Not Use `allowpopups` +## 11) Do Not Use `allowpopups` _Recommendation is Electron's default_ @@ -372,7 +389,7 @@ If you do not need popups, you are better off not allowing the creation of new [ ``` -## 11) Verify WebView Options Before Creation +## 12) Verify WebView Options Before Creation A WebView created in a renderer process that does not have Node.js integration enabled will not be able to enable integration itself. However, a WebView will always create an independent renderer process with its own `webPreferences`. @@ -408,7 +425,7 @@ app.on('web-contents-created', (event, contents) => { Again, this list merely minimizes the risk, it does not remove it. If your goal is to display a website, a browser will be a more secure option. -## 12) Disable or limit navigation +## 13) Disable or limit navigation If your app has no need to navigate or only needs to navigate to known pages, it is a good idea to limit navigation outright to that known scope, disallowing any other kinds of navigation. @@ -438,7 +455,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 13) Disable or limit creation of new windows +## 14) Disable or limit creation of new windows If you have a known set of windows, it's a good idea to limit the creation of additional windows in your app. @@ -473,7 +490,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 14) Do not use `openExternal` with untrusted content +## 15) Do not use `openExternal` with untrusted content Shell's [`openExternal`][open-external] allows opening a given protocol URI with the desktop's native utilities. On macOS, for instance, this function is similar to the `open` terminal command utility and will open the specific application based on the URI and filetype association. @@ -495,7 +512,7 @@ const { shell } = require('electron') shell.openExternal('https://example.com/index.html') ``` -## 15) Use a current version of Electron +## 16) Use a current version of Electron You should strive for always using the latest available version of Electron. Whenever a new major version is released, you should attempt to update your app as quickly as possible. diff --git a/content/de-DE/docs/tutorial/snapcraft.md b/content/de-DE/docs/tutorial/snapcraft.md index 87fdeae1768f1..a70ac8cf341fa 100644 --- a/content/de-DE/docs/tutorial/snapcraft.md +++ b/content/de-DE/docs/tutorial/snapcraft.md @@ -1,4 +1,4 @@ -# Snapcraft Guide (Ubuntu Software Center & More) +# Snapcraft Guide (Linux) This guide provides information on how to package your Electron application for any Snapcraft environment, including the Ubuntu Software Center. diff --git a/content/de-DE/docs/tutorial/support.md b/content/de-DE/docs/tutorial/support.md index 1ab2837f50cdb..d9e8aa2067583 100644 --- a/content/de-DE/docs/tutorial/support.md +++ b/content/de-DE/docs/tutorial/support.md @@ -41,9 +41,9 @@ When an API is changed or removed in a way that breaks existing functionality, t ### Currently supported versions +* 14.x.y * 13.x.y * 12.x.y -* 11.x.y ### End-of-life diff --git a/content/de-DE/docs/tutorial/updates.md b/content/de-DE/docs/tutorial/updates.md index 584e7289d7f98..7cd495e0addcc 100644 --- a/content/de-DE/docs/tutorial/updates.md +++ b/content/de-DE/docs/tutorial/updates.md @@ -35,14 +35,14 @@ Wenn Sie eine private Electron-Anwendung entwickeln oder wenn Sie sie nicht auf Abhängig von Ihren Ansprüchen können Sie einen der folgenden Server nutzen: -- [Hazel][hazel] – Update server for private or open-source apps which can be deployed for free on [Now][now]. It pulls from [GitHub Releases][gh-releases] and leverages the power of GitHub's CDN. +- [Hazel][hazel] – Update server for private or open-source apps which can be deployed for free on [Vercel][vercel]. It pulls from [GitHub Releases][gh-releases] and leverages the power of GitHub's CDN. - [Nuts][nuts] – Also uses [GitHub Releases][gh-releases], but caches app updates on disk and supports private repositories. - [electron-release-server][electron-release-server] – Provides a dashboard for handling releases and does not require releases to originate on GitHub. - [Nucleus][nucleus] – A complete update server for Electron apps maintained by Atlassian. Supports multiple applications and channels; uses a static file store to minify server cost. ## Implementieren von Updates in deiner App -Wenn Sie Ihren Update-Server aufgesetzt haben, fahren Sie mit dem Importieren der erforderlichen Module in Ihrem Code fort. Der folgende Code kann etwas abweichen für die verschiedenen Server, aber er funktioniert wie beschrieben bei der Verwendung von [Hazel](https://github.com/zeit/hazel). +Wenn Sie Ihren Update-Server aufgesetzt haben, fahren Sie mit dem Importieren der erforderlichen Module in Ihrem Code fort. Der folgende Code kann etwas abweichen für die verschiedenen Server, aber er funktioniert wie beschrieben bei der Verwendung von [Hazel][hazel]. **Wichtig:** Bitte stellen Sie sicher, das der Code nur in Ihrer gepackten App ausgeführt wird und nicht in der Entwicklungsumgebung. Sie können [electron-is-dev](https://github.com/sindresorhus/electron-is-dev) nutzen, um Ihre Entwicklungsumgebung zu überprüfen. @@ -102,8 +102,8 @@ autoUpdater.on('error', message => { Because the requests made by Auto Update aren't under your direct control, you may find situations that are difficult to handle (such as if the update server is behind authentication). The `url` field does support files, which means that with some effort, you can sidestep the server-communication aspect of the process. [Here's an example of how this could work](https://github.com/electron/electron/issues/5020#issuecomment-477636990). -[now]: https://zeit.co/now -[hazel]: https://github.com/zeit/hazel +[vercel]: https://vercel.com +[hazel]: https://github.com/vercel/hazel [nuts]: https://github.com/GitbookIO/nuts [gh-releases]: https://help.github.com/articles/creating-releases/ [electron-release-server]: https://github.com/ArekSredzki/electron-release-server diff --git a/content/de-DE/docs/tutorial/using-native-node-modules.md b/content/de-DE/docs/tutorial/using-native-node-modules.md index 860b7a4947b8e..8cf8b4b79d821 100644 --- a/content/de-DE/docs/tutorial/using-native-node-modules.md +++ b/content/de-DE/docs/tutorial/using-native-node-modules.md @@ -1,4 +1,4 @@ -# Verwendung von Native Node Modules +# Native Node Modules Native Node.js modules are supported by Electron, but since Electron has a different [application binary interface (ABI)][abi] from a given Node.js binary (due to differences such as using Chromium's BoringSSL instead of OpenSSL), the native modules you use will need to be recompiled for Electron. Otherwise, you will get the following class of error when you try to run your app: @@ -74,7 +74,7 @@ HOME=~/.electron-gyp node-gyp rebuild --target=1.2.3 --arch=x64 --dist-url=https To compile native Node modules against a custom build of Electron that doesn't match a public release, instruct `npm` to use the version of Node you have bundled with your custom build. ```sh -npm rebuild --nodedir=/path/to/electron/vendor/node +npm rebuild --nodedir=/path/to/src/out/Default/gen/node_headers ``` ## Problemlösungen diff --git a/content/de-DE/docs/tutorial/using-pepper-flash-plugin.md b/content/de-DE/docs/tutorial/using-pepper-flash-plugin.md index 1751e48969c6a..f09a9f2d2fdaa 100644 --- a/content/de-DE/docs/tutorial/using-pepper-flash-plugin.md +++ b/content/de-DE/docs/tutorial/using-pepper-flash-plugin.md @@ -1,4 +1,4 @@ -# Verwendung des Pepper Flash-Plugins +# Pepper Flash Plugin Electron no longer supports the Pepper Flash plugin, as Chrome has removed support. diff --git a/content/de-DE/docs/tutorial/using-selenium-and-webdriver.md b/content/de-DE/docs/tutorial/using-selenium-and-webdriver.md index 77815135d0fab..144b8d2b24a41 100644 --- a/content/de-DE/docs/tutorial/using-selenium-and-webdriver.md +++ b/content/de-DE/docs/tutorial/using-selenium-and-webdriver.md @@ -1,4 +1,4 @@ -# Verwendung von Selenium und WebDriver +# Selenium and WebDriver Aus [ChromeDriver - WebDriver for Chrome][chrome-driver]: diff --git a/content/de-DE/docs/tutorial/web-embeds.md b/content/de-DE/docs/tutorial/web-embeds.md index da2ccf5a59e28..96f9cf11c209f 100644 --- a/content/de-DE/docs/tutorial/web-embeds.md +++ b/content/de-DE/docs/tutorial/web-embeds.md @@ -1,4 +1,4 @@ -# Web embeds +# Web Embeds ## Übersicht diff --git a/content/de-DE/docs/tutorial/windows-arm.md b/content/de-DE/docs/tutorial/windows-arm.md index 78b7baf2b6a3f..b8f076597351f 100644 --- a/content/de-DE/docs/tutorial/windows-arm.md +++ b/content/de-DE/docs/tutorial/windows-arm.md @@ -1,4 +1,4 @@ -# Windows 10 auf Arm +# Windows on ARM Wenn Ihre App mit Electron 6.0.8 oder höher läuft, können Sie sie nun unter Arm für Windows 10 bauen. This considerably improves performance, but requires recompilation of any native modules used in your app. It may also require small fixups to your build and packaging scripts. diff --git a/content/de-DE/docs/tutorial/windows-taskbar.md b/content/de-DE/docs/tutorial/windows-taskbar.md index 111a31a6579ac..7545ceff1950c 100644 --- a/content/de-DE/docs/tutorial/windows-taskbar.md +++ b/content/de-DE/docs/tutorial/windows-taskbar.md @@ -1,4 +1,4 @@ -# Windows Taskbar +# Taskbar Customization (Windows) ## Übersicht diff --git a/content/de-DE/website/blog/webview2.md b/content/de-DE/website/blog/webview2.md new file mode 100644 index 0000000000000..a70dc2a18d9ff --- /dev/null +++ b/content/de-DE/website/blog/webview2.md @@ -0,0 +1,81 @@ +--- +title: WebView2 and Electron +author: + - electron +date: '2021-07-22' +--- + +Over the past weeks, we’ve received several questions about the differences between the new [WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) and Electron. + +Both teams have the expressed goal of making web-tech the best it can be on the Desktop, and a shared comprehensive comparison is being discussed. + +Electron and WebView2 are fast-moving and constantly evolving projects. We have assembled a brief snapshot of similarities and differences between Electron and WebView2 as they exist today. + +--- + +## Architecture Overview + +Electron and WebView2 both build from the Chromium source for rendering web content. Strictly speaking, WebView2 builds from the Edge source, but Edge is built using a fork of the Chromium source. Electron does not share any DLLs with Chrome. WebView2 binaries hard link against Edge (Stable channel as of Edge 90), so they share disk and some working set. See [Evergreen distribution mode](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#evergreen-distribution-mode) for more info. + +Electron apps always bundle and distribute the exact version of Electron with which they were developed. WebView2 has two options in distribution. You can bundle the exact WebView2 library your application was developed with, or you can use a shared-runtime version that may already be present on the system. WebView2 provides tools for each approach, including a bootstrapping installer in case the shared runtime is missing. WebView2 is shipped _inbox_ starting with Windows 11. + +Applications that bundle their frameworks are responsible for updating those frameworks, including minor security releases. For apps using the shared WebView2 runtime, WebView2 has its own updater, similar to Chrome or Edge, that runs independent of your application. Updating the application's code or any of its other dependencies is still a responsibility for the developer, same as with Electron. Neither Electron nor WebView2 is managed by Windows Update. + +Both Electron and WebView2 inherit Chromium’s multi-process architecture - namely, a single main process that communicates with one-or-more renderer processes. These processes are entirely separate from other applications running on the system. Every Electron application is a separate process tree, containing a root browser-process, some utility processes, and zero or more render processes. WebView2 apps that use the same [user data folder](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder) (like a suite of apps would do), share non-renderer processes. WebView2 apps using different data folders do not share processes. + +* ElectronJS Process Model: + + ![ElectronJS Process Model Diagram](/images/Electron-Architecture.png) +* WebView2 Based Application Process Model: + + ![WebView2 Process Model Diagram](/images/WebView2-Architecture.png) + +Read more about [WebView2’s process model](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/process-model) and [Electron’s process model](https://www.electronjs.org/docs/tutorial/process-model) here. + +Electron provides APIs for common desktop application needs such as menus, file system access, notifications, and more. WebView2 is a component meant to be integrated into an application framework such as WinForms, WPF, WinUI, or Win32. WebView2 does not provide operating system APIs outside the web standard via JavaScript. + +Node.js is integrated into Electron. Electron applications may use any Node.js API, module, or node-native-addon from the renderer and main processes. A WebView2 application does not assume which language or framework the rest of your application is written in. Your JavaScript code must proxy any operating system access through the application-host process. + +Electron strives to maintain compatibility with the web API, including APIs developed from the [Fugu Project](https://fugu-tracker.web.app/). We have a [snapshot of Electron’s Fugu API compatibility](https://docs.google.com/spreadsheets/d/1APQalp8HCa-lXVOqyul369G-wjM2RcojMujgi67YaoE/edit?usp=sharing). WebView2 maintains a similar list of [API differences from Edge](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/browser-features). + +Electron has a configurable security model for web content, from full-access to full-sandbox. WebView2 content is always sandboxed. Electron has [comprehensive security documentation](https://www.electronjs.org/docs/tutorial/security) on choosing your security model. WebView2 also has [security best practices](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/security). + +The Electron source is maintained and available on GitHub. Applications can modify can build their own _brands_ of Electron. The WebView2 source is not available on GitHub. + +Quick Summary: + +| | Electron | WebView2 | +| ----------------------------------- | ---------------:| -----------------------:| +| Build Dependency | Chromium | Edge | +| Source Available on GitHub | Ja | Nein | +| Shares Edge/Chrome DLLs | Nein | Yes (as of Edge 90) | +| Shared Runtime Between Applications | Nein | Optional | +| Application APIs | Ja | Nein | +| Node.js | Ja | Nein | +| Sandbox | Optional | Always | +| Requires an Application Framework | Nein | Ja | +| Unterstützte Plattformen | Mac, Win, Linux | Win (Mac/Linux planned) | +| Process Sharing Between Apps | Never | Optional | +| Framework Updates Managed By | Application | WebView2 | + +## Performance Discussion + +When it comes to rendering your web content, we expect little performance difference between Electron, WebView2, and any other Chromium-based renderer. We created [scaffolding for apps built using Electron, C++ + WebView2, and C# + WebView2](https://github.com/crossplatform-dev/xplat-challenges) for those interested to investigate potential performance differences. + +There are a few differences that come into play _outside_ of rendering web content, and folks from Electron, WebView2, Edge, and others have expressed interest in working on a detailed comparison including PWAs. + +### Inter-Process Communication (IPC) + +_There is one difference we want to highlight immediately, as we believe it is often a performance consideration in Electron apps._ + +In Chromium, the browser process acts as an IPC broker between sandboxed renderers and the rest of the system. While Electron allows unsandboxed render processes, many apps choose to enable the sandbox for added security. WebView2 always has the sandbox enabled, so for most Electron and WebView2 apps IPC can impact overall performance. + +Even though Electron and WebView2 have a similar process models, the underlying IPC differs. Communicating between JavaScript and C++ or C# requires [marshalling](https://en.wikipedia.org/wiki/Marshalling_(computer_science)), most commonly to a JSON string. JSON serialization/parsing is an expensive operation, and IPC-bottlenecks can negatively impact performance. Starting with Edge 93, WV2 will use [CBOR](https://en.wikipedia.org/wiki/CBOR) for network events. + +Electron supports direct IPC between any two processes via the [MessagePorts](https://www.electronjs.org/docs/latest/tutorial/message-ports) API, which utilize [the structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). Applications which leverage this can avoid paying the JSON-serialization tax when sending objects between processes. + +## Zusammenfassung + +Electron and WebView2 have a number of differences, but don't expect much difference with respect to how they perform rendering web content. Ultimately, an app’s architecture and JavaScript libraries/frameworks have a larger impact on memory and performance than anything else because _Chromium is Chromium_ regardless of where it is running. + +Special thanks to the WebView2 team for reviewing this post, and ensuring we have an up-to-date view of the WebView2 architecture. They welcome any [feedback on the project](https://github.com/MicrosoftEdge/WebView2Feedback). diff --git a/content/de-DE/website/i18n/code.json b/content/de-DE/website/i18n/code.json index 8291b10512852..bc8dc20353d04 100644 --- a/content/de-DE/website/i18n/code.json +++ b/content/de-DE/website/i18n/code.json @@ -51,14 +51,14 @@ "message": "Older Post", "description": "The blog post button label to navigate to the older/next post" }, - "theme.blog.sidebar.navAriaLabel": { - "message": "Blog recent posts navigation", - "description": "The ARIA label for recent posts in the blog sidebar" - }, "theme.tags.tagsPageTitle": { "message": "Tags", "description": "The title of the tag list page" }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Blog recent posts navigation", + "description": "The ARIA label for recent posts in the blog sidebar" + }, "theme.blog.post.plurals": { "message": "One post|{count} posts", "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" @@ -76,11 +76,11 @@ "description": "The ARIA label for copy code blocks button" }, "theme.CodeBlock.copied": { - "message": "Copied", + "message": "Kopiert", "description": "The copied button label on code blocks" }, "theme.CodeBlock.copy": { - "message": "Copy", + "message": "Kopieren", "description": "The copy button label on code blocks" }, "theme.docs.sidebar.expandButtonTitle": { @@ -96,11 +96,11 @@ "description": "The ARIA label for the docs pagination" }, "theme.docs.paginator.previous": { - "message": "Previous", + "message": "Vorherige", "description": "The label used to navigate to the previous doc" }, "theme.docs.paginator.next": { - "message": "Next", + "message": "Nächste", "description": "The label used to navigate to the next doc" }, "theme.docs.sidebar.collapseButtonTitle": { @@ -111,18 +111,6 @@ "message": "Collapse sidebar", "description": "The title attribute for collapse button of doc sidebar" }, - "theme.docs.sidebar.responsiveCloseButtonLabel": { - "message": "Close menu", - "description": "The ARIA label for close button of mobile doc sidebar" - }, - "theme.docs.sidebar.responsiveOpenButtonLabel": { - "message": "Open menu", - "description": "The ARIA label for open button of mobile doc sidebar" - }, - "theme.docs.sidebar.navAriaLabel": { - "message": "Sidebar navigation", - "description": "The ARIA label for documentation menu" - }, "theme.docs.versions.unreleasedVersionLabel": { "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", "description": "The label used to tell the user that he's browsing an unreleased doc version" @@ -133,7 +121,7 @@ }, "theme.docs.versions.latestVersionSuggestionLabel": { "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", - "description": "The label userd to tell the user that he's browsing an unmaintained doc version" + "description": "The label used to tell the user to check the latest version" }, "theme.docs.versions.latestVersionLinkLabel": { "message": "latest version", @@ -159,10 +147,18 @@ "message": "Last updated{atDate}{byUser}", "description": "The sentence used to display when a page has been last updated, and by who" }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Back to main menu", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, "theme.common.skipToMainContent": { "message": "Skip to main content", "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "On this page", + "description": "The label used by the button on the collapsible TOC component" + }, "theme.SearchPage.documentsFound.plurals": { "message": "One document found|{count} documents found", "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" @@ -180,7 +176,7 @@ "description": "The placeholder for search page input" }, "theme.SearchPage.inputLabel": { - "message": "Search", + "message": "Suche", "description": "The ARIA label for search page input" }, "theme.SearchPage.algoliaLabel": { @@ -196,7 +192,7 @@ "description": "The paragraph for fetching new search results" }, "theme.SearchBar.label": { - "message": "Search", + "message": "Suche", "description": "The ARIA label and placeholder for search button" } } \ No newline at end of file diff --git a/content/de-DE/website/i18n/docusaurus-plugin-content-blog/options.json b/content/de-DE/website/i18n/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000000..94a4ebed2d7a2 --- /dev/null +++ b/content/de-DE/website/i18n/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Electron's blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Keep up to date with what's going on with the Electron project", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Latest posts", + "description": "The label for the left sidebar" + } +} \ No newline at end of file diff --git a/content/de-DE/website/i18n/docusaurus-theme-classic/footer.json b/content/de-DE/website/i18n/docusaurus-theme-classic/footer.json index 8b26237397c6f..aaec73352e17a 100644 --- a/content/de-DE/website/i18n/docusaurus-theme-classic/footer.json +++ b/content/de-DE/website/i18n/docusaurus-theme-classic/footer.json @@ -1,8 +1,12 @@ { "link.title.Docs": { - "message": "Docs", + "message": "Dokumentation", "description": "The title of the footer links column with title=Docs in the footer" }, + "link.title.Checklists": { + "message": "Checklists", + "description": "The title of the footer links column with title=Checklists in the footer" + }, "link.title.Community": { "message": "Community", "description": "The title of the footer links column with title=Community in the footer" @@ -12,12 +16,20 @@ "description": "The title of the footer links column with title=More in the footer" }, "link.item.label.Getting Started": { - "message": "Getting Started", - "description": "The label of footer link with label=Getting Started linking to /" + "message": "Erste Schritte", + "description": "The label of footer link with label=Getting Started linking to /docs/latest/" }, - "link.item.label.Stack Overflow": { - "message": "Stack Overflow", - "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + "link.item.label.API Reference": { + "message": "API-Referenz", + "description": "The label of footer link with label=API Reference linking to /docs/latest/api/app" + }, + "link.item.label.Performance": { + "message": "Performance", + "description": "The label of footer link with label=Performance linking to /docs/latest/tutorial/performance" + }, + "link.item.label.Security": { + "message": "Sicherheit", + "description": "The label of footer link with label=Security linking to /docs/latest/tutorial/security" }, "link.item.label.Discord": { "message": "Discord", @@ -27,12 +39,20 @@ "message": "Twitter", "description": "The label of footer link with label=Twitter linking to https://twitter.com/electronjs" }, + "link.item.label.Stack Overflow": { + "message": "Stack Overflow", + "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + }, "link.item.label.GitHub": { "message": "GitHub", "description": "The label of footer link with label=GitHub linking to https://github.com/electron/electron" }, + "link.item.label.Open Collective": { + "message": "Open Collective", + "description": "The label of footer link with label=Open Collective linking to https://opencollective.com/electron" + }, "copyright": { - "message": "Copyright © 2021 My Project, Inc. Built with Docusaurus.", + "message": "Copyright © 2021 OpenJS Foundation and Electron contributors.", "description": "The footer copyright" } } \ No newline at end of file diff --git a/content/de-DE/website/i18n/docusaurus-theme-classic/navbar.json b/content/de-DE/website/i18n/docusaurus-theme-classic/navbar.json index e49ff242e4f7e..942ac1b419f77 100644 --- a/content/de-DE/website/i18n/docusaurus-theme-classic/navbar.json +++ b/content/de-DE/website/i18n/docusaurus-theme-classic/navbar.json @@ -4,7 +4,7 @@ "description": "The title in the navbar" }, "item.label.Docs": { - "message": "Docs", + "message": "Dokumentation", "description": "Navbar item with label Docs" }, "item.label.API": { @@ -15,6 +15,10 @@ "message": "Beispiele", "description": "Navbar item with label Examples" }, + "item.label.Blog": { + "message": "Blog", + "description": "Navbar item with label Blog" + }, "item.label.GitHub": { "message": "GitHub", "description": "Navbar item with label GitHub" diff --git a/content/de-DE/website/locale.yml b/content/de-DE/website/locale.yml index 6702ae2a95b0f..6bbbc67c53215 100644 --- a/content/de-DE/website/locale.yml +++ b/content/de-DE/website/locale.yml @@ -1,240 +1,242 @@ -tagline: Build cross-platform desktop apps with JavaScript, HTML, and CSS +tagline: Plattformübergreifende Desktop-Anwendungen mit JavaScript, HTML und CSS entwickeln nav: apps: Apps blog: Blog code_of_conduct: Verhaltenskodex - security: Security + security: Sicherheit community: Community - contact: Contact - docs: Docs - donors: Donors - languages: Languages - license: License - releases: Releases - search: Search + contact: Kontakt + docs: Dokumentation + donors: Spender + languages: Sprachen + license: Lizenz + releases: Veröffentlichungen + search: Suche userland: Userland - governance: Governance + governance: Kontrolle keyboard_modal: title: Tastenkürzel - key: Key - action: Action - focus_search: Focus the search bar - focus_and_clear: Focus the search bar and cleans it - scroll_down: Select the next search result - scroll_up: Select the previous search result - open: Open the selected search result - open_new_tab: Open the selected search result in a new tab + key: Schlüssel + action: Aktion + focus_search: Suchleiste fokussieren + focus_and_clear: Fokussiert die Suchleiste und leert diese + scroll_down: Nächstes Suchergebnis auswählen + scroll_up: Vorheriges Suchergebnis auswählen + open: Ausgewähltes Suchergebnis öffnen + open_new_tab: Das ausgewählte Suchergebnis in einem neuen Tab öffnen docs: - title: Electron Documentation - guides: "Guides: Getting Started with Electron" - api_reference: API Reference - api_structures: API Structures - advanced: Advanced - detailed: In Detail - custom_dom: Custom DOM Elements - main_proc_modules: Main Process Modules - renderer_proc_modules: Renderer Process Modules - both_proc_modules: Modules for Both Process Types - propose_change: Improve this doc - version_history: Version history - translate: Translate this doc + title: Electron-Dokumentation + guides: "Guide: Erste Schritte mit Electron" + api_reference: API-Referenz + api_structures: API-Strukturen + advanced: Erweitert + detailed: Im Detail + custom_dom: Benutzerdefinierte DOM-Elemente + main_proc_modules: Hauptprozessmodule + renderer_proc_modules: Renderer Prozessmodule + both_proc_modules: Module für beide Prozesse + propose_change: Diese Dokumentation verbessern + version_history: Versionsverlauf + translate: Diese Dokumentation übersetzen languages: - choose_language: Choose Your Site Language - view_more_details: View More Language Details - translation_progress: Translation Progress - current: current selection + choose_language: Wählen Sie Ihre Sprache + view_more_details: Weitere Sprachdetails anzeigen + translation_progress: Übersetzungsfortschritt + current: Aktuelle Auswahl community: - title: Electron Community - description: Resources for connecting with people working on Electron. + title: Electron-Community + description: Quellen um die Nutzer von Electron zu verbinden. channels: - get_started: "Get started building an app by reading the quick-start guide." - updates: "Stay up to date by following @electronjs on Twitter and subscribing to the blog feed." - localized_docs: "Read docs in your native language by visiting the languages page." + get_started: "Anfangen eine App zu bauen mit hilfe der Schnellstart Anleitung." + updates: "Bleiben Sie auf dem neusten Stand, indem Sie @electronjs auf Twitter folgen und den Blog-Feed abonnieren." + localized_docs: "Lesen Sie die Dokumentation in Ihrer Sprache, indem Sie die Sprach-Seiten besuchen." help: "Get help and feedback by joining the Discord server, or visiting Stack Overflow." - security: "Report security issues by emailing security@electronjs.org." - bugs: "Report bugs by opening issues on the electron/electron repository." - feature_requests: "Request features by opening issues on the electron/electron repository." - code_of_conduct: "Report Code of Conduct violations by emailing coc@electronjs.org." - donations: "Donate on our OpenCollective page." - other: "For all other inquiries, email info@electronjs.org." + security: "Melde Sicherheitsprobleme per Email an security@electronjs.org." + bugs: "Bugs melden durch öffnen eines Issues im electron/electron Repository." + feature_requests: "Anfragen von Features durch Öffnen eines Issues im electron/electron Repository." + code_of_conduct: "Code of Conduct Verstöße melden per Email an coc@electronjs.org." + donations: "Spende auf unserer OpenCollective Seite." + other: "Für alle anderen Anfragen wenden Sie sich bitte per Email an info@electronjs.org." language_communities: - title: Language Communities - description: "The Electron community spans the globe, and English is not everyone's first language. Find documentation in your language, or join one of the language communities below:" - tools: Tools - boilerplates: Boilerplates - components: Components + title: Sprachcommunities + description: "Die Electron Geimeinschaft ist auf der ganzen Welt verteilt und Englisch ist nicht jedermanns Muttersprache. Finde eineDokumentation in deiner Sprache, oder betrete eine der folgenden Sprachgemeinschaften:" + tools: Werkzeuge + boilerplates: Codebausteine (Boilerplates) + components: Komponenten videos: Videos - meetups: Meetups - awesome_notice: This list is generated from @sindresorhus's Awesome Electron repository.
    Something missing? Make a pull request. - meetup_notice: To add a meetup, edit data/meetups.json and make a pull request. + meetups: Treffen + awesome_notice: "Diese Liste wurde von @sindresorhus's Awesome Electron Repository genieriert.\n
    Fehlt etwas? Dann erstellen Sie einen Pull-Request." + meetup_notice: Um ein Treffen hinzuzufügen, bearbeiten Sie die Datei data/meetups.json und erstellen einen Pull-Request. releases: - show_releases: "Show Releases:" - show_only_releases_from: "Show Only Releases From:" - all_versions: All Versions - stable_releases: Stable Releases - stable_desc: Regular, supported releases - beta_releases: Beta Releases - beta_desc: Test your app with upcoming changes - nightly_releases: Nightly Releases - nightly_desc: Experiment with the latest features - next: Next - next_page: Next Page - previous: Previous - previous_page: Previous Page - page: Page - all_releases: All Releases - back_to_index: Back to index + show_releases: "Veröffentlichungen anzeigen:" + show_only_releases_from: "Nur Veröffentlichungen anzeigen von:" + all_versions: Alle Versionen + stable_releases: Stabile Veröffentlichungen + stable_desc: Regelmäßige, unterstützte Versionen + beta_releases: Beta-Veröffentlichungen + beta_desc: Teste deine App mit anstehenden Änderungen + alpha_releases: Alpha Releases + alpha_desc: Test features slightly more on the edge + nightly_releases: Nighly-Veröffentlichungen + nightly_desc: Experimentiere mit den neuesten Funktionen + next: Nächste + next_page: Nächste Seite + previous: Vorherige + previous_page: Vorherige Seite + page: Seite + all_releases: Alle Veröffentlichungen + back_to_index: Zurück zum Index electron_is_good: title: Apps users love, built with Electron description: Thousands of organizations spanning all industries use Electron to build cross-platform software. electron_is_easy: - title: It's easier than you think - description: If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application. + title: Es ist einfacher, als Sie denken + description: Sind Sie in der Lage eine Website zu erstellen? Dann können Sie auch eine Desktop-Anwendung entwickeln! Electron ist ein Framework, mit dem Sie Webtechnologien wie JavaScript, HTML und CSS nutzen, um native Desktop-Applikationen zu erstellen. Wir kümmern uns um die kniffligen Dinge — und Sie um den Kern der Anwendung. web_technologies: - title: Web Technologies - description: Electron uses Chromium and Node.js so you can build your app with HTML, CSS, and JavaScript. + title: Web-Technologien + description: Electron verwendet Chromium und Node.js, damit Sie Ihre App mit HTML, CSS und JavaScript entwickeln können. open_source: title: Open Source description: Electron is an open source project maintained by the OpenJS Foundation and an active community of contributors. cross_platform: - title: Cross Platform - description: Compatible with Mac, Windows, and Linux, Electron apps build and run on three platforms. + title: Plattformübergreifend + description: Electron-Apps können unter MacOS, Windows und Linux entwickelt, erstellt und ausgeführt werden. benefits: - hard_parts_made_easy: The hard parts made easy - automatic_updates: Automatic updates - native_menus_and_notifications: Native menus & notifications - crash_reporting: Crash reporting - debugging_and_profiling: Debugging & profiling - windows_installers: Windows installers + hard_parts_made_easy: Die schweren Dinge leicht gemacht + automatic_updates: Automatische Updates + native_menus_and_notifications: Native Menüs & Benachrichtigungen + crash_reporting: Absturzbericht + debugging_and_profiling: Debugging & Profiling + windows_installers: Installationsprogramme für Windows get_started: - title: Get started - description: To get started with Electron, check out the resources below. Learn how to wrap your web app with Electron, access all the APIs, and generate installers. + title: Erste Schritte + description: Schauen Sie sich für den Einstieg mit Electron die unten aufgelisteten Ressourcen an. Lernen Sie, wie Sie Ihre Web-App in Electron einbetten, alle APIs ansprechen und letztlich Installer für Ihre Anwendung generieren. explore: fiddle_title: Try powerful experiments with Electron Fiddle - see_more_info: See more info + see_more_info: Weitere Infos anzeigen download: Download -download_from_github: Download from GitHub +download_from_github: Von GitHub herunterladen quick_start: - title: "Spin up the Quick Start app to see Electron in action:" - description: A minimal Electron app with helpful notations. - clone: Clone the Quick Start repository - go_into_repo: Go into the repository - install_deps: Install the dependencies and run - dive_deeper: Or dive deeper and read the documentation. + title: "Starten Sie mit der Quick-Start-App, um Electron in Aktion zu sehen:" + description: Eine minimale Electron-App mit hilfreichen Anmerkungen. + clone: Das Quick-Start Repository klonen + go_into_repo: Das Repository öffnen + install_deps: Die Abhängigkeiten installieren und ausführen + dive_deeper: Oder tauchen Sie tiefer ein und lesen Sie die Dokumentation. need_help: - title: Need Help? + title: Benötigen Sie Hilfe? description: Ask questions in the Discord server. Follow @electronjs on Twitter for important announcements. Need to privately reach out? Email info@electronjs.org. headings: - languages: Languages + languages: Sprachen taglines: - languages: Localized content from our awesome global developer community. + languages: Übersetzte Inhalte von unser atemberaubenden weltweiten Entwickler-Community. announcement: 'Black Lives Matter. Support the Equal Justice Initiative and read our statement here.' -help_translate: "Help translate" +help_translate: "Helfen Sie bei der Übersetzung" footer: - see_the_faq: See the frequently asked questions + see_the_faq: Lesen Sie die häufig gestellte Fragen apps: - something_missing: Something missing? - edit_this_app: Edit this app. - search_app: Filter apps by name, description, etc… - categories: Categories - add_app_link: 'Make a Pull Request to add your application.' + something_missing: Fehlt etwas? + edit_this_app: Diese App bearbeiten. + search_app: Apps nach Namen, Beschreibung usw. filtern… + categories: Kategorien + add_app_link: 'Erstelle einen Pull-Request um Ihre Anwendung hinzuzufügen.' #App show page specific localization strings - website: Website + website: Webseite repository: Repository - category: Category + category: Kategorie downloads: Downloads - keywords: Keywords - license: License - latest_release: Latest Release + keywords: Schlagwörter + license: Lizenz + latest_release: Neueste Veröffentlichung blog: - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Electron-Blog + description: Die neuesten Nachrichten vom Electron-Team und der Community. #Post show page specific localization strings - feedback: Have feedback on this post? Let @electronjs know on Twitter. - help: Need help or found a bug? Contact us. + feedback: Haben Sie Feedback zu diesem Beitrag? Lass es @electronjs auf Twitter wissen. + help: Brauchen Sie Hilfe oder haben Sie einen Fehler gefunden? Kontaktieren Sie uns. clipboard: - copy: Copy - copy_to_clipboard: Copy to Clipboard - copied: Copied + copy: Kopieren + copy_to_clipboard: In Zwischenablage kopieren + copied: Kopiert fiddle_launch_button: - launch: Launch - launch_in_fiddle: Launch in Fiddle + launch: Starten + launch_in_fiddle: In Fiddle starten pages: '/': - title: Electron | Build cross-platform desktop apps with JavaScript, HTML, and CSS. - description: 'Build cross-platform desktop apps with JavaScript, HTML, and CSS.' + title: Electron | Plattformübergreifende Desktop-Anwendungen mit JavaScript, HTML und CSS entwickeln. + description: 'Plattformübergreifende Desktop-Anwendungen mit JavaScript, HTML und CSS entwickeln.' '/apps': - title: Electron Apps - description: Apps Built on Electron + title: Electron-Anwendungen + description: Mit Electron entwickelte Anwendungen '/docs': title: Dokumentation - description: Guides and API reference documentation for the latest Electron release + description: Leitfäden und API-Referenz-Dokumentation für die neueste Version von Elektron '/docs/api': title: API - description: API reference documentation for the latest Electron release + description: API-Dokumentation für die neueste Version von Electron '/docs/development': title: Entwicklung - description: Developing with Electron + description: Entwicklung mit Electron '/docs/tutorial': title: Tutorial - description: Guides and tutorials for the latest Electron release + description: Anleitungen und Tutorials für die neueste Electron Version '/blog': - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Electron-Blog + description: Die neuesten Nachrichten vom Electron-Team und der Community. '/community': title: Community '/releases': - title: Releases + title: Veröffentlichungen '/contact': - title: Contact - description: Get in touch with the Electron team on Twitter, Slack, GitHub, or via email. + title: Kontakt + description: Das Electron-Team auf Twitter, Slack, GitHub oder per E-Mail kontaktieren. '/languages': - title: Languages + title: Sprachen '/userland': title: Userland '/devtron': title: Devtron - description: Devtron is an open source tool to help you inspect, monitor, and debug your Electron app. Built on top of the amazing Chrome Developer Tools. + description: "Devtron ist ein Open-Source-Werkzeug, mit dessen Hilfe Sie Ihre Electron App inspizieren, überwachen und debuggen können. \nDas Werkzeug beruht auf den hervorragenden Chrome Developer Tools." '/spectron': title: Spectron - description: Spectron is an open source framework for easily writing integrations tests for your Electron app. Built on top of ChromeDriver and WebDriverIO. + description: Spectron ist ein Open-Source-Framework um sehr einfach Integrationstests für deine Electron-App zu schreiben. Das Framework beruht auf ChromeDriver und WebDriverIO. '/fiddle': - title: Electron Fiddle - description: The easiest way to get started with Electron + title: Elektro-Fiddle + description: Der einfachste Weg mit Electron zu beginnen '/governance': - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. + title: Elektro-Governance + description: Das System der Electron Governance besteht aus Arbeitsgruppen, die verschiedene Aspekte des Electron Ökosystems überwachen, und einer Verwaltungsgruppe, die die Lösung von Konflikten zwischen ihnen unterstützt. '/donors': - title: Donors + title: Spender '/blacklivesmatter': title: Black Lives Matter landing: - get_started: Get started + get_started: Erste Schritte fiddle: - lead_desc: The easiest way to get started with Electron + lead_desc: Der einfachste Weg mit Electron zu beginnen different_os: "Not the right operating system? See:" - create_app: Create your app - description: Electron Fiddle lets you create and play with small Electron experiments. It greets you with a quick-start template after opening – change a few things, choose the version of Electron you want to run it with, and play around. Then, save your Fiddle either as a GitHub Gist or to a local folder. Once pushed to GitHub, anyone can quickly try your Fiddle out by just entering it in the address bar. - explore: Explore Electron - explore_desc: "Try Electron without installing any dependencies: Fiddle includes everything you'll need to explore the platform. It also includes examples for every API available in Electron, so if you want to quickly see what a BrowserView is or how the desktopCapturer works, Fiddle has got you covered." - code_with_types: Code with Types + create_app: Erstelle Deine App + description: Electron Fiddle ermöglicht es dir, kleine Electron-Experimente zu erstellen und zu spielen. Es begrüßt dich nach dem Öffnen mit einer Schnellstart-Vorlage – ändere einige Dinge, wähle die Version von Electron, mit der du sie ausführen möchtest und spielst. Dann speichere deinen Fiddle entweder als GitHub Gist oder in einen lokalen Ordner. Sobald er auf GitHub gedrückt wurde, kannst du deinen Fiddle schnell ausprobieren, indem du ihn in die Adressleiste eingibst. + explore: Erkunde Electron + explore_desc: "Testen Sie Electron ohne Abhängigkeiten zu installieren: Fiddle enthält alles, was Sie benötigen, um die Plattform zu erkunden. Es enthält auch Beispiele für jede API, die in Electron verfügbar ist, so dass Sie schnell sehen wollen, was ein BrowserView ist oder wie das desktopCapturer funktioniert, Fiddle Sie abgedeckt hat." + code_with_types: Programmiere mit Types code_with_types_desc: Fiddle includes Microsoft's excellent Monaco Editor, the same editor powering Visual Studio Code. It also installs the type definitions for the currently selected version of Electron automatically, ensuring that you always have all Electron APIs only a few keystrokes away. - compile_and_package: Compile and Package - compile_and_package_desc: Fiddle can automatically turn your experiment into binaries you can share with your friends, coworkers, or grandparents. It does so thanks to electron-forge, allowing you to package your fiddle as an app for Windows, macOS, or Linux. - easy_start: Start with Fiddle, Continue Wherever + compile_and_package: Kompilieren und Paket + compile_and_package_desc: Fiddle kann automatisch Ihr Experiment in Binärdateien verwandeln, die Sie mit Ihren Freunden, Mitarbeitern oder Großeltern teilen können. Dies ist dank Elektron-forgemöglich, damit Sie Ihre Fiddle als App für Windows, macOS oder Linux verpacken können. + easy_start: Beginne mit Fiddle, Fortfahren easy_start_desc: Fiddle is not an IDE – it is however an excellent starting point. Once your fiddle has grown up, export it as a project with or without electron-forge. Then, use your favorite editor and take on the world! governance: - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. - wgs: Working Groups + title: Elektro-Governance + description: Das System der Electron Governance besteht aus Arbeitsgruppen, die verschiedene Aspekte des Electron Ökosystems überwachen, und einer Verwaltungsgruppe, die die Lösung von Konflikten zwischen ihnen unterstützt. + wgs: Arbeitsgruppe ecosystem: - title: Ecosystem + title: Ökosystem description: Oversees the projects that make Electron app development easier. outreach: title: Outreach description: Grows the Electron community releases: - title: Releases + title: Veröffentlichungen description: Oversees all release branches, and tooling to support releases. upgrades: title: Upgrades @@ -243,7 +245,7 @@ governance: title: Community & Safety description: Oversees removal/bans from community. security: - title: Security + title: Sicherheit description: Proactively ensures the Security of Electron as a project, responds to incoming incidents, and oversees rollout of fixes. admins: title: Administrative @@ -253,10 +255,10 @@ governance: description: Oversees public API design based on project principles. global: overview: Übersicht - associated_repos: Associated Repositories + associated_repos: Verknüpfte Repositories notes: Meeting Notes definitions: - title: Definitions + title: Definitionen list: - A maintainer is anyone who plays an active role in governance. - A collaborator is active in the community, but not in governance. @@ -264,7 +266,7 @@ governance: - A working group is a group of maintainers that is formed to take responsibility for certain aspects of the Electron project. Normally these groups will meet regularly but in some cases will only meet as required to fulfill their responsibilities. - 'A chair leads a working group.' responsibilities: - title: Responsibilities + title: Verantwortungen listdescription: "All Working Groups have these core responsibilities:" list: - They shall decide for themselves, and publicly post, their rules, e.g. how decisions are made, when meetings are held, and who may attend. @@ -273,7 +275,7 @@ governance: - 'They shall be collaborative and work in good faith with other Working Groups.' see_charter: See charter for more information. code_of_conduct: The Electron organization and all repos therein adhere to the following Code of Conduct. - license: Electron is licensed with the MIT License. + license: Electron ist mit der MIT Lizenz lizenziert. repository: Check out the Governance Repository to find more information about the governance structure. _404: - page_not_found: Page not found. + page_not_found: Seite nicht gefunden. diff --git a/content/es-ES/docs/api/app.md b/content/es-ES/docs/api/app.md index 9daddd3ab715a..f5ef35b75c119 100644 --- a/content/es-ES/docs/api/app.md +++ b/content/es-ES/docs/api/app.md @@ -420,54 +420,6 @@ Devuelve: Emitido cuando `desktopCapturer.getSources()` es llamado en el render process del `webContents`. Llamando a `event.preventDefault()` hará que devuelva fuentes vacías. -### Evento: 'remote-require' _Obsoleto_ - -Devuelve: - -* `event` -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -Emitido cuando `remote.require()` es llamado en el renderer process de `webContents`. Llamando `event.preventDefault()` evitará que se devuelva el modulo. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - -### Evento: 'remote-get-global' _Obsoleto_ - -Devuelve: - -* `event` -* `webContents` [WebContents](web-contents.md) -* `globalName` String - -Emitido cuando `remote.getGlobal()` es llamado en el proceso de renderizado del `webContents`. Llamando `event.preventDefault()` evitará que sea devuelto el global. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - -### Evento: 'remote-get-builtin' _Obsoleto_ - -Devuelve: - -* `event` -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -Emitido cuando `remote.getBuiltin()` es llamado en el proceso renderizador del `webContents`. Llamando `event.preventDefault()` evitará que se devuelva el modulo. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - -### Evento: 'remote-get-current-window' _Obsoleto_ - -Devuelve: - -* `event` -* `webContents` [WebContents](web-contents.md) - -Emitido cuando `remote.getCurrentWindow()` es llamado en el renderer process de `webContents`. Llamar a `event.preventDefault()` evitará que el objeto sea retornado. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - -### Evento: 'remote-get-current-web-contents' _Obsoleto_ - -Devuelve: - -* `event` -* `webContents` [WebContents](web-contents.md) - -Emitido cuando `remote.getCurrentWebContents()` es llamado en el renderer process de `webContents`. Llamar a `event.preventDefault()` evitará que el objeto sea retornado. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - ## Métodos El objeto `app` tiene los siguientes métodos: @@ -981,7 +933,7 @@ Sets the counter badge for current app. Setting the count to `0` will hide the b On macOS, it shows on the dock icon. En Linux, solo funciona para Unity launcher. -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**Nota:** El lanzador de Unity necesita un archivo `.desktop` para funcionar. Para más información, por favor lee la [documentación de integración con Unity][unity-requirement]. ### `app.getBadgeCount()` _Linux_ _macOS_ @@ -1183,7 +1135,7 @@ Una propiedad `Integer` que devuelve el recuento de insignias para la aplicació On macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher. -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**Nota:** El lanzador de Unity necesita un archivo `.desktop` para funcionar. Para más información, por favor lee la [documentación de integración con Unity][unity-requirement]. **Note:** On macOS, you need to ensure that your application has the permission to display notifications for this property to take effect. @@ -1211,12 +1163,6 @@ Un `String` que es la cadena de agente de usuario Electron usará como una regre Este es el agente de usuario que se utilizará cuando ningún agente de usuario está establecido en el nivel `webContents` o `session`. Es útil para asegurar que la aplicación entera tiene el mismo agente de usuario. Establecer a un valor personalizado lo antes posible en la inicialización de tu aplicación para asegurar que el valor sobrescrito es usado. -### `app.allowRendererProcessReuse` - -Un `Boolean` que cuando es `true` deshabilita las anulaciones que Electron tiene en su lugar para asegurar que los renderer processes son reiniciados en cada navegación. El valor por defecto actual para esta propiedad es `true`. - -La intención para estos anuladores es desactivan por defecto y luego en algún punto en el futuro esta propiedad sera eliminada. Esta propiedad impacta en cuales modulos nativos puedes usar en el renderer process. Para más información de la dirección en que Electron esta yendo con el renderer process, reinicio y uso de modulos nativos en el renderer process por favor revisa esto [Tracking Issue](https://github.com/electron/electron/issues/18397). - ### `app.runningUnderRosettaTranslation` _macOS_ _SoloLectura_ A `Boolean` which when `true` indicates that the app is currently running under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)). @@ -1231,7 +1177,7 @@ You can use this property to prompt users to download the arm64 version of your [LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType -[unity-requirement]: ../tutorial/desktop-environment-integration.md#unity-launcher +[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher [mas-builds]: ../tutorial/mac-app-store-submission-guide.md [Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows [JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx diff --git a/content/es-ES/docs/api/auto-updater.md b/content/es-ES/docs/api/auto-updater.md index 00af11e4d45c4..e3282787062cd 100644 --- a/content/es-ES/docs/api/auto-updater.md +++ b/content/es-ES/docs/api/auto-updater.md @@ -97,6 +97,8 @@ Devuelve `String` - La actualización actual provee el URL. Pregunta al servidor si hay una actualización. Debes llamar a `setFeedURL` antes de usar esta API. +**Note:** If an update is available it will be downloaded automatically. Calling `autoUpdater.checkForUpdates()` twice will download the update two times. + ### `autoUpdater.quitAndInstall()` Reinicia la aplicación e instala la actualización después que esta ha sido descargada. Sólo debería llamarse después de que `update-downloaded` ha sido emitido. diff --git a/content/es-ES/docs/api/browser-window.md b/content/es-ES/docs/api/browser-window.md index 1511a92dbe1cb..2d2994752e8f8 100644 --- a/content/es-ES/docs/api/browser-window.md +++ b/content/es-ES/docs/api/browser-window.md @@ -6,15 +6,15 @@ Proceso: [principal](../glossary.md#main-process) ```javascript /// In the main process. -const { BrowserWindow } = require (' Electron ') +const { BrowserWindow } = require('electron') -const Win = New BrowserWindow ({ width: 800, height: 600 }) +const win = new BrowserWindow({ width: 800, height: 600 }) -//cargar una URL remota -Win. loadURL (' https://github.com ') +// Load a remote URL +win.loadURL('https://github.com') -//o cargar un archivo HTML local -Win. loadURL (' File://${__dirname}/app/index.html ') +// Or load a local HTML file +win.loadFile('index.html') ``` ## Ventana sin borde @@ -143,7 +143,7 @@ Crea una nueva `BrowserWindow` con propiedades nativas como las establecidas por * `frame` Boolean (opcional) - Especifica `false` para crear un [Frameless Window](frameless-window.md). Por defecto es `true`. * `parent` BrowserWindow (opcional) - Especifica la ventana padre. Por defecto es `null`. * `modal` Boolean (opcional) - Si es una ventana modal. Esto sólo funciona cuando la ventana es una ventana hija. Por defecto es `false`. - * `acceptFirstMouse` Boolean (opcional) - Si la vista web acepta un solo evento de mouse hacia abajo que activa simultáneamente la ventana. Por defecto es `false`. + * `acceptFirstMouse` Boolean (optional) - Whether clicking an inactive window will also click through to the web contents. Default is `false` on macOS. This option is not configurable on other platforms. * `disableAutoHideCursor` Boolean (opcional) - Si ocultar el cursor cuando se está escriniendo. Por defecto es `false`. * `autoHideMenuBar` Boolean (opcional) - Auto ocultar la barra de menú a menos que la tecla `Alt` este presionada. Por defecto es `false`. * `enableLargerThanScreen` Boolean (opcional) - Permite que la ventana se redimensione mayor que la pantalla. Solo relevante para macOS, ya que los otros sistemas operativos permiten ventanas más grandes que la pantalla por defecto. Por defecto es `false`. @@ -157,11 +157,11 @@ Crea una nueva `BrowserWindow` con propiedades nativas como las establecidas por * `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. Este es el valor predeterminado. * `active` - The backdrop should always appear active. * `inactive` - The backdrop should always appear inactive. - * `titleBarStyle` String (optional) - The style of window title bar. Por defecto es `default`. Los valores posibles son: - * `default` - Es la barra de título gris opaca estándar de Mac. - * `hidden` -Es una barra de título oculta y una ventana de tamaño completo. Sin embargo, la barra tiene los controles estándares de la ventana ("traffic lights") en la parte superior izquierda. - * `hiddenInset` - Es una barra de título oculta con una apariencia alternativa donde los botones de traffic light están ligeramente mas insertados en el borde de la ventana. - * `customButtonsOnHover` - Resulta en una barra de titulo oculta y en una ventana de contenido de tamaño completo, los botones del semáforo se mostrarán al pasar el cursor sobre la parte superior izquierda de la ventana. **Note:** Esta opción es experimental actualmente. + * `titleBarStyle` String (optional) _macOS_ _Windows_ - The style of window title bar. Por defecto es `default`. Los valores posibles son: + * `default` - Results in the standard title bar for macOS or Windows respectively. + * `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown. + * `hiddenInset` - Only on macOS, results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge. + * `customButtonsOnHover` - Only on macOS, results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. **Note:** Esta opción es experimental actualmente. * `trafficLightPosition` [Point](structures/point.md) (opcional) - Establece una posición para los botones del semáforo en ventanas sin marco. * `roundedCorners` Boolean (opcional) - Si la ventana sin marco debería tener o no esquinas redondeadas macOS. Por defecto es `true`. * `fullscreenWindowTitle` Boolean (opcional) _Obsoleto_ - Muestra el título en la barra de título en el modo de pantalla completa en macOS para `hiddenInset` titleBarStyle. Por defecto es `false`. @@ -176,10 +176,8 @@ Crea una nueva `BrowserWindow` con propiedades nativas como las establecidas por * `nodeIntegrationInSubFrames` Boolean (opcional) - Opcion experimental para habilitar soporte Node.js en sub-frames como iframes y ventas hijos. Todos tus preloads cargarán por cada iframe, puedes usar `process.isMainFrame` para determinar si estás en el marco principal o no. * `preload` String (opcional) - Especifica un script que será cargado antes del otros scripts en la página. Este script siempre tendrá acceso al nodo APIs sin importar si la integración de nodos esté activada o no. El valor debería ser la ruta del archivo absoluto al script. Cuando la integración de nodos esta desactivada, la precarga del script puede reintroducir de vuelta al ámbito global los símbolos globales del Nodo. Ver ejemplo [aquí](context-bridge.md#exposing-node-global-symbols). * `sandbox` Boolean (opcional) - Si se configura, protegerá al renderizador asociado a la ventana, haciéndolo compatible con el sandbox de Chromium OS-level, deshabilitando el motor Node.js. Esto no es lo mismo que la opción de `nodeIntegration` y las APIs disponibles para el script de precarga son más limitadas. Leer más sobre la opción [aquí](../tutorial/sandbox.md). - * `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module. Por defecto es `false`. * `session` [Session](session.md#class-session) (opcional) - Configura la sesión usada por la página. En lugar de pasar directamente el objeto de la sesión, se puede optar por utilizar la opción de `partition`, la cual acepta una cadena de partición. Cuando se proporcionen `session` y `partition`, se preferirá `session`. Default es la sesión por defecto. * `partition` Cadena (opcional) - Configura la sesión utilizada por la página según la cadena de partición de la sesión. Si la `partition` empieza con `persist:`, la página utilizará una sesión persistente disponible para todas las páginas en la partición con la misma `partition`. Si no está el prefijo `persist:`, la página usara una sesión de la memoria interna. Al asignar la misma `partition`, las páginas múltiples pueden compartir la misma sesión. Default es la sesión por defecto. - * `affinity` Cadena de caracteres (opcional): Cuando se especifica, las páginas web con la misma `affinity` se ejecutarán en el mismo proceso de renderizado. Nótese que debido a que se reutiliza el proceso de renderizado, ciertas opciones `webPreferences` también se compartirán entre las páginas web incluso si se especificaron valores diferentes para cada una de ellas, incluyendo pero no limitándose a `preload`, `sandbox` y`nodeIntegration`. Por lo tanto, se sugiere utilizar las mismas `webPreferences` para páginas web con la misma `affinity`. _Deprecated_ * `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents `300%`. Por defecto es `1.0`. * `javascript` Boolean (optional) - Enables JavaScript support. Por defecto es `true`. * `webSecurity` Boolean (opcional) - Cuando es `false`, desactivará la política de same-origin (por lo general se utiliza cuando la gente prueba los sitios web), y configurará `allowRunningInsecureContent`a `true` en caso de que estas opciones no hayan sido configuradas por el usuario. Por defecto es `true`. @@ -206,8 +204,7 @@ Crea una nueva `BrowserWindow` con propiedades nativas como las establecidas por * `backgroundThrottling` Boolean (opcional) - Para acelerar animaciones y temporizadores cuando la página esta al fondo. Esto también afecta a [Page Visibility API](#page-visibility). Por defecto es `true`. * `offscreen` Boolean(optional) - Para habilitar el renderizado offscreen para el navegador de la ventana. Por defecto es `false`. Para más detalles, ver [offscreen rendering tutorial](../tutorial/offscreen-rendering.md). * `contextIsolation` Boolean(opcional) - Para ejecutar las APIs de Electron y el script especificado `preload` en un contexto JavaScript independiente. Por defecto es `true`. The context that the `preload` script runs in will only have access to its own dedicated `document` and `window` 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 the `preload` 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 the `preload` script and any Electron APIs being used. Esta opción utiliza la misa técnica usada por [Chrome Content Scripts][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. - * `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values can't unsafely cross between worlds when using `contextIsolation`. Por defecto es `true`. _Deprecated_ - * `nativeWindowOpen` Boolean (opcional) - Si se usa el nativo `window.open()`. Por defecto es `false`. Las ventanas hijas siempre tienen la integración con node desabilidata a menos que `nodeIntegrationInSubFrames` es true. **Note:** Esta opción es experimental actualmente. + * `nativeWindowOpen` Boolean (opcional) - Si se usa el nativo `window.open()`. Por defecto es `false`. Las ventanas hijas siempre tienen la integración con node desabilidata a menos que `nodeIntegrationInSubFrames` es true. **Note:** The default value will be changing to `true` in Electron 15. * `webviewTag` Boolean (opcional) - Si se habilita o no el [`` tag](webview-tag.md). Por defecto es `false`. **Nota:** El script `preload` configurado para el ``tendrá la integración de nodos habilitada cuando se ejecuta por lo que hay que asegurarse que el contenido remoto o posiblemente dañino no sea capaz de crear una etiqueta de ``con un script `preload` posiblemente malicioso. Puede utilizarse el evento `will-attach-webview` en [webContents](web-contents.md) para quitar el script `preload` y validar o alterar la configuración inicial de ``. * `additionalArguments` String[] (optional) - A list of strings that will be appended to `process.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. Por defecto es `false`. @@ -225,6 +222,7 @@ Crea una nueva `BrowserWindow` con propiedades nativas como las establecidas por * `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation * `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager. Default policy is `code`. * `enablePreferredSizeMode` Boolean (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 the `preferred-size-changed` event to be emitted on the `WebContents` when the preferred size changes. Por defecto es `false`. + * `titleBarOverlay` [OverlayOptions](structures/overlay-options.md) | Boolean (optional) - When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Por defecto es `false`. On Windows, the [OverlayOptions](structures/overlay-options.md) can be used instead of a boolean to specify colors for the overlay. Cuando se configura el tamaño máximo o mínimo de la ventana con `minWidth`/`maxWidth`/ `minHeight`/`maxHeight`, solo limita a los usuarios. No impide pasar de un tamaño que no sigue las restricciones de tamaño a`setBounds`/`setSize` o al constructor de `BrowserWindow`. @@ -544,6 +542,10 @@ A `Boolean` property that determines whether the window is in simple (pre-Lion) A `Boolean` property that determines whether the window is in fullscreen mode. +#### `win.focusable` _Windows_ _macOS_ + +A `Boolean` property that determines whether the window is focusable. + #### `win.visibleOnAllWorkspaces` A `Boolean` property that determines whether the window is visible on all workspaces. @@ -958,7 +960,7 @@ Mover ventana a la parte superior(z-order) independientemente del enfoque #### `win.center()` -Moves window to the center of the screen. +Mueve la ventana al centro de la pantalla. #### `win.setPosition(x, y[, animate])` @@ -966,28 +968,28 @@ Moves window to the center of the screen. * `y` Integer * `animate` Boolean (opcional) _macOS_ -Moves window to `x` and `y`. +Mueve la ventana a `x` y `y`. #### `win.getPosition()` -Returns `Integer[]` - Contains the window's current position. +Devuelve `Integer[]` - Contiene la posición actual de la ventana. #### `win.setTitle(title)` * `title` String -Changes the title of native window to `title`. +Cambia el título de la ventana nativa a `title`. #### `win.getTitle()` -Returns `String` - The title of the native window. +Devuelve `String` - El título de la ventana nativa. -**Note:** The title of the web page can be different from the title of the native window. +**Note:** El título de la página web puede ser diferente del título de la ventana nativa. #### `win.setSheetOffset(offsetY[, offsetX])` _macOS_ * `offsetY` Float -* `offsetX` Float (optional) +* `offsetX` Float (opcional) Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. Por ejemplo: @@ -1003,23 +1005,23 @@ win.setSheetOffset(toolbarRect.height) * `flag` Boolean -Starts or stops flashing the window to attract user's attention. +Empieza y deja de hacer parpadear la ventana para atraer la atención del usuario. #### `win.setSkipTaskbar(skip)` -* `skip` Boolean +* `skip` Booleano -Makes the window not show in the taskbar. +Hace que la ventana no se muestre en la barra de tareas. #### `win.setKiosk(flag)` * `flag` Boolean -Enters or leaves kiosk mode. +Entra / sale del modo Kiosko. #### `win.isKiosk()` -Returns `Boolean` - Whether the window is in kiosk mode. +Devuelve `Boolean` - Si la ventana está o no en modo kiosco. #### `win.isTabletMode()` _Windows_ @@ -1031,60 +1033,60 @@ This API returns whether the window is in tablet mode, and the `resize` event ca #### `win.getMediaSourceId()` -Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1324:0". +Returns `String` - Window id in the format of DesktopCapturerSource's id. Por ejemplo "window:1324:0". -More precisely the format is `window:id:other_id` where `id` is `HWND` on Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on Linux. `other_id` is used to identify web contents (tabs) so within the same top level window. +Más específicamente el formato es `window:id:other_id` donde `id` es `HWND` en Windows, `CGWindowID` (`uint64_t`) en macOS y `Window` (`unsigned long`) en Linux. `other_id` es usado para identificar contenidos webs (pestañas) así dentro de la misma ventana de nivel superior. #### `win.getNativeWindowHandle()` -Returns `Buffer` - The platform-specific handle of the window. +Devuelve `Buffer` - El controlador específico de la plataforma de la ventana. -The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and `Window` (`unsigned long`) on Linux. +El tipo nativo del controlador en Windows es `HWND`, en macOS `NSView*` y en Linux `Window` (`unsigned long`). #### `win.hookWindowMessage(message, callback)` _Windows_ * `message` Integer * `callback` Función - * `wParam` any - The `wParam` provided to the WndProc - * `lParam` any - The `lParam` provided to the WndProc + * `wParam` any - El `wParam` proveído al WndProc + * `lParam` any - El `lParam` proveído al WndProc -Hooks a windows message. The `callback` is called when the message is received in the WndProc. +Engancha una ventana de mensaje. The `callback` is called when the message is received in the WndProc. #### `win.isWindowMessageHooked(message)` _Windows_ * `message` Integer -Returns `Boolean` - `true` or `false` depending on whether the message is hooked. +Devuelve `Boolean` - `true` o `false` dependiendo de si el mensaje esta anclado o no. #### `win.unhookWindowMessage(message)` _Windows_ * `message` Integer -Unhook the window message. +Desancla el mensaje de la ventana. #### `win.unhookAllWindowMessages()` _Windows_ -Unhooks all of the window messages. +Desancla todos los mensajes de la ventana. #### `win.setRepresentedFilename(filename)` _macOS_ -* `filename` String +* `filename` Cadena -Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar. +Establece el nombre de la ruta del archivo que la ventana representa, y el icono del archivo se mostrará en la barra de título de la ventana. #### `win.getRepresentedFilename()` _macOS_ -Returns `String` - The pathname of the file the window represents. +Devuelve `String` - El nombre de la ruta del archivo que la ventana representa. #### `win.setDocumentEdited(edited)` _macOS_ * `edited` Boolean -Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to `true`. +Especifica si se ha editado el documento de la ventana y el icono en la barra de título se volverá gris cuando se establece en `true`. #### `win.isDocumentEdited()` _macOS_ -Returns `Boolean` - Whether the window's document has been edited. +Devuelve `Boolean` - Si se ha editado el documento de la ventana. #### `win.focusOnWebView()` @@ -1092,29 +1094,29 @@ Returns `Boolean` - Whether the window's document has been edited. #### `win.capturePage([rect])` -* `rect` [Rectangle](structures/rectangle.md) (optional) - The bounds to capture +* `rect` [Rectangle](structures/rectangle.md) (opcional) - Los límites para capturar -Returns `Promise` - Resolves with a [NativeImage](native-image.md) +Devuelve `Promise` - Resuelve con el un [NativeImage](native-image.md) -Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty. +Captura una foto instantánea de la página dentro de `rect`. Omitiendo `rect` capturará toda la página visible. Si la página no es visible, `rect` puede estar vacía. #### `win.loadURL(url[, options])` * `url` String * `options` Object (opcional) - * `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL. - * `userAgent` String (optional) - A user agent originating the request. - * `extraHeaders` String (optional) - Extra headers separated by "\n" + * `httpReferrer` (String | [Referrer](structures/referrer.md)) (opcional) - Una URL de referencia HTTP. + * `userAgent` Cadena (opcional) - Un agente de usuario originando el pedido. + * `extraHeaders` Cadena (opcional) - Encabezados extras separados por "\n" * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional) - * `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files. + * `baseURLForDataURL` String (opcional) - URL base (con separador de ruta final) para archivos a ser cargados por el data URL. Esto solo es necesario si la `url` especificada es una data URL y necesita cargar otros archivos. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Devuelve `Promise` - la promesa sera resolvida cuando la página haya finalizado de cargar (mira [`did-finish-load`](web-contents.md#event-did-finish-load)), y será rechazada si la pagina falla al cargar (mira [`did-fail-load`](web-contents.md#event-did-fail-load)). -Same as [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options). +Igual que [`webContents.loadURL(url[, opciones])`](web-contents.md#contentsloadurlurl-options). -The `url` can be a remote address (e.g. `http://`) or a path to a local HTML file using the `file://` protocol. +El `url` puede ser una dirección remota (por ejemplo `http://`) o una de un archivo locar HTML utilizando el protocolo `file://`. -To ensure that file URLs are properly formatted, it is recommended to use Node's [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject) method: +Para garantizar que los URLs del archivo estén adecuadamente formateados, se recomienda utilizar el método [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject) del Nodo: ```javascript const url = require('url').format({ @@ -1126,7 +1128,7 @@ const url = require('url').format({ win.loadURL(url) ``` -You can load a URL using a `POST` request with URL-encoded data by doing the following: +Se puede cargar un URL utilizando la solicitud `POST` con los datos codificados de URL haciendo lo siguiente: ```javascript win.loadURL('http://localhost:8000/post', { @@ -1142,197 +1144,197 @@ win.loadURL('http://localhost:8000/post', { * `filePath` String * `options` Object (opcional) - * `query` Record (optional) - Passed to `url.format()`. - * `search` String (optional) - Passed to `url.format()`. - * `hash` String (optional) - Passed to `url.format()`. + * `query` Record (opcional) - Pasado a `url.format()`. + * `search` String (opcional) - Pasado a `url.format()`. + * `hash` String (opcional) - Pasado a `url.format()`. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Devuelve `Promise` - la promesa sera resolvida cuando la página haya finalizado de cargar (mira [`did-finish-load`](web-contents.md#event-did-finish-load)), y será rechazada si la pagina falla al cargar (mira [`did-fail-load`](web-contents.md#event-did-fail-load)). -Same as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information. +Same as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. Ver la documentación `webContents` para más información. #### `win.reload()` -Same as `webContents.reload`. +Es igual a `webContents.reload`. #### `win.setMenu(menu)` _Linux_ _Windows_ * `menu` Menu | null -Sets the `menu` as the window's menu bar. +Establece el `menu` como el menu bar de la ventana. #### `win.removeMenu()` _Linux_ _Windows_ -Remove the window's menu bar. +Eliminar la barra de menú de la ventana. #### `win.setProgressBar(progress[, options])` * `progress` Double * `options` Object (opcional) - * `mode` String _Windows_ - Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or `paused`. + * `mode` String _Windows_ - Mode for the progress bar. Puede ser `none`, `normal`, `indeterminate`, `error` o `paused`. -Sets progress value in progress bar. Valid range is [0, 1.0]. +Establece el valor del progreso en el progress bar. Rango valido es [0, 1.0]. -Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1. +Elimina la barra de progreso cuando el progreso es < 0; cambia a modo indeterminado cuando el progreso es >1. -On Linux platform, only supports Unity desktop environment, you need to specify the `*.desktop` file name to `desktopName` field in `package.json`. By default, it will assume `{app.name}.desktop`. +En la plataforma Linux, solo es compatible con el environment de escritorio Unity. Se necesita especificar el nombre del archivo `*.desktop` en el campo `desktopName` dentro de `package.json`. Por defecto, será asumido `{app.name}.desktop`. -On Windows, a mode can be passed. Accepted values are `none`, `normal`, `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a mode set (but with a value within the valid range), `normal` will be assumed. +En Windows, se puede pasar de modo. Los valores aceptados son `none`, `normal`, `indeterminate`, `error`, y `paused`. Si se llama a`setProgressBar` sin establecer un modo (pero con un valor dentro del rango válido), se asumirá el modo `normal`. #### `win.setOverlayIcon(overlay, description)` _Windows_ -* `overlay` [NativeImage](native-image.md) | null - the icon to display on the bottom right corner of the taskbar icon. If this parameter is `null`, the overlay is cleared -* `description` String - a description that will be provided to Accessibility screen readers +* `overlay` [NativeImage](native-image.md) | null - el icono a mostrar en la parte inferior derecha del icono de la barra de tareas. Si este parámetro es `null`, se borra la superposición +* `description` Cadena- una descripción que se facilitará a los lectores de la pantalla Accessibility -Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user. +Establece una superposición de 16 x 16 píxeles sobre el icono actual de la barra de tareas. Generalmente se utiliza para transmitir algún tipo de estatus de la aplicación o para notificar pasivamente al usuario. #### `win.setHasShadow(hasShadow)` * `hasShadow` Boolean -Sets whether the window should have a shadow. +Establece si la ventana debe tener una sombra. #### `win.hasShadow()` -Returns `Boolean` - Whether the window has a shadow. +Devuelve `Boolean` - Si la ventana tiene o no una sombra. #### `win.setOpacity(opacity)` _Windows_ _macOS_ -* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque) +* `opacity` Number- entre 0.0 (completamente transparente) y 1.0 (completamente opaco) -Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the [0, 1] range. +Establece la opacidad de la ventana. En Linux no hace nada. Out of bound number values are clamped to the [0, 1] range. #### `win.getOpacity()` -Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1. +Devuelve `number` - entre 0.0 (completamente transparente) y 1.0 (totalmente opaco). En Linux, siempre devuelve 1. #### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_ * `rects` [Rectangle[]](structures/rectangle.md) - Sets a shape on the window. Passing an empty list reverts the window to being rectangular. -Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window. +Establecer una forma de ventana determina el área dentro de la ventana donde el sistema permite dibujar y interactuar con el usuario. Fuera de la región dada, no se dibujarán píxeles y no se registrarán eventos del ratón. Los eventos del ratón fuera de la región no será recibida por esa ventana, pero pasará a lo que esté detrás de la misma. #### `win.setThumbarButtons(buttons)` _Windows_ * `buttons` [ThumbarButton[]](structures/thumbar-button.md) -Returns `Boolean` - Whether the buttons were added successfully +Devuelve `Boolean` - Si los botones se añadieron o no exitosamente -Add a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a `Boolean` object indicates whether the thumbnail has been added successfully. +Añade la barra de herramientas de la vista previa con una configuración específica de los botones para la imagen previsualizada de una ventana en el plano del botón en la barra de tareas. Devuelve un objeto `Boolean` e indica si la previsualización se ha agregado con éxito. -The number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform's limitation. But you can call the API with an empty array to clean the buttons. +El número de botones en la barra de herramientas de la vista previa no debe ser mayor que 7 debido al limitado espacio. Una vez que se configura la barra de herramientas de la vista previa, la barra de tareas no puede ser eliminada debido a las limitaciones de la plataforma. Sin embargo, se puede llamar a la API con un arreglo vacío para limpiar los botones. -The `buttons` is an array of `Button` objects: +Los `buttons` es un arreglo de objetos `Button`: * `Button` Object - * `icon` [NativeImage](native-image.md) - The icon showing in thumbnail toolbar. - * `click` Function - * `tooltip` String (optional) - The text of the button's tooltip. - * `flags` String[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`. + * `icon` [NativeImage](native-image.md) - El icono que muestra la barra de herramientas de la vista previa. + * `click` Función + * `tooltip` String (opcional): el texto de la información sobre el botón. + * `flags` String[] (opcional) - Controla los estados y comportamientos específicos del botón. Por defecto, es `['enabled']`. -The `flags` is an array that can include following `String`s: +Los `flags` es una matriz que puede incluir siguientes `String`s: -* `enabled` - The button is active and available to the user. -* `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action. -* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately. -* `nobackground` - Do not draw a button border, use only the image. -* `hidden` - The button is not shown to the user. -* `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification. +* `enabled` - El botón está activo y disponible para el usuario. +* `disabled` - El botón está deshabilitado. Está presente, pero tiene un estado visual indicando que no responderá a la acción del usuario. +* `dismissonclick` - Cuando se hace clic en el botón, la ventana de miniatura se cierra de inmediato. +* `nobackground` - No dibuja un borde del botón, usa solo la imagen. +* `hidden` - El botón no es mostrado al usuario. +* `noninteractive` - El botón está habilitado pero no es interactivo; no se dibuja el estado del botón pulsado. Este valor está destinado a instancias donde el botón se utiliza en una notificación. #### `win.setThumbnailClip(region)` _Windows_ -* `region` [Rectangle](structures/rectangle.md) - Region of the window +* `region` [Rectangle](structures/rectangle.md) - la región de la ventana -Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0 }`. +Establece la región de la ventana para mostrar como la vista previa de la imagen es mostrada cuando se pasa sobre la ventana en la barra de tareas. Puede restablecer la miniatura de la la ventana completa simplemente especificando una región vacía: `{ x: 0, y: 0, width: 0, height: 0 }`. #### `win.setThumbnailToolTip(toolTip)` _Windows_ * `toolTip` String -Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar. +Configura la descripción emergente que se muestra cuando se pasa sobre la vista previa de la ventana en la barra de tareas. #### `win.setAppDetails(options)` _Windows_ * `options` Object - * `appId` String (optional) - Window's [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx). It has to be set, otherwise the other options will have no effect. - * `appIconPath` String (optional) - Window's [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx). + * `appId` String (opcional) - El [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx) de Windows. Tiene que estar configurado, de lo contrario las otras opciones no tendrán efecto. + * `appIconPath` String (opcional) - El [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx) de Windows. * `appIconIndex` Integer (optional) - Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set. Por defecto es `0`. - * `relaunchCommand` String (optional) - Window's [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx). - * `relaunchDisplayName` String (optional) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx). + * `relaunchCommand` String (opcional) - El [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx) de Windows. + * `relaunchDisplayName` String (opcional) - El [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx) de Windows. -Sets the properties for the window's taskbar button. +Establece las propiedades para el botón de la barra de herramientas de la ventana. -**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set together. If one of those properties is not set, then neither will be used. +**Note:** `relaunchCommand` y `relaunchDisplayName` siempre deben ser establecidos juntos. Si una de esas propiedades no está establecida, entonces ninguna será usada. #### `win.showDefinitionForSelection()` _macOS_ -Same as `webContents.showDefinitionForSelection()`. +Es igual a `webContents.showDefinitionForSelection()`. #### `win.setIcon(icon)` _Windows_ _Linux_ * `icon` [NativeImage](native-image.md) | String -Changes window icon. +Cambia el icono de la ventana. #### `win.setWindowButtonVisibility(visible)` _macOS_ * `visible` Boolean -Sets whether the window traffic light buttons should be visible. +Establece si los botones de luz del tráfico de ventana deben estar visibles. #### `win.setAutoHideMenuBar(hide)` * `hide` Boolean -Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single `Alt` key. +Establece si el menu bar de la ventana debe ocultarse a si misma automáticamente o no. Once set the menu bar will only show when users press the single `Alt` key. If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately. #### `win.isMenuBarAutoHide()` -Returns `Boolean` - Whether menu bar automatically hides itself. +Devuelve `Boolean` - Si la barra de menú se oculta o no automáticamente. #### `win.setMenuBarVisibility(visible)` _Windows_ _Linux_ * `visible` Boolean -Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key. +Establece si la barra de menú debe estar visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key. #### `win.isMenuBarVisible()` -Returns `Boolean` - Whether the menu bar is visible. +Devuelve `Boolean` - Si la barra de menú es visible o no. #### `win.setVisibleOnAllWorkspaces(visible[, options])` * `visible` Boolean * `options` Object (opcional) - * `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether the window should be visible above fullscreen windows. - * `skipTransformProcessType` Boolean (optional) _macOS_ - Calling setVisibleOnAllWorkspaces will by default transform the process type between UIElementApplication and ForegroundApplication to ensure the correct behavior. However, this will hide the window and dock for a short time every time it is called. If your window is already of type UIElementApplication, you can bypass this transformation by passing true to skipTransformProcessType. + * `visibleOnFullScreen` Boolean (opcional) _macOS_ - Establece si la ventana debe ser visible encima de la ventanas de pantalla completas. + * `skipTransformProcessType` Boolean (opcional) _macOS_ - Llamando a setVisibleOnAllWorkspaces por defecto transformará el tipo de proceso entre UIElementApplication y ForegroundApplication para asegurar el comportamiento correcto. Sin embargo, esto ocultará la ventana y el dock por un tiempo corto cada vez que es llamado. Si su ventana ya es de tipo UIElementApplication, puede saltarse esta tranformación pasando true a skipTransformProcessType. -Sets whether the window should be visible on all workspaces. +Establece si la ventana debe ser visible o no en todos los espacios de trabajo. -**Note:** This API does nothing on Windows. +**Nota:** Esta API no hace nada en Windows. #### `win.isVisibleOnAllWorkspaces()` -Returns `Boolean` - Whether the window is visible on all workspaces. +Devuelve `Boolean` - Si la ventana es visible en todos los espacios de trabajo. -**Note:** This API always returns false on Windows. +**Nota:** Esta API siempre devuelve false en Windows. #### `win.setIgnoreMouseEvents(ignore[, options])` * `ignore` Boolean * `options` Object (opcional) - * `forward` Boolean (optional) _macOS_ _Windows_ - If true, forwards mouse move messages to Chromium, enabling mouse related events such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false, forwarding is always disabled regardless of this value. + * `forward` Boolean (opcional) _macOS_ _Windows_ - Si es true, enviá el mensaje de movimiento de mouse a Chromium, permitiendo eventos relacionados tal como `mouseleave`. Solo se usa cuando `ignore` es verdadero. Si `ignore` es falso, el reenvío está simpre desactivado independientemente de este valor. -Makes the window ignore all mouse events. +Hace que la ventana ignore todos los eventos del ratón. -All mouse events happened in this window will be passed to the window below this window, but if this window has focus, it will still receive keyboard events. +Todos los eventos del ratón ocurridos en esta ventana se pasarán a la ventana debajo de esta ventana, pero si esta ventana esta enfocada, todavía recibirá los eventos del teclado. #### `win.setContentProtection(enable)` _macOS_ _Windows_ * `enable` Boolean -Prevents the window contents from being captured by other apps. +Evita que los contenidos de la ventana sean capturados por otras aplicaciones. On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10 version 2004 and up the window will be removed from capture entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window. @@ -1340,95 +1342,99 @@ On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows i * `focusable` Boolean -Changes whether the window can be focused. +Cambia si se puede enfocar o no la ventana. + +En macOS no elimina el foco de la ventana. + +#### `win.isFocusable()` _macOS_ _Windows_ -On macOS it does not remove the focus from the window. +Returns whether the window can be focused. #### `win.setParentWindow(parent)` * `parent` BrowserWindow | null -Sets `parent` as current window's parent window, passing `null` will turn current window into a top-level window. +Establece `parent` como la ventana de la ventana principal actual. Al pasar `null` cambiará la ventana actual a una ventana de nivel superior. #### `win.getParentWindow()` -Returns `BrowserWindow` - The parent window. +Devuelve `BrowserWindow` - La ventana principal. #### `win.getChildWindows()` -Returns `BrowserWindow[]` - All child windows. +Devuelve `BrowserWindow[]` - Todas las ventanas secundarias. #### `win.setAutoHideCursor(autoHide)` _macOS_ * `autoHide` Boolean -Controls whether to hide cursor when typing. +Controla si se debe ocultar el cursor al escribir. #### `win.selectPreviousTab()` _macOS_ -Selects the previous tab when native tabs are enabled and there are other tabs in the window. +Selecciona la pestaña previa cuando las pestañas nativas están activas y hay otras pestañas en la ventana. #### `win.selectNextTab()` _macOS_ -Selects the next tab when native tabs are enabled and there are other tabs in the window. +Selecciona la siguiente pestaña cuando las pestañas nativas están activas y hay otras pestañas en la ventana. #### `win.mergeAllWindows()` _macOS_ -Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window. +Unifica todas las ventanas en una sola con múltiples pestañas cuando las pestañas nativas están activas y hay más de una ventana abierta. #### `win.moveTabToNewWindow()` _macOS_ -Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window. +Mueve la pestaña actual a una nueva ventana si las pestañas nativas están activas y hay más de una pestaña en la ventana actual. #### `win.toggleTabBar()` _macOS_ -Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window. +Conmuta la visibilidad de la barra de pestañas si las pestañas nativas están activas y hay solo una pestaña en la ventana actual. #### `win.addTabbedWindow(browserWindow)` _macOS_ * `browserWindow` BrowserWindow -Adds a window as a tab on this window, after the tab for the window instance. +Añade una ventana como pestaña de la ventana actual, después de la pestaña para la instancia de la ventana actual. #### `win.setVibrancy(type)` _macOS_ -* `type` String | null - Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See the [macOS documentation][vibrancy-docs] for more details. +* `type` String | null - Puede ser `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, o `under-page`. Para más detalles, ver [macOS documentation][vibrancy-docs]. -Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window. +Añade un efecto de vibración a la ventana del navegador. Passing `null` or an empty string will remove the vibrancy effect on the window. -Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS. +Note que `appearance-based`, `light`, `dark`, `medium-light`, y `ultra-dark` han sido marcadas como obsoletas y serán eliminadas un un próxima versión de macOS. #### `win.setTrafficLightPosition(position)` _macOS_ -* `position` [Point](structures/point.md) +* `position` [Punto](structures/point.md) -Set a custom position for the traffic light buttons in frameless window. +Establece una posición personalizada para los botones del semáforo en la ventana sin marco. #### `win.getTrafficLightPosition()` _macOS_ -Returns `Point` - The custom position for the traffic light buttons in frameless window. +Devuelve `Point` - La posición personalizada para los botones del semáforo en la ventana sin marco. #### `win.setTouchBar(touchBar)` _macOS_ * `touchBar` TouchBar | null -Sets the touchBar layout for the current window. Specifying `null` or `undefined` clears the touch bar. This method only has an effect if the machine has a touch bar and is running on macOS 10.12.1+. +Configura el plano de la touchBar para la ventana actual. Espeficando `null` o `undefined` elimina la barra táctil. Este método solo es efectivo si la máquina tiene una barra táctil y si se está ejecutando en macOS 10.12.1+. -**Note:** The TouchBar API is currently experimental and may change or be removed in future Electron releases. +**Nota:** La API TouchBar API actualmente es experimental y puede cambiar o ser eliminada en futuras versiones de Electron. #### `win.setBrowserView(browserView)` _Experimental_ -* `browserView` [BrowserView](browser-view.md) | null - Attach `browserView` to `win`. If there are other `BrowserView`s attached, they will be removed from this window. +* `browserView` [BrowserView](browser-view.md) | null - Adjunta `browserView` a `win`. Si hay otros `BrowserView`s adjuntos, se eliminarán de esta ventana. #### `win.getBrowserView()` _Experimental_ -Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null` if one is not attached. Throws an error if multiple `BrowserView`s are attached. +Devuelve `BrowserView | null` - El `BrowserView` adjunto a `win`. Devuelve `null` si uno no esta adjunto. Lanza un error si múltiples `BrowserView` son adjuntos. #### `win.addBrowserView(browserView)` _Experimental_ * `browserView` [BrowserView](browser-view.md) -Replacement API for setBrowserView supporting work with multi browser views. +API de reemplazo para setBrowserView soporta el trabajo con múltiples vistas de navegador. #### `win.removeBrowserView(browserView)` _Experimental_ @@ -1438,13 +1444,13 @@ Replacement API for setBrowserView supporting work with multi browser views. * `browserView` [BrowserView](browser-view.md) -Raises `browserView` above other `BrowserView`s attached to `win`. Throws an error if `browserView` is not attached to `win`. +Levanta un `browserView` sobre otro `BrowserView` adjunto a `win`. Lanza un error si `browserView` no está adjunto a `win`. #### `win.getBrowserViews()` _Experimental_ -Returns `BrowserView[]` - an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. +Devuelve `BrowserView[]` - Un array de todos los BrowserViews que han sido adjuntados con `addBrowserView` or `setBrowserView`. -**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases. +**Nota:** actualmente la API BrowserView es experimental y puede cambiar o ser eliminada en versiones futuras de Electron. [runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 [page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API @@ -1453,3 +1459,5 @@ Returns `BrowserView[]` - an array of all BrowserViews that have been attached w [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/es-ES/docs/api/clipboard.md b/content/es-ES/docs/api/clipboard.md index a0b6661dc8946..d6acb7a5d967d 100644 --- a/content/es-ES/docs/api/clipboard.md +++ b/content/es-ES/docs/api/clipboard.md @@ -1,10 +1,10 @@ # clipboard -> Perform copy and paste operations on the system clipboard. +> Realiza las operaciones de copiar y pegar en el portapapeles del sistema. -Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) +Procesos: [principal](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) -On Linux, there is also a `selection` clipboard. To manipulate it you need to pass `selection` to each method: +En Linux, también hay un portapapeles `selección`. Para manipularlo necesita pasar `selección` a cada método: ```javascript const { clipboard } = require('electron') @@ -15,15 +15,15 @@ console.log(clipboard.readText('selection')) ## Métodos -The `clipboard` module has the following methods: +El módulo `portapapeles` tiene los siguientes métodos: -**Note:** Experimental APIs are marked as such and could be removed in future. +**Nota:** APIs experimentales son marcadas como tales y podría ser removidas en el futuro. ### `clipboard.readText([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (opcional) - Puede ser `selection` o `clipboard`; por defecto es 'clipboard'. `selection` solo está disponible en Linux. -Returns `String` - The content in the clipboard as plain text. +Devuelve `Cadena` - El contenido en el portapapeles como texto sin formato. ```js const { clipboard } = require('electron') @@ -35,12 +35,12 @@ console.log(text) // hello i am a bit of text!' ``` -### `clipboard.writeText(text[, type])` +### `clipboard.writeText(texto[, type])` -* `text` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `texto` Cadena +* `type` String (opcional) - Puede ser `selection` o `clipboard`; por defecto es 'clipboard'. `selection` solo está disponible en Linux. -Writes the `text` into the clipboard as plain text. +Escribe el `texto` en el portapapeles como texto sin formato. ```js const { clipboard } = require('electron') @@ -51,9 +51,9 @@ clipboard.writeText(text) ### `clipboard.readHTML([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (opcional) - Puede ser `selection` o `clipboard`; por defecto es 'clipboard'. `selection` solo está disponible en Linux. -Returns `String` - The content in the clipboard as markup. +Devuelve `Cadena` - El contenido en el portapapeles como marca. ```js const { clipboard } = require('electron') @@ -67,10 +67,10 @@ console.log(html) ### `clipboard.writeHTML(markup[, type])` -* `markup` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `markup` Cadena +* `type` String (opcional) - Puede ser `selection` o `clipboard`; por defecto es 'clipboard'. `selection` solo está disponible en Linux. -Writes `markup` to the clipboard. +Escribe `markup` en el portapapeles. ```js const { clipboard } = require('electron') @@ -80,22 +80,22 @@ clipboard.writeHTML('Hiselection

    ') console.log(hasFormat) -// 'true' or 'false +// 'true' or 'false' ``` ### `clipboard.read(format)` _Experimental_ -* `format` String +* `formato` Cadena -Returns `String` - Reads `format` type from the clipboard. +Devuelve `String` - Lee el tipo de `formato` del portapapeles. + +`format` should contain valid ASCII characters and have `/` separator. `a/c`, `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid. ### `clipboard.readBuffer(format)` _Experimental_ -* `format` String +* `formato` Cadena -Returns `Buffer` - Reads `format` type from the clipboard. +Devuelve `Buffer` - Lee el `formato` del portapapeles. ```js const { clipboard } = require('electron') const buffer = Buffer.from('this is binary', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) -const ret = clipboard.readBuffer('public.utf8-plain-text') +const ret = clipboard.readBuffer('public/utf8-plain-text') console.log(buffer.equals(out)) // true @@ -222,30 +224,30 @@ console.log(buffer.equals(out)) ### `clipboard.writeBuffer(format, buffer[, type])` _Experimental_ -* `format` String +* `formato` Cadena * `buffer` Buffer -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (opcional) - Puede ser `selection` o `clipboard`; por defecto es 'clipboard'. `selection` solo está disponible en Linux. -Writes the `buffer` into the clipboard as `format`. +Escribe el `buffer` en el portapapeles como `formato`. ```js const { clipboard } = require('electron') const buffer = Buffer.from('writeBuffer', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) ``` ### `clipboard.write(data[, type])` * `data` Object - * `text` String (optional) - * `html` String (optional) - * `image` [NativeImage](native-image.md) (optional) - * `rtf` String (optional) - * `bookmark` String (optional) - The title of the URL at `text`. -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. - -Writes `data` to the clipboard. + * `text` Cadena (opcional) + * `html` Cadena (opcional) + * `image` [NativeImage](native-image.md) (opcional) + * `rtf` Cadena (opcional) + * `bookmark` String (opcional) - El título de la URL en `text`. +* `type` String (opcional) - Puede ser `selection` o `clipboard`; por defecto es 'clipboard'. `selection` solo está disponible en Linux. + +Escribe `datos` en el portapapeles. ```js const { clipboard } = require('electron') diff --git a/content/es-ES/docs/api/command-line-switches.md b/content/es-ES/docs/api/command-line-switches.md index cc189726c39d0..6ae627504e44a 100644 --- a/content/es-ES/docs/api/command-line-switches.md +++ b/content/es-ES/docs/api/command-line-switches.md @@ -59,17 +59,18 @@ Fuerza el espacio máximo de disco a utilizar por la caché de disco, en bytes. Habilita el caller stack logging para las siguientes APIs (eventos filtrados): * `desktopCapturer.getSources()` / `desktop-capturer-get-sources` -* `remote.require()` / `remote-require` -* `remote.getGlobal()` / `remote-get-builtin` -* `remote.getBuiltin()` / `remote-get-global` -* `remote.getCurrentWindow()` / `remote-get-current-window` -* `remote.getCurrentWebContents()` / `remote-get-current-web-contents` -### --enable-logging +### --enable-logging[=file] -Escribe registros de Chromium en la consola. +Prints Chromium's logging to stderr (or a log file). -Esta opción no puede ser usada en `app.commandLine.appendSwitch` ya que es procesada antes que la app del usuario es cargada, pero puedes establecer la variable de entorno `ELECTRON_ENABLE_LOGGING` para lograr el mismo efecto. +The `ELECTRON_ENABLE_LOGGING` environment variable has the same effect as passing `--enable-logging`. + +Passing `--enable-logging` will result in logs being printed on stderr. Passing `--enable-logging=file` will result in logs being saved to the file specified by `--log-file=...`, or to `electron_debug.log` in the user-data directory if `--log-file` is not specified. + +> **Note:** On Windows, logs from child processes cannot be sent to stderr. Logging to a file is the most reliable way to collect logs on Windows. + +See also `--log-file`, `--log-level`, `--v`, and `--vmodule`. ### --force-fieldtrials=`trials` @@ -116,10 +117,26 @@ Vea la [Documentación de Node.js][node-cli] o ejecute `node --help` en su termi Establecer una configuración regional personalizada. +### --log-file=`path` + +If `--enable-logging` is specified, logs will be written to the given path. The parent directory must exist. + +Setting the `ELECTRON_LOG_FILE` environment variable is equivalent to passing this flag. If both are present, the command-line switch takes precedence. + ### --log-net-log=`path` Habilita el registro de los eventos de red para ser salvados y escritos en la ruta `path`. +### --log-level=`N` + +Sets the verbosity of logging when used together with `--enable-logging`. `N` should be one of [Chrome's LogSeverities][severities]. + +Note that two complimentary logging mechanisms in Chromium -- `LOG()` and `VLOG()` -- are controlled by different switches. `--log-level` controls `LOG()` messages, while `--v` and `--vmodule` control `VLOG()` messages. So you may want to use a combination of these three switches depending on the granularity you want and what logging calls are made by the code you're trying to watch. + +See [Chromium Logging source][logging] for more information on how `LOG()` and `VLOG()` interact. Loosely speaking, `VLOG()` can be thought of as sub-levels / per-module levels inside `LOG(INFO)` to control the firehose of `LOG(INFO)` data. + +See also `--enable-logging`, `--log-level`, `--v`, and `--vmodule`. + ### --no-proxy-server Don't use a proxy server and always make direct connections. Overrides any other proxy server flags that are passed. @@ -159,6 +176,8 @@ Gives the default maximal active V-logging level; 0 is the default. Normally pos Esta opción solo funciona cuando `--enable-logging` es también pasada. +See also `--enable-logging`, `--log-level`, and `--vmodule`. + ### --vmodule=`pattern` Permite que el nivel máximo por module de V-logging sobrepase el valor dado por `--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in source files `my_module.*` and `foo*.*`. @@ -167,6 +186,8 @@ Cualquier patrón que contenga una barra hacia adelante o una barra hacia atras Esta opción solo funciona cuando `--enable-logging` es también pasada. +See also `--enable-logging`, `--log-level`, and `--v`. + ### --force_high_performance_gpu Force using discrete GPU when there are multiple GPUs available. @@ -214,5 +235,7 @@ By default inspector websocket url is available in stderr and under /json/list e [ready]: app.md#event-ready [play-silent-audio]: https://github.com/atom/atom/pull/9485/files [debugging-main-process]: ../tutorial/debugging-main-process.md +[logging]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h [node-cli]: https://nodejs.org/api/cli.html [node-cli]: https://nodejs.org/api/cli.html +[severities]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h?q=logging::LogSeverity&ss=chromium diff --git a/content/es-ES/docs/api/dialog.md b/content/es-ES/docs/api/dialog.md index 13fda03f4d24f..0699c22397e1b 100644 --- a/content/es-ES/docs/api/dialog.md +++ b/content/es-ES/docs/api/dialog.md @@ -186,8 +186,6 @@ Los `filtros` especifican un arreglo de los tipos de archivos can pueden ser mos * `defaultId` Íntegro (opcional) - El índice del botón en el arreglo de los botones, el cual será selecto por defecto cuando el mensaje de la caja se abra. * `title` Cadena (opcional) - Título del mensaje de la caja, algunas plataformas no se mostrarán. * `detail` Cadena (opcional) - Información extra del mensaje. - * `checkboxLabel` String (opcional) - Si se proporciona, el cuadro de mensaje será incluido como un checkbox con la etiqueta dada. - * `checkboxChecked` Boolean (opcional) - Estado inicial checked del checkbox. `false` por defecto. * `icon` ([NativeImage](native-image.md) | String) (opcional) * `cancelId` Íntegro (opcional) - El índice el botón a ser usado a cancelar el diálogo, por vía la llave `Esc`. Por defecto, esto es asignado a el primer botón con "cancelar" o "no" como una etiqueta. Si no existen tales botones etiquetados y esta opción no esta configurada, `0` será usada como el valor de retorno. * `noLink` Boolean (opcional) - En Windows Electron se tratará de averiguar cuál de los `buttons` son botones comunes (como "Cancelar" o "Sí"), y muestra los otros como links de comandos en el diálogo. Esto puede hacer que el diálogo aparezca en el estilo de las aplicaciones modernas de Windows. Si no te gusta este comportamiento, puedes establecer `noLink` a `true`. diff --git a/content/es-ES/docs/api/environment-variables.md b/content/es-ES/docs/api/environment-variables.md index c04bf55fa6a19..fa09b9f9d54ee 100644 --- a/content/es-ES/docs/api/environment-variables.md +++ b/content/es-ES/docs/api/environment-variables.md @@ -104,7 +104,15 @@ Las siguientes variables de entorno están principalmente diseñadas para propó ### `ELECTRON_ENABLE_LOGGING` -Imprime el registro interno de Chrome a la consola. +Prints Chromium's internal logging to the console. + +Setting this variable is the same as passing `--enable-logging` on the command line. For more info, see `--enable-logging` in [command-line switches](./command-line-switches.md#enable-loggingfile). + +### `ELECTRON_LOG_FILE` + +Sets the file destination for Chromium's internal logging. + +Setting this variable is the same as passing `--log-file` on the command line. For more info, see `--log-file` in [command-line switches](./command-line-switches.md#log-filepath). ### `ELECTRON_DEBUG_DRAG_REGIONS` @@ -112,7 +120,7 @@ Agrega coloración a regiones arrastrables en [`BrowserView`](./browser-view.md) ### `ELECTRON_DEBUG_NOTIFICATIONS` -Agrega registros adicionales al ciclos de vida [`Notification`](./notification.md) en macOS para ayudar a depurar. Se mostrará un registro adicional cuando se creen o activen nuevas notificaciones. También se mostraran cuando acciones comunes son realizadas: se muestra una notificación, se descarga, su botón es pulsado, o responde a. +Agrega registros adicionales al ciclos de vida [`Notification`](./notification.md) en macOS para ayudar a depurar. Se mostrará un registro adicional cuando se creen o activen nuevas notificaciones. They will also be displayed when common a tions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. Ejemplo de salida: diff --git a/content/es-ES/docs/api/extensions.md b/content/es-ES/docs/api/extensions.md index efd762a55eed4..91c86d71d3fe9 100644 --- a/content/es-ES/docs/api/extensions.md +++ b/content/es-ES/docs/api/extensions.md @@ -64,6 +64,7 @@ Los siguientes métodos de `chrome.runtime` son soportados: - `chrome.runtime.getURL` - `chrome.runtime.connect` - `chrome.runtime.sendMessage` +- `chrome.runtime.reload` Los siguientes eventos de `chrome.runtime` están soportados: diff --git a/content/es-ES/docs/api/frameless-window.md b/content/es-ES/docs/api/frameless-window.md index 8ad1c242bfa3a..7d84f63244fd7 100644 --- a/content/es-ES/docs/api/frameless-window.md +++ b/content/es-ES/docs/api/frameless-window.md @@ -14,13 +14,13 @@ const win = new BrowserWindow({ width: 800, height: 600, frame: false }) win.show() ``` -### Alternativas en macOS +### Alternatives -Hay una forma alternativa par especificar un ventana sin bordes (chromeless). En lugar de establecer `frame` a `false` lo que deshabilita ambos la barra de título y los controles de la ventana, usted puede querer tener la barra de título oculta y su contenido se extienda al tamaño completo de la ventana, aún conserva los controles de la ventana ("semáforos") para las acciones estándar de la ventana. Puede hacerse especificando la opción `titleBarStyle`: +There's an alternative way to specify a chromeless window on macOS and Windows. Instead of setting `frame` to `false` which disables both the titlebar and window controls, you may want to have the title bar hidden and your content extend to the full window size, yet still preserve the window controls ("traffic lights" on macOS) for standard window actions. Puede hacerse especificando la opción `titleBarStyle`: #### `hidden` -Es una barra de título oculta y una ventana de contenido de tamaño completo. Sin embargo, la barra de título mantiene los controles estándares de la ventana (“traffic lights”) en la parte superior izquierda. +Results in a hidden title bar and a full size content window. On macOS, the title bar still has the standard window controls (“traffic lights”) in the top left. ```javascript const { BrowserWindow } = require('electron') @@ -28,6 +28,8 @@ const win = new BrowserWindow({ titleBarStyle: 'hidden' }) win.show() ``` +### Alternativas en macOS + #### `hiddenInset` Es una barra de título oculta con un aspecto alternativo donde los botones de traffic light están ligeramente mas insertados desde el borde de la ventana. @@ -48,6 +50,33 @@ const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: fa win.show() ``` +## Windows Control Overlay + +When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS, using one of the `titleBarStyle`s as described above so that the traffic lights are visible, or using `titleBarStyle: hidden` on Windows, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true. Specifying `true` will result in an overlay with default system colors. + +On Windows, you can also specify the color of the overlay and its symbols by setting `titleBarOverlay` to an object with the options `color` and `symbolColor`. If an option is not specified, the color will default to its system color for the window control buttons: + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: true +}) +win.show() +``` + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: { + color: '#2f3241', + symbolColor: '#74b1be' + } +}) +win.show() +``` + ## Ventana transparente Al configurar la opción `transparent` a `true`, se puede hacer transparente la ventana sin bordes: @@ -142,3 +171,5 @@ En una ventana sin marco el comportamiento de arrastrar puede causar conflicto c En algunas plataformas, el área desplazable puede ser considerada como un borde que no forma parte del cliente, de esta manera cuando se haga clic sobre él, aparecerá un menú del sistema. Para que el menú de contexto se comporte correctamente en todas las plataformas, nunca debe usarse un menú de contexto personalizado en áreas desplazables. [ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/es-ES/docs/api/ipc-main.md b/content/es-ES/docs/api/ipc-main.md index 5b55831cd08a9..e028b46af8c90 100644 --- a/content/es-ES/docs/api/ipc-main.md +++ b/content/es-ES/docs/api/ipc-main.md @@ -32,6 +32,8 @@ ipcMain.on('synchronous-message', (event, arg) => { ```javascript // In renderer process (web page). +// NB. Electron APIs are only accessible from preload, unless contextIsolation is disabled. +// Vea https://www.electronjs.org/docs/tutorial/process-model#preload-scripts para más detalles. const { ipcRenderer } = require('electron') console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints "pong" diff --git a/content/es-ES/docs/api/menu-item.md b/content/es-ES/docs/api/menu-item.md index 4eda5f3b8b980..552c0175f5e3b 100644 --- a/content/es-ES/docs/api/menu-item.md +++ b/content/es-ES/docs/api/menu-item.md @@ -13,7 +13,7 @@ Vea [`Menú`](menu.md) para obtener ejemplos. * `menuItem` MenuItem * `browserWindow` [BrowserWindow](browser-window.md) | undefined - Esto no se definirá si no hay alguna ventana abierta. * `event` [KeyboardEvent](structures/keyboard-event.md) - * `role` String (opcional) - Puede ser `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define la acción del elemento del menú, cuando se especifica la propiedad `click` se ignorara esta propiedad. Ver [roles](#roles). + * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. Ver [roles](#roles). * `type` String (opcional) - Puede ser `normal`, `separador`, `submenu`, `checkbox` o `radio`. * `label` String (opcional) * `sublabel` String (opcional) @@ -128,7 +128,7 @@ Un `String` indicando el tipo del elemento. Puede ser `normal`, `separator`, `su #### `menuItem.role` -Una `String` (opcional) indicando el rol del elemento, si está establecido. Puede ser `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` o `windowMenu` +Una `String` (opcional) indicando el rol del elemento, si está establecido. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` #### `menuItem.accelerator` diff --git a/content/es-ES/docs/api/menu.md b/content/es-ES/docs/api/menu.md index bc7db8938e03c..c5d673b1a6b45 100644 --- a/content/es-ES/docs/api/menu.md +++ b/content/es-ES/docs/api/menu.md @@ -143,7 +143,7 @@ const template = [ { role: 'services' }, { type: 'separator' }, { role: 'hide' }, - { role: 'hideothers' }, + { role: 'hideOthers' }, { role: 'unhide' }, { type: 'separator' }, { role: 'quit' } diff --git a/content/es-ES/docs/api/power-monitor.md b/content/es-ES/docs/api/power-monitor.md index 4ea398ded3dac..a9435c3925af3 100644 --- a/content/es-ES/docs/api/power-monitor.md +++ b/content/es-ES/docs/api/power-monitor.md @@ -8,11 +8,11 @@ Proceso: [principal](../glossary.md#main-process) El módulo `powerMonitor` emite los siguientes eventos: -### Event: 'suspend' _macOS_ _Windows_ +### Evento: "suspend" Se emite cuando se suspende el sistema. -### Event: 'resume' _macOS_ _Windows_ +### Evento: "resume" Se emite cuando se reanuda el sistema. diff --git a/content/es-ES/docs/api/session.md b/content/es-ES/docs/api/session.md index 5c835c8c60f12..358ec7cf15aaa 100644 --- a/content/es-ES/docs/api/session.md +++ b/content/es-ES/docs/api/session.md @@ -160,7 +160,7 @@ Devuelve: Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request. -#### Evento: 'select-serial-port' _Experimental_ +#### Event: 'select-serial-port' Devuelve: @@ -172,21 +172,15 @@ Devuelve: Emitted when a serial port needs to be selected when a call to `navigator.serial.requestPort` is made. `callback` should be called with `portId` to be selected, passing an empty string to `callback` will cancel the request. Additionally, permissioning on `navigator.serial` can be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler) with the `serial` permission. -Because this is an experimental feature it is disabled by default. To enable this feature, you will need to use the `--enable-features=ElectronSerialChooser` command line switch. Additionally because this is an experimental Chromium feature you will need to set `enableBlinkFeatures: 'Serial'` on the `webPreferences` property when opening a BrowserWindow. - ```javascript const { app, BrowserWindow } = require('electron') let win = null -app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser') app.whenReady().then(() => { win = new BrowserWindow({ width: 800, - height: 600, - webPreferences: { - enableBlinkFeatures: 'Serial' - } + height: 600 }) win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => { event.preventDefault() @@ -202,7 +196,7 @@ app.whenReady().then(() => { }) ``` -#### Evento: 'serial-port-added' _Experimental_ +#### Event: 'serial-port-added' Devuelve: @@ -212,7 +206,7 @@ Devuelve: Emitted after `navigator.serial.requestPort` has been called and `select-serial-port` has fired if a new serial port becomes available. For example, this event will fire when a new USB device is plugged in. -#### Evento: 'serial-port-removed' _Experimental_ +#### Event: 'serial-port-removed' Devuelve: @@ -452,7 +446,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents #### `ses.setPermissionCheckHandler(handler)` * `handler` Función\ | null - * `webContents` ([WebContents](web-contents.md) | null) - WebContents verificando el permiso. Por favor, tenga en cuenta que si la solicitud viene de un subframe debe utilizar `requestUrl` para comprobar el origen de la solicitud. Los subframes de origen cruzado que hacen chequeos de permisos pasarán un contenido web `null` a este manejador. Debería usar `embeddingOrigin` y `requestingOrigin` para determinar que origen se encuentra en el marco propietario y en el marco solicitante respectivamente. + * `webContents` ([WebContents](web-contents.md) | null) - WebContents verificando el permiso. Por favor, tenga en cuenta que si la solicitud viene de un subframe debe utilizar `requestUrl` para comprobar el origen de la solicitud. All cross origin sub frames making permission checks will pass a `null` webContents to this handler, while certain other permission checks such as `notifications` checks will always pass `null`. Debería usar `embeddingOrigin` y `requestingOrigin` para determinar que origen se encuentra en el marco propietario y en el marco solicitante respectivamente. * `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, or `serial`. * `requestingOrigin` String - La URL de origen para la comprobación de permisos * `details` Object - Some properties are only available on certain permission types. diff --git a/content/es-ES/docs/api/structures/overlay-options.md b/content/es-ES/docs/api/structures/overlay-options.md new file mode 100644 index 0000000000000..9e0e4815ea59c --- /dev/null +++ b/content/es-ES/docs/api/structures/overlay-options.md @@ -0,0 +1,4 @@ +# OverlayOptions Object + +* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color. +* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color. diff --git a/content/es-ES/docs/api/structures/user-default-types.md b/content/es-ES/docs/api/structures/user-default-types.md new file mode 100644 index 0000000000000..97e14259be608 --- /dev/null +++ b/content/es-ES/docs/api/structures/user-default-types.md @@ -0,0 +1,12 @@ +# UserDefaultTypes Object + +* `string` String +* `boolean` Boolean +* `integer` Number +* `float` Number +* `double` Number +* `url` String +* `array` Arreglo\ +* `dictionary` Record\ + +This type is a helper alias, no object will never exist of this type. diff --git a/content/es-ES/docs/api/system-preferences.md b/content/es-ES/docs/api/system-preferences.md index c75c0765094fe..9cbe788f8f280 100644 --- a/content/es-ES/docs/api/system-preferences.md +++ b/content/es-ES/docs/api/system-preferences.md @@ -147,12 +147,12 @@ Igual que `unsubscribeNotification`, pero remueve el subscriptor desde `NSWorksp Agregue los valores predeterminados especificados a `NSUserDefaults` de su aplicación. -### `systemPreferences.getUserDefault(key, type)` _macOS_ +### `systemPreferences.getUserDefault(key, type)` _macOS_ * `llave` Cadena -* `type` String - Puede ser `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` o `dictionary`. +* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. -Devuelve `any` - El valor de `Key` en `NSUserDefaults`. +Returns [`UserDefaultTypes[Type]`](structures/user-default-types.md) - The value of `key` in `NSUserDefaults`. Algún `key` y `type`s populares: diff --git a/content/es-ES/docs/api/touch-bar-scrubber.md b/content/es-ES/docs/api/touch-bar-scrubber.md index 8e250895ca2bd..0c4cb8f4cf3a6 100644 --- a/content/es-ES/docs/api/touch-bar-scrubber.md +++ b/content/es-ES/docs/api/touch-bar-scrubber.md @@ -14,7 +14,7 @@ Proceso: [principal](../glossary.md#main-process) * `índice destacado` Entero - El índice del elemento que el usuario tocó. * `selectedStyle` String (opcional) - Estilo de elemento seleccionado. Puede ser `background`, `outline` o `none`. Por defecto es `none`. * `overlayStyle` String (opcional) - Estilo de elemento de superposición seleccionado. Puede ser `background`, `outline` o `none`. Por defecto es `none`. - * `showArrowButtons` Boolean (opcional) - Por defecto a `false`. + * `showArrowButtons` Boolean (optional) - Whether to show arrow buttons. Defaults to `false` and is only shown if `items` is non-empty. * `mode` String (opcional) - Puede ser `fixed` o `free`. Por defecto es `free`. * `continuous` Boolean (opcional) - Por defecto a `true`. diff --git a/content/es-ES/docs/api/web-contents.md b/content/es-ES/docs/api/web-contents.md index 6ce53738f0e9b..7e8901d724d35 100644 --- a/content/es-ES/docs/api/web-contents.md +++ b/content/es-ES/docs/api/web-contents.md @@ -39,6 +39,24 @@ Volver `WebContents` - El contenido web que se centra en esta aplicación, de lo Devuelve `WebContents` | undefined - Una instancia de WebContents con el ID dado, o `undefined` si no hay WebContents asociados con ID dado. +### `webContents.fromDevToolsTargetId(targetId)` + +* `targetId` String - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance. + +Returns `WebContents` | undefined - A WebContents instance with the given TargetID, or `undefined` if there is no WebContents associated with the given TargetID. + +When communicating with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), it can be useful to lookup a WebContents instance based on its assigned TargetID. + +```js +async function lookupTargetId (browserWindow) { + const wc = browserWindow.webContents + await wc.debugger.attach('1.3') + const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo') + const { targetId } = targetInfo + const targetWebContents = await webContents.fromDevToolsTargetId(targetId) +} +``` + ## Clase: WebContents > Renderice y controle el contenido de una instancia de BrowserWindow. @@ -134,7 +152,7 @@ Devuelve: * `frameName` String * `disposition` String - Puede ser `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. * `options` BrowserWindowConstructorOptions - Las opciones que serán usadas para crear la nueva [`BrowserWindow`](browser-window.md). -* `additionalFeatures` String[] - Las características no estándar (características no manejadas por Chromium o Electron) pasadas a `window.open()`. +* `additionalFeatures` String[] - Las características no estándar (características no manejadas por Chromium o Electron) pasadas a `window.open()`. Deprecated, and will now always be the empty array `[]`. * `referrer` [Referrer](structures/referrer.md) - El remitente que será pasado a la nueva ventana. Puede resultar o no en la cabecera `Referer` siendo enviado, dependiendo de la política de referencia. * `postBody` [PostBody](structures/post-body.md) (opcional) - Los datos que serán enviados a la nueva ventana, junto con las cabeceras apropiadas que se establecerán. Si no hay datos para enviar, el valor será `null`. Solo se define cuando la ventana está siendo creada por un formulario que establece `target=_blank`. @@ -178,8 +196,7 @@ Devuelve: * `details` Object * `url` String - URL de la ventana creada. * `frameName` String - Nombre dado a la ventana creada en la llamada `window.open()`. - * `options` BrowserWindowConstructorOptions - Las opciones utilizadas para crear el BrowserWindow. Se fusionan en una precedencia creciente: opciones heredadas desde el padre, opciones analizadas de la cadena `features` de `window.open()`, y opciones dadas por [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Las opciones no reconocidas no están filtradas. - * `additionalFeatures` String[] - Las características no estándar (características no manejadas por Chromium o Electron) _Deprecated_ + * `options` BrowserWindowConstructorOptions - Las opciones utilizadas para crear el BrowserWindow. They are merged in increasing precedence: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Las opciones no reconocidas no están filtradas. * `referrer` [Referrer](structures/referrer.md) - El remitente que será pasado a la nueva ventana. Puede resultar o no en la cabecera `Referer` siendo enviado, dependiendo de la política de referencia. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. Si no hay datos para enviar, el valor será `null`. Only defined when the window is being created by a form that set `target=_blank`. * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. @@ -320,6 +337,8 @@ win.webContents.on('will-prevent-unload', (event) => { }) ``` +**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the [specification](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). + #### Evento: 'crashed' _Obsoleto_ Devuelve: @@ -726,49 +745,6 @@ Devuelve: Emitted when `desktopCapturer.getSources()` is called in the renderer process. Llamando a `event.preventDefault()` hará que devuelva fuentes vacías. -#### Evento: 'remote-require' _Obsoleto_ - -Devuelve: - -* `event` IpcMainEvent -* `moduleName` String - -Emitido cuando `remote.require()` se llama en el proceso de renderizado. Llamando `event.preventDefault()` evitará que se devuelva el modulo. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - -#### Evento: 'remote-get-global' _Obsoleto_ - -Devuelve: - -* `event` IpcMainEvent -* `globalName` String - -Emitido cuando `remote.getGlobal()` se llama en el proceso de renderizado. Llamando `event.preventDefault()` evitará que sea devuelto el global. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - -#### Evento: 'remote-get-builtin' _Obsoleto_ - -Devuelve: - -* `event` IpcMainEvent -* `moduleName` String - -Emitido cuando `remote.getBuiltin()` se llama en el proceso de renderizado. Llamando `event.preventDefault()` evitará que se devuelva el modulo. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - -#### Evento: 'remote-get-current-window' _Obsoleto_ - -Devuelve: - -* `event` IpcMainEvent - -Emitido cuando `remote.getCurrentWindow()` se llama en el proceso de renderizado. Llamar a `event.preventDefault()` evitará que el objeto sea retornado. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - -#### Evento: 'remote-get-current-web-contents' _Obsoleto_ - -Devuelve: - -* `event` IpcMainEvent - -Emitido cuando `remote.getCurrentWebContents()` se llama en el proceso de renderizado. Llamar a `event.preventDefault()` evitará que el objeto sea retornado. Un valor personalizado puede ser devuelto estableciendo `event.returnValue`. - #### Evento: 'preferred-size-changed' Devuelve: @@ -1040,7 +1016,7 @@ Ignora los accesos directos del menú de la aplicación mientras se enfoca los c Devuelve `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancela la creación de la nueva ventana. `allow` permitirá la que se cree la nueva ventana. Especificando `overrideBrowserWindowOptions` permite la personalización de la ventana creada. Devolver un valor no reconocido como un null, undefined o un objeto sin una 'action' reconocida resultará en un error de consola tiene el mismo efecto que devolver `{action: 'deny'}`. -Called before creating a window when `window.open()` is called from the renderer. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. +Called before creating a window a new window is requested by the renderer, e.g. by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or submitting a form with ``. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. #### `contents.setAudioMuted(muted)` diff --git a/content/es-ES/docs/api/web-frame-main.md b/content/es-ES/docs/api/web-frame-main.md index 45f1264d138c0..36599871e6952 100644 --- a/content/es-ES/docs/api/web-frame-main.md +++ b/content/es-ES/docs/api/web-frame-main.md @@ -154,3 +154,9 @@ Un `Integer` que representa el `pid` del proceso interno de Chromium al cual per #### `frame.routingId` _Readonly_ An `Integer` representing the unique frame id in the current renderer process. Las instancias distintas de `WebFrameMain` que se refieren al mimo frame subyacente tendrán el mismo `routingId`. + +#### `frame.visibilityState` _SoloLectura_ + +A `string` representing the [visibility state](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) of the frame. + +See also how the [Page Visibility API](browser-window.md#page-visibility) is affected by other Electron APIs. diff --git a/content/es-ES/docs/api/web-request.md b/content/es-ES/docs/api/web-request.md index b6a7dcbbdf2d6..c18f48c6e3e58 100644 --- a/content/es-ES/docs/api/web-request.md +++ b/content/es-ES/docs/api/web-request.md @@ -46,7 +46,7 @@ Lo siguientes métodos están disponibles en instancias de `WebRequest`: * `webContentsId` Entero (opcional) * `webContents` WebContents (opcional) * `frame` WebFrameMain (opcional) - * `sourceId` Cadena + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `fecha y hora` Doble * `uploadData` [UploadData[]](structures/upload-data.md) @@ -88,7 +88,7 @@ Algunos ejemplos de `urls` válidas: * `webContentsId` Entero (opcional) * `webContents` WebContents (opcional) * `frame` WebFrameMain (opcional) - * `sourceId` Cadena + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `fecha y hora` Doble * `requestHeaders` Record @@ -113,7 +113,7 @@ El `callback` ha de ser llamado con un objeto `response`. * `webContentsId` Entero (opcional) * `webContents` WebContents (opcional) * `frame` WebFrameMain (opcional) - * `sourceId` Cadena + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `fecha y hora` Doble * `requestHeaders` Record @@ -132,7 +132,7 @@ El`oyente` Será llamado con `listener(details)` justo antes que una solicitud v * `webContentsId` Entero (opcional) * `webContents` WebContents (opcional) * `frame` WebFrameMain (opcional) - * `sourceId` Cadena + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `fecha y hora` Doble * `linea de estatus` Cadena @@ -160,7 +160,7 @@ El `callback` ha de ser llamado con un objeto `response`. * `webContentsId` Entero (opcional) * `webContents` WebContents (opcional) * `frame` WebFrameMain (opcional) - * `sourceId` Cadena + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `fecha y hora` Doble * `responseHeaders` Record (opcional) @@ -182,7 +182,7 @@ El `oyente` será cancelado con `listener(details)` cuando se reciba el primer b * `webContentsId` Entero (opcional) * `webContents` WebContents (opcional) * `frame` WebFrameMain (opcional) - * `sourceId` Cadena + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `fecha y hora` Doble * `redirectURL` String @@ -206,7 +206,7 @@ El `oyente` Será cancelado con `listener(details)` cuando la redirección del s * `webContentsId` Entero (opcional) * `webContents` WebContents (opcional) * `frame` WebFrameMain (opcional) - * `sourceId` Cadena + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `fecha y hora` Doble * `responseHeaders` Record (opcional) @@ -229,7 +229,7 @@ El `listener` será llamado con `listener(details)` cuando una petición es comp * `webContentsId` Entero (opcional) * `webContents` WebContents (opcional) * `frame` WebFrameMain (opcional) - * `sourceId` Cadena + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `fecha y hora` Doble * `Desde cache` Booleano diff --git a/content/es-ES/docs/api/webview-tag.md b/content/es-ES/docs/api/webview-tag.md index fd767a6faba85..c77850967130d 100644 --- a/content/es-ES/docs/api/webview-tag.md +++ b/content/es-ES/docs/api/webview-tag.md @@ -94,14 +94,6 @@ Un `Boolean`. Cuando este atributo esté presente, la página de invitado en `we Un `Boolean` para habilitar la opción experimental soporte NodeJS en sub frames tal como iframes dentro de `webview`. Todas sus precargas se cargarán por cada iframe, pude usar `process.isMainFrame` para determinar si estás en el frame principal o no. Esta opción está deshailitada por defecto en la pagina de invitado. -### `enableremotemodule` - -```html - -``` - -Un `Boolean`. Cuando este atributo es `false` la pagina de invitado en `webview` no tendrá acceso al módulo [`remote`](remote.md). The remote module is unavailable by default. - ### `plugins` ```html @@ -737,6 +729,18 @@ It is also not emitted during in-page navigation, such as clicking anchor links Llamar a `event.preventDefault()`, __NO__ tiene ningún efecto. +### Evento: 'did-start-navigation' + +Devuelve: + +* `url` String +* `isInPlace` Boolean +* `EsElFramePrincipal` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitido cuando cualquier frame (incluyendo el principal) comienza la navegación. `isInPlace` will be `true` for in-page navigations. + ### Evento: 'did-navigate' Devuelve: @@ -747,6 +751,21 @@ Emitido cuando la navegación es finalizada. This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. +### Evento: 'did-frame-navigate' + +Devuelve: + +* `url` String +* `httpResponseCode` Integer - -1 para navegaciones no HTTP +* `httpStatusText` String - vacío para navegaciones no HTTP +* `EsElFramePrincipal` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitido cuando se ha realizado un navegación de algun frame. + +This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. + ### Evento: 'did-navigate-in-page' Devuelve: diff --git a/content/es-ES/docs/api/window-open.md b/content/es-ES/docs/api/window-open.md index b4f7b1a26691c..a48a67157706a 100644 --- a/content/es-ES/docs/api/window-open.md +++ b/content/es-ES/docs/api/window-open.md @@ -1,4 +1,4 @@ -# Opening windows from the renderer +# Abrir ventanas desde el renderer There are several ways to control how windows are created from trusted or untrusted content within a renderer. Windows can be created from the renderer in two ways: @@ -11,7 +11,7 @@ However, when the `sandbox` (or directly, `nativeWindowOpen`) option is set, a ` Electron pairs this native Chrome `Window` with a BrowserWindow under the hood. You can take advantage of all the customization available when creating a BrowserWindow in the main process by using `webContents.setWindowOpenHandler()` for renderer-created windows. -Las opciones del constructor de BrowserWindow son establecidas por, en orden de precedencia creciente: opciones heredadas desde el padre, analizadas desde la cadena `features` de `window.open()`, webPreferences relacionadas a seguridad heredadas desde el padre y opciones dadas por [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. +BrowserWindow constructor options are set by, in increasing precedence order: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. ### `window.open(url[, frameName][, features])` @@ -36,11 +36,12 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn * La integración de nodo siempre estará deshabilitada en la `window` abierta si está deshabilitada en la ventana principal. * El aislamiento de contexto siempre estará habilitado en la `window` abierta si está habilitado en la ventana principal. * JavaScript siempre estará deshabilitado en la `window` abierta si está deshabilitado en la ventana principal. -* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `additionalFeatures` argument. +* Las características no estándares (que no son manejadas por Chromium o Electron) dadas en `features` serán pasadas a cualquier manejador de evento registrado `did-create-window` de `webContents` en el argumento `options`. +* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters). To customize or cancel the creation of the window, you can optionally set an override handler with `webContents.setWindowOpenHandler()` from the main process. Returning `false` cancels the window, while returning an object sets the `BrowserWindowConstructorOptions` used when creating the window. Note that this is more powerful than passing options through the feature string, as the renderer has more limited privileges in deciding security preferences than the main process. -### `BrowserWindowProxy` example +### Ejemplo de `BrowserWindowProxy` ```javascript @@ -56,7 +57,7 @@ mainWindow.webContents.setWindowOpenHandler(({ url }) => { mainWindow.webContents.on('did-create-window', (childWindow) => { // For example... - childWindow.webContents('will-navigate', (e) => { + childWindow.webContents.on('will-navigate', (e) => { e.preventDefault() }) }) @@ -68,7 +69,7 @@ const windowProxy = window.open('https://github.com/', null, 'minimizable=false' windowProxy.postMessage('hi', '*') ``` -### Native `Window` example +### Ejemplo de `Window` nativo ```javascript // main.js diff --git a/content/es-ES/docs/breaking-changes.md b/content/es-ES/docs/breaking-changes.md index edb75e67f648f..f43c63b629148 100644 --- a/content/es-ES/docs/breaking-changes.md +++ b/content/es-ES/docs/breaking-changes.md @@ -12,9 +12,29 @@ Este documento usa la siguiente convención para clasificar los cambios de ruptu * **Obsoleto:** Una API fue marcada como obsoleta. La API continuará funcionando, pero emitirá una advertencia de desaprobación y será eliminada en una futura versión. * **Eliminado:** Una API o característica fue eliminada y ya no es compatible por Electron. +## Cambios planeados en la API(15.0) + +### Valor por defecto modificado: `nativeWindowOpen` por defecto a `true` + +Prior to Electron 15, `window.open` was by default shimmed to use `BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work to open synchronously scriptable child windows, among other incompatibilities. `nativeWindowOpen: true` is no longer experimental, and is now the default. + +See the documentation for [window.open in Electron](api/window-open.md) for more details. + ## Cambios planeados en la API(14.0) -### API Changed: `window.(open)` +### Eliminada: `app.allowRendererProcessReuse` + +The `app.allowRendererProcessReuse` property will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. + +Para información más detallada vea [#18397](https://github.com/electron/electron/issues/18397). + +### Eliminado: Browser Window Affinity + +La opción `affinity` al construir una nueva `BrowserWindow` se eliminará como parte de nuestro plan para alinear más estrechamente con el modelo de proceso de Chromium por seguridad, rendimiento y mantenimiento. + +Para información más detallada vea [#18397](https://github.com/electron/electron/issues/18397). + +### API modificada: `window.open()` El parámetro opcional `frameName` ya no se establecerá como el título de la ventana. Esto ahora sigue la especificación descrita por la [documentación nativa](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) bajo el correspondiente parámetro `windowName`. @@ -27,6 +47,44 @@ En Electron 14 `worldSafeExecuteJavaScript` será eliminado. No hay alternativa Será afectado por este cambio si usted utliza `webFrame.executeJavaScript` o `webFrame.executeJavaScriptInIsolatedWorld`. Necesitará asegurase que los valores devueltos por cualquiera de esos métodos son soportados por [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) ya que estos métodos utilizan la misma semántica de paso de valores. +### Removed: BrowserWindowConstructorOptions inheriting from parent windows + +Prior to Electron 14, windows opened with `window.open` would inherit BrowserWindow constructor options such as `transparent` and `resizable` from their parent window. Beginning with Electron 14, this behavior is removed, and windows will not inherit any BrowserWindow constructor options from their parents. + +Instead, explicitly set options for the new window with `setWindowOpenHandler`: + +```js +webContents.setWindowOpenHandler((details) => { + return { + action: 'allow', + overrideBrowserWindowOptions: { + // ... + } + } +}) +``` + +### Eliminada: `additionalFeatures` + +The deprecated `additionalFeatures` property in the `new-window` and `did-create-window` events of WebContents has been removed. Since `new-window` uses positional arguments, the argument is still present, but will always be the empty array `[]`. (Though note, the `new-window` event itself is deprecated, and is replaced by `setWindowOpenHandler`.) Bare keys in window features will now present as keys with the value `true` in the options object. + +```js +// Removed in Electron 14 +// Triggered by window.open('...', '', 'my-key') +webContents.on('did-create-window', (window, details) => { + if (details.additionalFeatures.includes('my-key')) { + // ... + } +}) + +// Replace with +webContents.on('did-create-window', (window, details) => { + if (details.options['my-key']) { + // ... + } +}) +``` + ## Cambios planeados en la API(13.0) ### API modificada: `session.setPermissionCheckHandler(handler)` @@ -134,17 +192,17 @@ systemPreferences.isHighContrastColorScheme() nativeTheme.shouldUseHighContrastColors ``` -### Deprecated: WebContents `new-window` event +### En desuso: evento Webcontens `nueva ventana` -The `new-window` event of WebContents has been deprecated. Es reemplazado por [`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler). +El evento `new-window` de WebContents está obsoleto. Es reemplazado por [`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler). ```js -// Deprecated in Electron 13 +// Obsoleto en Electron 13 webContents.on('new-window', (event) => { event.preventDefault() }) -// Replace with +// Reemplazar por webContents.setWindowOpenHandler((details) => { return { action: 'deny' } }) @@ -234,11 +292,11 @@ shell.trashItem(path).then(/* ... */) ## Cambios planeados en la API(11.0) -### Removed: `BrowserView.{destroy, fromId, fromWebContents, getAllViews}` and `id` property of `BrowserView` +### Eliminado: `BrowserView.{destroy, fromId, fromWebContents, getAllViews}` y `id` propiedad de `BrowserView` Las APIs experimentales `BrowserView.{destroy, fromId, fromWebContents, getAllViews}` fueron removidas. Adicionalmente, la propiedad `id` de `BrowserView` también ha sido removida. -For more detailed information, see [#23578](https://github.com/electron/electron/pull/23578). +Para ver más información, consulta [#23578](https://github.com/electron/electron/pull/23578). ## Cambios planeados en la API(10.0) @@ -285,12 +343,6 @@ Vea [#23265](https://github.com/electron/electron/pull/23265) para más detalles Establecer `{ compress: false }` en `crashReporter.start` está obsoleto. Casi todos los servidores de gestión de fallos soportan compresión gzip. Esta opción será eliminada en una versión futura de Electron. -### Eliminado: Browser Window Affinity - -La opción `affinity` al construir una nueva `BrowserWindow` se eliminará como parte de nuestro plan para alinear más estrechamente con el modelo de proceso de Chromium por seguridad, rendimiento y mantenimiento. - -Para información más detallada vea [#18397](https://github.com/electron/electron/issues/18397). - ### Valor por defecto modificado: `enableRemoteModule` por defecto a `false` En Electron 9, usar el módulo remoto sin habilitarlo explícitamente a través de la opción `enableRemoteModule` WebPreferences comenzó a emitir una advertencia. En Electron 10, el módulo remote está deshabilitado por defecto. Para usar el módulo remote debe especificarse `enableRemoteModule: true` en WebPreferences: @@ -365,9 +417,9 @@ const isIntercepted = protocol.isProtocolIntercepted(scheme) ### Default Changed: Loading non-context-aware native modules in the renderer process is disabled by default -As of Electron 9 we do not allow loading of non-context-aware native modules in the renderer process. This is to improve security, performance and maintainability of Electron as a project. +A partir de Electron 9 no permitimos la carga de módulos nativos no conscientes del contexto en el proceso de renderizado. Esto es para mejorar la seguridad, el rendimiento y el mantenimiento de Electron como proyecto. -If this impacts you, you can temporarily set `app.allowRendererProcessReuse` to `false` to revert to the old behavior. This flag will only be an option until Electron 11 so you should plan to update your native modules to be context aware. +Si esto te impacta, puedes configurar de forma temporal `app.allowRendererProcessReuse` a `false` para revertir el comportamiento antiguo. Esta marca solo será una opción hasta Electron 11 y deberías planear actualizar tus módulos nativos para que sean conscientes del contexto. Para información más detallada vea [#18397](https://github.com/electron/electron/issues/18397). @@ -430,7 +482,7 @@ Chromium ha eliminado el soporte para cambiar los limites del nivel de zoom del ### Comportamiento Modificado: Enviando objetos no JS sobre IPC ahora lanza una excepción -In Electron 8.0, IPC was changed to use the Structured Clone Algorithm, bringing significant performance improvements. To help ease the transition, the old IPC serialization algorithm was kept and used for some objects that aren't serializable with Structured Clone. In particular, DOM objects (e.g. `Element`, `Location` and `DOMMatrix`), Node.js objects backed by C++ classes (e.g. `process.env`, some members of `Stream`), and Electron objects backed by C++ classes (e.g. `WebContents`, `BrowserWindow` and `WebFrame`) are not serializable with Structured Clone. Whenever the old algorithm was invoked, a deprecation warning was printed. +En Electron 8.0, el IPC se cambió para que utilizara el algoritmo de clon estructurado, con importantes mejoras de rendimiento. To help ease the transition, the old IPC serialization algorithm was kept and used for some objects that aren't serializable with Structured Clone. In particular, DOM objects (e.g. `Element`, `Location` and `DOMMatrix`), Node.js objects backed by C++ classes (e.g. `process.env`, some members of `Stream`), and Electron objects backed by C++ classes (e.g. `WebContents`, `BrowserWindow` and `WebFrame`) are not serializable with Structured Clone. Whenever the old algorithm was invoked, a deprecation warning was printed. En Electron 9,0, se eliminó el algoritmo de serialización anterior, y enviar tales objetos no serializables ahora lanzará un error "no se pudo clonar el objeto". diff --git a/content/es-ES/docs/development/pull-requests.md b/content/es-ES/docs/development/pull-requests.md index 088419d3931ce..be38e64fa731c 100644 --- a/content/es-ES/docs/development/pull-requests.md +++ b/content/es-ES/docs/development/pull-requests.md @@ -92,7 +92,6 @@ Prefijos usuales: * perf: Un cambio en el código que mejora el rendimiento * refactor: Un cambio en el código que no corrige un error ni agrega una característica * style: Cambios que no afectan el significado del código (linting) -* vendor: Cambiar una dependencia como libchromiumcontent o node Otras cosas para tener en mente cuando se escribe un mensaje de commit: diff --git a/content/es-ES/docs/development/source-code-directory-structure.md b/content/es-ES/docs/development/source-code-directory-structure.md index b95e731001f59..1af74d828a7e8 100644 --- a/content/es-ES/docs/development/source-code-directory-structure.md +++ b/content/es-ES/docs/development/source-code-directory-structure.md @@ -76,7 +76,6 @@ Electron * **.circleci** - Archivo de configuración para CI con CircleCI. * **.github** - Archivos de configuración específicos de GitHub, incluyendo plantillas de problemas y CODEOWNERS. * **dist** - Directorio temporal creado por el comando `script/create-dist.py` cuando se crea una distribución. -* **external_binaries** - Binarios descargados de terceros los cuales no soportan la construcción con `gn`. * **Nodos de módulo** - Nodos de módulo de terceros usados para compilar. * **npm** - Lógica para la instalación de Electron via npm. * **afuera** - temporalmente afuera del directorio de `ninja`. @@ -92,4 +91,3 @@ script/ - El conjunto de todo los scripts que Electron ejecuta para una variedad ``` * **typings** - Tipos de TypeScript para el código interno de Electron. -* **vendor** - Código fuente para algunas dependencias de terceros. diff --git a/content/es-ES/docs/tutorial/application-debugging.md b/content/es-ES/docs/tutorial/application-debugging.md index dc56ce4fff237..ee196426b7552 100644 --- a/content/es-ES/docs/tutorial/application-debugging.md +++ b/content/es-ES/docs/tutorial/application-debugging.md @@ -29,7 +29,7 @@ Si el contexto V8 se bloquea, el DevTools mostrará este mensaje. Los registros de Chromium puden ser habilitados a través de la variable de entorno `ELECTRON_ENABLE_LOGGING`. Para más información, vea la [documentacion de variables de entorno](../api/environment-variables.md#electron_enable_logging). -Alternativamente, el argumento de linea de comando `--enable-logging` puede ser pasado. Más información esta disponible en la [la documentación de parámetros de la línea de comando](../api/command-line-switches.md#--enable-logging). +Alternativamente, el argumento de linea de comando `--enable-logging` puede ser pasado. Más información esta disponible en la [la documentación de parámetros de la línea de comando](../api/command-line-switches.md#--enable-loggingfile). [node-inspect]: https://nodejs.org/en/docs/inspector/ [devtools]: https://developer.chrome.com/devtools diff --git a/content/es-ES/docs/tutorial/code-signing.md b/content/es-ES/docs/tutorial/code-signing.md index 48a5c1da867a9..b48d7865ae2b2 100644 --- a/content/es-ES/docs/tutorial/code-signing.md +++ b/content/es-ES/docs/tutorial/code-signing.md @@ -103,7 +103,7 @@ Electron Builder viene con una solución personalizada para la firma de su aplic If you're not using an integrated build pipeline like Forge or Builder, you are likely using [`electron-packager`][], which includes [`electron-osx-sign`][] and [`electron-notarize`][]. -If you're using Packager's API, you can pass [in configuration that both signs and notarizes your application](https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html). +If you're using Packager's API, you can pass [in configuration that both signs and notarizes your application](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html). ```js const packager = require('electron-packager') @@ -156,7 +156,6 @@ Usted puede obtener una certificado de firma de código desde muchos revendedore * [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm) * [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing) -* [GoDaddy](https://au.godaddy.com/web-security/code-signing-certificate) * Amongst others, please shop around to find one that suits your needs, Google is your friend 😄 Hay una serie de herramientas para firmar su aplicación empaquetada: diff --git a/content/es-ES/docs/tutorial/dark-mode.md b/content/es-ES/docs/tutorial/dark-mode.md index ee68ed8106cf3..aeb97dea2c607 100644 --- a/content/es-ES/docs/tutorial/dark-mode.md +++ b/content/es-ES/docs/tutorial/dark-mode.md @@ -56,9 +56,9 @@ Starting with the `index.html` file: ``` -And the `style.css` file: +And the `styles.css` file: -```css title='style.css' +```css title='styles.css' @media (prefers-color-scheme: dark) { body { background: #333; color: white; } } @@ -160,6 +160,6 @@ Run the example using Electron Fiddle and then click the "Toggle Dark Mode" butt [system-wide-dark-mode]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/ [electron-forge]: https://www.electronforge.io/ [electron-packager]: https://github.com/electron/electron-packager -[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport +[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#darwindarkmodesupport [prefers-color-scheme]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme [event-listeners]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener diff --git a/content/es-ES/docs/tutorial/in-app-purchases.md b/content/es-ES/docs/tutorial/in-app-purchases.md index 72f6c85239be0..36ab621104667 100644 --- a/content/es-ES/docs/tutorial/in-app-purchases.md +++ b/content/es-ES/docs/tutorial/in-app-purchases.md @@ -1,4 +1,4 @@ -# Compra dentro de la App (macOS) +# In-App Purchases (macOS) ## Preparando diff --git a/content/es-ES/docs/tutorial/installation.md b/content/es-ES/docs/tutorial/installation.md index 2c10cd3f6f433..58af95d9e51f0 100644 --- a/content/es-ES/docs/tutorial/installation.md +++ b/content/es-ES/docs/tutorial/installation.md @@ -1,4 +1,4 @@ -# Instalación +# Advanced Installation Instructions To install prebuilt Electron binaries, use [`npm`][npm]. The preferred method is to install Electron as a development dependency in your app: diff --git a/content/es-ES/docs/tutorial/launch-app-from-url-in-another-app.md b/content/es-ES/docs/tutorial/launch-app-from-url-in-another-app.md index d26e2d06151e5..e5d9da4f53e59 100644 --- a/content/es-ES/docs/tutorial/launch-app-from-url-in-another-app.md +++ b/content/es-ES/docs/tutorial/launch-app-from-url-in-another-app.md @@ -1,5 +1,5 @@ --- -title: launch-app-from-URL-in-another-app +title: Launching Your Electron App From A URL In Another App description: This guide will take you through the process of setting your electron app as the default handler for a specific protocol. slug: launch-app-from-url-in-another-app hide_title: true @@ -123,31 +123,25 @@ This feature will only work on macOS when your app is packaged. It will not work ### Plist ```XML -

    -

    macOS plist
    -
    
    -    
    -        
    -            
    -                
    -                    CFBundleURLTypes
    -                    
    -                        
    -                            CFBundleURLSchemes
    -                            
    -                                electron-api-demos
    -                            
    -                            CFBundleURLName
    -                            Electron API Demos Protocol
    -                        
    -                    
    -                    ElectronTeamID
    -                    VEKTX9H2N7
    -                
    -            
    -        
    -    
    -

    + + + + + CFBundleURLTypes + + + CFBundleURLSchemes + + electron-api-demos + + CFBundleURLName + Electron API Demos Protocol + + + ElectronTeamID + VEKTX9H2N7 + + ``` ## Conclusión diff --git a/content/es-ES/docs/tutorial/linux-desktop-actions.md b/content/es-ES/docs/tutorial/linux-desktop-actions.md index a66e3f5a4e0bb..b654b0f4791a2 100644 --- a/content/es-ES/docs/tutorial/linux-desktop-actions.md +++ b/content/es-ES/docs/tutorial/linux-desktop-actions.md @@ -1,4 +1,4 @@ -# Acciones personalizadas de arranque de escritorio de Linux +# Desktop Launcher Actions (Linux) ## Descripción general diff --git a/content/es-ES/docs/tutorial/macos-dock.md b/content/es-ES/docs/tutorial/macos-dock.md index a9db676e88307..7a7140a18f01c 100644 --- a/content/es-ES/docs/tutorial/macos-dock.md +++ b/content/es-ES/docs/tutorial/macos-dock.md @@ -1,4 +1,4 @@ -# Configuring the macOS Dock +# Dock (macOS) Electron tiene APIs para configurar el icono de la aplicación en el Dock de macOS. Solo existe una API macOS para crear menú de dock personalizado, pero Electron además usa el icono de app dock como el punto de entrada para características multiplataforma como [recent documents][recent-documents] y [application progress][progress-bar]. diff --git a/content/es-ES/docs/tutorial/notifications.md b/content/es-ES/docs/tutorial/notifications.md index 0ac817b5d12ec..07cc6695f512f 100644 --- a/content/es-ES/docs/tutorial/notifications.md +++ b/content/es-ES/docs/tutorial/notifications.md @@ -1,4 +1,4 @@ -# Notificaciones (Windows, Linux, macOS) +# Notificaciones ## Descripción general diff --git a/content/es-ES/docs/tutorial/progress-bar.md b/content/es-ES/docs/tutorial/progress-bar.md index 95d22a7da8252..483eebde97b47 100644 --- a/content/es-ES/docs/tutorial/progress-bar.md +++ b/content/es-ES/docs/tutorial/progress-bar.md @@ -1,4 +1,4 @@ -# Barra de progreso en la barra de tareas (Windows, macOS, Unity) +# Taskbar Progress Bar (Windows & macOS) ## Descripción general diff --git a/content/es-ES/docs/tutorial/represented-file.md b/content/es-ES/docs/tutorial/represented-file.md index 55ecd5acb9dae..8b71544c3c55e 100644 --- a/content/es-ES/docs/tutorial/represented-file.md +++ b/content/es-ES/docs/tutorial/represented-file.md @@ -1,4 +1,4 @@ -# Archivo representado por macOS BrowserWindows +# Representing Files in a BrowserWindow (macOS) ## Descripción general diff --git a/content/es-ES/docs/tutorial/security.md b/content/es-ES/docs/tutorial/security.md index af20094a34330..11624d864cd5e 100644 --- a/content/es-ES/docs/tutorial/security.md +++ b/content/es-ES/docs/tutorial/security.md @@ -18,7 +18,7 @@ Electron keeps up to date with alternating Chromium releases. For more informati Es importante recordar que la seguridad de tu aplicación Electron es el resultado de la seguridad general de la base de framework (*Chromium*, *Node.js*), Electron mismo, todas las dependencias NPM y tu código. Por tanto, es tu responsabilidad seguir algunas importantes mejores prácticas: -* **Mantenga su aplicación actualizada con la última versión liberada de Electron.** Cuando libere su producto, también está compartiendo un conjunto compuesto de Electron, librerías compartidas de Chromium y Node.js. Vulnerabilidades afectando a estos componentes pueden impactar en la seguridad de su aplicación. Actualizando Electron a la última versión, asegura que las vulnerabilidades críticas (tales como *nodeIntegration bypasses*) ya estén reparadas y no puedan ser explotadas en su aplicación. Para más informacón, vea "[Use a current version of Electron](#15-use-a-current-version-of-electron)". +* **Mantenga su aplicación actualizada con la última versión liberada de Electron.** Cuando libere su producto, también está compartiendo un conjunto compuesto de Electron, librerías compartidas de Chromium y Node.js. Vulnerabilidades afectando a estos componentes pueden impactar en la seguridad de su aplicación. Actualizando Electron a la última versión, asegura que las vulnerabilidades críticas (tales como *nodeIntegration bypasses*) ya estén reparadas y no puedan ser explotadas en su aplicación. Para más informacón, vea "[Use a current version of Electron](#16-use-a-current-version-of-electron)". * **Evalue sus dependencias.**Mientras NPM provee más de medio millón de paquetes reusables, es su responsabilidad la elección de librerías confiables de terceros. Si utiliza librerías desactualizadas afectadas por vulnerabilidades conocidas o basado en código escasamente mantenido, la seguridad de su aplicación puede estar en peligro. @@ -43,18 +43,19 @@ Al menos debes seguir los siguientes pasos para mejorar la seguridad de su aplic 1. [Solo carga contenido seguro](#1-only-load-secure-content) 2. [Desactiva la integración Node.js en todas las renderizadores que muestran el contenido remoto](#2-do-not-enable-nodejs-integration-for-remote-content) 3. [Permite el aislamiento de contexto en todos los renderizadores que muestran el contenido remoto](#3-enable-context-isolation-for-remote-content) -4. [Usar `ses.setPermissionRequestHandler()` en todas las sesiones que cargan contenido remoto](#4-handle-session-permission-requests-from-remote-content) -5. [No desactives `webSecurity`](#5-do-not-disable-websecurity) -6. [Define un `Content-Security-Policy`](#6-define-a-content-security-policy) y usa reglas estrictas (i.e. `script-src 'self'`) -7. [No establezca `allowRunningInsecureContent` a `true`](#7-do-not-set-allowrunninginsecurecontent-to-true) -8. [No active ajustes experimentales](#8-do-not-enable-experimental-features) -9. [No use `enableBlinkFeatures`](#9-do-not-use-enableblinkfeatures) -10. [``: No use`allowpopups`](#10-do-not-use-allowpopups) -11. [``: Verificar opciones y parámetros](#11-verify-webview-options-before-creation) -12. [Deshabilitar o limitar navegación](#12-disable-or-limit-navigation) -13. [Deshabilitar o limitar la generación de nuevas ventanas](#13-disable-or-limit-creation-of-new-windows) -14. [No utilice `openExternal` con contenido no confiable](#14-do-not-use-openexternal-with-untrusted-content) -15. [Usar una versión actual de Electron](#15-use-a-current-version-of-electron) +4. [Enable sandboxing](#4-enable-sandboxing) +5. [Usar `ses.setPermissionRequestHandler()` en todas las sesiones que cargan contenido remoto](#5-handle-session-permission-requests-from-remote-content) +6. [No desactives `webSecurity`](#6-do-not-disable-websecurity) +7. [Define un `Content-Security-Policy`](#7-define-a-content-security-policy) y usa reglas estrictas (i.e. `script-src 'self'`) +8. [No establezca `allowRunningInsecureContent` a `true`](#8-do-not-set-allowrunninginsecurecontent-to-true) +9. [No active ajustes experimentales](#9-do-not-enable-experimental-features) +10. [No use `enableBlinkFeatures`](#10-do-not-use-enableblinkfeatures) +11. [``: No use`allowpopups`](#11-do-not-use-allowpopups) +12. [``: Verificar opciones y parámetros](#12-verify-webview-options-before-creation) +13. [Deshabilitar o limitar navegación](#13-disable-or-limit-navigation) +14. [Deshabilitar o limitar la generación de nuevas ventanas](#14-disable-or-limit-creation-of-new-windows) +15. [No utilice `openExternal` con contenido no confiable](#15-do-not-use-openexternal-with-untrusted-content) +16. [Usar una versión actual de Electron](#16-use-a-current-version-of-electron) Para automatizar la detección de configuraciones erróneas y de modelos inseguros, es posible usar [electronegativity](https://github.com/doyensec/electronegativity). Para detalles adicionales sobre potenciales debilidades y errores en la implementación durante el desarrollo de aplicaciones usando Electron, consulte [guía para desarrolladores y auditores](https://doyensec.com/resources/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf) @@ -158,7 +159,23 @@ Even when `nodeIntegration: false` is used, to truly enforce strong isolation an For more information on what `contextIsolation` is and how to enable it please see our dedicated [Context Isolation](context-isolation.md) document. -## 4) Gestionar las solicitudes de permiso de sesión desde el contenido remoto +## 4) Enable Sandboxing + +[Sandboxing](sandbox.md) is a Chromium feature that uses the operating system to significantly limit what renderer processes have access to. You should enable the sandbox in all renderers. Loading, reading or processing any untrusted content in an unsandboxed process, including the main process, is not advised. + +### ¿Còmo? + +When creating a window, pass the `sandbox: true` option in `webPreferences`: + +```js +const win = new BrowserWindow({ + webPreferences: { + sandbox: true + } +}) +``` + +## 5) Gestionar las solicitudes de permiso de sesión desde el contenido remoto Tu puedes haber visto pedidos de permiso mientras usas Chrome: Ellos avisan lo que sea que la página intente usar como una característica que el usuario tiene que aprobar manualmente (como notificaciones). @@ -191,7 +208,7 @@ session }) ``` -## 5) No deshabilitar WebSecurity +## 6) No deshabilitar WebSecurity _La recomendación por defecto es Electrón_ @@ -227,7 +244,7 @@ const mainWindow = new BrowserWindow() ``` -## 6) Definir una política de seguridad de contenido +## 7) Definir una política de seguridad de contenido Un Contenido de Política de Seguridad (CSP) es una capa adicional de protección contra los ataques cross-site-scripting attacks y ataques de inyecciones de data. Recomendamos que ellos estén activados por cualquier página web cargada dentro de Electron. @@ -270,7 +287,7 @@ El mecanismo de entrega preferido de CSP es una cabecera HTTP, sin embargo no es ``` -## 7) No establecer `allowRunningInsecureContent` a `true` +## 8) No establecer `allowRunningInsecureContent` a `true` _La recomendación por defecto es Electrón_ @@ -298,7 +315,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 8) No Habilitar características experimentales +## 9) No Habilitar características experimentales _La recomendación por defecto es Electrón_ @@ -326,7 +343,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 9) No use `enableBlinkFeatures` +## 10) No use `enableBlinkFeatures` _La recomendación por defecto es Electrón_ @@ -352,7 +369,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow() ``` -## 10) No use `allowpopups` +## 11) No use `allowpopups` _La recomendación por defecto es Electrón_ @@ -372,7 +389,7 @@ Si usted no necesita ventanas emergentes, le conviene no permitir la creación d ``` -## 11) Verificar las opciones de WebView antes de la creación +## 12) Verificar las opciones de WebView antes de la creación Un WebView creado en un proceso de renderizado que no contenga integración habilitada de Node.js no será capaz de habilitar integración por sí mismo. Sin embargo, a WebView siempre creará un proco de renderizado independiente con su propio `webPreferences`. @@ -408,7 +425,7 @@ app.on('web-contents-created', (event, contents) => { Una vez más, esta lista simplemente minimiza el riesgo, no lo elimina. If your goal is to display a website, a browser will be a more secure option. -## 12) Deshabilitar o limitar la navegación +## 13) Deshabilitar o limitar la navegación Si tu aplicación no tiene la necesidad de navegar o sólo necesita navegar a páginas conocidas, es una buena idea limitar la navegación directamente a ese alcance conocido, inhabilitando cualquier otro tipo de navegación. @@ -438,7 +455,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 13) Deshabilite o limite la creación de nuevas ventasnas +## 14) Deshabilite o limite la creación de nuevas ventasnas Si tienes un conjunto de ventanas conocido, es una buena idea limitar la creación de ventanas adicionales en tu aplicación. @@ -473,7 +490,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 14) No use `openExternal` con contenido no confiable +## 15) No use `openExternal` con contenido no confiable El [`openExternal`][open-external] de Shell permite abrir un protocolo URI dado con las utilidades nativas del escritorio. En macOS, a modo de ejemplo, esta función es similar a la utilidad de comando de terminal `open` y abrirá la aplicación especifica basado en la URI y en el tipo de archivo asociado. @@ -495,7 +512,7 @@ const { shell } = require('electron') shell.openExternal('https://example.com/index.html') ``` -## 15) Utilizar una versión actual de Electron +## 16) Utilizar una versión actual de Electron You should strive for always using the latest available version of Electron. Whenever a new major version is released, you should attempt to update your app as quickly as possible. diff --git a/content/es-ES/docs/tutorial/snapcraft.md b/content/es-ES/docs/tutorial/snapcraft.md index f7545d6c49d58..6882b919e9f35 100644 --- a/content/es-ES/docs/tutorial/snapcraft.md +++ b/content/es-ES/docs/tutorial/snapcraft.md @@ -1,4 +1,4 @@ -# Guía de Snapcraft (Ubuntu Software Center & Más) +# Snapcraft Guide (Linux) Esta guía provee información sobre cómo empacar you aplicación en Electron para cualquier ambiente en Snapcraft, incluyendo el Centro de Software de Ubuntu. diff --git a/content/es-ES/docs/tutorial/support.md b/content/es-ES/docs/tutorial/support.md index 43c348b78ecc6..5fe5f5d80b135 100644 --- a/content/es-ES/docs/tutorial/support.md +++ b/content/es-ES/docs/tutorial/support.md @@ -41,9 +41,9 @@ When an API is changed or removed in a way that breaks existing functionality, t ### Versiones soportadas actualmente +* 14.x.y * 13.x.y * 12.x.y -* 11.x.y ### Fin de vida diff --git a/content/es-ES/docs/tutorial/updates.md b/content/es-ES/docs/tutorial/updates.md index 192eb2b42c46d..161e4efc0fc6b 100644 --- a/content/es-ES/docs/tutorial/updates.md +++ b/content/es-ES/docs/tutorial/updates.md @@ -35,14 +35,14 @@ Si está desarrollando una aplicación privada de Electrón, o si no está publi Dependiendo de sus necesidades, puede escoger una de esta: -- [Hazel][hazel] – Servidor de actualizaciones para aplicaciones privadas o de código abierto que pueden ser desplegadas de forma gratuita. [Now][now]. Es tomado de los [Lanzamientos de GitHub][gh-releases] y aprovecha al maximo el poder de las CDN's de GitHub. +- [Hazel][hazel] – Update server for private or open-source apps which can be deployed for free on [Vercel][vercel]. Es tomado de los [Lanzamientos de GitHub][gh-releases] y aprovecha al maximo el poder de las CDN's de GitHub. - [Nuts][nuts] – También usa los [Lanzamientos de GitHub][gh-releases], pero almacena la aplicación, actualiza en el Disco Duro y también soporta repositorios privados. - [electron-release-server][electron-release-server] – proporciona un panel para administrar los lanzamientos y no es necesarios que los lanzamientos se originen desde GitHub. - [Nucleus][nucleus] – Un servidor de actualizaciones completo para aplicaciones de Electrón y es mantenido gracias a Atlassian. Soporta múltiples aplicaciones y canales, y utiliza un almacén de archivos estáticos para minimizar el coste del servidor. ## Implementación de actualizaciones en su aplicación -Una vez que haya implementado su servidor de actualización, continúe con la importación de los módulos requeridos en su código. El siguiente código podría variar en diferentes servidores de software, pero funciona como está descrito cuando se utiliza [Hazel](https://github.com/zeit/hazel). +Una vez que haya implementado su servidor de actualización, continúe con la importación de los módulos requeridos en su código. El siguiente código podría variar en diferentes servidores de software, pero funciona como está descrito cuando se utiliza [Hazel][hazel]. **Importantante:** por favor asegurate de que el siguiente código solo se ejecutara en su paquete de aplicaciones, y no en desarrollo. Puedes usar [electron-is-dev](https://github.com/sindresorhus/electron-is-dev) para chequear el tipo de ambiente. @@ -102,8 +102,8 @@ autoUpdater.on('error', message => { Because the requests made by Auto Update aren't under your direct control, you may find situations that are difficult to handle (such as if the update server is behind authentication). The `url` field does support files, which means that with some effort, you can sidestep the server-communication aspect of the process. [Here's an example of how this could work](https://github.com/electron/electron/issues/5020#issuecomment-477636990). -[now]: https://zeit.co/now -[hazel]: https://github.com/zeit/hazel +[vercel]: https://vercel.com +[hazel]: https://github.com/vercel/hazel [nuts]: https://github.com/GitbookIO/nuts [gh-releases]: https://help.github.com/articles/creating-releases/ [electron-release-server]: https://github.com/ArekSredzki/electron-release-server diff --git a/content/es-ES/docs/tutorial/using-native-node-modules.md b/content/es-ES/docs/tutorial/using-native-node-modules.md index 63ff02f84073e..eea2d7cce6708 100644 --- a/content/es-ES/docs/tutorial/using-native-node-modules.md +++ b/content/es-ES/docs/tutorial/using-native-node-modules.md @@ -1,4 +1,4 @@ -# Uso de Módulos Nativos de Node +# Native Node Modules Los módulos nativos de Node.js están soportados por Electron, pero dado que Electron tiene una diferente [interfaz binaria de aplicación (ABI)][abi] de un binario Node.js dado (debido a diferencias tales como usar BoringSSL de Chromium en lugar de OpenSSL), los módulos nativos que use necesitarán ser recompilados para Electron. De lo contrario, obtendrá la siguiente clase de error cuando intente ejecutar su aplicación: @@ -74,7 +74,7 @@ HOME=~/.electron-gyp node-gyp rebuild --target=1.2.3 --arch=x64 --dist-url=https Para compilar Módulos Nativos de Node contra una compilación personalizada de Electron que no coincide con una version pública, indique a `npm` que use la versión de Node que ha incluido en su versión personalizada. ```sh -npm rebuild --nodedir=/path/to/electron/vendor/node +npm rebuild --nodedir=/path/to/src/out/Default/gen/node_headers ``` ## Problemas diff --git a/content/es-ES/docs/tutorial/using-pepper-flash-plugin.md b/content/es-ES/docs/tutorial/using-pepper-flash-plugin.md index 72276672420d1..f09a9f2d2fdaa 100644 --- a/content/es-ES/docs/tutorial/using-pepper-flash-plugin.md +++ b/content/es-ES/docs/tutorial/using-pepper-flash-plugin.md @@ -1,4 +1,4 @@ -# Uso del Plugin de Pepper Flash +# Pepper Flash Plugin Electron no longer supports the Pepper Flash plugin, as Chrome has removed support. diff --git a/content/es-ES/docs/tutorial/using-selenium-and-webdriver.md b/content/es-ES/docs/tutorial/using-selenium-and-webdriver.md index a37ce521e6592..9683ade4cadc0 100644 --- a/content/es-ES/docs/tutorial/using-selenium-and-webdriver.md +++ b/content/es-ES/docs/tutorial/using-selenium-and-webdriver.md @@ -1,4 +1,4 @@ -# Uso de Selenium y WebDriver +# Selenium and WebDriver Para [ChromeDriver - WebDriver para Chrome][chrome-driver]: diff --git a/content/es-ES/docs/tutorial/web-embeds.md b/content/es-ES/docs/tutorial/web-embeds.md index 340b55d968ecd..998eb0e0953bb 100644 --- a/content/es-ES/docs/tutorial/web-embeds.md +++ b/content/es-ES/docs/tutorial/web-embeds.md @@ -1,4 +1,4 @@ -# Web embedidas +# Web Embeds ## Descripción general diff --git a/content/es-ES/docs/tutorial/windows-arm.md b/content/es-ES/docs/tutorial/windows-arm.md index 2c9676f9dabad..cb9878c576eb0 100644 --- a/content/es-ES/docs/tutorial/windows-arm.md +++ b/content/es-ES/docs/tutorial/windows-arm.md @@ -1,4 +1,4 @@ -# Windows 10 on Arm +# Windows on ARM If your app runs with Electron 6.0.8 or later, you can now build it for Windows 10 on Arm. Esto aumenta considerablemente el rendimiento, pero necesitará recopilar cualquier módulo nativo usado en tu app. It may also require small fixups to your build and packaging scripts. diff --git a/content/es-ES/docs/tutorial/windows-taskbar.md b/content/es-ES/docs/tutorial/windows-taskbar.md index c196b315ee997..4a794abf7d621 100644 --- a/content/es-ES/docs/tutorial/windows-taskbar.md +++ b/content/es-ES/docs/tutorial/windows-taskbar.md @@ -1,4 +1,4 @@ -# Barra de tareas de Windows +# Taskbar Customization (Windows) ## Descripción general diff --git a/content/es-ES/website/blog/webview2.md b/content/es-ES/website/blog/webview2.md new file mode 100644 index 0000000000000..8fcddad505ccf --- /dev/null +++ b/content/es-ES/website/blog/webview2.md @@ -0,0 +1,81 @@ +--- +title: WebView2 and Electron +author: + - electron +date: '22-07-2021' +--- + +Over the past weeks, we’ve received several questions about the differences between the new [WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) and Electron. + +Both teams have the expressed goal of making web-tech the best it can be on the Desktop, and a shared comprehensive comparison is being discussed. + +Electron and WebView2 are fast-moving and constantly evolving projects. We have assembled a brief snapshot of similarities and differences between Electron and WebView2 as they exist today. + +--- + +## Architecture Overview + +Electron and WebView2 both build from the Chromium source for rendering web content. Strictly speaking, WebView2 builds from the Edge source, but Edge is built using a fork of the Chromium source. Electron does not share any DLLs with Chrome. WebView2 binaries hard link against Edge (Stable channel as of Edge 90), so they share disk and some working set. See [Evergreen distribution mode](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#evergreen-distribution-mode) for more info. + +Electron apps always bundle and distribute the exact version of Electron with which they were developed. WebView2 has two options in distribution. You can bundle the exact WebView2 library your application was developed with, or you can use a shared-runtime version that may already be present on the system. WebView2 provides tools for each approach, including a bootstrapping installer in case the shared runtime is missing. WebView2 is shipped _inbox_ starting with Windows 11. + +Applications that bundle their frameworks are responsible for updating those frameworks, including minor security releases. For apps using the shared WebView2 runtime, WebView2 has its own updater, similar to Chrome or Edge, that runs independent of your application. Updating the application's code or any of its other dependencies is still a responsibility for the developer, same as with Electron. Neither Electron nor WebView2 is managed by Windows Update. + +Both Electron and WebView2 inherit Chromium’s multi-process architecture - namely, a single main process that communicates with one-or-more renderer processes. These processes are entirely separate from other applications running on the system. Every Electron application is a separate process tree, containing a root browser-process, some utility processes, and zero or more render processes. WebView2 apps that use the same [user data folder](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder) (like a suite of apps would do), share non-renderer processes. WebView2 apps using different data folders do not share processes. + +* ElectronJS Process Model: + + ![ElectronJS Process Model Diagram](/images/Electron-Architecture.png) +* WebView2 Based Application Process Model: + + ![WebView2 Process Model Diagram](/images/WebView2-Architecture.png) + +Read more about [WebView2’s process model](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/process-model) and [Electron’s process model](https://www.electronjs.org/docs/tutorial/process-model) here. + +Electron provides APIs for common desktop application needs such as menus, file system access, notifications, and more. WebView2 is a component meant to be integrated into an application framework such as WinForms, WPF, WinUI, or Win32. WebView2 does not provide operating system APIs outside the web standard via JavaScript. + +Node.js is integrated into Electron. Electron applications may use any Node.js API, module, or node-native-addon from the renderer and main processes. A WebView2 application does not assume which language or framework the rest of your application is written in. Your JavaScript code must proxy any operating system access through the application-host process. + +Electron strives to maintain compatibility with the web API, including APIs developed from the [Fugu Project](https://fugu-tracker.web.app/). We have a [snapshot of Electron’s Fugu API compatibility](https://docs.google.com/spreadsheets/d/1APQalp8HCa-lXVOqyul369G-wjM2RcojMujgi67YaoE/edit?usp=sharing). WebView2 maintains a similar list of [API differences from Edge](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/browser-features). + +Electron has a configurable security model for web content, from full-access to full-sandbox. WebView2 content is always sandboxed. Electron has [comprehensive security documentation](https://www.electronjs.org/docs/tutorial/security) on choosing your security model. WebView2 also has [security best practices](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/security). + +The Electron source is maintained and available on GitHub. Applications can modify can build their own _brands_ of Electron. The WebView2 source is not available on GitHub. + +Quick Summary: + +| | Electron | WebView2 | +| ----------------------------------- | ---------------:| -----------------------:| +| Build Dependency | Chromium | Borde | +| Source Available on GitHub | Sí | No | +| Shares Edge/Chrome DLLs | No | Yes (as of Edge 90) | +| Shared Runtime Between Applications | No | Opcional | +| Application APIs | Sí | No | +| Node.js | Sí | No | +| Sandbox | Opcional | Siempre | +| Requires an Application Framework | No | Sí | +| Plataformas soportadas | Mac, Win, Linux | Win (Mac/Linux planned) | +| Process Sharing Between Apps | Never | Opcional | +| Framework Updates Managed By | Application | WebView2 | + +## Performance Discussion + +When it comes to rendering your web content, we expect little performance difference between Electron, WebView2, and any other Chromium-based renderer. We created [scaffolding for apps built using Electron, C++ + WebView2, and C# + WebView2](https://github.com/crossplatform-dev/xplat-challenges) for those interested to investigate potential performance differences. + +There are a few differences that come into play _outside_ of rendering web content, and folks from Electron, WebView2, Edge, and others have expressed interest in working on a detailed comparison including PWAs. + +### Inter-Process Communication (IPC) + +_There is one difference we want to highlight immediately, as we believe it is often a performance consideration in Electron apps._ + +In Chromium, the browser process acts as an IPC broker between sandboxed renderers and the rest of the system. While Electron allows unsandboxed render processes, many apps choose to enable the sandbox for added security. WebView2 always has the sandbox enabled, so for most Electron and WebView2 apps IPC can impact overall performance. + +Even though Electron and WebView2 have a similar process models, the underlying IPC differs. Communicating between JavaScript and C++ or C# requires [marshalling](https://en.wikipedia.org/wiki/Marshalling_(computer_science)), most commonly to a JSON string. JSON serialization/parsing is an expensive operation, and IPC-bottlenecks can negatively impact performance. Starting with Edge 93, WV2 will use [CBOR](https://en.wikipedia.org/wiki/CBOR) for network events. + +Electron supports direct IPC between any two processes via the [MessagePorts](https://www.electronjs.org/docs/latest/tutorial/message-ports) API, which utilize [the structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). Applications which leverage this can avoid paying the JSON-serialization tax when sending objects between processes. + +## Resumen + +Electron and WebView2 have a number of differences, but don't expect much difference with respect to how they perform rendering web content. Ultimately, an app’s architecture and JavaScript libraries/frameworks have a larger impact on memory and performance than anything else because _Chromium is Chromium_ regardless of where it is running. + +Special thanks to the WebView2 team for reviewing this post, and ensuring we have an up-to-date view of the WebView2 architecture. They welcome any [feedback on the project](https://github.com/MicrosoftEdge/WebView2Feedback). diff --git a/content/es-ES/website/i18n/code.json b/content/es-ES/website/i18n/code.json index 8291b10512852..ad59bc8ada76a 100644 --- a/content/es-ES/website/i18n/code.json +++ b/content/es-ES/website/i18n/code.json @@ -1,202 +1,198 @@ { "theme.NotFound.title": { - "message": "Page Not Found", + "message": "Página no encontrada", "description": "The title of the 404 page" }, "theme.NotFound.p1": { - "message": "We could not find what you were looking for.", + "message": "No pudimos encontrar lo que buscabas.", "description": "The first paragraph of the 404 page" }, "theme.NotFound.p2": { - "message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.", + "message": "Por favor, contacte al dueño del sitio al que estaba enlazada la URL original y hágale saber que el enlace esta roto.", "description": "The 2nd paragraph of the 404 page" }, "theme.AnnouncementBar.closeButtonAriaLabel": { - "message": "Close", + "message": "Cerrar", "description": "The ARIA label for close button of announcement bar" }, "theme.blog.paginator.navAriaLabel": { - "message": "Blog list page navigation", + "message": "Navegación por la página de la lista de blogs", "description": "The ARIA label for the blog pagination" }, "theme.blog.paginator.newerEntries": { - "message": "Newer Entries", + "message": "Entradas más recientes", "description": "The label used to navigate to the newer blog posts page (previous page)" }, "theme.blog.paginator.olderEntries": { - "message": "Older Entries", + "message": "Entradas más antiguas", "description": "The label used to navigate to the older blog posts page (next page)" }, "theme.blog.post.readingTime.plurals": { - "message": "One min read|{readingTime} min read", + "message": "Lectura de un minuto|{readingTime} lectura mínima", "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" }, "theme.tags.tagsListLabel": { - "message": "Tags:", + "message": "Etiquetas:", "description": "The label alongside a tag list" }, "theme.blog.post.readMore": { - "message": "Read More", + "message": "Leer más", "description": "The label used in blog post item excerpts to link to full blog posts" }, "theme.blog.post.paginator.navAriaLabel": { - "message": "Blog post page navigation", + "message": "Navegación por la página de publicaciones del blog", "description": "The ARIA label for the blog posts pagination" }, "theme.blog.post.paginator.newerPost": { - "message": "Newer Post", + "message": "Publicación más reciente", "description": "The blog post button label to navigate to the newer/previous post" }, "theme.blog.post.paginator.olderPost": { - "message": "Older Post", + "message": "Publicación más antigua", "description": "The blog post button label to navigate to the older/next post" }, - "theme.blog.sidebar.navAriaLabel": { - "message": "Blog recent posts navigation", - "description": "The ARIA label for recent posts in the blog sidebar" - }, "theme.tags.tagsPageTitle": { - "message": "Tags", + "message": "Etiquetas", "description": "The title of the tag list page" }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Navegación de mensajes recientes del blog", + "description": "The ARIA label for recent posts in the blog sidebar" + }, "theme.blog.post.plurals": { - "message": "One post|{count} posts", + "message": "Una publicación|{count} publicaciones", "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" }, "theme.blog.tagTitle": { - "message": "{nPosts} tagged with \"{tagName}\"", + "message": "{nPosts} etiquetados con \"{tagName}\"", "description": "The title of the page for a blog tag" }, "theme.tags.tagsPageLink": { - "message": "View All Tags", + "message": "Ver todas las categorías", "description": "The label of the link targeting the tag list page" }, "theme.CodeBlock.copyButtonAriaLabel": { - "message": "Copy code to clipboard", + "message": "Copiar código al portapapeles", "description": "The ARIA label for copy code blocks button" }, "theme.CodeBlock.copied": { - "message": "Copied", + "message": "Copiado", "description": "The copied button label on code blocks" }, "theme.CodeBlock.copy": { - "message": "Copy", + "message": "Copiar", "description": "The copy button label on code blocks" }, "theme.docs.sidebar.expandButtonTitle": { - "message": "Expand sidebar", + "message": "Expandir barra lateral", "description": "The ARIA label and title attribute for expand button of doc sidebar" }, "theme.docs.sidebar.expandButtonAriaLabel": { - "message": "Expand sidebar", + "message": "Expandir barra lateral", "description": "The ARIA label and title attribute for expand button of doc sidebar" }, "theme.docs.paginator.navAriaLabel": { - "message": "Docs pages navigation", + "message": "Navegación de páginas de documentos", "description": "The ARIA label for the docs pagination" }, "theme.docs.paginator.previous": { - "message": "Previous", + "message": "Anterior", "description": "The label used to navigate to the previous doc" }, "theme.docs.paginator.next": { - "message": "Next", + "message": "Siguiente", "description": "The label used to navigate to the next doc" }, "theme.docs.sidebar.collapseButtonTitle": { - "message": "Collapse sidebar", + "message": "Ocultar la barra lateral", "description": "The title attribute for collapse button of doc sidebar" }, "theme.docs.sidebar.collapseButtonAriaLabel": { - "message": "Collapse sidebar", + "message": "Ocultar la barra lateral", "description": "The title attribute for collapse button of doc sidebar" }, - "theme.docs.sidebar.responsiveCloseButtonLabel": { - "message": "Close menu", - "description": "The ARIA label for close button of mobile doc sidebar" - }, - "theme.docs.sidebar.responsiveOpenButtonLabel": { - "message": "Open menu", - "description": "The ARIA label for open button of mobile doc sidebar" - }, - "theme.docs.sidebar.navAriaLabel": { - "message": "Sidebar navigation", - "description": "The ARIA label for documentation menu" - }, "theme.docs.versions.unreleasedVersionLabel": { - "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", + "message": "Esta es la {versionLabel} versión de la documentación no publicada de {siteTitle}.", "description": "The label used to tell the user that he's browsing an unreleased doc version" }, "theme.docs.versions.unmaintainedVersionLabel": { - "message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.", + "message": "Esta es la documentación para {siteTitle} {versionLabel}, que ya no está mantenida de forma activa.", "description": "The label used to tell the user that he's browsing an unmaintained doc version" }, "theme.docs.versions.latestVersionSuggestionLabel": { - "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", - "description": "The label userd to tell the user that he's browsing an unmaintained doc version" + "message": "Para obtener la última documentación actualizada, consulte {latestVersionLink} ({versionLabel}).", + "description": "The label used to tell the user to check the latest version" }, "theme.docs.versions.latestVersionLinkLabel": { - "message": "latest version", + "message": "última versión", "description": "The label used for the latest version suggestion link label" }, "theme.common.editThisPage": { - "message": "Edit this page", + "message": "Editar esta página", "description": "The link label to edit the current page" }, "theme.common.headingLinkTitle": { - "message": "Direct link to heading", + "message": "Enlace directo al encabezado", "description": "Title for link to heading" }, "theme.lastUpdated.atDate": { - "message": " on {date}", + "message": " en {date}", "description": "The words used to describe on which date a page has been last updated" }, "theme.lastUpdated.byUser": { - "message": " by {user}", + "message": " de {user}", "description": "The words used to describe by who the page has been last updated" }, "theme.lastUpdated.lastUpdatedAtBy": { - "message": "Last updated{atDate}{byUser}", + "message": "Última actualización{atDate}{byUser}", "description": "The sentence used to display when a page has been last updated, and by who" }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Back to main menu", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, "theme.common.skipToMainContent": { - "message": "Skip to main content", + "message": "Saltar al contenido principal", "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "On this page", + "description": "The label used by the button on the collapsible TOC component" + }, "theme.SearchPage.documentsFound.plurals": { - "message": "One document found|{count} documents found", + "message": "Un documento encontrado|{count} documentos encontrados", "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" }, "theme.SearchPage.existingResultsTitle": { - "message": "Search results for \"{query}\"", + "message": "Resultados de la búsqueda para \"{query}\"", "description": "The search page title for non-empty query" }, "theme.SearchPage.emptyResultsTitle": { - "message": "Search the documentation", + "message": "Buscar en la documentación", "description": "The search page title for empty query" }, "theme.SearchPage.inputPlaceholder": { - "message": "Type your search here", + "message": "Escribe tu búsqueda aquí", "description": "The placeholder for search page input" }, "theme.SearchPage.inputLabel": { - "message": "Search", + "message": "Búsqueda", "description": "The ARIA label for search page input" }, "theme.SearchPage.algoliaLabel": { - "message": "Search by Algolia", + "message": "Búsqueda por Algolia", "description": "The ARIA label for Algolia mention" }, "theme.SearchPage.noResultsText": { - "message": "No results were found", + "message": "No se encontraron resultados", "description": "The paragraph for empty search result" }, "theme.SearchPage.fetchingNewResults": { - "message": "Fetching new results...", + "message": "Obteniendo nuevos resultados...", "description": "The paragraph for fetching new search results" }, "theme.SearchBar.label": { - "message": "Search", + "message": "Búsqueda", "description": "The ARIA label and placeholder for search button" } } \ No newline at end of file diff --git a/content/es-ES/website/i18n/docusaurus-plugin-content-blog/options.json b/content/es-ES/website/i18n/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000000..94a4ebed2d7a2 --- /dev/null +++ b/content/es-ES/website/i18n/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Electron's blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Keep up to date with what's going on with the Electron project", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Latest posts", + "description": "The label for the left sidebar" + } +} \ No newline at end of file diff --git a/content/es-ES/website/i18n/docusaurus-theme-classic/footer.json b/content/es-ES/website/i18n/docusaurus-theme-classic/footer.json index 8b26237397c6f..99e0dce9e830f 100644 --- a/content/es-ES/website/i18n/docusaurus-theme-classic/footer.json +++ b/content/es-ES/website/i18n/docusaurus-theme-classic/footer.json @@ -1,10 +1,14 @@ { "link.title.Docs": { - "message": "Docs", + "message": "Documentación", "description": "The title of the footer links column with title=Docs in the footer" }, + "link.title.Checklists": { + "message": "Checklists", + "description": "The title of the footer links column with title=Checklists in the footer" + }, "link.title.Community": { - "message": "Community", + "message": "Comunidad", "description": "The title of the footer links column with title=Community in the footer" }, "link.title.More": { @@ -12,12 +16,20 @@ "description": "The title of the footer links column with title=More in the footer" }, "link.item.label.Getting Started": { - "message": "Getting Started", - "description": "The label of footer link with label=Getting Started linking to /" + "message": "Empezar", + "description": "The label of footer link with label=Getting Started linking to /docs/latest/" }, - "link.item.label.Stack Overflow": { - "message": "Stack Overflow", - "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + "link.item.label.API Reference": { + "message": "Referencia de la API", + "description": "The label of footer link with label=API Reference linking to /docs/latest/api/app" + }, + "link.item.label.Performance": { + "message": "Rendimiento", + "description": "The label of footer link with label=Performance linking to /docs/latest/tutorial/performance" + }, + "link.item.label.Security": { + "message": "Seguridad", + "description": "The label of footer link with label=Security linking to /docs/latest/tutorial/security" }, "link.item.label.Discord": { "message": "Discord", @@ -27,12 +39,20 @@ "message": "Twitter", "description": "The label of footer link with label=Twitter linking to https://twitter.com/electronjs" }, + "link.item.label.Stack Overflow": { + "message": "Stack Overflow", + "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + }, "link.item.label.GitHub": { "message": "GitHub", "description": "The label of footer link with label=GitHub linking to https://github.com/electron/electron" }, + "link.item.label.Open Collective": { + "message": "Open Collective", + "description": "The label of footer link with label=Open Collective linking to https://opencollective.com/electron" + }, "copyright": { - "message": "Copyright © 2021 My Project, Inc. Built with Docusaurus.", + "message": "Copyright © 2021 OpenJS Foundation and Electron contributors.", "description": "The footer copyright" } } \ No newline at end of file diff --git a/content/es-ES/website/i18n/docusaurus-theme-classic/navbar.json b/content/es-ES/website/i18n/docusaurus-theme-classic/navbar.json index dbb29ad3e6345..a4fa15b1797f6 100644 --- a/content/es-ES/website/i18n/docusaurus-theme-classic/navbar.json +++ b/content/es-ES/website/i18n/docusaurus-theme-classic/navbar.json @@ -4,7 +4,7 @@ "description": "The title in the navbar" }, "item.label.Docs": { - "message": "Docs", + "message": "Documentación", "description": "Navbar item with label Docs" }, "item.label.API": { @@ -15,6 +15,10 @@ "message": "Ejemplos", "description": "Navbar item with label Examples" }, + "item.label.Blog": { + "message": "Blog", + "description": "Navbar item with label Blog" + }, "item.label.GitHub": { "message": "GitHub", "description": "Navbar item with label GitHub" diff --git a/content/es-ES/website/locale.yml b/content/es-ES/website/locale.yml index b7114be445031..3411232df1025 100644 --- a/content/es-ES/website/locale.yml +++ b/content/es-ES/website/locale.yml @@ -1,279 +1,281 @@ -tagline: Build cross-platform desktop apps with JavaScript, HTML, and CSS +tagline: Crea aplicaciones multiplataforma de escritorio con JavaScript, HTML y CSS nav: - apps: Apps + apps: Aplicaciones blog: Blog code_of_conduct: Código de conducta - security: Security + security: Seguridad community: Comunidad - contact: Contact - docs: Docs - donors: Donors - languages: Languages - license: License - releases: Releases - search: Search - userland: Userland - governance: Governance + contact: Contacto + docs: Documentación + donors: Donaciones + languages: Idiomas + license: Licencia + releases: Lanzamientos + search: Búsqueda + userland: Entorno + governance: Gobernanza keyboard_modal: title: Atajos del teclado - key: Key - action: Action - focus_search: Focus the search bar - focus_and_clear: Focus the search bar and cleans it - scroll_down: Select the next search result - scroll_up: Select the previous search result - open: Open the selected search result - open_new_tab: Open the selected search result in a new tab + key: Clave + action: Acción + focus_search: Enfoca en la barra de búsqueda + focus_and_clear: Enfoca la barra de búsqueda y la limpia + scroll_down: Selecciona el siguiente resultado de la búsqueda + scroll_up: Selecciona el resultado anterior de la búsqueda + open: Abre el resultado seleccionado de la búsqueda + open_new_tab: Abrir el resultado obtenido en una nueva pestaña docs: - title: Electron Documentation - guides: "Guides: Getting Started with Electron" - api_reference: API Reference - api_structures: API Structures - advanced: Advanced - detailed: In Detail - custom_dom: Custom DOM Elements - main_proc_modules: Main Process Modules - renderer_proc_modules: Renderer Process Modules - both_proc_modules: Modules for Both Process Types - propose_change: Improve this doc - version_history: Version history - translate: Translate this doc + title: Documentación de Electron + guides: "Guías: Empezando con Electron" + api_reference: Referencia de la API + api_structures: Estructuras del API + advanced: Avanzado + detailed: En detalle + custom_dom: Elementos de DOM personalizados + main_proc_modules: Módulos del proceso principal + renderer_proc_modules: Módulos de Process Renderer + both_proc_modules: Módulos para ambos tipos de procesos + propose_change: Mejora este documento + version_history: Historial de versiones + translate: Traducir este documento languages: - choose_language: Choose Your Site Language - view_more_details: View More Language Details - translation_progress: Translation Progress - current: current selection + choose_language: Elige el idioma del sitio + view_more_details: Ver más detalles del idioma + translation_progress: Progreso de la traducción + current: selección actual community: - title: Electron Community - description: Resources for connecting with people working on Electron. + title: Comunidad Electron + description: Recursos para conectarse con personas que trabajan en Electron. channels: - get_started: "Get started building an app by reading the quick-start guide." - updates: "Stay up to date by following @electronjs on Twitter and subscribing to the blog feed." - localized_docs: "Read docs in your native language by visiting the languages page." + get_started: "Empieza a crear una aplicación leyendo la guía de inicio rápido." + updates: "Mantente al día siguiendo a @electronjs en Twitter y suscribiendote a nuestro blog." + localized_docs: "Lee la documentación en tu idioma visitando la página de idiomas." help: "Get help and feedback by joining the Discord server, or visiting Stack Overflow." - security: "Report security issues by emailing security@electronjs.org." - bugs: "Report bugs by opening issues on the electron/electron repository." - feature_requests: "Request features by opening issues on the electron/electron repository." - code_of_conduct: "Report Code of Conduct violations by emailing coc@electronjs.org." - donations: "Donate on our OpenCollective page." - other: "For all other inquiries, email info@electronjs.org." + security: "Reporte problemas de seguridad enviando un correo electrónicosecurity@electronjs.org." + bugs: "Reporta errores abriendo un issue en el repositorio de electron/electron." + feature_requests: "Solicita características abriendo un issue en el repositorio de electron/electron." + code_of_conduct: "Reporta violaciones al Código de Conducta enviando un correo electrónico a coc@electronjs.org." + donations: "Dona en nuestra página de OpenCollective." + other: "Para cualquier otro tipo de consultas, envía un correo electrónico a info@electronjs.org." language_communities: - title: Language Communities - description: "The Electron community spans the globe, and English is not everyone's first language. Find documentation in your language, or join one of the language communities below:" - tools: Tools + title: Comunidades de idiomas + description: "La comunidad Electron se extiende por todo el mundo, y el inglés no es el idioma principal de todos. Busque la documentación en su idioma, o únase a una de las siguientes comunidades de idiomas:" + tools: Herramientas boilerplates: Boilerplates - components: Components - videos: Videos - meetups: Meetups - awesome_notice: This list is generated from @sindresorhus's Awesome Electron repository.
    Something missing? Make a pull request. - meetup_notice: To add a meetup, edit data/meetups.json and make a pull request. + components: Componentes + videos: Vídeos + meetups: MeetUps + awesome_notice: Esta lista es generada desde el repositorio@sindresorhus's Awesome Electron.
    ¿Falta algo?Haz una solicitud de cambios. + meetup_notice: Para añadir un MeetUp, edite data/meetups.json y realize una pull request . releases: - show_releases: "Show Releases:" - show_only_releases_from: "Show Only Releases From:" - all_versions: All Versions - stable_releases: Stable Releases - stable_desc: Regular, supported releases - beta_releases: Beta Releases - beta_desc: Test your app with upcoming changes - nightly_releases: Nightly Releases - nightly_desc: Experiment with the latest features - next: Next - next_page: Next Page - previous: Previous - previous_page: Previous Page - page: Page - all_releases: All Releases - back_to_index: Back to index + show_releases: "Mostrar Versiones:" + show_only_releases_from: "Mostrar únicamente las versiones de:" + all_versions: Todas las versiones + stable_releases: Versiones estables + stable_desc: Versiones regulares y soportadas + beta_releases: Lanzamientos Beta + beta_desc: Pruebe su aplicación con los cambios venideros + alpha_releases: Alpha Releases + alpha_desc: Test features slightly more on the edge + nightly_releases: Versiones nocturnas + nightly_desc: Experimente con las últimas funciones + next: Siguiente + next_page: Siguiente página + previous: Anterior + previous_page: Página anterior + page: Página + all_releases: Todas las Versiones + back_to_index: Volver al Índice electron_is_good: - title: Apps users love, built with Electron - description: Thousands of organizations spanning all industries use Electron to build cross-platform software. + title: Aplicaciones que los usuarios adoran, creadas con Electron + description: Miles de organizaciones que abarcan todas las industrias utilizan Electron para construir software multiplataforma. electron_is_easy: - title: It's easier than you think - description: If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application. + title: Es más fácil de lo que piensas + description: Si puedes crear un sitio web, puedes crear una aplicación de escritorio. Electron es un framework para crear aplicaciones nativas con tecnologías web como Javascript, HTML y CSS. Se encargará de las partes más difíciles para que puedas enfocarte en el núcleo de tu aplicación. web_technologies: - title: Web Technologies - description: Electron uses Chromium and Node.js so you can build your app with HTML, CSS, and JavaScript. + title: Tecnologías Web + description: Electron usa Chromium y Node.js para que puedas construir aplicaciones con HTML, CSS y JavaScript. open_source: - title: Open Source + title: Código Abierto description: Electron is an open source project maintained by the OpenJS Foundation and an active community of contributors. cross_platform: - title: Cross Platform - description: Compatible with Mac, Windows, and Linux, Electron apps build and run on three platforms. + title: Multiplataforma + description: Compatible con Mac, Windows y Linux las aplicaciones de Electron compilan y corren en tres plataformas. benefits: - hard_parts_made_easy: The hard parts made easy - automatic_updates: Automatic updates - native_menus_and_notifications: Native menus & notifications - crash_reporting: Crash reporting - debugging_and_profiling: Debugging & profiling - windows_installers: Windows installers + hard_parts_made_easy: Las partes difíciles de manera sencilla + automatic_updates: Actualizaciones automáticas + native_menus_and_notifications: Menús nativos y notificaciones + crash_reporting: Informe de errores + debugging_and_profiling: Depuración y optimización + windows_installers: Instaladores de Windows get_started: - title: Get started - description: To get started with Electron, check out the resources below. Learn how to wrap your web app with Electron, access all the APIs, and generate installers. + title: Empezar + description: Para empezar con Electron, revisa los recursos a continuación. Aprende a envolver tu aplicación web con Electron, accede a todas las API y genera instaladores. explore: fiddle_title: Try powerful experiments with Electron Fiddle - see_more_info: See more info -download: Download -download_from_github: Download from GitHub + see_more_info: Ver más información +download: Descargar +download_from_github: Descargar desde GitHub quick_start: - title: "Spin up the Quick Start app to see Electron in action:" - description: A minimal Electron app with helpful notations. - clone: Clone the Quick Start repository - go_into_repo: Go into the repository - install_deps: Install the dependencies and run - dive_deeper: Or dive deeper and read the documentation. + title: "Girar la aplicación de Start de Quick ver Electron en acción:" + description: Una aplicación mínima de Electron con anotaciones útiles. + clone: Clonar el repositorio de Inicio Rapido + go_into_repo: Ir al repositorio + install_deps: Instalar las dependencias y ejecutar + dive_deeper: O sumérgete mas y lee la documentación. need_help: - title: Need Help? + title: '¿Necesitas ayuda?' description: Ask questions in the Discord server. Follow @electronjs on Twitter for important announcements. Need to privately reach out? Email info@electronjs.org. headings: - languages: Languages + languages: Idiomas taglines: - languages: Localized content from our awesome global developer community. - announcement: 'Black Lives Matter. Support the Equal Justice Initiative and read our statement here.' -help_translate: "Help translate" + languages: Encuentra contenido en nuestra increíble comunidad global de desarrolladores. + announcement: 'Black Lives Matter. Apoya la Iniciativa de Justicia Igualitaria y lee nuestra declaración aquí.' +help_translate: "Ayuda a traducir" footer: - see_the_faq: See the frequently asked questions + see_the_faq: Ver las preguntas frecuentes apps: - something_missing: Something missing? - edit_this_app: Edit this app. - search_app: Filter apps by name, description, etc… - categories: Categories - add_app_link: 'Make a Pull Request to add your application.' + something_missing: '¿Falta algo?' + edit_this_app: Editar esta aplicación. + search_app: Filtrar aplicaciones por Nombre, Descripción, Etc… + categories: Categorías + add_app_link: 'Cree una gestión de Solicitud para agregar su Aplicación.' #App show page specific localization strings - website: Website - repository: Repository - category: Category - downloads: Downloads - keywords: Keywords - license: License - latest_release: Latest Release + website: Sitio Web + repository: Repositorio + category: Categoría + downloads: Descargas + keywords: Palabras Claves + license: Licencia + latest_release: Última Versión blog: - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Blog de Electron + description: Todas las ultimas noticias del equipo y la comunidad de Electron. #Post show page specific localization strings - feedback: Have feedback on this post? Let @electronjs know on Twitter. - help: Need help or found a bug? Contact us. + feedback: Tienes algún comentario sobre este post? Dejanos un @electronjs para saberlo a través de Twitter. + help: '¿Necesitas ayuda o encontraste un error? Contáctanos.' clipboard: - copy: Copy - copy_to_clipboard: Copy to Clipboard - copied: Copied + copy: Copiar + copy_to_clipboard: Copiar al portapapeles + copied: Copiado fiddle_launch_button: - launch: Launch - launch_in_fiddle: Launch in Fiddle + launch: Iniciar + launch_in_fiddle: Lanzar en Fiddle pages: '/': - title: Electron | Build cross-platform desktop apps with JavaScript, HTML, and CSS. - description: 'Build cross-platform desktop apps with JavaScript, HTML, and CSS.' + title: Electron | Crea aplicaciones multiplataforma de escritorio con JavaScript, HTML y CSS. + description: 'Crea aplicaciones multiplataforma de escritorio con JavaScript, HTML y CSS.' '/apps': - title: Electron Apps - description: Apps Built on Electron + title: Aplicaciones de Electron + description: Aplicaciones hechas con Electron '/docs': title: Documentación - description: Guides and API reference documentation for the latest Electron release + description: Guías y documentación de referencia de la API para la ultima versión de Electron '/docs/api': title: API - description: API reference documentation for the latest Electron release + description: Guías y documentación de referencia de la API para la última versión de Electron '/docs/development': title: Desarrollo - description: Developing with Electron + description: Desarrollando con Electron '/docs/tutorial': title: Tutorial - description: Guides and tutorials for the latest Electron release + description: Guías y tutoriales para la última versión de Electron '/blog': - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Blog de Electron + description: Todas las ultimas noticias del equipo y la comunidad de Electron. '/community': title: Comunidad '/releases': - title: Releases + title: Lanzamientos '/contact': - title: Contact - description: Get in touch with the Electron team on Twitter, Slack, GitHub, or via email. + title: Contacto + description: Ponte en contacto con el equipo de Electron en Twitter, Slack, GitHub o vía email. '/languages': - title: Languages + title: Idiomas '/userland': - title: Userland + title: Entorno '/devtron': title: Devtron - description: Devtron is an open source tool to help you inspect, monitor, and debug your Electron app. Built on top of the amazing Chrome Developer Tools. + description: Devtron es una herramienta de código abierto para ayudar a inspeccionar, monitorear y depurar su aplicación de Electron. Está construido sobre las increíbles Chrome Developer Tools. '/spectron': title: Spectron - description: Spectron is an open source framework for easily writing integrations tests for your Electron app. Built on top of ChromeDriver and WebDriverIO. + description: Spectron es un framework de código abierto para escribir fácilmente tests de integración para sus aplicaciones de Electron. Está construido sobre ChromeDriver y WebDriverIO. '/fiddle': title: Electron Fiddle - description: The easiest way to get started with Electron + description: La forma más fácil para empezar con Electron '/governance': - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. + title: Gobernanza Electron + description: El sistema de gobernanza Electron está compuesto por grupos de trabajo que supervisan diferentes aspectos del ecosistema Electron, y un grupo de trabajo administrativo que funciona para resolver conflictos entre ellos. '/donors': - title: Donors + title: Donaciones '/blacklivesmatter': title: Black Lives Matter landing: - get_started: Get started + get_started: Empezar fiddle: - lead_desc: The easiest way to get started with Electron - different_os: "Not the right operating system? See:" - create_app: Create your app - description: Electron Fiddle lets you create and play with small Electron experiments. It greets you with a quick-start template after opening – change a few things, choose the version of Electron you want to run it with, and play around. Then, save your Fiddle either as a GitHub Gist or to a local folder. Once pushed to GitHub, anyone can quickly try your Fiddle out by just entering it in the address bar. + lead_desc: La forma más fácil para empezar con Electron + different_os: "¿No es el sistema operativo correcto? Ver:" + create_app: Cree su aplicación + description: Electron Fiddle te permite crear y jugar con pequeños experimentos de Electron. Te da la bienvenida con una plantilla de inicio rápido después de abrirla cambian algunas cosas, elige la version de Electron que deseas ejecutar y juega. Luego de eso guarda tu Fiddle como un GitHub Gist o en una carpeta local. Una vez subido a GitHub, cualquiera puede probar inmediatamente tu Fiddle ingresandolo en la barra de direcciones. explore: Explore Electron - explore_desc: "Try Electron without installing any dependencies: Fiddle includes everything you'll need to explore the platform. It also includes examples for every API available in Electron, so if you want to quickly see what a BrowserView is or how the desktopCapturer works, Fiddle has got you covered." - code_with_types: Code with Types - code_with_types_desc: Fiddle includes Microsoft's excellent Monaco Editor, the same editor powering Visual Studio Code. It also installs the type definitions for the currently selected version of Electron automatically, ensuring that you always have all Electron APIs only a few keystrokes away. - compile_and_package: Compile and Package - compile_and_package_desc: Fiddle can automatically turn your experiment into binaries you can share with your friends, coworkers, or grandparents. It does so thanks to electron-forge, allowing you to package your fiddle as an app for Windows, macOS, or Linux. - easy_start: Start with Fiddle, Continue Wherever - easy_start_desc: Fiddle is not an IDE – it is however an excellent starting point. Once your fiddle has grown up, export it as a project with or without electron-forge. Then, use your favorite editor and take on the world! + explore_desc: "Prueba Electron sin instalar ninguna dependencia: Fiddle incluye todo lo que necesitas para explorar la plataforma. También incluye ejemplos para cada API disponible en Electron, para que puedas ver rápidamente lo que es un BrowserView o como funciona un desktopCapturer, Fiddle lo tiene cubierto." + code_with_types: Código con Tipos + code_with_types_desc: Fiddle incluye el excelente Editor Mónaco de Microsoft, el mismo editor que impulsa Visual Studio Code. También instala automáticamente las definiciones de tipo para la versión seleccionada de Electron, asegurando que siempre tenga todas las API de Electron unas pocas pulsaciones de distancia. + compile_and_package: Compile y empaquete + compile_and_package_desc: Fiddle puede convertir automáticamente tu experimento en binarios que puedes compartir con tus amigos, compañeros de trabajo o abuelos. Lo hace gracias a electron-forge , permitiendote empacar tu fiddle como una aplicación para Windows, macOS o Linux. + easy_start: Comienza con Fiddle, continua donde quieras + easy_start_desc: Fiddle no es un IDE – sin embargo es un punto de partida excelente. Una vez que tu fiddle haya crecido, puedes exportarlo como un proyecto con o sin electron-forge. Una vez lo hayas exportado, ¡Usa tu editor favorito y toma en el mundo! governance: - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. - wgs: Working Groups + title: Gobernanza Electron + description: El sistema de gobernanza Electron está compuesto por grupos de trabajo que supervisan diferentes aspectos del ecosistema Electron, y un grupo de trabajo administrativo que funciona para resolver conflictos entre ellos. + wgs: Grupos de trabajo ecosystem: - title: Ecosystem - description: Oversees the projects that make Electron app development easier. + title: Ecosistema + description: Supervisa los proyectos que facilitan el desarrollo de aplicaciones Electron. outreach: - title: Outreach - description: Grows the Electron community + title: Fuera + description: Crece la comunidad Electron releases: - title: Releases - description: Oversees all release branches, and tooling to support releases. + title: Lanzamientos + description: Supervisa todas las ramas de lanzamiento y herramientas para soportar las distintas versiones. upgrades: - title: Upgrades - description: Oversees upgrades of upstream dependencies; specifically Chromium and Node. + title: Actualizaciones + description: Supervisa las actualizaciones de las dependencias previas; específicamente de Chromium y Node. cmsf: - title: Community & Safety - description: Oversees removal/bans from community. + title: Comunidad y seguridad + description: Supervisa la eliminación/prohibición de la comunidad. security: - title: Security - description: Proactively ensures the Security of Electron as a project, responds to incoming incidents, and oversees rollout of fixes. + title: Seguridad + description: Proactivamente garantiza la seguridad de Electron como proyecto, responde a incidentes entrantes y supervisa la eliminación de correcciones. admins: - title: Administrative - description: The Administrative Working Group oversees the entire governance and project. + title: Administrativo + description: El Grupo de Trabajo Administrativo supervisa toda la gobernanza y el proyecto. api: title: API - description: Oversees public API design based on project principles. + description: Supervisa el diseño de la API publica basado en los principios del proyecto. global: overview: Descripción general - associated_repos: Associated Repositories - notes: Meeting Notes + associated_repos: Repositorios asociados + notes: Notas de la reunión de trabajo definitions: - title: Definitions + title: Definiciones list: - - A maintainer is anyone who plays an active role in governance. - - A collaborator is active in the community, but not in governance. - - A participant is anyone who is a maintainer or collaborator. - - A working group is a group of maintainers that is formed to take responsibility for certain aspects of the Electron project. Normally these groups will meet regularly but in some cases will only meet as required to fulfill their responsibilities. - - 'A chair leads a working group.' + - Un mantenedor es alguien que desempeñe un papel activo en la gobernanza. + - Un colaborador es alguien activo en la comunidad, pero no en la gobernanza. + - Un participante es alguien que es un mantenedor o colaborador. + - Un grupo de trabajo es un grupo de mantenedores que se forma para asumir la responsabilidad de ciertos aspectos del proyecto Electron. Normalmente estos grupos se reunirán regularmente pero en algunos casos solo se cumplirá según sea necesario para cumplir sus responsabilidades. + - 'Un presidente lidera un grupo de trabajo.' responsibilities: - title: Responsibilities - listdescription: "All Working Groups have these core responsibilities:" + title: Responsabilidades + listdescription: "Todos los grupos de trabajo tienen estas responsabilidades principales:" list: - - They shall decide for themselves, and publicly post, their rules, e.g. how decisions are made, when meetings are held, and who may attend. - - 'They shall select a chair to represent the group.' - - They shall keep meeting notes, including agenda items, discussion points, and outcomes for everyone to review. - - 'They shall be collaborative and work in good faith with other Working Groups.' - see_charter: See charter for more information. - code_of_conduct: The Electron organization and all repos therein adhere to the following Code of Conduct. - license: Electron is licensed with the MIT License. - repository: Check out the Governance Repository to find more information about the governance structure. + - Ellos decidirán por sí mismos y en público, sus reglas, por ejemplo, cómo se toman las decisiones, cuando se celebran reuniones y quién puede asistir. + - 'Ellos seleccionarán un presidente para representar al grupo.' + - Deberán mantener las notas de reunión, incluyendo los puntos de la agenda, los puntos de debate y los resultados para que todos lo revisen. + - 'Estarán colaborando y trabajando de buena fe con otros grupos de trabajo.' + see_charter: Vea el estatuto para una mayor información. + code_of_conduct: La organización Electron y todos los demás repositorios se adhieren al siguiente código de conducta . + license: Electron está licenciado bajo una Licencia MIT. + repository: Verifica el repositorio de Gobernanza para encontrar mayor información acerca de la estructura de la misma. _404: - page_not_found: Page not found. + page_not_found: Página no encontrada. diff --git a/content/fr-FR/docs/api/app.md b/content/fr-FR/docs/api/app.md index 4ee800bc3dd9e..b48988a3431d3 100644 --- a/content/fr-FR/docs/api/app.md +++ b/content/fr-FR/docs/api/app.md @@ -30,7 +30,7 @@ Retourne : * `event` Event * `launchInfo` Record | [NotificationResponse](structures/notification-response.md) _macOS_ -Émis lorsqu'Electron a terminé l’initialisation. On macOS, `launchInfo` holds the `userInfo` of the `NSUserNotification` or information from [`UNNotificationResponse`](structures/notification-response.md) that was used to open the application, if it was launched from Notification Center. Vous pouvez également appeler `app.isReady()` pour vérifier si cet événement a déjà été émis et `app.whenReady()` pour obtenir une Promesse qui sera résolue Electron sera initialisé. +Émis lorsqu'Electron a terminé l’initialisation. Sur macOS, `launchInfo` contient le `userInfo` de la `NSUserNotification` ou les informations de [`UNNotificationResponse`](structures/notification-response.md) qui ont été utilisés pour ouvrir l'application , si elle a été lancée à partir du centre de notification. Vous pouvez également appeler `app.isReady()` pour vérifier si cet événement a déjà été émis et `app.whenReady()` pour obtenir une Promesse qui sera résolue Electron sera initialisé. ### Événement : 'window-all-closed' @@ -336,7 +336,7 @@ Retourne : * `oom` - Le processus est tombé à cours de mémoire * `launch-failed` - Le processus ne s'est pas lancé avec succès * `integrity-failure` - Les vérifications d'intégrité du code Windows ont échouées - * `Codedesortie`Numero integre-Le code de sortie du proces, sauf `si la raison est lancer a echoue,`ou <0>le codeSortie sera une plateforme specifique, de code envoye errone. + * `exitCode` Integer - Le code de sortie du proces, sauf si `reason` est `launch-failed`, dans ce cas là `exitCode` sera specifique per plateforme. Émis lorsque le processus de rendu plante de manière inattendue. C'est normalement dans les cas où il s'est planté ou qu'il a été tué. @@ -347,14 +347,14 @@ Retourne : * `event` Event * Objet `details` * `type` String - Type de processus. Une des valeurs suivantes: - * `Utilitaire` + * `Utility` * `Zygote` - * `Assistant bac à sable` + * `Sandbox helper` * `GPU` - * `Plugin Pepper` - * `Broker de plugin Pepper` - * `Inconnu` - * `reason` String - The reason the child process is gone. Valeurs possibles : + * `Pepper Plugin` + * `Pepper Plugin Broker` + * `Unknown` + * `reason` String - La raison pour laquelle le processus enfant s'est terminé. Valeurs possibles : * `` de sortie propre - Processus s'est terminé avec le code de sortie zéro * `anormal-exit` - Le Processus s'est terminé avec un code de sortie différent de zéro * `killed` - Le processus a reçu un SIGTERM ou a été tué autrement de l'extérieur @@ -362,9 +362,9 @@ Retourne : * `oom` - Le processus est tombé à cours de mémoire * `launch-failed` - Le processus ne s'est pas lancé avec succès * `integrity-failure` - Les vérifications d'intégrité du code Windows ont échouées - * `exitCode` Number - The exit code for the process (e.g. status from waitpid if on posix, from GetExitCodeProcess on Windows). + * `exitCode` Number - Le code de sortie du processus (cad: l'état de waitpid sur posix, de GetExitCodeProcess sur Windows). * `serviceName` String (optional) - The non-localized name of the process. - * `name` String (optional) - The name of the process. Examples for utility: `Audio Service`, `Content Decryption Module Service`, `Network Service`, `Video Capture`, etc. + * `name` String (facultatif) - Le nom du processus. Examples for utility: `Audio Service`, `Content Decryption Module Service`, `Network Service`, `Video Capture`, etc. Émis lorsque le processus enfant plante de manière inattendue. C'est normalement dans les cas où il s'est planté ou qu'il a été tué. Cela n'inclut pas le processus de rendu. @@ -420,54 +420,6 @@ Retourne : Émis lors de l'appel à `desktopCapturer.getSources()` dans le processus de rendu de `webContents`. L' Appel à `event.preventDefault()` lui fera retourner des sources vides. -### Événement: 'remote-require' _Deprecated_ - -Retourne : - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `module` String - -Émis lorsque `remote.require()` est appelé dans le processus de rendu de `webContents`. Appeler `event.preventDefault()` empêchera le module d'être retourné. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - -### Événement: 'remote-get-global' _Deprecated_ - -Retourne : - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `globalName` String - -Émis lorsque `remote.getGlobal()` est appelé dans le processus de rendu de `webContents`. Appeler `event.preventDefault()` empêchera le module d'être retourné. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - -### Événement: 'remote-get-builtin' _Deprecated_ - -Retourne : - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `module` String - -Émis lorsque `remote.getBuiltin()` est appelé dans le processus de rendu de `webContents`. Appeler `event.preventDefault()` empêchera le module d'être retourné. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - -### Événement: 'remote-get-current-window' _Deprecated_ - -Retourne : - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -Émis lorsque `remote.getCurrentWindow()` est appelé dans le processus de rendu de `webContents`. Appeler `event.preventDefault()` empêchera l'objet d'être renvoyé. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - -### Événement: 'remote-get-current-web-contents' _Deprecated_ - -Retourne : - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -Émis lorsque `remote.getCurrentWebContents()` est appelé dans le processus de rendu de `webContents`. Appeler `event.preventDefault()` empêchera l'objet d'être renvoyé. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - ## Méthodes L'objet `app` dispose des méthodes suivantes : @@ -568,7 +520,7 @@ Retourne `String` - Répertoire courant de l'application. * `logs` Répertoire du dossier de log de votre application. * `crashDumps` Dossier où les rapports d'incidents sont stockés. -Retourne `String` - Un chemin vers le répertoire spécial ou le fichier associé à `nom`. On failure, an `Error` is thrown. +Retourne `String` - Un chemin vers le répertoire spécial ou le fichier associé à `nom`. En cas d'échec, une `Error` sera levée. Si `app.getPath('logs')` est appelé sans que `app.setAppLogsPath()` soit appelé en premier, un répertoire de logs par défaut sera créé équivalent à un appel `app.setAppLogsPath()` sans paramètre `path`. @@ -701,9 +653,9 @@ Cette méthode retourne le nom de l'application du gestionnaire par défaut pour Retourne `Promise` - Résoudre avec un objet contenant les éléments suivants : -* `icon` NativeImage - the display icon of the app handling the protocol. -* `path` String - installation path of the app handling the protocol. -* `name` String - display name of the app handling the protocol. +* `icon` NativeImage - l’icône d’affichage de l’application qui gère le protocole. +* `path` String - chemin d’installation de l’application qui gère le protocole. +* `name` String - nom complet de l’application qui gère le protocole. This method returns a promise that contains the application name, icon and path of the default handler for the protocol (aka URI scheme) of a URL. @@ -978,7 +930,7 @@ Sets the counter badge for current app. Setting the count to `0` will hide the b Sur macOS, il s'affiche sur l'icône du dock. Sous Linux, il ne fonctionne que pour le lanceur Unity. -**Note :** le launcher Unity requiert la présence d'un fichier `.desktop` pour fonctionner, pour de plus amples informations, lisez le document [Intégration de l'environnement de bureau][unity-requirement]. +**Remarque :** Le lanceur Unity nécessite un fichier `.desktop` pour fonctionner. Pour plus d’informations, lisez la [documentation d’intégration Unity][unity-requirement]. ### `app.getBadgeCount()` _Linux_ _macOS_ @@ -1070,9 +1022,9 @@ Show the app's about panel options. These options can be overridden with `app.se Configure les options de la fenêtre À propos de. This will override the values defined in the app's `.plist` file on macOS. See the [Apple docs][about-panel-options] for more details. Sous Linux, les valeurs doivent être définies pour être affichées ; il n'y a pas de valeurs par défaut. -Si vous ne définissez pas `credits<0> mais vous souhaitez quand même les afficher dans votre app, AppKit cherchera un fichier nommé "Credits.html", "Credits.rtf", et "Credits.rtfd", dans cet ordre, dans le bundle retourné par la méthode la classe main de NSBundle. Le premier fichier trouvé est utilisé, et si aucun n'est trouvé, la zone info est laissée vide. Consultez la documentation Apple pour plus d'informations.

    +Si vous ne définissez pas `credits` mais vous souhaitez quand même les afficher dans votre app, AppKit cherchera un fichier nommé "Credits.html", "Credits.rtf", et "Credits.rtfd", dans cet ordre, dans le bundle retourné par la méthode la classe main de NSBundle. Le premier fichier trouvé est utilisé, et si aucun n'est trouvé, la zone info est laissée vide. Consultez la [documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc) Apple pour plus d'informations. -

    app.isEmojiPanelSupported()`

    +### `app.isEmojiPanelSupported()` Retourne `Boolean` - que la version actuelle de l'OS autorise ou non les sélecteurs natifs d'émojis. @@ -1180,7 +1132,7 @@ An `Integer` property that returns the badge count for current app. Setting the On macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher. -**Note :** le launcher Unity requiert la présence d'un fichier `.desktop` pour fonctionner, pour de plus amples informations, lisez le document [Intégration de l'environnement de bureau][unity-requirement]. +**Remarque :** Le lanceur Unity nécessite un fichier `.desktop` pour fonctionner. Pour plus d’informations, lisez la [documentation d’intégration Unity][unity-requirement]. **Note:** On macOS, you need to ensure that your application has the permission to display notifications for this property to take effect. @@ -1208,12 +1160,6 @@ Une `String` qui est la chaîne d'agent utilisateur que Electron utilisera comme C'est l'agent utilisateur qui sera utilisé quand aucun agent utilisateur n'est défini au niveau `webContents` ou `session`. Il est utile pour s'assurer que l'ensemble de votre application a le même agent utilisateur. Définissez une valeur personnalisée dès que possible dans l'initialisation de votre application pour vous assurer que votre valeur remplacée est utilisée. -### `allowRenderererProcessRuse` - -Un `Booléen` qui, lorsque `true` désactive les remplacements qu'Electron a en place pour s'assurer que les processus de rendu sont redémarrés à chaque navigation. La valeur par défaut actuelle pour cette propriété est `true`. - -L'intention est que ces dérogations soient désactivées par défaut, puis à un point dans le futur cette propriété sera supprimée. Cette propriété impacte les modules natifs que vous pouvez utiliser dans le processus de rendu. Pour plus d'informations sur la direction vers laquelle Electron va avec le redémarrage du processus de rendu et l'utilisation de modules natifs dans le processus de rendu veuillez consulter ce [Problème de suivi](https://github.com/electron/electron/issues/18397). - ### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ A `Boolean` which when `true` indicates that the app is currently running under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)). @@ -1229,7 +1175,7 @@ You can use this property to prompt users to download the arm64 version of your [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType -[unity-requirement]: ../tutorial/desktop-environment-integration.md#unity-launcher +[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher [mas-builds]: ../tutorial/mac-app-store-submission-guide.md [Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows [JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx diff --git a/content/fr-FR/docs/api/auto-updater.md b/content/fr-FR/docs/api/auto-updater.md index 5ca909a2a98bf..a148d51a0a1d6 100644 --- a/content/fr-FR/docs/api/auto-updater.md +++ b/content/fr-FR/docs/api/auto-updater.md @@ -97,6 +97,8 @@ Retourne `String` - L'URL de flux des mises à jour. Demande au serveur s'il y a une mise à jour. You must call `setFeedURL` before using this API. +**Note:** If an update is available it will be downloaded automatically. Calling `autoUpdater.checkForUpdates()` twice will download the update two times. + ### `autoUpdater.quitAndInstall()` Redémarre l'application et installe la mise à jour après son téléchargement. It should only be called after `update-downloaded` has been emitted. diff --git a/content/fr-FR/docs/api/browser-window.md b/content/fr-FR/docs/api/browser-window.md index 1f1e99404af2d..ab0ed8dd05cb3 100644 --- a/content/fr-FR/docs/api/browser-window.md +++ b/content/fr-FR/docs/api/browser-window.md @@ -14,7 +14,7 @@ const win = new BrowserWindow({ width: 800, height: 600 }) win.loadURL('https://github.com') // Or load a local HTML file -win.loadURL(`file://${__dirname}/app/index.html`) +win.loadFile('index.html') ``` ## Fenêtre sans bords (Frameless window) @@ -143,7 +143,7 @@ Cela crée une nouvelle `BrowserWindow` avec les propriétés natives définies * `frame` Boolean (optional) - Specify `false` to create a [Frameless Window](frameless-window.md). La valeur par défaut est `vraie`. * `parent` BrowserWindow (optional) - Specify parent window. Par défaut la valeur est `null`. * `modal` Boolean (optional) - Whether this is a modal window. This only works when the window is a child window. Par défaut la valeur est `false`. - * `acceptFirstMouse` Boolean (optional) - Whether the web view accepts a single mouse-down event that simultaneously activates the window. La valeur par défaut est `false`. + * `acceptFirstMouse` Boolean (facultatif) - Un click sur une fenêtre inactive passera à travers jusqu'au contenu Web. La valeur par défaut est `false` sur macOS. Cette option n'est pas configurable sur les autres plateformes. * `disableAutoHideCursor` Boolean (optional) - Whether to hide cursor when typing. Par défaut la valeur est `false`. * `autoHideMenuBar` Boolean (optional) - Auto hide the menu bar unless the `Alt` key is pressed. Par défaut la valeur est `false`. * `enableLargerThanScreen` Booléen (facultatif) - Permet à la fenêtre d'être redimensionnée plus grande que l'écran. Seulement pertinent pour macOS, car les autres systèmes d'exploitation autorisent par défaut des fenêtres plus grandes qu'écran par défaut. Par défaut la valeur est `false`. @@ -157,11 +157,11 @@ Cela crée une nouvelle `BrowserWindow` avec les propriétés natives définies * `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default. * `active` - The backdrop should always appear active. * `inactive` - The backdrop should always appear inactive. - * `titleBarStyle` String (optional) - The style of window title bar. Par défaut la valeur est `default`. Les valeurs possibles sont : - * `default` - Résultats dans la barre de titre standard de Mac opaque gris. - * `Caché` - Résultats dans une barre de titre cachée et une fenêtre de contenu en pleine taille, encore la barre de titre a toujours les contrôles standards de la fenêtre ("feux de circulation") dans en haut à gauche. - * `hiddenInset` - Résultats dans une barre de titre cachée avec un look alternatif où les boutons du feu de circulation sont légèrement plus insérables à partir du bord de la fenêtre. - * `customButtonsOnHover` - Results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. **Note:** Cette option est actuellement expérimentale. + * `titleBarStyle` String (optional) _macOS_ _Windows_ - The style of window title bar. Par défaut la valeur est `default`. Les valeurs possibles sont : + * `default` - Results in the standard title bar for macOS or Windows respectively. + * `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown. + * `hiddenInset` - Only on macOS, results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge. + * `customButtonsOnHover` - Only on macOS, results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. **Note:** Cette option est actuellement expérimentale. * `trafficLightPosition` [Point](structures/point.md) (optional) - Set a custom position for the traffic light buttons in frameless windows. * `roundedCorners` Boolean (optional) - Whether frameless window should have rounded corners on macOS. La valeur par défaut est `vraie`. * `fullscreenWindowTitle` Boolean (optional) _Deprecated_ - Shows the title in the title bar in full screen mode on macOS for `hiddenInset` titleBarStyle. Par défaut la valeur est `false`. @@ -176,10 +176,8 @@ Cela crée une nouvelle `BrowserWindow` avec les propriétés natives définies * `nodeIntegrationInSubFrames` Boolean (facultatif) - Option expérimentale pour activer le support de Node.js dans les sous-cadres tels que les iframes et les fenêtres enfants. Tous vos préchargements seront chargés pour chaque iframe, vous pouvez utiliser `process.isMainFrame` pour déterminer si vous êtes dans le cadre principal ou non. * `preload` String (facultatif) - Spécifie un script qui sera chargé avant les autres scripts exécutés dans la page. Ce script aura toujours accès aux API de noeuds peu importe que l'intégration de noeuds soit activée ou désactivée. La valeur doit être le chemin absolu vers le script. Lorsque l'intégration des nœuds est désactivée, le script de préchargement peut réintroduire les symboles globaux de nœud dans la portée globale. Voir l'exemple [ici](context-bridge.md#exposing-node-global-symbols). * `sandbox` Booléen (facultatif) - Si défini, le moteur de rendu associé à la fenêtre, la rendre compatible avec le bac à sable Chromium au niveau du système d'exploitation et la désactivation du nœud. s moteur. Ce n'est pas la même chose que l'option `nodeIntegration` et les API disponibles pour le script de préchargement sont plus limitées. En savoir plus sur l'option [ici](../tutorial/sandbox.md). - * `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module. Par défaut la valeur est `false`. * `session` [Session](session.md#class-session) (facultatif) - Définit la session utilisée par la page . Au lieu de passer l'objet Session directement, vous pouvez également choisir d'utiliser l'option `partition` à la place, qui accepte une chaîne de partition. Lorsque `session` et `partition` sont fournies, `session` sera préférée. La session par défaut est celle par défaut. * `partition` String (facultatif) - Définit la session utilisée par la page en fonction de la chaîne de partition de la session . Si `partition` commence par `persist:`, la page utilisera une session persistante disponible pour toutes les pages de l'application avec le même `partition`. S'il n'y a pas de préfixe `persistant:`, la page utilisera une session en mémoire . En assignant la même `partition`, plusieurs pages peuvent partager la même session. La session par défaut est celle par défaut. - * `affinity` String (facultatif) - Lorsque spécifié, les pages web avec le même `affinity` s'exécuteront dans le même processus de rendu . Notez que en raison de la réutilisation du processus du moteur de rendu certaines options `webPreferences` seront également partagées entre les pages web, même lorsque vous avez spécifié des valeurs différentes pour elles, incluant mais non limité à `preload`, `sandbox` et `nodeIntegration`. Il est donc suggéré d'utiliser exactement la même `webPreferences` pour les pages web avec la même `affinité`. _Déprécié_ * `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents `300%`. Par défaut la valeur est `1.0`. * `javascript` Boolean (optional) - Enables JavaScript support. La valeur par défaut est `vraie`. * `webSecurity` Boolean (facultatif) - Lorsque `false`, il désactivera la politique de même origine (généralement en utilisant des sites de test par des personnes), et définissez `allowRunningInsecureContent` à `true` si cette option n'a pas été définie par l'utilisateur. La valeur par défaut est `vraie`. @@ -206,8 +204,7 @@ Cela crée une nouvelle `BrowserWindow` avec les propriétés natives définies * `backgroundThrottling` Boolean (facultatif) - Si vous voulez maîtriser les animations et les minuteurs lorsque la page devient en arrière-plan. Cela affecte également l'API [Visibilité de la page](#page-visibility). Par défaut, `true`. * `Offscreen` Boolean (facultatif) - Activer le rendu hors écran pour la fenêtre du navigateur. Par défaut, `faux`. Voir le [tutoriel de rendu hors écran](../tutorial/offscreen-rendering.md) pour plus de détails. * `contextIsolation` Boolean (facultatif) - Exécuter les API Electron et le script `preload` spécifié dans un contexte JavaScript séparé. Est à `true` par défaut. Le contexte dans lequel le script `preload` s’exécute n’aura accès qu'à ses propres `document` , globales de `window` et ensemble de types JavaScript intégrés (`Array`, `Object`, `JSON`, etc.), qui seront tous invisibles pour le contenu chargé. L'API Electron ne sera disponible que dans le script de préchargement de `` et pas dans la page chargée. Cette option doit être utilisée lors du chargement de contenu distant potentiellement non fiable afin de se prémunit de toute utilisation frauduleuse du script `preload` ou des APIs Electron. Cette option utilise la même technique que celle utilisée par les [Chrome Content Scripts][chrome-content-scripts]. Vous pouvez accéder à ce contexte dans les outils de développement en sélectionnant l'entrée 'Electron Isolated Context' de la liste déroulante en haut de l'onglet Console. - * `worldSafeExecuteJavaScript` Boolean (facultatif) - Si vrai, les valeurs retournées par `webFrame. xecuteJavaScript` seront nettoyées pour empêcher que les valeurs JavaScript puissent changer de monde lors de l'utilisation de `contextIsolation`. Par défaut, `true`. _Déprécié_ - * `nativeWindowOpen` Boolean (facultatif) - Utiliser natif `window.open()`. Par défaut, `faux`. Les fenêtres enfants auront toujours l'intégration du nœud désactivée sauf si `nodeIntegrationInSubFrames` est vrai. **Note:** Cette option est actuellement expérimentale. + * `nativeWindowOpen` Boolean (facultatif) - Utiliser natif `window.open()`. Par défaut, `faux`. Les fenêtres enfants auront toujours l'intégration du nœud désactivée sauf si `nodeIntegrationInSubFrames` est vrai. **Note:** The default value will be changing to `true` in Electron 15. * `webviewTag` Boolean (facultatif) - Activer la balise [`< webview>`](webview-tag.md). Par défaut, `faux`. **Remarque :** Le script `preload` configuré pour le `< webview>` aura une intégration de nœuds activée lorsqu'il est exécuté, donc vous devez vous assurer que le contenu distant/non fiable n'est pas en mesure de créer une balise `` avec un préchargement de `potentiellement malveillant` script. Vous pouvez utiliser l'événement `will-attach-webview` sur [webContents](web-contents.md) pour supprimer le script `preload` et valider ou modifier les paramètres initiaux de `< webview>`. * `additionalArguments` String[] (facultatif) - Liste de chaînes qui seront ajoutées au `process.argv` dans le processus de rendu de cette application. Utile afin de transmettre de petites informations aux scripts de préchargement du processus de rendu. * `safeDialogs` Boolean (facultatif) - Indique s’il faut activer la protection pour les boîtes de dialogue consécutives à la mode "navigateur". Par défaut la valeur est `false`. @@ -225,6 +222,7 @@ Cela crée une nouvelle `BrowserWindow` avec les propriétés natives définies * `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation * `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager. Default policy is `code`. * `enablePreferredSizeMode` Boolean (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 the `preferred-size-changed` event to be emitted on the `WebContents` when the preferred size changes. Par défaut la valeur est `false`. + * `titleBarOverlay` [OverlayOptions](structures/overlay-options.md) | Boolean (optional) - When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Par défaut la valeur est `false`. On Windows, the [OverlayOptions](structures/overlay-options.md) can be used instead of a boolean to specify colors for the overlay. Lorsque l'on définie une taille minimum ou maximum pour la fenêtre avec `minWidth`/`maxWidth`/ `minHeight`/`maxHeight`, cela contraint les utilisateurs uniquement. Cela ne vous empêche pas de passer une taille qui ne suit pas les contraintes de tailles à `setBounds`/`setSize` ou au constructeur de `BrowserWindow`. @@ -543,6 +541,10 @@ A `Boolean` property that determines whether the window is in simple (pre-Lion) A `Boolean` property that determines whether the window is in fullscreen mode. +#### `win.focusable` _Windows_ _macOS_ + +A `Boolean` property that determines whether the window is focusable. + #### `win.visibleOnAllWorkspaces` A `Boolean` property that determines whether the window is visible on all workspaces. @@ -613,7 +615,7 @@ Sur Linux, le setter est un no-op, bien que le getter retourne `true`. #### `win.excludedFromShownWindowsMenu` _macOS_ -A `Boolean` property that determines whether the window is excluded from the application’s Windows menu. `false` by default. +A `Boolean` property that determines whether the window is excluded from the application’s Windows menu. `false` par défaut. ```js const win = new BrowserWindow({ height: 600, width: 600 }) @@ -929,35 +931,35 @@ Sets whether the window can be manually closed by user. N'a aucun effet sous Lin #### `win.isClosable()` _macOS_ _Windows_ -Returns `Boolean` - Whether the window can be manually closed by user. +Retourne `Boolean` - Si la fenêtre peut être fermée manuellement par l'utilisateur. Sous Linux, retourne toujours `true`. #### `win.setAlwaysOnTop(flag[, level][, relativeLevel])` * `flag` Boolean -* `level` String (optional) _macOS_ _Windows_ - Values include `normal`, `floating`, `torn-off-menu`, `modal-panel`, `main-menu`, `status`, `pop-up-menu`, `screen-saver`, and ~~`dock`~~ (Deprecated). The default is `floating` when `flag` is true. The `level` is reset to `normal` when the flag is false. Note that from `floating` to `status` included, the window is placed below the Dock on macOS and below the taskbar on Windows. From `pop-up-menu` to a higher it is shown above the Dock on macOS and above the taskbar on Windows. See the [macOS docs][window-levels] for more details. -* `relativeLevel` Integer (optional) _macOS_ - The number of layers higher to set this window relative to the given `level`. The default is `0`. Note that Apple discourages setting levels higher than 1 above `screen-saver`. +* `level` String (facultatif) _macOS_ _Windows_ - Les valeurs incluent `normal`, `floating`, `torn-off-menu`, `modal-panel`, `main-menu`, `statuus`, `pop-up-menu`, `screen-saver`, et ~`dock`~~ (obsolète). La valeur par défaut est `floating` lorsque `flag` est vrai. Le `niveau` est réinitialisé à `normal` lorsque le drapeau est faux. Notez que de `flottant` à `statut` inclus, la fenêtre est placée sous le Dock sur macOS et sous la barre des tâches sous Windows. De `pop-up-menu` à une valeur supérieure, il est affiché au-dessus du Dock sur macOS et au-dessus de la barre des tâches sur Windows. Voir la documentation [macOS][window-levels] pour plus de détails. +* `relativeLevel` Integer (facultatif) _macOS_ - Le nombre de calques supérieur à définir cette fenêtre par rapport au `level`. Par défaut, `0`. Notez que Apple décourage le réglage de niveaux supérieurs à 1 au-dessus de `économiseur d'écran`. Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on. #### `win.isAlwaysOnTop()` -Returns `Boolean` - Whether the window is always on top of other windows. +Retourne `Boolean` - Si la fenêtre est toujours au-dessus des autres fenêtres ou non. #### `win.moveAbove(mediaSourceId)` -* `mediaSourceId` String - Window id in the format of DesktopCapturerSource's id. For example "window:1869:0". +* `mediaSourceId` String - Window id in the format of DesktopCapturerSource's id. Par exemple "window:1869:0". Moves window above the source window in the sense of z-order. If the `mediaSourceId` is not of type window or if the window does not exist then this method throws an error. #### `win.moveTop()` -Moves window to top(z-order) regardless of focus +Déplace la fenêtre sur le dessus (dans l'ordre z) peu importe qu'elle ait le focus ou non #### `win.center()` -Moves window to the center of the screen. +Déplace la fenêtre vers le centre de l’écran. #### `win.setPosition(x, y[, animate])` @@ -965,28 +967,28 @@ Moves window to the center of the screen. * `y` Integer * `animate` Boolean (facultatif) _macOS_ -Moves window to `x` and `y`. +Déplace la fenêtre à la position `x` et `y`. #### `win.getPosition()` -Returns `Integer[]` - Contains the window's current position. +Retourne `Integer[]` - Contient la position actuelle de la fenêtre. #### `win.setTitle(title)` * `title` String -Changes the title of native window to `title`. +Remplace le titre de la fenêtre native par `title`. #### `win.getTitle()` -Returns `String` - The title of the native window. +Retourne `String` - le titre de la fenêtre native. -**Note:** The title of the web page can be different from the title of the native window. +**Remarque :** Le titre de la page web peut être différent du titre de la fenêtre native . #### `win.setSheetOffset(offsetY[, offsetX])` _macOS_ * `offsetY` Float -* `offsetX` Float (optional) +* `offsetX` Float (facultatif) Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. Par exemple : @@ -1002,13 +1004,13 @@ win.setSheetOffset(toolbarRect.height) * `flag` Boolean -Starts or stops flashing the window to attract user's attention. +Démarre ou arrête de flasher la fenêtre pour attirer l'attention de l'utilisateur. #### `win.setSkipTaskbar(skip)` * `skip` Boolean -Makes the window not show in the taskbar. +Fait que la fenêtre ne soit pas affichée dans la barre des tâches. #### `win.setKiosk(flag)` @@ -1018,7 +1020,7 @@ Enters or leaves kiosk mode. #### `win.isKiosk()` -Returns `Boolean` - Whether the window is in kiosk mode. +Retourne `Boolean` - Si la fenêtre est en mode kiosque. #### `win.isTabletMode()` _Windows_ @@ -1030,15 +1032,15 @@ This API returns whether the window is in tablet mode, and the `resize` event ca #### `win.getMediaSourceId()` -Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1324:0". +Returns `String` - Window id in the format of DesktopCapturerSource's id. Par exemple "window:1324:0". More precisely the format is `window:id:other_id` where `id` is `HWND` on Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on Linux. `other_id` is used to identify web contents (tabs) so within the same top level window. #### `win.getNativeWindowHandle()` -Returns `Buffer` - The platform-specific handle of the window. +Retourne `Buffer` - Le gestionnaire spécifique à la plate-forme de la fenêtre. -The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and `Window` (`unsigned long`) on Linux. +Le type natif du handle est `HWND` sous Windows, `NSView*` sur macOS, et `Window` (`long`non signé) sous Linux. #### `win.hookWindowMessage(message, callback)` _Windows_ @@ -1047,43 +1049,43 @@ The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and `Win * `wParam` any - The `wParam` provided to the WndProc * `lParam` any - The `lParam` provided to the WndProc -Hooks a windows message. The `callback` is called when the message is received in the WndProc. +Hooks a windows message. La `callback` est appelée lorsque le message est reçu dans le WndProc. #### `win.isWindowMessageHooked(message)` _Windows_ * `message` Integer -Returns `Boolean` - `true` or `false` depending on whether the message is hooked. +Retourne `Boolean` - `true` ou `false` selon que le message est accroché. #### `win.unhookWindowMessage(message)` _Windows_ * `message` Integer -Unhook the window message. +Débranchez le message de la fenêtre. #### `win.unhookAllWindowMessages()` _Windows_ -Unhooks all of the window messages. +Décroche tous les messages de la fenêtre. #### `win.setRepresentedFilename(filename)` _macOS_ * `filename` String -Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar. +Définit le chemin d'accès du fichier que la fenêtre représente, et l'icône du fichier s'affichera dans la barre de titre de la fenêtre. #### `win.getRepresentedFilename()` _macOS_ -Returns `String` - The pathname of the file the window represents. +Retourne `String` - Le chemin du fichier que la fenêtre représente. #### `win.setDocumentEdited(edited)` _macOS_ * `edited` Boolean -Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to `true`. +Spécifie si le document de la fenêtre a été modifié, et l'icône dans la barre de titre deviendra grise lorsque réglé sur `true`. #### `win.isDocumentEdited()` _macOS_ -Returns `Boolean` - Whether the window's document has been edited. +Retourne `Boolean` - Si le document de la fenêtre a été modifié. #### `win.focusOnWebView()` @@ -1091,29 +1093,29 @@ Returns `Boolean` - Whether the window's document has been edited. #### `win.capturePage([rect])` -* `rect` [Rectangle](structures/rectangle.md) (optional) - The bounds to capture +* `rect` [Rectangle](structures/rectangle.md) (facultatif) - Les limites à capturer -Returns `Promise` - Resolves with a [NativeImage](native-image.md) +Retourne `Promise` - résout avec une [NativeImage](native-image.md) -Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty. +Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. Si la page n'est pas visible, `rect` peut être vide. #### `win.loadURL(url[, options])` * `url` String * `options` Object (facultatif) - * `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL. - * `userAgent` String (optional) - A user agent originating the request. - * `extraHeaders` String (optional) - Extra headers separated by "\n" + * `httpReferrer` (String | [Referrer](structures/referrer.md)) (facultatif) - Une URL de référence HTTP. + * `userAgent` String (optionnel) - Un agent utilisateur d'où provient la requête. + * `extraHeaders` String (optionnel) - Headers supplémentaires séparés par "\n" * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional) - * `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files. + * `baseURLForDataURL` String (facultatif) - URL de base (avec séparateur de chemin de pointe) pour que les fichiers soient chargés par l'URL de données. Ceci n'est nécessaire que si l'`url` spécifiée est une URL de données et a besoin de charger d'autres fichiers. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Retourne `Promise` - la promesse se résoudra lorsque la page aura terminé le chargement (voir [`did-finish-load`](web-contents.md#event-did-finish-load)), et rejette si la page ne parvient pas à se charger (voir [`did-fail-load`](web-contents.md#event-did-fail-load)). -Same as [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options). +Même que [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options). -The `url` can be a remote address (e.g. `http://`) or a path to a local HTML file using the `file://` protocol. +L'`url` peut être une adresse distante (par exemple `http://`) ou un chemin vers un fichier HTML local en utilisant le `file://` protocole. -To ensure that file URLs are properly formatted, it is recommended to use Node's [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject) method: +Pour s'assurer que les URL de fichier sont correctement formatées, il est recommandé d'utiliser la méthode Node's [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject) : ```javascript const url = require('url').format({ @@ -1125,7 +1127,7 @@ const url = require('url').format({ win.loadURL(url) ``` -You can load a URL using a `POST` request with URL-encoded data by doing the following: +Vous pouvez charger une URL en utilisant une requête `POST` avec des données encodées par URL en faisant ce qui suit : ```javascript win.loadURL('http://localhost:8000/post', { @@ -1141,27 +1143,27 @@ win.loadURL('http://localhost:8000/post', { * `filePath` String * `options` Object (facultatif) - * `query` Record (optional) - Passed to `url.format()`. - * `search` String (optional) - Passed to `url.format()`. - * `hash` String (optional) - Passed to `url.format()`. + * `query` Enregistrement (facultatif) - Passé à `url.format()`. + * `search` String (facultatif) - Passé à `url.format()`. + * `hash` String (facultatif) - Passé à `url.format()`. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Retourne `Promise` - la promesse se résoudra lorsque la page aura terminé le chargement (voir [`did-finish-load`](web-contents.md#event-did-finish-load)), et rejette si la page ne parvient pas à se charger (voir [`did-fail-load`](web-contents.md#event-did-fail-load)). Same as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information. #### `win.reload()` -Same as `webContents.reload`. +Identique à `webContents.reload`. #### `win.setMenu(menu)` _Linux_ _Windows_ * `menu` Menu | null -Sets the `menu` as the window's menu bar. +Définit le `menu` comme barre de menu de la fenêtre. #### `win.removeMenu()` _Linux_ _Windows_ -Remove the window's menu bar. +Retirez la barre de menu de la fenêtre. #### `win.setProgressBar(progress[, options])` @@ -1169,126 +1171,126 @@ Remove the window's menu bar. * `options` Object (facultatif) * `mode` String _Windows_ - Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or `paused`. -Sets progress value in progress bar. Valid range is [0, 1.0]. +Définit la valeur de progression dans la barre de progression. La plage valide est [0, 1.0]. -Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1. +Supprimer la barre de progression lorsque la progression < 0 ; Passer en mode indéterminé lorsque la progression > 1. -On Linux platform, only supports Unity desktop environment, you need to specify the `*.desktop` file name to `desktopName` field in `package.json`. By default, it will assume `{app.name}.desktop`. +Sur la plate-forme Linux, ne prend en charge que l'environnement de bureau Unity, vous devez spécifier le nom du fichier `*.desktop` au champ `desktopName` dans `package.json`. Par défaut, il assumera `{app.name}.desktop`. -On Windows, a mode can be passed. Accepted values are `none`, `normal`, `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a mode set (but with a value within the valid range), `normal` will be assumed. +Sous Windows, un mode peut être passé. Les valeurs acceptées sont `none`, `normal`, `indeterminate`, `erreur`, et `paused`. Si vous appelez `setProgressBar` sans mode défini (mais avec une valeur dans la plage valide), `normal` sera utilisé. #### `win.setOverlayIcon(overlay, description)` _Windows_ -* `overlay` [NativeImage](native-image.md) | null - the icon to display on the bottom right corner of the taskbar icon. If this parameter is `null`, the overlay is cleared -* `description` String - a description that will be provided to Accessibility screen readers +* `overlay` [NativeImage](native-image.md) | null - l'icône à afficher en bas à droite de l'icône de la barre des tâches. Si ce paramètre est `null`, l'overlay est effacé +* `description` Chaîne - une description qui sera fournie aux lecteurs d'écran d'accessibilité -Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user. +Définit une superposition de 16 x 16 pixels sur l'icône actuelle de la barre des tâches, généralement utilisé pour transmettre une sorte de statut d'application ou pour notifier passivement l'utilisateur. #### `win.setHasShadow(hasShadow)` * `hasShadow` Boolean -Sets whether the window should have a shadow. +Définit si la fenêtre doit avoir une ombre. #### `win.hasShadow()` -Returns `Boolean` - Whether the window has a shadow. +Retourne `Boolean` - Si la fenêtre a une ombre. #### `win.setOpacity(opacity)` _Windows_ _macOS_ -* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque) +* `opacité` Nombre - entre 0.0 (entièrement transparent) et 1.0 (entièrement opaque) -Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the [0, 1] range. +Définit l'opacité de la fenêtre. Sur Linux, n'a aucun effet. Out of bound number values are clamped to the [0, 1] range. #### `win.getOpacity()` -Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1. +Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). Sur Linux, renvoie toujours 1. #### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_ * `rects` [Rectangle[]](structures/rectangle.md) - Sets a shape on the window. Passing an empty list reverts the window to being rectangular. -Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window. +Définir une forme de fenêtre détermine la zone dans la fenêtre où le système permet de dessiner et d'interagir avec l'utilisateur. En dehors de la région donnée, aucun pixel ne sera dessiné et aucun événement de souris ne sera enregistré. Les événements de souris en dehors de la région ne seront pas reçus par cette fenêtre, mais passeront à tout ce qui se trouve derrière la fenêtre. #### `win.setThumbarButtons(buttons)` _Windows_ * `buttons` [ThumbarButton[]](structures/thumbar-button.md) -Returns `Boolean` - Whether the buttons were added successfully +Retourne `Boolean` - Si les boutons ont été ajoutés avec succès -Add a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a `Boolean` object indicates whether the thumbnail has been added successfully. +Ajouter une barre d'outils miniature avec un ensemble de boutons spécifié à l'image de miniature d'une fenêtre dans la disposition d'un bouton de la barre des tâches. Renvoie un objet `Booléen` indique si la vignette a été ajoutée avec succès. -The number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform's limitation. But you can call the API with an empty array to clean the buttons. +Le nombre de boutons dans la barre d'outils miniature ne doit pas dépasser 7 en raison de la salle limitée. Une fois que vous avez configuré la barre d'outils miniature, la barre d'outils ne peut pas être retirée en raison de la limitation de la plateforme. Mais vous pouvez appeler l'API avec un tableau vide pour nettoyer les boutons. -The `buttons` is an array of `Button` objects: +Le `boutons` est un tableau d'objets `Bouton` : -* `Button` Object - * `icon` [NativeImage](native-image.md) - The icon showing in thumbnail toolbar. +* Objet `Button` + * `icon` [NativeImage](native-image.md) - L'icône s'affichant dans la miniature dans la barre d'outils. * `click` Function - * `tooltip` String (optional) - The text of the button's tooltip. - * `flags` String[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`. + * `tooltip` String (facultatif) - Le texte dans l'info-bulle du bouton. + * `flags` String[] (facultatif) - Contrôle les états et comportements spécifiques du bouton. Par défaut, il est `['activé']`. -The `flags` is an array that can include following `String`s: +Le `flags` est un tableau pouvant inclure ces `String`s suivant : -* `enabled` - The button is active and available to the user. -* `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action. -* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately. -* `nobackground` - Do not draw a button border, use only the image. -* `hidden` - The button is not shown to the user. -* `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification. +* `enabled` - Le bouton est actif et disponible à l'utilisateur. +* `désactivé` - Le bouton est désactivé. Il est présent, mais a un état visuel indiquant qu'il ne répondra pas à l'action de l'utilisateur. +* `dismissonclick` - Lorsque le bouton est cliqué, la fenêtre de miniature se ferme immédiatement. +* `nobackground` - Utilise uniquement l'image et ne dessine pas de bordure sur le bouton. +* `hidden` - Le bouton n'est pas affiché à l'utilisateur. +* `non interactif` - Le bouton est activé mais non interactif ; aucun état de bouton n'est dessiné. Cette valeur est destinée aux cas où le bouton est utilisé dans une notification. #### `win.setThumbnailClip(region)` _Windows_ -* `region` [Rectangle](structures/rectangle.md) - Region of the window +* `region` [Rectangle](structures/rectangle.md) - La région de la fenêtre -Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0 }`. +Définit la région de la fenêtre à afficher comme image de miniature affichée lorsque survole la fenêtre dans la barre des tâches. Vous pouvez réinitialiser la miniature en toute la fenêtre en spécifiant une région vide : `{ x: 0, y: 0, width: 0, height: 0 }`. #### `win.setThumbnailToolTip(toolTip)` _Windows_ * `toolTip` String -Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar. +Définit l'infobulle qui s'affiche en survolant la vignette de la fenêtre dans la barre des tâches. #### `win.setAppDetails(options)` _Windows_ * Objet `options` - * `appId` String (optional) - Window's [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx). It has to be set, otherwise the other options will have no effect. - * `appIconPath` String (optional) - Window's [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx). + * `appId` String (facultatif) - Fenêtre [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx). Elle doit être définie, sinon les autres options n'auront aucun effet. + * `appIconPath` String (facultatif) - Fenêtre [Icône de relance](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx). * `appIconIndex` Integer (optional) - Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set. La valeur par defaut en est ``. - * `relaunchCommand` String (optional) - Window's [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx). - * `relaunchDisplayName` String (optional) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx). + * `relaunchCommand` String (facultatif) - La [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx)de Windows. + * `relaunchDisplayName` String (facultatif) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx). -Sets the properties for the window's taskbar button. +Définit les propriétés du bouton de la barre des tâches de la fenêtre. -**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set together. If one of those properties is not set, then neither will be used. +**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set together. Si l'une de ces propriétés n'est pas définie, aucune ne sera utilisée. #### `win.showDefinitionForSelection()` _macOS_ -Same as `webContents.showDefinitionForSelection()`. +Identique à `webContents.showDefinitionForSelection()`. #### `win.setIcon(icon)` _Windows_ _Linux_ -* `icon` [NativeImage](native-image.md) | String +* `icon` [NativeImage](native-image.md) | Chaîne -Changes window icon. +Change l'icône de la fenêtre. #### `win.setWindowButtonVisibility(visible)` _macOS_ * `visible` Boolean -Sets whether the window traffic light buttons should be visible. +Définit si les boutons du feu de la fenêtre doivent être visibles. #### `win.setAutoHideMenuBar(hide)` * `hide` Boolean -Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single `Alt` key. +Définit si la barre de menus de la fenêtre doit se cacher automatiquement. Once set the menu bar will only show when users press the single `Alt` key. If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately. #### `win.isMenuBarAutoHide()` -Returns `Boolean` - Whether menu bar automatically hides itself. +Retourne `Boolean` - Si la barre de menu se cache automatiquement. #### `win.setMenuBarVisibility(visible)` _Windows_ _Linux_ @@ -1298,40 +1300,40 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users #### `win.isMenuBarVisible()` -Returns `Boolean` - Whether the menu bar is visible. +Retourne `Boolean` - Si la barre de menu est visible. -#### `win.setVisibleOnAllWorkspaces(visible[, options])` +#### `win.setVisibleOnWorkspaces(visible[, options])` * `visible` Boolean * `options` Object (facultatif) - * `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether the window should be visible above fullscreen windows. + * `visibleOnFullScreen` Booléen (facultatif) _macOS_ - Définit si la fenêtre doit être visible au-dessus des fenêtres plein écran. * `skipTransformProcessType` Boolean (optional) _macOS_ - Calling setVisibleOnAllWorkspaces will by default transform the process type between UIElementApplication and ForegroundApplication to ensure the correct behavior. However, this will hide the window and dock for a short time every time it is called. If your window is already of type UIElementApplication, you can bypass this transformation by passing true to skipTransformProcessType. -Sets whether the window should be visible on all workspaces. +Définit si la fenêtre doit être visible sur tous les espaces de travail. -**Note:** This API does nothing on Windows. +**Remarque :** Cette API ne fonctionne pas sous Windows. #### `win.isVisibleOnAllWorkspaces()` -Returns `Boolean` - Whether the window is visible on all workspaces. +Retourne `Boolean` - Si la fenêtre est visible sur tous les espaces de travail. -**Note:** This API always returns false on Windows. +**Remarque **: Cette API retourne toujours false sur Windows. #### `win.setIgnoreMouseEvents(ignore[, options])` * `ignore` Boolean * `options` Object (facultatif) - * `forward` Boolean (optional) _macOS_ _Windows_ - If true, forwards mouse move messages to Chromium, enabling mouse related events such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false, forwarding is always disabled regardless of this value. + * `Avancer` Boolean (facultatif) _macOS_ _Windows_ - Si vrai, transférez la souris messages vers Chromium, en activant les événements liés à la souris tels que `souris`. Utilisé uniquement lorsque `ignore` est vrai. Si `ignore` est faux, le transfert est toujours désactivé quelle que soit cette valeur. -Makes the window ignore all mouse events. +Fait que la fenêtre ignore tous les événements de la souris. -All mouse events happened in this window will be passed to the window below this window, but if this window has focus, it will still receive keyboard events. +Tous les événements survenus dans cette fenêtre seront passés à la fenêtre ci-dessous cette fenêtre, mais si cette fenêtre a le focus, elle recevra toujours les événements du clavier . #### `win.setContentProtection(enable)` _macOS_ _Windows_ * `enable` Boolean -Prevents the window contents from being captured by other apps. +Empêche le contenu de la fenêtre d'être capturé par d'autres applications. On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10 version 2004 and up the window will be removed from capture entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window. @@ -1339,63 +1341,67 @@ On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows i * `focusable` Boolean -Changes whether the window can be focused. +Modifie si la fenêtre peut être mise au point. + +Sur macOS, il ne supprime pas le focus de la fenêtre. + +#### `win.isFocusable()` _macOS_ _Windows_ -On macOS it does not remove the focus from the window. +Returns whether the window can be focused. #### `win.setParentWindow(parent)` * `parent` BrowserWindow | null -Sets `parent` as current window's parent window, passing `null` will turn current window into a top-level window. +Définit `parent` comme la fenêtre parent de la fenêtre actuelle, en passant `null` transformera la fenêtre actuelle en une fenêtre de niveau supérieur. #### `win.getParentWindow()` -Returns `BrowserWindow` - The parent window. +Retourne `BrowserWindow` - La fenêtre parent. #### `win.getChildWindows()` -Returns `BrowserWindow[]` - All child windows. +Retourne `BrowserWindow[]` - Toutes les fenêtres enfants. #### `win.setAutoHideCursor(autoHide)` _macOS_ * `autoHide` Boolean -Controls whether to hide cursor when typing. +Contrôle s'il faut masquer le curseur lors de la saisie. #### `win.selectPreviousTab()` _macOS_ -Selects the previous tab when native tabs are enabled and there are other tabs in the window. +Sélectionne l'onglet précédent lorsque les onglets natifs sont activés et il y a d'autres onglets dans la fenêtre. #### `win.selectNextTab()` _macOS_ -Selects the next tab when native tabs are enabled and there are other tabs in the window. +Sélectionne l'onglet suivant lorsque les onglets natifs sont activés et il y a d'autres onglets dans la fenêtre. #### `win.mergeAllWindows()` _macOS_ -Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window. +Fusionne toutes les fenêtres dans une seule fenêtre avec plusieurs onglets lorsque les onglets natifs sont activés et qu'il y a plus d'une fenêtre ouverte. #### `win.moveTabToNewWindow()` _macOS_ -Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window. +Déplace l'onglet actuel dans une nouvelle fenêtre si les onglets natifs sont activés et il y a plus d'un onglet dans la fenêtre actuelle. #### `win.toggleTabBar()` _macOS_ -Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window. +Active/désactive la visibilité de la barre d’onglets si les onglets natifs sont activés et il n’y a qu’un seul onglet dans la fenêtre actuelle. #### `win.addTabbedWindow(browserWindow)` _macOS_ * `browserWindow` BrowserWindow -Adds a window as a tab on this window, after the tab for the window instance. +Ajoute une fenêtre sous la forme d'un onglet sur cette fenêtre, après l'onglet de l'instance de fenêtre. #### `win.setVibrancy(type)` _macOS_ -* `type` String | null - Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See the [macOS documentation][vibrancy-docs] for more details. +* `type` String | null - Peut être `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `sous-window`, ou `sous-page`. Voir la documentation [macOS][vibrancy-docs] pour plus de détails. Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window. -Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS. +Notez que `appearance-based`, `light`, `dark`, `medium-light`, et `ultra-dark` ont été obsolètes et seront supprimées dans une prochaine version de macOS. #### `win.setTrafficLightPosition(position)` _macOS_ @@ -1411,39 +1417,39 @@ Returns `Point` - The custom position for the traffic light buttons in frameless * `touchBar` TouchBar | null -Sets the touchBar layout for the current window. Specifying `null` or `undefined` clears the touch bar. This method only has an effect if the machine has a touch bar and is running on macOS 10.12.1+. +Définit la disposition de la barre tactile pour la fenêtre actuelle. La spécification `null` ou `undefined` efface la barre de contact. Cette méthode n'a d'effet que si la machine a une barre tactile et est en cours d'exécution sur macOS 10.12.1+. -**Note:** The TouchBar API is currently experimental and may change or be removed in future Electron releases. +**Remarque :** L’API TouchBar est actuellement expérimentale et peut changer ou être supprimée dans les futures mises à jour d'Electron. #### `win.setBrowserView(browserView)` _Experimental_ -* `browserView` [BrowserView](browser-view.md) | null - Attach `browserView` to `win`. If there are other `BrowserView`s attached, they will be removed from this window. +* `browserView` [BrowserView](browser-view.md) | null - Attache une `browserView` à `win`. Si d'autres `BrowserView`sont déjà attachées, elles seront supprimés de cette fenêtre. -#### `win.getBrowserView()` _Experimental_ +#### `win.getBrowserView()` _Expérimental_ -Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null` if one is not attached. Throws an error if multiple `BrowserView`s are attached. +Retourne `BrowserView | null` - La `BrowserView` attachée à `win`. Retourne `null` si aucune n'est attachée. Lance une erreur si plusieurs `BrowserView` sont attachées. -#### `win.addBrowserView(browserView)` _Experimental_ +#### `win.addBrowserView(browserView)` _Expérimental_ * `browserView` [BrowserView](browser-view.md) -Replacement API for setBrowserView supporting work with multi browser views. +Remplacement de l'API pour setBrowserView prenant en charge le travail avec des vues multi navigateurs. -#### `win.removeBrowserView(browserView)` _Experimental_ +#### `win.removeBrowserView(browserView)` _Expérimental_ * `browserView` [BrowserView](browser-view.md) -#### `win.setTopBrowserView(browserView)` _Experimental_ +#### `win.setTopBrowserView(browserView)` _Expérimental_ * `browserView` [BrowserView](browser-view.md) -Raises `browserView` above other `BrowserView`s attached to `win`. Throws an error if `browserView` is not attached to `win`. +Raises `browserView` above other `BrowserView`s attached to `win`. Lance une erreur si `browserView` n'est pas attaché à `win`. -#### `win.getBrowserViews()` _Experimental_ +#### `win.getBrowserViews()` _Expérimental_ -Returns `BrowserView[]` - an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. +Retourne `BrowserView[]` - un tableau de toutes les BrowserViews qui ont été attachées avec `addBrowserView` ou `setBrowserView`. -**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases. +**Remarque :** L’API BrowserView est actuellement expérimentale et peut changer ou être supprimée dans les futures mises à jour d'Electron. [runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 [page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API @@ -1452,3 +1458,5 @@ Returns `BrowserView[]` - an array of all BrowserViews that have been attached w [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/fr-FR/docs/api/clipboard.md b/content/fr-FR/docs/api/clipboard.md index 383cf28f3d50f..f08dc1aed6191 100644 --- a/content/fr-FR/docs/api/clipboard.md +++ b/content/fr-FR/docs/api/clipboard.md @@ -1,29 +1,28 @@ # clipboard -> Perform copy and paste operations on the system clipboard. +> Permet d'effectuer les opérations copier et coller dans le presse-papiers. -Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) +Processus : [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) On Linux, there is also a `selection` clipboard. To manipulate it you need to pass `selection` to each method: ```javascript const { clipboard } = require('electron') -clipboard.writeText('Example String', 'selection') -console.log(clipboard.readText('selection')) +clipboard.writeText('Mon exemple', 'selection') console.log(clipboard.readText('selection')) ``` ## Méthodes -The `clipboard` module has the following methods: +Le module `clipboard` dispose des méthodes suivantes : -**Note:** Experimental APIs are marked as such and could be removed in future. +**Remarque :** Les APIs expérimentales sont marquées comme telles et sont susceptibles d'être supprimés à l'avenir. ### `clipboard.readText([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` n'est disponible que sur Linux. -Returns `String` - The content in the clipboard as plain text. +Retourne `String` - Le contenu du presse-papiers en tant que texte brut. ```js const { clipboard } = require('electron') @@ -38,22 +37,22 @@ console.log(text) ### `clipboard.writeText(text[, type])` * `text` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` n'est disponible que sur Linux. -Writes the `text` into the clipboard as plain text. +Écrit le `text` dans le presse-papiers au format texte brut. ```js const { clipboard } = require('electron') -const text = 'hello i am a bit of text!' +const text = 'bonjour je suis un peu de texte!' clipboard.writeText(text) ``` ### `clipboard.readHTML([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` n'est disponible que sur Linux. -Returns `String` - The content in the clipboard as markup. +Retourne `String` - Le contenu du presse-papiers en tant que balisage. ```js const { clipboard } = require('electron') @@ -68,56 +67,56 @@ console.log(html) ### `clipboard.writeHTML(markup[, type])` * `markup` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` n'est disponible que sur Linux. -Writes `markup` to the clipboard. +Écrit le `markup` dans le presse-papiers. ```js const { clipboard } = require('electron') -clipboard.writeHTML('HiBonjourselection

    ') console.log(hasFormat) -// 'true' or 'false +// 'true' ou 'false' ``` -### `clipboard.read(format)` _Experimental_ +### `clipboard.read(format)` _Expérimental_ * `format` String -Returns `String` - Reads `format` type from the clipboard. +Retourne `String` - Lit le type de `format` depuis le presse-papiers. -### `clipboard.readBuffer(format)` _Experimental_ +`format` should contain valid ASCII characters and have `/` separator. `a/c`, `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid. + +### `clipboard.readBuffer(format)` _Expérimental_ * `format` String -Returns `Buffer` - Reads `format` type from the clipboard. +Retourne un `Buffer` - Lit le type de `format` depuis le presse-papiers. ```js const { clipboard } = require('electron') const buffer = Buffer.from('this is binary', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) -const ret = clipboard.readBuffer('public.utf8-plain-text') +const ret = clipboard.readBuffer('public/utf8-plain-text') console.log(buffer.equals(out)) // true @@ -224,40 +225,40 @@ console.log(buffer.equals(out)) * `format` String * `buffer` Buffer -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` n'est disponible que sur Linux. -Writes the `buffer` into the clipboard as `format`. +Écrit le `buffer` dans le presse-papiers comme `format`. ```js const { clipboard } = require('electron') const buffer = Buffer.from('writeBuffer', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) ``` ### `clipboard.write(data[, type])` -* `data` Object - * `text` String (optional) - * `html` String (optional) - * `image` [NativeImage](native-image.md) (optional) - * `rtf` String (optional) - * `bookmark` String (optional) - The title of the URL at `text`. -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* Objet `data` + * `text` String (facultatif) + * `html` String (facultatif) + * `image` [NativeImage](native-image.md) (facultatif) + * `rtf` String (facultatif) + * `marque-page` String (facultatif) - Le titre de l'URL à `text`. +* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` n'est disponible que sur Linux. -Writes `data` to the clipboard. +Écrit `data` dans le presse-papiers. ```js const { clipboard } = require('electron') -clipboard.write({ +presse-papiers. rite({ text: 'test', html: 'Hi', rtf: '{\\rtf1\\utf8 text}', - bookmark: 'a title' + marque-page : 'un titre' }) -console.log(clipboard.readText()) +console. og(presse-papiers. eadText()) // 'test' console.log(clipboard.readHTML()) diff --git a/content/fr-FR/docs/api/command-line-switches.md b/content/fr-FR/docs/api/command-line-switches.md index 399d20a84a344..554567966baff 100644 --- a/content/fr-FR/docs/api/command-line-switches.md +++ b/content/fr-FR/docs/api/command-line-switches.md @@ -59,17 +59,18 @@ Force l'espace disque maximum à utiliser par le cache disque, en octets. Enables caller stack logging for the following APIs (filtering events): * `desktopCapturer.getSources()` / `desktop-capturer-get-sources` -* `remote.require()` / `remote-require` -* `remote.getGlobal()` / `remote-get-builtin` -* `remote.getBuiltin()` / `remote-get-global` -* `remote.getCurrentWindow()` / `remote-get-current-window` -* `remote.getCurrentWebContents()` / `remote-get-current-web-contents` -### --enable-logging +### --enable-logging[=file] -Envoie les traces de Chromium à la console. +Prints Chromium's logging to stderr (or a log file). -Ce commutateur ne peut pas être utilisé dans `app.commandLine.appendSwitch` car il est pris en compte avant que l'app utilisateur soit chargée, mais vous pouvez activer la variable d'environnement `ELECTRON_ENABLE_LOGGING` pour obtenir le même résultat. +The `ELECTRON_ENABLE_LOGGING` environment variable has the same effect as passing `--enable-logging`. + +Passing `--enable-logging` will result in logs being printed on stderr. Passing `--enable-logging=file` will result in logs being saved to the file specified by `--log-file=...`, or to `electron_debug.log` in the user-data directory if `--log-file` is not specified. + +> **Note:** On Windows, logs from child processes cannot be sent to stderr. Logging to a file is the most reliable way to collect logs on Windows. + +See also `--log-file`, `--log-level`, `--v`, and `--vmodule`. ### --force-fieldtrials=`trials` @@ -116,10 +117,26 @@ Consultez la documentation [Node.js][node-cli] ou exécutez `node --help` dans v Permet de mettre une langue personnalisée. +### --log-file=`path` + +If `--enable-logging` is specified, logs will be written to the given path. The parent directory must exist. + +Setting the `ELECTRON_LOG_FILE` environment variable is equivalent to passing this flag. If both are present, the command-line switch takes precedence. + ### --log-net-log=`path` Permet que les événements réseau net log soient sauvés et les écrit dans `path`. +### --log-level=`N` + +Sets the verbosity of logging when used together with `--enable-logging`. `N` should be one of [Chrome's LogSeverities][severities]. + +Note that two complimentary logging mechanisms in Chromium -- `LOG()` and `VLOG()` -- are controlled by different switches. `--log-level` controls `LOG()` messages, while `--v` and `--vmodule` control `VLOG()` messages. So you may want to use a combination of these three switches depending on the granularity you want and what logging calls are made by the code you're trying to watch. + +See [Chromium Logging source][logging] for more information on how `LOG()` and `VLOG()` interact. Loosely speaking, `VLOG()` can be thought of as sub-levels / per-module levels inside `LOG(INFO)` to control the firehose of `LOG(INFO)` data. + +See also `--enable-logging`, `--log-level`, `--v`, and `--vmodule`. + ### --no-proxy-server N'utilisez pas de serveur proxy et établissez toujours des connexions directes. Overrides any other proxy server flags that are passed. @@ -159,6 +176,8 @@ Gives the default maximal active V-logging level; 0 is the default. Normally pos Ce commutateur ne fonctionne que si `--enable-logging` est également fourni. +See also `--enable-logging`, `--log-level`, and `--vmodule`. + ### --vmodule=`pattern` Permet que les niveaux maximum par module de V-logging puisse dépasser la valeur donnée par `--v`. Exemple : `my_module=2,foo*=3` would change the logging level for all code in source files `my_module.*` and `foo*.*`. @@ -167,6 +186,8 @@ Tout pattern contenant un slash ou un anti-slash sera testé pour tout le chemin Ce commutateur ne fonctionne que si `--enable-logging` est également fourni. +See also `--enable-logging`, `--log-level`, and `--v`. + ### --force_high_performance_gpu Force using discrete GPU when there are multiple GPUs available. @@ -214,5 +235,7 @@ Par défaut, l'url du websocket de l'inspecteur est disponible dans stderr et da [ready]: app.md#event-ready [play-silent-audio]: https://github.com/atom/atom/pull/9485/files [debugging-main-process]: ../tutorial/debugging-main-process.md +[logging]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h [node-cli]: https://nodejs.org/api/cli.html [node-cli]: https://nodejs.org/api/cli.html +[severities]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h?q=logging::LogSeverity&ss=chromium diff --git a/content/fr-FR/docs/api/dialog.md b/content/fr-FR/docs/api/dialog.md index db350ccff68a9..fb5debcbe6266 100644 --- a/content/fr-FR/docs/api/dialog.md +++ b/content/fr-FR/docs/api/dialog.md @@ -137,7 +137,7 @@ dialog.showOpenDialog(mainWindow, { * `treatPackageAsDirectory` _macOS_ - Considérer les paquets, tels que les dossiers `.app`, comme des dossiers plutôt que des fichiers. * `showOverwriteConfirmation` _Linux_ - Définit si une boîte de dialogue de confirmation sera affichée lorsque l’utilisateur tape un nom de fichier déjà existant. * `dontAddToRecent` _Windows_ - N'ajoutez pas l'élément en cours d'ouverture à la liste des documents récents. - * `securityScopedBookmarks` Boolean (facultatif) _macOS_ _mas_ - Créez un marque-page à portée de sécurité lorsque empaqueté pour le Mac App Store. Si cette option est activée et que le fichier n'existe pas encore, un fichier vide sera créé dans le chemin choisi. + * `securityScopedBookmarks` Boolean (facultatif) _macOS_ _mas_ - Créez un [marque-page à portée de sécurité](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) lorsque empaqueté pour le Mac App Store. Si cette option est activée et que le fichier n'existe pas encore, un fichier vide sera créé dans le chemin choisi. Retourne `String | undefined`, le chemin du fichier choisi par l'utilisateur ; si la boîte de dialogue est annulée, elle retourne `undefined`. @@ -162,7 +162,7 @@ Les `filters` spécifie un tableau de types de fichiers qui peuvent être affich * `treatPackageAsDirectory` _macOS_ - Considérer les paquets, tels que les dossiers `.app`, comme des dossiers plutôt que des fichiers. * `showOverwriteConfirmation` _Linux_ - Définit si une boîte de dialogue de confirmation sera affichée lorsque l’utilisateur tape un nom de fichier déjà existant. * `dontAddToRecent` _Windows_ - N'ajoutez pas l'élément en cours d'ouverture à la liste des documents récents. - * `securityScopedBookmarks` Boolean (facultatif) _macOS_ _mas_ - Créez un marque-page à portée de sécurité lorsque empaqueté pour le Mac App Store. Si cette option est activée et que le fichier n'existe pas encore, un fichier vide sera créé dans le chemin choisi. + * `securityScopedBookmarks` Boolean (facultatif) _macOS_ _mas_ - Créez un [marque-page à portée de sécurité](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) lorsque empaqueté pour le Mac App Store. Si cette option est activée et que le fichier n'existe pas encore, un fichier vide sera créé dans le chemin choisi. Retourne `Promise` - Résoudre avec un objet contenant les éléments suivants : @@ -186,8 +186,6 @@ Les `filters` spécifie un tableau de types de fichiers qui peuvent être affich * `defaultId` Integer (facultatif) - Index du bouton dans le tableau des boutons qui seront sélectionnés par défaut lorsque la boîte de message s'ouvrira. * `title` String (facultatif) - Titre de la boîte de message, certaines plateformes ne l'afficheront pas. * `detail` String (facultatif) - Informations supplémentaires du message. - * `checkboxLabel` String (facultatif) - Si fourni, la case de message inclura une case à cocher avec l'étiquette donnée. - * `checkboxChecked` Boolean (optional) - Initial checked state of the checkbox. `false` by default. * `icon` ([NativeImage](native-image.md) | String) (facultatif) * `cancelId` Integer (facultatif) - L'index du bouton à utiliser pour annuler la boîte de dialogue, via la touche `Esc`. Par défaut, ceci est assigné au premier bouton avec l'étiquette "annuler" ou "non". Si aucun bouton de ce type n'existe et que cette option n'est pas définie, `0` sera utilisé comme valeur de retour . * `noLink` Booléen (optionnel) - Sous Windows, Electron essaiera de déterminer lequel des les boutons `` sont des boutons courants (comme "Annuler" ou "Oui"), et affichent le d'autres comme liens de commande dans le dialogue. Cela peut faire apparaître la boîte de dialogue dans le style des applications Windows modernes. Si vous n'aimez pas ce comportement, vous pouvez définir `noLink` à `true`. @@ -210,7 +208,7 @@ L'argument `browserWindow` permet à la boîte de dialogue de s'attacher elle-m * `title` String (facultatif) - Titre de la boîte de message, certaines plateformes ne l'afficheront pas. * `detail` String (facultatif) - Informations supplémentaires du message. * `checkboxLabel` String (facultatif) - Si fourni, la case de message inclura une case à cocher avec l'étiquette donnée. - * `checkboxChecked` Boolean (optional) - Initial checked state of the checkbox. `false` by default. + * `checkboxChecked` Boolean (optional) - Initial checked state of the checkbox. `false` par défaut. * `icon` [NativeImage](native-image.md) (facultatif) * `cancelId` Integer (facultatif) - L'index du bouton à utiliser pour annuler la boîte de dialogue, via la touche `Esc`. Par défaut, ceci est assigné au premier bouton avec l'étiquette "annuler" ou "non". Si aucun bouton de ce type n'existe et que cette option n'est pas définie, `0` sera utilisé comme valeur de retour . * `noLink` Booléen (optionnel) - Sous Windows, Electron essaiera de déterminer lequel des les boutons `` sont des boutons courants (comme "Annuler" ou "Oui"), et affichent le d'autres comme liens de commande dans le dialogue. Cela peut faire apparaître la boîte de dialogue dans le style des applications Windows modernes. Si vous n'aimez pas ce comportement, vous pouvez définir `noLink` à `true`. @@ -257,7 +255,7 @@ Sous Windows, les options sont plus limitées, en raison des API Win32 utilisée | Type de compilation | securityScopedBookmarks boolean | Return Type | Return Value | | ------------------- | ------------------------------- |:-----------:| ------------------------------ | | macOS mas | True | Succès | `['LONGBOOKMARKSTRING']` | -| macOS mas | True | Error | `['']` (array of empty string) | +| macOS mas | True | Erreur | `['']` (array of empty string) | | macOS mas | False | NA | `[]` (empty array) | | non mas | any | NA | `[]` (empty array) | diff --git a/content/fr-FR/docs/api/environment-variables.md b/content/fr-FR/docs/api/environment-variables.md index d48ee10e36e55..69a9dbfe71b5f 100644 --- a/content/fr-FR/docs/api/environment-variables.md +++ b/content/fr-FR/docs/api/environment-variables.md @@ -104,7 +104,15 @@ Les variables d'environnement suivantes sont destinés principalement pour le d ### `ELECTRON_ENABLE_LOGGING` -Affiche les logs interne de Chrome sur la console. +Prints Chromium's internal logging to the console. + +Setting this variable is the same as passing `--enable-logging` on the command line. For more info, see `--enable-logging` in [command-line switches](./command-line-switches.md#enable-loggingfile). + +### `ELECTRON_LOG_FILE` + +Sets the file destination for Chromium's internal logging. + +Setting this variable is the same as passing `--log-file` on the command line. For more info, see `--log-file` in [command-line switches](./command-line-switches.md#log-filepath). ### `ELECTRON_DEBUG_DRAG_REGIONS` @@ -112,7 +120,7 @@ Adds coloration to draggable regions on [`BrowserView`](./browser-view.md)s on m ### `ELECTRON_DEBUG_NOTIFICATIONS` -Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common actions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. +Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common a tions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. Sample output: diff --git a/content/fr-FR/docs/api/extensions.md b/content/fr-FR/docs/api/extensions.md index bce8cc627bd61..57ef37965ee54 100644 --- a/content/fr-FR/docs/api/extensions.md +++ b/content/fr-FR/docs/api/extensions.md @@ -64,6 +64,7 @@ Les méthodes suivantes de `chrome.runtime` sont prises en charge : - `chrome.runtime.getURL` - `chrome.runtime.connect` - `chrome.runtime.sendMessage` +- `chrome.runtime.reload` Les événements suivants de `chrome.runtime` sont pris en charge : diff --git a/content/fr-FR/docs/api/frameless-window.md b/content/fr-FR/docs/api/frameless-window.md index 8dee9b7ade7c0..a6431c3ee80cd 100644 --- a/content/fr-FR/docs/api/frameless-window.md +++ b/content/fr-FR/docs/api/frameless-window.md @@ -14,13 +14,13 @@ const win = new BrowserWindow({ width: 800, height: 600, frame: false }) win.show() ``` -### Alternatives sur macOS +### Alternatives -Il existe une autre façon de spécifier une fenêtre sans chrominance. Au lieu de définir `frame` à `false` qui désactive à la fois la barre de titre et le contrôle de fenêtre, vous pouvez vouloir masquer la barre de titre et étendre votre contenu à la taille de la fenêtre complète, tout en préservant les contrôles de fenêtres ("feux de circulation") pour les actions de fenêtres standard. Vous pouvez le faire en spécifiant l'option `titleBarStyle` : +There's an alternative way to specify a chromeless window on macOS and Windows. Instead of setting `frame` to `false` which disables both the titlebar and window controls, you may want to have the title bar hidden and your content extend to the full window size, yet still preserve the window controls ("traffic lights" on macOS) for standard window actions. Vous pouvez le faire en spécifiant l'option `titleBarStyle` : #### `hidden` -Résultats dans une barre de titre cachée et une fenêtre de contenu en taille réelle, Pourtant, la barre de titre possède toujours les contrôles standard des fenêtres (« feux de circulation ») en haut à gauche. +Results in a hidden title bar and a full size content window. On macOS, the title bar still has the standard window controls (“traffic lights”) in the top left. ```javascript const { BrowserWindow } = require('electron') @@ -28,6 +28,8 @@ const win = new BrowserWindow({ titleBarStyle: 'hidden' }) win.show() ``` +### Alternatives sur macOS + #### `hiddenInset` Résultats dans une barre de titre cachée avec un aspect alternatif où les boutons de feux de circulation sont un peu plus intégrés à partir du bord de la fenêtre. @@ -48,6 +50,33 @@ const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: fa win.show() ``` +## Windows Control Overlay + +When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS, using one of the `titleBarStyle`s as described above so that the traffic lights are visible, or using `titleBarStyle: hidden` on Windows, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true. Specifying `true` will result in an overlay with default system colors. + +On Windows, you can also specify the color of the overlay and its symbols by setting `titleBarOverlay` to an object with the options `color` and `symbolColor`. If an option is not specified, the color will default to its system color for the window control buttons: + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: true +}) +win.show() +``` + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: { + color: '#2f3241', + symbolColor: '#74b1be' + } +}) +win.show() +``` + ## Fenêtre transparente En définissant l'option `transparente` à `true`, vous pouvez également rendre la fenêtre sans cadre transparente : @@ -142,3 +171,5 @@ In a frameless window the dragging behavior may conflict with selecting text. Pa Sur certaines plateformes, la zone glissable sera traitée comme une image non-client, donc lorsque vous faites un clic droit dessus un menu système apparaîtra. Pour que le menu contextuel se comporte correctement sur toutes les plates-formes, vous ne devriez jamais utiliser un menu contextuel personnalisé sur zones glissables. [ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/fr-FR/docs/api/ipc-main.md b/content/fr-FR/docs/api/ipc-main.md index 11af5d83a2549..3fa199c923bb7 100644 --- a/content/fr-FR/docs/api/ipc-main.md +++ b/content/fr-FR/docs/api/ipc-main.md @@ -32,6 +32,8 @@ ipcMain.on('synchronous-message', (event, arg) => { ```javascript // Dans le processus de rendu (page web). +// NB. Electron APIs are only accessible from preload, unless contextIsolation is disabled. +// Voir https://www.electronjs.org/docs/tutorial/process-model#preload-scripts pour plus de détails. const { ipcRenderer } = require('electron') console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // affiche "pong" diff --git a/content/fr-FR/docs/api/menu-item.md b/content/fr-FR/docs/api/menu-item.md index 229c6b5a64ae5..891fa904516f6 100644 --- a/content/fr-FR/docs/api/menu-item.md +++ b/content/fr-FR/docs/api/menu-item.md @@ -13,7 +13,7 @@ Voir [`Menu`](menu.md) pour des exemples. * `menuItem` MenuItem * `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open. * `event` [KeyboardEvent](structures/keyboard-event.md) - * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. Voir [rôles](#roles). + * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. Voir [rôles](#roles). * `type` String (facultatif) - Peut être `normal`, `séparateur`, `sous-menu`, `checkbox` ou `radio`. * `label` String (optionnel) * `sublabel` String (optionnel) @@ -128,7 +128,7 @@ A `String` indicating the type of the item. Can be `normal`, `separator`, `subme #### `menuItem.role` -Un `String` (facultatif) indiquant le rôle de l'élément, si défini. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` +Un `String` (facultatif) indiquant le rôle de l'élément, si défini. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` #### `menuItem.accelerator` diff --git a/content/fr-FR/docs/api/menu.md b/content/fr-FR/docs/api/menu.md index 4266515d1d016..4d0a78ff47c2a 100644 --- a/content/fr-FR/docs/api/menu.md +++ b/content/fr-FR/docs/api/menu.md @@ -143,7 +143,7 @@ const template = [ { role: 'services' }, { type: 'separator' }, { role: 'hide' }, - { role: 'hideothers' }, + { role: 'hideOthers' }, { role: 'unhide' }, { type: 'separator' }, { role: 'quit' } diff --git a/content/fr-FR/docs/api/power-monitor.md b/content/fr-FR/docs/api/power-monitor.md index 12b72b26a28c5..77b8217fda7c4 100644 --- a/content/fr-FR/docs/api/power-monitor.md +++ b/content/fr-FR/docs/api/power-monitor.md @@ -8,11 +8,11 @@ Processus : [Main](../glossary.md#main-process) Le module `powerMonitor` émet les événements suivants : -### Event: 'suspend' _macOS_ _Windows_ +### Événement : 'suspend' Émis lorsque le système est suspendu. -### Event: 'resume' _macOS_ _Windows_ +### Événement : 'resume' Émis lorsque le système reprend. diff --git a/content/fr-FR/docs/api/session.md b/content/fr-FR/docs/api/session.md index 903e3f8b5d0fa..1144c57f7ac27 100644 --- a/content/fr-FR/docs/api/session.md +++ b/content/fr-FR/docs/api/session.md @@ -160,7 +160,7 @@ Retourne : Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request. -#### Événement : 'select-serial-port' _Expérimental_ +#### Event: 'select-serial-port' Retourne : @@ -172,21 +172,15 @@ Retourne : Emitted when a serial port needs to be selected when a call to `navigator.serial.requestPort` is made. `callback` should be called with `portId` to be selected, passing an empty string to `callback` will cancel the request. Additionally, permissioning on `navigator.serial` can be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler) with the `serial` permission. -Parce qu'il s'agit d'une fonctionnalité expérimentale, elle est désactivée par défaut. To enable this feature, you will need to use the `--enable-features=ElectronSerialChooser` command line switch. Additionally because this is an experimental Chromium feature you will need to set `enableBlinkFeatures: 'Serial'` on the `webPreferences` property when opening a BrowserWindow. - ```javascript const { app, BrowserWindow } = require('electron') let win = null -app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser') app.whenReady().then(() => { win = new BrowserWindow({ width: 800, - height: 600, - webPreferences: { - enableBlinkFeatures: 'Serial' - } + height: 600 }) win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => { event.preventDefault() @@ -202,7 +196,7 @@ app.whenReady().then(() => { }) ``` -#### Événement : 'serial-port-added' _Expérimental_ +#### Event: 'serial-port-added' Retourne : @@ -212,7 +206,7 @@ Retourne : Emitted after `navigator.serial.requestPort` has been called and `select-serial-port` has fired if a new serial port becomes available. Par exemple, cet événement se déclenchera lorsqu'un nouveau périphérique USB est branché. -#### Événement : 'serial-port-removed' _Expérimental_ +#### Event: 'serial-port-removed' Retourne : @@ -302,7 +296,7 @@ Le `proxyBypassRules` est une liste de règles séparées par des virgules, comm Correspond à un suffixe de domaine particulier. - Examples: ".google.com", ".com", "http://.google.com" + Exemples: ".google.com", ".com", "http://.google.com" * `[ SCHEME "://" ] IP_LITERAL [ ":" PORT ]` @@ -452,7 +446,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents #### `ses.setPermissionCheckHandler(handler)` * `handler` Function\ | null - * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. Cross origin sub frames making permission checks will pass a `null` webContents to this handler. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. + * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. Toutes les frames de cross origin effectuant des vérifications de permission passeront un `null` webContents à ce gestionnaire, alors que certaines autres vérifications de permissions, telles que `notifications` , passeront toujours `null`. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. * `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, or `serial`. * `requestingOrigin` String - The origin URL of the permission check * `details` Object - Some properties are only available on certain permission types. diff --git a/content/fr-FR/docs/api/structures/overlay-options.md b/content/fr-FR/docs/api/structures/overlay-options.md new file mode 100644 index 0000000000000..9e0e4815ea59c --- /dev/null +++ b/content/fr-FR/docs/api/structures/overlay-options.md @@ -0,0 +1,4 @@ +# OverlayOptions Object + +* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color. +* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color. diff --git a/content/fr-FR/docs/api/structures/user-default-types.md b/content/fr-FR/docs/api/structures/user-default-types.md new file mode 100644 index 0000000000000..647a87ad1d09e --- /dev/null +++ b/content/fr-FR/docs/api/structures/user-default-types.md @@ -0,0 +1,12 @@ +# UserDefaultTypes Object + +* `string` String +* `boolean` Boolean +* `integer` Number +* `float` Number +* `double` Number +* `url` String +* `array` Array\ +* Enregistrement `dictionary`\ + +This type is a helper alias, no object will never exist of this type. diff --git a/content/fr-FR/docs/api/system-preferences.md b/content/fr-FR/docs/api/system-preferences.md index d3371871e5eb1..ee15d05e34386 100644 --- a/content/fr-FR/docs/api/system-preferences.md +++ b/content/fr-FR/docs/api/system-preferences.md @@ -147,12 +147,12 @@ Identique à `unsubscribeNotification`, mais supprime l'abonné de `NSWorkspace. Ajoute les valeurs par défaut à `NSUserDefaults`de votre application. -### `systemPreferences.getUserDefault(key, type)` _macOS_ +### `systemPreferences.getUserDefault(key, type)` _macOS_ * `key` String -* `type` String - Peut être `chaîne`, `booléen`, `integer`, `float`, `double`, `url`, `array` ou `dictionnaire`. +* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. -Retourne `any` - La valeur de `clé` dans `NSUserDefaults`. +Returns [`UserDefaultTypes[Type]`](structures/user-default-types.md) - The value of `key` in `NSUserDefaults`. Certaines `clé` populaires et `type`s sont: diff --git a/content/fr-FR/docs/api/touch-bar-scrubber.md b/content/fr-FR/docs/api/touch-bar-scrubber.md index 1b0d0259833b0..d6528f424a0d7 100644 --- a/content/fr-FR/docs/api/touch-bar-scrubber.md +++ b/content/fr-FR/docs/api/touch-bar-scrubber.md @@ -14,7 +14,7 @@ Processus : [Main](../glossary.md#main-process) * `highlightedIndex` Integer - L'index de l'élément que l'utilisateur a sélectionné. * `selectedStyle` String (optional) - Selected item style. Can be `background`, `outline` or `none`. Par défaut, `none`. * `overlayStyle` String (optional) - Selected overlay item style. Can be `background`, `outline` or `none`. Par défaut, `none`. - * `showArrowButtons` Boolean (optionnel) - `false` par défaut. + * `showArrowButtons` Boolean (facultatif) - Afficher ou non les boutons flèches. La valeur par défaut est `false` et n'est affichée que si `items` n'est pas vide. * `mode` String (optional) - Can be `fixed` or `free`. Par défaut, `free`. * `continuous` Boolean (optionnel) - `true` par défaut. diff --git a/content/fr-FR/docs/api/web-contents.md b/content/fr-FR/docs/api/web-contents.md index ea3ab08d9173b..9f66595e4a3b6 100644 --- a/content/fr-FR/docs/api/web-contents.md +++ b/content/fr-FR/docs/api/web-contents.md @@ -39,6 +39,24 @@ Retourne `WebContents` - Le contenu web qui a le focus dans cette application, s Returns `WebContents` | undefined - A WebContents instance with the given ID, or `undefined` if there is no WebContents associated with the given ID. +### `webContents.fromDevToolsTargetId(targetId)` + +* `targetId` String - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance. + +Returns `WebContents` | undefined - A WebContents instance with the given TargetID, or `undefined` if there is no WebContents associated with the given TargetID. + +When communicating with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), it can be useful to lookup a WebContents instance based on its assigned TargetID. + +```js +async function lookupTargetId (browserWindow) { + const wc = browserWindow.webContents + await wc.debugger.attach('1.3') + const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo') + const { targetId } = targetInfo + const targetWebContents = await webContents.fromDevToolsTargetId(targetId) +} +``` + ## Classe : WebContents > Affiche et contrôle le contenu d'une instance de BrowserWindow. @@ -134,7 +152,7 @@ Retourne : * `frameName` String * `disposition` String - Peut être `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` et `other`. * `options` BrowserWindowConstructorOptions - Les options qui seront utilisées pour créer le nouveau [`BrowserWindow`](browser-window.md). -* `additionalFeatures` String[] - Les fonctionnalités non standards (fonctionnalités non gérés par Chromium ou Electron) donné à `window.open()`. +* `additionalFeatures` String[] - Les fonctionnalités non standards (fonctionnalités non gérés par Chromium ou Electron) donné à `window.open()`. Deprecated, and will now always be the empty array `[]`. * `referrer` [Referrer](structures/referrer.md) - Le parrain qui sera passé à la nouvelle fenêtre. Peut ou ne peut pas entraîner l'envoi de l'en-tête `Référent` en fonction de la politique du référent. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. @@ -178,8 +196,7 @@ Retourne : * Objet `details` * `url` String - URL for the created window. * `frameName` String - Name given to the created window in the `window.open()` call. - * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: options inherited from the parent, parsed options from the `features` string from `window.open()`, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. - * `additionalFeatures` String[] - The non-standard features (features not handled Chromium or Electron) _Deprecated_ + * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. * `referrer` [Referrer](structures/referrer.md) - Le parrain qui sera passé à la nouvelle fenêtre. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. @@ -320,6 +337,8 @@ win.webContents.on('will-prevent-unload', (event) => { }) ``` +**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the [specification](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). + #### Événement : 'crash' _Déprécié_ Retourne : @@ -345,7 +364,7 @@ Retourne : * `oom` - Le processus est tombé à cours de mémoire * `launch-failed` - Le processus ne s'est pas lancé avec succès * `integrity-failure` - Les vérifications d'intégrité du code Windows ont échouées - * `Codedesortie`Numero integre-Le code de sortie du proces, sauf `si la raison est lancer a echoue,`ou <0>le codeSortie sera une plateforme specifique, de code envoye errone. + * `exitCode` Integer - Le code de sortie du proces, sauf si `reason` est `launch-failed`, dans ce cas là `exitCode` sera specifique per plateforme. Émis lorsque le processus de rendu plante de manière inattendue. C'est normalement dans les cas où il s'est planté ou qu'il a été tué. @@ -726,49 +745,6 @@ Retourne : Emitted when `desktopCapturer.getSources()` is called in the renderer process. L' Appel à `event.preventDefault()` lui fera retourner des sources vides. -#### Événement: 'remote-require' _Deprecated_ - -Retourne : - -* `événement` IpcMainEvent -* `module` String - -Emitted when `remote.require()` is called in the renderer process. Appeler `event.preventDefault()` empêchera le module d'être retourné. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - -#### Événement: 'remote-get-global' _Deprecated_ - -Retourne : - -* `événement` IpcMainEvent -* `globalName` String - -Emitted when `remote.getGlobal()` is called in the renderer process. Appeler `event.preventDefault()` empêchera le module d'être retourné. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - -#### Événement: 'remote-get-builtin' _Deprecated_ - -Retourne : - -* `événement` IpcMainEvent -* `module` String - -Emitted when `remote.getBuiltin()` is called in the renderer process. Appeler `event.preventDefault()` empêchera le module d'être retourné. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - -#### Événement: 'remote-get-current-window' _Deprecated_ - -Retourne : - -* `événement` IpcMainEvent - -Emitted when `remote.getCurrentWindow()` is called in the renderer process. Appeler `event.preventDefault()` empêchera l'objet d'être renvoyé. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - -#### Événement: 'remote-get-current-web-contents' _Deprecated_ - -Retourne : - -* `événement` IpcMainEvent - -Emitted when `remote.getCurrentWebContents()` is called in the renderer process. Appeler `event.preventDefault()` empêchera l'objet d'être renvoyé. Des valeurs personnalisées peuvent être retournées en définissant `event.returnValue`. - #### Event: 'preferred-size-changed' Retourne : @@ -1040,7 +1016,7 @@ Ignore application menu shortcuts while this web contents is focused. Va donner `{action: 'deny'} | {action: 'permettre', surpasserOptionsduNavigateurFenetreBrowser?: OptionsConstructeurNavigateursFenetre}`- - `refuser` va supprimer la creation dans la fenetre nouvelle. `permettre`va permettre la creation d'une fenetre nouvelle. Specifying `overrideBrowserWindowOptions` allows customization of the created window. Returning an unrecognized value such as a null, undefined, or an object without a recognized 'action' value will result in a console error and have the same effect as returning `{action: 'deny'}`. -Called before creating a window when `window.open()` is called from the renderer. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. +Called before creating a window a new window is requested by the renderer, e.g. by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or submitting a form with ``. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. #### `contents.setAudioMuted(muted)` diff --git a/content/fr-FR/docs/api/web-frame-main.md b/content/fr-FR/docs/api/web-frame-main.md index b8858898f37f9..14bd276cf1027 100644 --- a/content/fr-FR/docs/api/web-frame-main.md +++ b/content/fr-FR/docs/api/web-frame-main.md @@ -154,3 +154,9 @@ An `Integer` representing the Chromium internal `pid` of the process which owns #### `frame.routingId` _Readonly_ An `Integer` representing the unique frame id in the current renderer process. Distinct `WebFrameMain` instances that refer to the same underlying frame will have the same `routingId`. + +#### `frame.visibilityState` _Lecture seule_ + +A `string` representing the [visibility state](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) of the frame. + +See also how the [Page Visibility API](browser-window.md#page-visibility) is affected by other Electron APIs. diff --git a/content/fr-FR/docs/api/web-request.md b/content/fr-FR/docs/api/web-request.md index 455e2dd308557..97163ca56584c 100644 --- a/content/fr-FR/docs/api/web-request.md +++ b/content/fr-FR/docs/api/web-request.md @@ -46,7 +46,7 @@ Les méthodes suivantes sont disponibles pour les instances de `WebRequest` : * `webContentsId` Integer (facultatif) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `uploadData` [UploadData[]](structures/upload-data.md) @@ -88,7 +88,7 @@ Some examples of valid `urls`: * `webContentsId` Integer (facultatif) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * Enregistrement `requestHeaders` @@ -113,7 +113,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (facultatif) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * Enregistrement `requestHeaders` @@ -132,7 +132,7 @@ The `listener` will be called with `listener(details)` just before a request is * `webContentsId` Integer (facultatif) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `statusLine` String @@ -160,7 +160,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (facultatif) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -182,7 +182,7 @@ The `listener` will be called with `listener(details)` when first byte of the re * `webContentsId` Integer (facultatif) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `redirectURL` String @@ -206,7 +206,7 @@ The `listener` will be called with `listener(details)` when a server initiated r * `webContentsId` Integer (facultatif) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -229,7 +229,7 @@ The `listener` will be called with `listener(details)` when a request is complet * `webContentsId` Integer (facultatif) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `fromCache` Boolean diff --git a/content/fr-FR/docs/api/webview-tag.md b/content/fr-FR/docs/api/webview-tag.md index 4872919987ad6..a87ee07c52375 100644 --- a/content/fr-FR/docs/api/webview-tag.md +++ b/content/fr-FR/docs/api/webview-tag.md @@ -94,14 +94,6 @@ A `Boolean`. Lorsque cet attribut est présent, la page hébergée dans la `webv A `Boolean` for the experimental option for enabling NodeJS support in sub-frames such as iframes inside the `webview`. All your preloads will load for every iframe, you can use `process.isMainFrame` to determine if you are in the main frame or not. Cette option est désactivée par défaut dans la page invité. -### `enableremotemodule` - -```html - -``` - -A `Boolean`. When this attribute is `false` the guest page in `webview` will not have access to the [`remote`](remote.md) module. The remote module is unavailable by default. - ### `plugins` ```html @@ -737,6 +729,18 @@ It is also not emitted during in-page navigation, such as clicking anchor links Calling `event.preventDefault()` does __NOT__ have any effect. +### Événement : 'did-start-navigation' + +Retourne : + +* `url` String +* `isInPlace` Boolean +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitted when any frame (including main) starts navigating. `isInPlace` will be `true` for in-page navigations. + ### Événement : 'did-navigate' Retourne : @@ -747,6 +751,21 @@ Retourne : This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. +### Event: 'did-frame-navigate' + +Retourne : + +* `url` String +* `httpResponseCode` Integer - -1 for non HTTP navigations +* `httpStatusText` String - vide pour les navigations non HTTP, +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Émis lorsqu'une navigation est terminée. + +This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. + ### Événement : 'did-navigate-in-page' Retourne : diff --git a/content/fr-FR/docs/api/window-open.md b/content/fr-FR/docs/api/window-open.md index 9bfc25f0ec686..13a92a46c9750 100644 --- a/content/fr-FR/docs/api/window-open.md +++ b/content/fr-FR/docs/api/window-open.md @@ -11,7 +11,7 @@ However, when the `sandbox` (or directly, `nativeWindowOpen`) option is set, a ` Electron pairs this native Chrome `Window` with a BrowserWindow under the hood. You can take advantage of all the customization available when creating a BrowserWindow in the main process by using `webContents.setWindowOpenHandler()` for renderer-created windows. -Les options du constructeur BrowserWindow sont définies par ordre croissant de priorité : d'abord les options héritées du parent puis les options analysées à partir de la chaîne `traits` de `window.open()` puis webPreferences liées à la sécurité héritées du parent, et enfin les options données par [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. +BrowserWindow constructor options are set by, in increasing precedence order: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. ### `window.open(url[, frameName][, features])` @@ -36,7 +36,8 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn * L'intégration de Node sera toujours désactivée dans le nouveau `window` si elle est désactivée sur la fenêtre parent. * L'isolation du context sera toujours activée dans le nouveau `window` si elle est activée sur la fenêtre parent. * JavaScript sera toujours désactivé dans le nouveau `window` si il est désactivé sur la fenêtre parent. -* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `additionalFeatures` argument. +* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `options` argument. +* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters). To customize or cancel the creation of the window, you can optionally set an override handler with `webContents.setWindowOpenHandler()` from the main process. Returning `false` cancels the window, while returning an object sets the `BrowserWindowConstructorOptions` used when creating the window. Note that this is more powerful than passing options through the feature string, as the renderer has more limited privileges in deciding security preferences than the main process. @@ -56,7 +57,7 @@ mainWindow.webContents.setGestionnairedeFenetreOuverte (({ url }) => { mainWindow.webContents.on('did-create-window', (childWindow) => { // Par exemple... - childWindow.webContents('will-navigate', (e) => { + childWindow.webContents.on('will-navigate', (e) => { e.preventDefault() }) }) diff --git a/content/fr-FR/docs/breaking-changes.md b/content/fr-FR/docs/breaking-changes.md index 444f53a01a700..f8e0ddc25a380 100644 --- a/content/fr-FR/docs/breaking-changes.md +++ b/content/fr-FR/docs/breaking-changes.md @@ -12,9 +12,29 @@ Ce document utilise la convention suivante pour catégoriser les modifications m * **Déprécié :** une API a été marquée comme étant dépréciée. L'API continuera à fonctionner, mais émettra une alerte de dépréciation, et sera supprimée dans une prochaine version. * **Supprimé:** Une API ou une fonctionnalité a été supprimée et n'est plus prise en charge par Electron. +## Changements majeurs prévus de l'API (15.0) + +### Valeur par défaut modifié : `nativeWindowOpen`est par défaut à `true` + +Prior to Electron 15, `window.open` was by default shimmed to use `BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work to open synchronously scriptable child windows, among other incompatibilities. `nativeWindowOpen: true` is no longer experimental, and is now the default. + +See the documentation for [window.open in Electron](api/window-open.md) for more details. + ## Changements majeurs prévus de l'API (14.0) -### API modifiée : `window.(open)` +### Supprimé : `app.allowRendererProcessReuse` + +The `app.allowRendererProcessReuse` property will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. + +Pour des informations plus détaillées, voir [#18397](https://github.com/electron/electron/issues/18397). + +### Suppression : Browser Window Affinity + +L'option `affinity` lors de l'instanciation d'une nouvelle `BrowserWindow` sera supprimée dans le cadre de notre plan d'alignement sur le modèle de processus de Chromium à des fins de sécurité, performances et maintenabilité. + +Pour des informations plus détaillées, voir [#18397](https://github.com/electron/electron/issues/18397). + +### API modifiée : `window.open()` Le paramètre optionnel `frameName` ne définira plus le titre de la fenêtre. Ceci conformément à la spécification décrite par la [documentation native](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) sous le paramètre correspondant `windowName`. @@ -27,6 +47,44 @@ Dans Electron 14, `worldSafeExecuteJavaScript` sera supprimé. Il n'y a pas d'a Vous serez affecté par ce changement si vous utilisez `webFrame.executeJavaScript` ou `webFrame.executeJavaScriptInIsolatedWorld`. Changements de rupture. +### Removed: BrowserWindowConstructorOptions inheriting from parent windows + +Prior to Electron 14, windows opened with `window.open` would inherit BrowserWindow constructor options such as `transparent` and `resizable` from their parent window. Beginning with Electron 14, this behavior is removed, and windows will not inherit any BrowserWindow constructor options from their parents. + +Instead, explicitly set options for the new window with `setWindowOpenHandler`: + +```js +webContents.setWindowOpenHandler((details) => { + return { + action: 'allow', + overrideBrowserWindowOptions: { + // ... + } + } +}) +``` + +### Supprimé : `additionalFeatures` + +The deprecated `additionalFeatures` property in the `new-window` and `did-create-window` events of WebContents has been removed. Since `new-window` uses positional arguments, the argument is still present, but will always be the empty array `[]`. (Though note, the `new-window` event itself is deprecated, and is replaced by `setWindowOpenHandler`.) Bare keys in window features will now present as keys with the value `true` in the options object. + +```js +// Removed in Electron 14 +// Triggered by window.open('...', '', 'my-key') +webContents.on('did-create-window', (window, details) => { + if (details.additionalFeatures.includes('my-key')) { + // ... + } +}) + +// Replace with +webContents.on('did-create-window', (window, details) => { + if (details.options['my-key']) { + // ... + } +}) +``` + ## Changements majeurs prévus de l'API (13.0) ### API modifiée : `session.setPermissionCheckHandler(handler)` @@ -285,12 +343,6 @@ Voir [#23265](https://github.com/electron/electron/pull/23265) pour plus de dét La configuration `{ compress: false }` dans `crashReporter.start` est obsolète. Presque tous les serveurs d'ingestion de plantages supportent la compression gzip. Cette option sera supprimée dans une future version d’Electron. -### Suppression : Browser Window Affinity - -L'option `affinity` lors de l'instanciation d'une nouvelle `BrowserWindow` sera supprimée dans le cadre de notre plan d'alignement sur le modèle de processus de Chromium à des fins de sécurité, performances et maintenabilité. - -Pour des informations plus détaillées, voir [#18397](https://github.com/electron/electron/issues/18397). - ### Valeur par défaut modifié : `enableRemoteModule`est par défaut à `false` Dans Electron 9, l'utilisation du module remote sans l'activer explicitement via l'option `enableRemoteModule` de WebPreferences émet dès maintenant un avertissement. Avec Electron 10, le module remote est dès maintenant désactivé par défaut. Pour utiliser le module remote, on doit spécifier `enableRemoteModule : true` dans les WebPreferences: @@ -525,12 +577,12 @@ Les événements `systemPreferences` suivants ont été dépréciés : Utilisez à la place le nouvel événement `updated` sur le module `nativeTheme`. ```js -// Deprecated +// Deprécié systemPreferences.on('inverted-color-scheme-changed', () => { /* ... */ }) systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ }) -// Replace with -nativeTheme.on('updated', () => { /* ... */ }) +// Replacer avec +nativmeTheme.on('updated', () => { /* ... */ }) ``` ### Méthodes obsolètes dans `systemPreferences` @@ -606,11 +658,11 @@ const idleTime = powerMonitor.getSystemIdleTime() ### API Changed: `webFrame.setIsolatedWorldInfo` replaces separate methods ```js -// Removed in Electron 7.0 +// Supprimé dans Electron 7.0 webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp) webFrame.setIsolatedWorldHumanReadableName(worldId, name) webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin) -// Replace with +// Remplacer par webFrame.setIsolatedWorldInfo( worldId, { @@ -683,7 +735,7 @@ Les fonctions suivantes ne retournent plus que des promesses : * `session.clearStorageData()` [#17249](https://github.com/electron/electron/pull/17249) * `session.getBlobData()` [#17303](https://github.com/electron/electron/pull/17303) * `session.getCacheSize()` [#17185](https://github.com/electron/electron/pull/17185) -* `session.resolveProxy()` [#17222](https://github.com/electron/electron/pull/17222) +* `session.getCacheSize()` [#17185](https://github.com/electron/electron/pull/17222) * `session.setProxy()` [#17222](https://github.com/electron/electron/pull/17222) * `shell.openExternal()` [#16176](https://github.com/electron/electron/pull/16176) * `()` [#15855](https://github.com/electron/electron/pull/15855) diff --git a/content/fr-FR/docs/development/pull-requests.md b/content/fr-FR/docs/development/pull-requests.md index a17e59e4fe1fc..6a43cf9ecfe27 100644 --- a/content/fr-FR/docs/development/pull-requests.md +++ b/content/fr-FR/docs/development/pull-requests.md @@ -92,7 +92,6 @@ Common prefixes: * perf: A code change that improves performance * refactor: A code change that neither fixes a bug nor adds a feature * style: Changes that do not affect the meaning of the code (linting) -* vendor: Bumping a dependency like libchromiumcontent or node Autres choses à garder à l'esprit lors de la rédaction d'un message de commit : diff --git a/content/fr-FR/docs/development/source-code-directory-structure.md b/content/fr-FR/docs/development/source-code-directory-structure.md index 4d7e29c600ada..6a94042cb037f 100644 --- a/content/fr-FR/docs/development/source-code-directory-structure.md +++ b/content/fr-FR/docs/development/source-code-directory-structure.md @@ -79,7 +79,6 @@ Electron * **.circleci** - Fichier de configuration pour CI avec CircleCI. * **.github** - Les fichiers de configuration spécifiques à GitHub, y compris les modèles de problèmes et CODEOWNERS. * **dist** - Dossier temporaire créé par `script/create-dist.py` lors de la création d'une distribution. -* **external_binaries** - Des binaires téléchargés de frameworks tiers qui ne supportent pas la construction avec `gn`. * **node_modules** - Modules de Node tiers utilisés pour les builds. * **npm** - Logique pour l'installation d'Electron via npm. * **out** - Dossier de sortie temporaire de `ninja`. @@ -95,4 +94,3 @@ script/ - L'ensemble de tous les scripts que Electron exécute pour une variét ``` * **typings** - Types TypeScript pour le code interne d'Electron. -* **vendor** - Code source de certaines dépendances tierces. diff --git a/content/fr-FR/docs/tutorial/application-debugging.md b/content/fr-FR/docs/tutorial/application-debugging.md index 172327f72bbb7..5feba36677e1e 100644 --- a/content/fr-FR/docs/tutorial/application-debugging.md +++ b/content/fr-FR/docs/tutorial/application-debugging.md @@ -29,7 +29,7 @@ If the V8 context crashes, the DevTools will display this message. Chromium logs can be enabled via the `ELECTRON_ENABLE_LOGGING` environment variable. For more information, see the [environment variables documentation](../api/environment-variables.md#electron_enable_logging). -Alternatively, the command line argument `--enable-logging` can be passed. More information is available in the [command line switches documentation](../api/command-line-switches.md#--enable-logging). +Alternatively, the command line argument `--enable-logging` can be passed. More information is available in the [command line switches documentation](../api/command-line-switches.md#--enable-loggingfile). [node-inspect]: https://nodejs.org/en/docs/inspector/ [devtools]: https://developer.chrome.com/devtools diff --git a/content/fr-FR/docs/tutorial/code-signing.md b/content/fr-FR/docs/tutorial/code-signing.md index 3d8ec6553a2da..3b5fed10dacb6 100644 --- a/content/fr-FR/docs/tutorial/code-signing.md +++ b/content/fr-FR/docs/tutorial/code-signing.md @@ -22,7 +22,7 @@ Une bonne préparation des applications macOS pour la publication nécessite deu Pour démarrer le processus, assurez-vous que vous remplissez les conditions pour signer et certifier votre application : 1. S'inscrire au [Programme de Développeurs Apple][] (moyennant des frais annuels) -2. Download and install [Xcode][] - this requires a computer running macOS +2. Téléchargez et installez [Xcode][] - cela nécessite un ordinateur exécutant macOS 3. Générer, télécharger et installer [des certificats de signature][] L'écosystème d'Electron donne priorité à la configuration et a la liberté et bien sur donc il y a plusieurs moyens de signer et certifier votre application. @@ -93,7 +93,7 @@ const { systemPreferences } = require('electron') const microphone = systemPreferences.askForMediaAccess('microphone') ``` -Your app may crash. See the Resource Access section in [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime) for more information and entitlements you may need. +Votre application peut planter. See the Resource Access section in [Hardened Runtime](https://developer.apple.com/documentation/security/hardened_runtime) for more information and entitlements you may need. ## `electron-builder` @@ -103,7 +103,7 @@ Electron Builder comes with a custom solution for signing your application. You If you're not using an integrated build pipeline like Forge or Builder, you are likely using [`electron-packager`][], which includes [`electron-osx-sign`][] and [`electron-notarize`][]. -Si vous utilisez l'API de Packager, vous pouvez fournit une [configuration](https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html) qui signera et certifiera votre application. +Si vous utilisez l'API de Packager, vous pouvez fournit une [configuration](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html) qui signera et certifiera votre application. ```js const packager = require('electron-packager') @@ -156,7 +156,6 @@ Vous pouvez obtenir un certificat de signature de code auprès de nombreux reven * [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm) * [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing) -* [GoDaddy](https://au.godaddy.com/web-security/code-signing-certificate) * Et bien d'autres, veuillez comparer pour en trouver un qui correspond à vos besoins, Google est votre ami 😄 Il existe un certain nombre d’outils pour la signature de votre application empaquetée : diff --git a/content/fr-FR/docs/tutorial/dark-mode.md b/content/fr-FR/docs/tutorial/dark-mode.md index 7d31c64b4d13e..1632a5659bfcd 100644 --- a/content/fr-FR/docs/tutorial/dark-mode.md +++ b/content/fr-FR/docs/tutorial/dark-mode.md @@ -18,7 +18,7 @@ If you want to manually switch between light/dark modes, you can do this by sett In macOS 10.14 Mojave, Apple introduced a new [system-wide dark mode][system-wide-dark-mode] for all macOS computers. If your Electron app has a dark mode, you can make it follow the system-wide dark mode setting using [the `nativeTheme` api](../api/native-theme.md). -In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers. In order for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on Catalina, you need to use Electron `>=7.0.0`, or set `NSRequiresAquaSystemAppearance` to `false` in your `Info.plist` file for older versions. Both [Electron Packager][electron-packager] and [Electron Forge][electron-forge] have a [`darwinDarkModeSupport` option][packager-darwindarkmode-api] to automate the `Info.plist` changes during app build time. +In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers. In order for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on Catalina, you need to use Electron `>=7.0.0`, or set `NSRequiresAquaSystemAppearance` to `false` in your `Info.plist` file for older versions. [Electron Packager][electron-packager] et [Electron Forge][electron-forge] ont une option [`darwinDarkModeSupport`][packager-darwindarkmode-api] pour automatiser les infos `Info.plist` modifications pendant la compilation de l'application. If you wish to opt-out while using Electron > 8.0.0, you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file to `true`. Please note that Electron 8.0.0 and above will not let you opt-out of this theming, due to the use of the macOS 10.14 SDK. @@ -56,9 +56,9 @@ Starting with the `index.html` file: ``` -And the `style.css` file: +Et le fichier `styles.css`: -```css title='style.css' +```css title='styles.css' @media (prefers-color-scheme: dark) { body { background: #333; color: white; } } @@ -160,6 +160,6 @@ Run the example using Electron Fiddle and then click the "Toggle Dark Mode" butt [system-wide-dark-mode]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/ [electron-forge]: https://www.electronforge.io/ [electron-packager]: https://github.com/electron/electron-packager -[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport +[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#darwindarkmodesupport [prefers-color-scheme]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme [event-listeners]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener diff --git a/content/fr-FR/docs/tutorial/in-app-purchases.md b/content/fr-FR/docs/tutorial/in-app-purchases.md index 572a521dcfda0..ed932a3bd4672 100644 --- a/content/fr-FR/docs/tutorial/in-app-purchases.md +++ b/content/fr-FR/docs/tutorial/in-app-purchases.md @@ -1,6 +1,6 @@ -# In-App Purchase (macOS) +# Achats avec l'application (macOS) -## Preparing +## Préparation ### Paid Applications Agreement @@ -61,7 +61,7 @@ inAppPurchase.on('transactions-updated', (event, transactions) => { // If the receipt is valid, the product is purchased // ... - // Finish the transaction. + // Terminer la transaction. inAppPurchase.finishTransactionByDate(transaction.transactionDate) break diff --git a/content/fr-FR/docs/tutorial/installation.md b/content/fr-FR/docs/tutorial/installation.md index c6dc7f2334187..8f6f261ff60c8 100644 --- a/content/fr-FR/docs/tutorial/installation.md +++ b/content/fr-FR/docs/tutorial/installation.md @@ -1,4 +1,4 @@ -# Installation +# Instructions d’installation avancées To install prebuilt Electron binaries, use [`npm`][npm]. The preferred method is to install Electron as a development dependency in your app: diff --git a/content/fr-FR/docs/tutorial/launch-app-from-url-in-another-app.md b/content/fr-FR/docs/tutorial/launch-app-from-url-in-another-app.md index 08af5acf05dc4..5b0acb595ac45 100644 --- a/content/fr-FR/docs/tutorial/launch-app-from-url-in-another-app.md +++ b/content/fr-FR/docs/tutorial/launch-app-from-url-in-another-app.md @@ -1,5 +1,5 @@ --- -title: launch-app-from-URL-in-another-app +title: Lancement de votre application Electron depuis une URL dans une autre application description: This guide will take you through the process of setting your electron app as the default handler for a specific protocol. slug: launch-app-from-url-in-another-app hide_title: true @@ -123,31 +123,25 @@ Cette fonctionnalité ne fonctionnera sur macOS que si votre application est emp ### Plist ```XML -

    -

    macOS plist
    -
    
    -    
    -        
    -            
    -                
    -                    CFBundleURLTypes
    -                    
    -                        
    -                            CFBundleURLSchemes
    -                            
    -                                electron-api-demos
    -                            
    -                            CFBundleURLName
    -                            Electron API Demos Protocol
    -                        
    -                    
    -                    ElectronTeamID
    -                    VEKTX9H2N7
    -                
    -            
    -        
    -    
    -

    + + + + + CFBundleURLTypes + + + CFBundleURLSchemes + + electron-api-demos + + CFBundleURLName + Electron API Demos Protocol + + + ElectronTeamID + VEKTX9H2N7 + + ``` ## Conclusion diff --git a/content/fr-FR/docs/tutorial/linux-desktop-actions.md b/content/fr-FR/docs/tutorial/linux-desktop-actions.md index b05408fd2bd02..dae1edfd811a6 100644 --- a/content/fr-FR/docs/tutorial/linux-desktop-actions.md +++ b/content/fr-FR/docs/tutorial/linux-desktop-actions.md @@ -1,4 +1,4 @@ -# Actions personnalisées de lancement du bureau Linux +# Actions du lanceur d'applications sur le bureau (Linux) ## Vue d'ensemble diff --git a/content/fr-FR/docs/tutorial/macos-dock.md b/content/fr-FR/docs/tutorial/macos-dock.md index 081088ad19d60..7429ab8ec8d2d 100644 --- a/content/fr-FR/docs/tutorial/macos-dock.md +++ b/content/fr-FR/docs/tutorial/macos-dock.md @@ -1,4 +1,4 @@ -# Configuring the macOS Dock +# Dock (macOS) Electron a des APIs pour configurer l'icône de l'application dans le macOS Dock. A macOS-only API exists to create a custom dock menu, but Electron also uses the app dock icon as the entry point for cross-platform features like [recent documents][recent-documents] and [application progress][progress-bar]. diff --git a/content/fr-FR/docs/tutorial/notifications.md b/content/fr-FR/docs/tutorial/notifications.md index 7f8f0ab1b69c5..4e708659efd4a 100644 --- a/content/fr-FR/docs/tutorial/notifications.md +++ b/content/fr-FR/docs/tutorial/notifications.md @@ -1,4 +1,4 @@ -# Notifications (Windows, Linux, macOS) +# Notifications ## Vue d'ensemble diff --git a/content/fr-FR/docs/tutorial/progress-bar.md b/content/fr-FR/docs/tutorial/progress-bar.md index 441743f5a0dd3..08f197d879d4b 100644 --- a/content/fr-FR/docs/tutorial/progress-bar.md +++ b/content/fr-FR/docs/tutorial/progress-bar.md @@ -1,4 +1,4 @@ -# Barre de progression dans la barre des tâches (Windows, macOS, Unity) +# Barre de progression de la barre des tâches (Windows & macOS) ## Vue d'ensemble diff --git a/content/fr-FR/docs/tutorial/represented-file.md b/content/fr-FR/docs/tutorial/represented-file.md index d6349d10fe17b..21a18a2f11526 100644 --- a/content/fr-FR/docs/tutorial/represented-file.md +++ b/content/fr-FR/docs/tutorial/represented-file.md @@ -1,4 +1,4 @@ -# Fichier représenté pour BrowserWindows sur macOS +# Représentation des fichiers dans une BrowserWindow (macOS) ## Vue d'ensemble diff --git a/content/fr-FR/docs/tutorial/security.md b/content/fr-FR/docs/tutorial/security.md index e06f7c0793032..6047f8faee4a7 100644 --- a/content/fr-FR/docs/tutorial/security.md +++ b/content/fr-FR/docs/tutorial/security.md @@ -18,11 +18,11 @@ Electron keeps up to date with alternating Chromium releases. For more informati Il est important de se rappeler que la sécurité de votre application Electron dépend de la sécurité globalement de la fondation du framework (*Chromium*, *Node.js*), Electron lui-même, toutes les dépendances NPM et votre code. Ainsi, il est de votre responsabilité de suivre quelques pratiques essentielles de test : -* **Gardez votre application à jour avec la dernière version de framework Electron. /0> Lorsque vous libérez votre produit, vous expédiez également un paquet composé d'Electron, bibliothèque partagée Chromium et Node.js. Les vulnérabilités affectant ces composants peuvent affecter la sécurité de votre application. En mettant à jour Electron vers la dernière version vous vous assurez que les vulnérabilités critiques (telles que *nodeIntegration bypasses*) sont déjà corrigées et ne peuvent pas être exploitées dans votre application. Pour plus d'informations, voir "[Utiliser une version actuelle d'Electron](#15-use-a-current-version-of-electron)".

    +* **Gardez votre application à jour avec la dernière version de framework Electron. ** Lorsque vous libérez votre produit, vous expédiez également un paquet composé d'Electron, bibliothèque partagée Chromium et Node.js. Les vulnérabilités affectant ces composants peuvent affecter la sécurité de votre application. En mettant à jour Electron vers la dernière version vous vous assurez que les vulnérabilités critiques (telles que *nodeIntegration bypasses*) sont déjà corrigées et ne peuvent pas être exploitées dans votre application. Pour plus d'informations, voir "[Utiliser une version actuelle d'Electron](#16-use-a-current-version-of-electron)". * **Évaluez vos dépendances.** Alors que NPM fournit un demi-million de paquets réutilisables, il est de votre responsabilité de choisir des bibliothèques de tiers de confiance. Si vous utilisez des bibliothèques obsolètes affectées par des vulnérabilités connues ou si vous êtes dépendants d'un code mal géré, la sécurité de votre application pourrait être compromise. -* **Adoptez des pratiques de codage sécurisées.** La première ligne de défense pour votre application est votre propre code. Des vulnérabilités web courantes, telles que le cross-site scripting (XSS), ont un impact de sécurité plus élevé sur les applications Electron, c'est pourquoi il est fortement recommandé d'adopter des meilleures pratiques de développement de logiciel sécurisé et d'effectuer des tests de sécurité. +* **Adoptez des pratiques de codage sécurisées.** La première ligne de défense pour votre application est votre propre code. Des vulnérabilités web courantes, telles que le cross-site scripting (XSS), ont un impact de sécurité plus élevé sur les applications Electron, c'est pourquoi il est fortement recommandé d'adopter des meilleures pratiques de développement de logiciel sécurisé et d'effectuer des tests de sécurité. ## Isolation pour les contenus non approuvés @@ -43,18 +43,19 @@ Vous devriez au moins suivre ces étapes pour améliorer la sécurité de votre 1. [Charger uniquement du contenu sécurisé](#1-only-load-secure-content) 2. [Désactiver l'intégration de Node.js dans tous les moteurs de rendu qui affichent du contenu distant](#2-do-not-enable-nodejs-integration-for-remote-content) 3. [Activer l'isolement du contexte dans tous les moteurs de rendu qui affichent le contenu distant](#3-enable-context-isolation-for-remote-content) -4. [Utiliser `ses.setPermissionRequestHandler()` dans toutes les sessions qui se chargent de contenu distant](#4-handle-session-permission-requests-from-remote-content) -5. [Ne pas désactiver `webSecurity`](#5-do-not-disable-websecurity) -6. [Définissez une `Content-Security-Policy`](#6-define-a-content-security-policy) et utilisez des règles restrictives (c.-à-d. `script-src 'self'`) -7. [Ne pas définir `allowRunningInsecureContent` à `true`](#7-do-not-set-allowrunninginsecurecontent-to-true) -8. [Ne pas activer les fonctionnalités expérimentales](#8-do-not-enable-experimental-features) -9. [Ne pas utiliser `enableBlinkFeatures`](#9-do-not-use-enableblinkfeatures) -10. [`` : N'utilisez pas `allowpopups`](#10-do-not-use-allowpopups) -11. [``: Vérifier les options et les paramètres](#11-verify-webview-options-before-creation) -12. [Désactiver ou limiter la navigation](#12-disable-or-limit-navigation) -13. [Désactiver ou limiter la création de nouvelles fenêtres](#13-disable-or-limit-creation-of-new-windows) -14. [Ne pas utiliser `openExternal` avec un contenu non fiable](#14-do-not-use-openexternal-with-untrusted-content) -15. [Utiliser une version actuelle d'Electron](#15-use-a-current-version-of-electron) +4. [Activer le bac à sable](#4-enable-sandboxing) +5. [Utiliser `ses.setPermissionRequestHandler()` dans toutes les sessions qui se chargent de contenu distant](#5-handle-session-permission-requests-from-remote-content) +6. [Ne pas désactiver `webSecurity`](#6-do-not-disable-websecurity) +7. [Définissez une `Content-Security-Policy`](#7-define-a-content-security-policy) et utilisez des règles restrictives (c.-à-d. `script-src 'self'`) +8. [Ne pas définir `allowRunningInsecureContent` à `true`](#8-do-not-set-allowrunninginsecurecontent-to-true) +9. [Ne pas activer les fonctionnalités expérimentales](#9-do-not-enable-experimental-features) +10. [Ne pas utiliser `enableBlinkFeatures`](#10-do-not-use-enableblinkfeatures) +11. [`` : N'utilisez pas `allowpopups`](#11-do-not-use-allowpopups) +12. [``: Vérifier les options et les paramètres](#12-verify-webview-options-before-creation) +13. [Désactiver ou limiter la navigation](#13-disable-or-limit-navigation) +14. [Désactiver ou limiter la création de nouvelles fenêtres](#14-disable-or-limit-creation-of-new-windows) +15. [Ne pas utiliser `openExternal` avec un contenu non fiable](#15-do-not-use-openexternal-with-untrusted-content) +16. [Utiliser une version actuelle d'Electron](#16-use-a-current-version-of-electron) Pour automatiser la détection de mauvaises configurations et de patrons non sécurisés, il est possible d'utiliser [electronegativity](https://github.com/doyensec/electronegativity). Pour plus de détails sur les faiblesses potentielles et les bogues d'implémentation lorsque développant des applications utilisant Electron, veuillez vous référer à ce [guide pour développeurs et auditeurs](https://doyensec.com/resources/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf) @@ -154,11 +155,27 @@ L'électron utilise la même technologie que le chrome [Content Scripts](https:/ Même lorsque `nodeIntegration: false` est utilisé, pour vraiment appliquer une isolation forte et empêcher l'utilisation de Node primitives `contextIsolation` **doivent** également être utilisées. -### Why & How? +### Pourquoi & Comment ? For more information on what `contextIsolation` is and how to enable it please see our dedicated [Context Isolation](context-isolation.md) document. -## 4) Gérer les demandes d'autorisation de session à partir du contenu distant +## Activer le bac à sable + +[Sandboxing](sandbox.md) est une fonctionnalité de Chromium qui utilise le système d’exploitation pour limiter considérablement ce à quoi les processus de rendu ont accès. Vous devez activer le bac à sable dans tous les moteurs de rendu. Charger, lire ou traiter tout contenu non fiable dans un processus non protégé par le bac à sable, y compris le processus principal, n'est pas conseillé. + +### Comment ? + +Lors de la création d'une fenêtre, passez l'option `sandbox : true` dans `webPreferences`: + +```js +const win = new BrowserWindow({ + webPreferences: { + sandbox: true + } +}) +``` + +## 5) Gérer les demandes d'autorisation de session à partir du contenu distant Vous avez peut-être vu des demandes d'autorisation lors de l'utilisation de Chrome : elles apparaissent chaque fois que le site Web tente d'utiliser une fonctionnalité que l'utilisateur doit approuver manuellement ( comme les notifications). @@ -191,11 +208,11 @@ session }) ``` -## 5) Ne pas désactiver WebSecurity +## 6) Ne pas désactiver WebSecurity _Cette recommandation est appliquée par défaut sur Electron_ -Vous avez peut-être déjà deviné que la désactivation de la propriété `webSecurity` sur un processus de rendu ([`BrowserWindow`][browser-window], [`BrowserView`][browser-view], ou [``][webview-tag]<4>
    ) désactive les fonctionnalités de sécurité cruciales . +Vous avez peut-être déjà deviné que la désactivation de la propriété `webSecurity` sur un processus de rendu ([`BrowserWindow`][browser-window], [`BrowserView`][browser-view], ou [``][webview-tag]) désactive les fonctionnalités de sécurité cruciales. . Ne pas désactiver `webSecurity` dans les applications de production. @@ -227,7 +244,7 @@ const mainWindow = new BrowserWindow() ``` -## 6) Définir une politique de sécurité de contenu +## 7) Définir une politique de sécurité de contenu Une politique de sécurité de contenu (CSP) est une couche supplémentaire de protection contre des attaques cross-site-scripting et des attaques d'injection de données. Nous recommandons qu'ils soient activés par n'importe quel site Web que vous chargez dans Electron. @@ -270,7 +287,7 @@ Le mécanisme de livraison préféré de CSP est un en-tête HTTP, cependant il ``` -## 7) Ne pas définir `allowRunningInsecureContent` à `true` +## 8) Ne pas définir `allowRunningInsecureContent` à `true` _Cette recommandation est appliquée par défaut sur Electron_ @@ -298,7 +315,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 8) N'autorisez pas de fonctionnalités expérimentales +## 9) N'autorisez pas de fonctionnalités expérimentales _Cette recommandation est appliquée par défaut sur Electron_ @@ -326,7 +343,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 9) N'utilisez pas `enableBlinkFeatures` +## 10) N'utilisez pas `enableBlinkFeatures` _Cette recommandation est appliquée par défaut sur Electron_ @@ -352,11 +369,11 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow() ``` -## 10) Ne pas utiliser `allowpopups` +## 11) Ne pas utiliser `allowpopups` _Cette recommandation est appliquée par défaut sur Electron_ -Si vous utilisez [``][webview-tag]``, vous aurez peut-être besoin des pages et des scripts chargés dans votre balise <2> pour ouvrir de nouvelles fenêtres. L'attribut `allowpopups` leur permet de créer un nouveau [`BrowserWindows`][browser-window] en utilisant la méthode `window.open()`. Les balises `` ne sont pas autorisées à créer de nouvelles fenêtres . +Si vous utilisez [``][webview-tag], vous aurez peut-être besoin des pages et des scripts chargés dans votre balise `` pour ouvrir de nouvelles fenêtres. L'attribut `allowpopups` leur permet de créer un nouveau [`BrowserWindows`][browser-window] en utilisant la méthode `window.open()`. Les balises `` ne sont pas autorisées à créer de nouvelles fenêtres . ### Pourquoi ? @@ -372,7 +389,7 @@ Si vous n'avez pas besoin de popups, il vaut mieux ne pas autoriser la création ``` -## 11) Vérifiez les options de WebView avant la création +## 12) Vérifiez les options de WebView avant la création Un WebView créé dans un processus de rendu qui n'a pas d'intégration Node.js activé ne sera pas en mesure d'activer l'intégration elle-même. Cependant, un WebView créera toujours un processus de rendu indépendant avec ses propres `webPreferences`. @@ -410,7 +427,7 @@ app.on('web-contents-created', (event, contents) => { Again, this list merely minimizes the risk, it does not remove it. If your goal is to display a website, a browser will be a more secure option. -## 12) Désactiver ou limiter la navigation +## 13) Désactiver ou limiter la navigation Si votre application n'a pas besoin de naviguer ou a seulement besoin de naviguer vers des pages connues, c'est une bonne idée de limiter la navigation directement à cette portée connue, interdire tout autre type de navigation. @@ -440,7 +457,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 13) Désactiver ou limiter la création de nouvelles fenêtres +## 14) Désactiver ou limiter la création de nouvelles fenêtres Si vous avez un ensemble connu de fenêtres, il est bon de limiter la création de fenêtres supplémentaires dans votre application. @@ -475,7 +492,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 14) N'utilisez pas `openExternal` avec du contenu non fiable +## 15) N'utilisez pas `openExternal` avec du contenu non fiable Le [`openExternal`][open-external] de Shell permet d'ouvrir un URI de protocole donné avec les utilitaires natifs du bureau. Sur macOS, par exemple, cette fonction est similaire à l'utilitaire de commande terminal `open` et ouvrira l'application spécifique basée sur l'URI et l'association de type fichier. @@ -497,7 +514,7 @@ const { shell } = require('electron') shell.openExternal('https://example.com/index.html') ``` -## 15) Utiliser une version actuelle d'Electron +## 16) Utiliser une version actuelle d'Electron Vous devriez toujours vous efforcer d'utiliser la dernière version disponible d'Electron. Chaque fois qu'une nouvelle version majeure est publiée, vous devriez essayer de mettre à jour votre application le plus rapidement possible. diff --git a/content/fr-FR/docs/tutorial/snapcraft.md b/content/fr-FR/docs/tutorial/snapcraft.md index 9c7276371fc89..cc31ee72c80e9 100644 --- a/content/fr-FR/docs/tutorial/snapcraft.md +++ b/content/fr-FR/docs/tutorial/snapcraft.md @@ -1,4 +1,4 @@ -# Snapcraft Guide (Ubuntu Software Center & More) +# Guide Snapcraft (Linux) Ce guide fournit des informations sur comment empaqueter votre application Electron pour n’importe quel environnement Snapcraft, y compris l’Ubuntu Software Center. diff --git a/content/fr-FR/docs/tutorial/support.md b/content/fr-FR/docs/tutorial/support.md index 32c5ce3cc52e9..fde22a8c2617f 100644 --- a/content/fr-FR/docs/tutorial/support.md +++ b/content/fr-FR/docs/tutorial/support.md @@ -41,9 +41,9 @@ When an API is changed or removed in a way that breaks existing functionality, t ### Currently supported versions +* 14.x.y * 13.x.y * 12.x.y -* 11.x.y ### End-of-life diff --git a/content/fr-FR/docs/tutorial/updates.md b/content/fr-FR/docs/tutorial/updates.md index 8fcbe437a0f29..377866efdcff3 100644 --- a/content/fr-FR/docs/tutorial/updates.md +++ b/content/fr-FR/docs/tutorial/updates.md @@ -35,14 +35,14 @@ Si vous développez une application Electron privée, ou si vous ne publiez pas Selon vos besoins, vous pouvez choisir parmi l'un d'entre eux : -- [Hazel][hazel] – Serveur de mise à jour pour des applications privées ou open-source qui peuvent être déployées gratuitement sur [Now][now]. Cela récupère les [releases GitHub][gh-releases] et exploite la puissance du CDN de GitHub. +- [Hazel][hazel] - Serveur de mise à jour pour les applications privées ou open source qui peuvent être déployées gratuitement sur [Vercel][vercel]. Cela récupère les [releases GitHub][gh-releases] et exploite la puissance du CDN de GitHub. - [Nuts][nuts] – Utilise aussi les [releases GitHub][gh-releases], mais met en cache les mises à jour des applications sur le disque et prend en charge les dépôts privés. - [electron-release-server][electron-release-server] – Fournit un tableau de bord pour la gestion des releases et n'exige pas que les releases soient créés sur GitHub. - [Nucleus][nucleus] – Un serveur de mise à jour complet pour les applications Electron maintenues par Atlassian. Prend en charge plusieurs applications et canaux; utilise un magasin de fichiers statique pour minimiser le coût du serveur. ## Implémentation des mises à jour dans votre application -Une fois que vous avez déployé votre serveur de mise à jour, continuez d'importer les modules requis dans votre code. Le code suivant peut varier pour les différents serveurs, mais il fonctionne comme décrit lors de l'utilisation de [Hazel](https://github.com/zeit/hazel). +Une fois que vous avez déployé votre serveur de mise à jour, continuez d'importer les modules requis dans votre code. Le code suivant peut varier pour les différents serveurs, mais il fonctionne comme décrit lors de l'utilisation de [Hazel][hazel]. **Important :** Veuillez vous assurer que le code ci-dessous sera exécuté uniquement dans votre application empaquetée, et non dans la version en développement. Vous pouvez utiliser [electron-is-dev](https://github.com/sindresorhus/electron-is-dev) pour vérifier l'environnement. @@ -102,8 +102,8 @@ autoUpdater.on('error', message => { Because the requests made by Auto Update aren't under your direct control, you may find situations that are difficult to handle (such as if the update server is behind authentication). The `url` field does support files, which means that with some effort, you can sidestep the server-communication aspect of the process. [Here's an example of how this could work](https://github.com/electron/electron/issues/5020#issuecomment-477636990). -[now]: https://zeit.co/now -[hazel]: https://github.com/zeit/hazel +[vercel]: https://vercel.com +[hazel]: https://github.com/vercel/hazel [nuts]: https://github.com/GitbookIO/nuts [gh-releases]: https://help.github.com/articles/creating-releases/ [electron-release-server]: https://github.com/ArekSredzki/electron-release-server diff --git a/content/fr-FR/docs/tutorial/using-native-node-modules.md b/content/fr-FR/docs/tutorial/using-native-node-modules.md index 8a9ba80415802..cb2e55def7ec3 100644 --- a/content/fr-FR/docs/tutorial/using-native-node-modules.md +++ b/content/fr-FR/docs/tutorial/using-native-node-modules.md @@ -1,4 +1,4 @@ -# Utiliser Modules Natifs de Node +# Modules natifs de Node Native Node.js modules are supported by Electron, but since Electron has a different [application binary interface (ABI)][abi] from a given Node.js binary (due to differences such as using Chromium's BoringSSL instead of OpenSSL), the native modules you use will need to be recompiled for Electron. Sinon, vous obtiendrez l'erreur de classe suivante lorsque vous essaierez d'exécuter votre application : @@ -75,7 +75,7 @@ HOME=~/.electron-gyp node-gyp rebuild --target=1.2.3 --arch=x64 --dist-url=https Pour compiler des modules Node natifs avec une compilation personnalisée d'Electron qui ne correspond pas à une release publique, utilisez la commande `npm` pour utiliser la version de Node que vous avez empaquetée avec votre compilation personnalisée. ```sh -npm rebuild --nodedir=/path/to/electron/vendor/node +npm rebuild --nodedir=/path/to/src/out/Default/gen/node_headers ``` ## Résolution de problème diff --git a/content/fr-FR/docs/tutorial/using-pepper-flash-plugin.md b/content/fr-FR/docs/tutorial/using-pepper-flash-plugin.md index a15fe698f4ad8..a4094a8d9fc63 100644 --- a/content/fr-FR/docs/tutorial/using-pepper-flash-plugin.md +++ b/content/fr-FR/docs/tutorial/using-pepper-flash-plugin.md @@ -1,4 +1,4 @@ -# Utilisation du plugin Pepper Flash +# Plugin Pepper Flash Electron no longer supports the Pepper Flash plugin, as Chrome has removed support. diff --git a/content/fr-FR/docs/tutorial/using-selenium-and-webdriver.md b/content/fr-FR/docs/tutorial/using-selenium-and-webdriver.md index c58bd90e8bb12..b28ad91dfc6ca 100644 --- a/content/fr-FR/docs/tutorial/using-selenium-and-webdriver.md +++ b/content/fr-FR/docs/tutorial/using-selenium-and-webdriver.md @@ -1,4 +1,4 @@ -# Utilisation de Selenium et WebDriver +# Selenium et WebDriver De [ChromeDriver - WebDriver pour Chrome][chrome-driver] : diff --git a/content/fr-FR/docs/tutorial/web-embeds.md b/content/fr-FR/docs/tutorial/web-embeds.md index d879fbe7db40e..587cb30b28373 100644 --- a/content/fr-FR/docs/tutorial/web-embeds.md +++ b/content/fr-FR/docs/tutorial/web-embeds.md @@ -1,4 +1,4 @@ -# Intégration de contenu web +# Intégrations Web ## Vue d'ensemble diff --git a/content/fr-FR/docs/tutorial/windows-arm.md b/content/fr-FR/docs/tutorial/windows-arm.md index 170e315c5229c..7258760a4c53b 100644 --- a/content/fr-FR/docs/tutorial/windows-arm.md +++ b/content/fr-FR/docs/tutorial/windows-arm.md @@ -1,4 +1,4 @@ -# Windows 10 sur Arm +# Windows sur ARM If your app runs with Electron 6.0.8 or later, you can now build it for Windows 10 on Arm. This considerably improves performance, but requires recompilation of any native modules used in your app. It may also require small fixups to your build and packaging scripts. diff --git a/content/fr-FR/docs/tutorial/windows-taskbar.md b/content/fr-FR/docs/tutorial/windows-taskbar.md index 4b07e448e570b..6b6902a496216 100644 --- a/content/fr-FR/docs/tutorial/windows-taskbar.md +++ b/content/fr-FR/docs/tutorial/windows-taskbar.md @@ -1,4 +1,4 @@ -# Barre des tâches Windows +# Personnalisation de la barre des tâches (Windows) ## Vue d'ensemble diff --git a/content/fr-FR/website/blog/webview2.md b/content/fr-FR/website/blog/webview2.md new file mode 100644 index 0000000000000..fcd4af257268d --- /dev/null +++ b/content/fr-FR/website/blog/webview2.md @@ -0,0 +1,81 @@ +--- +title: WebView2 et Electron +author: + - electron +date: '2021-07-22' +--- + +Au cours des dernières semaines, nous avons reçu plusieurs questions sur les différences entre la nouvelle [WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) et Electron. + +Les deux équipes ont pour but de transposer la technologie du web pour les application de Bureau de la meilleure façon possible et une comparaison faite en commun est en cours de discussion. + +Electron et WebView2 sont des projets en évolution rapide et constante. Nous avons rassemblé un bref aperçu des similitudes et des différences entre Electron et WebView2 telles qu’elles existent aujourd’hui. + +--- + +## Vue d’ensemble de l’architecture + +Electron et WebView2 sont tous deux issus des source de Chromium pour le rendu du contenu Web. À proprement parler, WebView2 est généré à partir des sources de Edge, mais Edge est construit à l’aide d’un fork de Chromium. Electron ne partage aucune DLL avec Chrome. Les fichiers binaires WebView2 sont liés fortement à Edge (canal stable à compter d’Edge 90), et partagent certains éléments. Voir [le mode de distribution Evergreen](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#evergreen-distribution-mode) pour plus d'informations. + +Les applications Electron regroupent et distribuent toujours la version exacte d’Electron avec laquelle elles ont été développées. WebView2 a deux options pour la distribution. Vous pouvez soit empaqueter la même bibliothèque WebView2 utilisée pour le développement de votre application, soit utiliser une version partagée du runtime pouvant être déjà présente sur le système. WebView2 fournit des outils pour chaque approche, y compris un programme d’installation d’amorçage au cas où le runtime partagé serait manquant. WebView2 est inclus dans Windows 11. + +Les applications qui incluent des frameworks sont responsables de leur mise à jour et ce même pour les versions mineures de sécurité. Pour les applications utilisant le runtime partagé WebView2, WebView2 possède son propre programme de mise à jour, similaire à Chrome ou Edge, qui s’exécute indépendamment de votre application. La mise à jour du code de l’application ou de l’une de ses dépendances est toujours une responsabilité du développeur, comme avec Electron. Electron et WebView2 ne sont pas gérés par Windows Update. + +Electron et WebView2 héritent tous deux de l’architecture multi-processus de Chromium - à savoir, un processus principal unique qui communique avec un ou plusieurs processus de rendu. Ces processus sont entièrement séparés des autres applications exécutées sur le système. Chaque application Electron est une arborescence de processus séparée qui contient un processus de navigation racine, des processus utilitaires et éventuellement d'autres processus de rendu. Les applications WebView2 qui utilisent le même [dossier de données utilisateur](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder) (comme le ferait une suite d’applications), partagent les processus qui ne concernent pas le rendu. Les applications WebView2 utilisant différents dossiers de données ne partagent pas de processus. + +* Modèle des processus d'Electron: + + ![Modèle des processus d'Electron](/images/Electron-Architecture.png) +* Modèle de processus des applications basées sur WebView2 : + + ![Schéma du modèle du processus WebView2](/images/WebView2-Architecture.png) + +Pour en savoir plus sur le modèle de processus de [WebView2,](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/process-model) et sur le modèle de processus d' [Electron,](https://www.electronjs.org/docs/tutorial/process-model) cliquez ici. + +Electron fournit des API pour les besoins courants des applications de bureau telles que les menus, l'accès au système de fichiers, les notifications et plus encore. WebView2 est un composant destiné à être intégré dans un framework d'application tel que WinForms, WPF, WinUI ou Win32. WebView2 ne fournit pas d'API vers le système d'exploitation en dehors de la norme web via JavaScript. + +Node.js est intégré dans Electron. Les applications Electron peuvent utiliser n'importe quelle API Node.js, module ou node-native-addon depuis le moteur de rendu et les processus principaux. Une application WebView2 ne suppose pas dans quel langage ou infrastructure le reste de votre application est écrit. Votre code JavaScript doit transmettre par proxy tout accès au système d’exploitation via le processus application-hôte. + +Electron s'efforce de maintenir la compatibilité avec l'API web, y compris les API développées à partir du [Projet Fugu](https://fugu-tracker.web.app/). Nous avons un aperçu [de la compatibilité de l’API Fugu d’Electron](https://docs.google.com/spreadsheets/d/1APQalp8HCa-lXVOqyul369G-wjM2RcojMujgi67YaoE/edit?usp=sharing). WebView2 maintient une liste similaire de [différences d'API par rapport à Edge](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/browser-features). + +Electron a un modèle de sécurité configurable pour le contenu web, de l'accès complet au bac à sable. Le contenu WebView2 est toujours en bac à sable. Electron a [une documentation de sécurité complète](https://www.electronjs.org/docs/tutorial/security) sur le choix de votre modèle de sécurité. WebView2 dispose également de : [les meilleures pratiques de sécurité](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/security). + +Les sources d'Electron sont maintenues et disponibles sur GitHub. Les applications peuvent modifier et leurs propres _version_ d'Electron. Les sources de WebView2 ne sont pas disponibles sur GitHub. + +Résumé rapide: + +| | Electron | WebView2 | +| --------------------------------------- | ---------------:| --------------------------:| +| Installation des dépendances | Chromium | Edge | +| Source disponible sur GitHub | Oui | Non | +| Partage des DLL Edge/Chrome | Non | Oui (à compter de Edge 90) | +| Runtime partagé entre applications | Non | Facultatif | +| API d’application | Oui | Non | +| Node.js | Oui | Non | +| Mode bac à sable | Facultatif | Toujours | +| Nécessite un Framework d'application | Non | Oui | +| Plateformes supportées | Mac, Win, Linux | Win (Mac/Linux prévu) | +| Partage de processus entre applications | Jamais | Facultatif | +| Mises à jour du framework gérées par | Application | WebView2 | + +## Discussion sur les performances + +En ce qui concerne le rendu de votre contenu web, nous nous attendons à peu de différence de performance entre Electron, WebView2 et tout autre moteur de rendu basé sur Chromium. Nous avons créé [ossatures d'applications construites à l'aide d'Electron, C++ + WebView2, et C# + WebView2](https://github.com/crossplatform-dev/xplat-challenges) pour les personnes intéressées à étudier les différences potentielles de performance. + +Il y a quelques différences qui entrent en jeu _en dehors_ du rendu de contenu web, et les gens d'Electron, WebView2, Edge, et d'autres personnes ont exprimé leur intérêt à travailler sur une comparaison détaillée, y compris les PWAs. + +### La communication inter-processus(IPC) + +_Nous voulons mettre en évidence immédiatement une différence , car nous pensons qu'il s'agit souvent d'une considération de performance dans les applications Electron._ + +Dans Chromium, le processus du navigateur agit comme un courtier de IPC entre les moteurs de rendu en bac à sable et le reste du système. Tandis qu'Electron autorise les processus de rendu sans bac à sable (sandbox), de nombreuses applications choisissent d'activer le sandbox pour plus de sécurité. WebView2 a toujours le sandbox activé, donc pour la plupart des applications Electron et WebView2 les IPC peut affecter les performances globales. + +Même si Electron et WebView2 ont des modèles de processus similaires, les IPC sous-jacents diffèrent. La communication entre JavaScript et C++ ou C# nécessite [marshalling](https://en.wikipedia.org/wiki/Marshalling_(computer_science)), le plus souvent vers une chaîne JSON. La sérialisation/parsing JSON est une opération coûteuse, et les goulots d’étranglement IPC peuvent avoir un impact négatif sur les performances. À partir de Edge 93, WV2 utilisera [CBOR](https://en.wikipedia.org/wiki/CBOR) pour les événements du réseau. + +Electron prend en charge les IPC directement entre deux processus via l'API [MessagePorts](https://www.electronjs.org/docs/latest/tutorial/message-ports) , qui utilise [l'algorithme de clonage structuré](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). Les applications qui tirent parti de cela peuvent éviter de payer le tribut de la sérialisation JSON lors de l'envoi d'objets entre processus. + +## Summary + +Electron et WebView2 ont un certain nombre de différences, mais ne vous attendez pas à une grande différence par rapport à la façon dont ils effectuent le rendu du contenu web. En définitive, l'architecture d'une application et ses bibliothèques / frameworks JavaScript ont un impact plus important sur la mémoire et les performances que tout autre parce que _Chromium est Chromium_ peu importe où il fonctionne. + +Remerciements spéciaux à l'équipe WebView2 pour avoir examiné ce post, et s'assurer que nous avons une vue actualisée de l'architecture WebView2. Ils sont heureux de recevoir tout [commentaire sur le projet](https://github.com/MicrosoftEdge/WebView2Feedback). diff --git a/content/fr-FR/website/i18n/code.json b/content/fr-FR/website/i18n/code.json index 8291b10512852..864be1635a0ff 100644 --- a/content/fr-FR/website/i18n/code.json +++ b/content/fr-FR/website/i18n/code.json @@ -1,6 +1,6 @@ { "theme.NotFound.title": { - "message": "Page Not Found", + "message": "Page non trouvée", "description": "The title of the 404 page" }, "theme.NotFound.p1": { @@ -12,7 +12,7 @@ "description": "The 2nd paragraph of the 404 page" }, "theme.AnnouncementBar.closeButtonAriaLabel": { - "message": "Close", + "message": "Fermer", "description": "The ARIA label for close button of announcement bar" }, "theme.blog.paginator.navAriaLabel": { @@ -51,14 +51,14 @@ "message": "Older Post", "description": "The blog post button label to navigate to the older/next post" }, - "theme.blog.sidebar.navAriaLabel": { - "message": "Blog recent posts navigation", - "description": "The ARIA label for recent posts in the blog sidebar" - }, "theme.tags.tagsPageTitle": { "message": "Tags", "description": "The title of the tag list page" }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Blog recent posts navigation", + "description": "The ARIA label for recent posts in the blog sidebar" + }, "theme.blog.post.plurals": { "message": "One post|{count} posts", "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" @@ -76,11 +76,11 @@ "description": "The ARIA label for copy code blocks button" }, "theme.CodeBlock.copied": { - "message": "Copied", + "message": "Copié", "description": "The copied button label on code blocks" }, "theme.CodeBlock.copy": { - "message": "Copy", + "message": "Copier", "description": "The copy button label on code blocks" }, "theme.docs.sidebar.expandButtonTitle": { @@ -96,11 +96,11 @@ "description": "The ARIA label for the docs pagination" }, "theme.docs.paginator.previous": { - "message": "Previous", + "message": "Précédent", "description": "The label used to navigate to the previous doc" }, "theme.docs.paginator.next": { - "message": "Next", + "message": "Suivant", "description": "The label used to navigate to the next doc" }, "theme.docs.sidebar.collapseButtonTitle": { @@ -111,18 +111,6 @@ "message": "Collapse sidebar", "description": "The title attribute for collapse button of doc sidebar" }, - "theme.docs.sidebar.responsiveCloseButtonLabel": { - "message": "Close menu", - "description": "The ARIA label for close button of mobile doc sidebar" - }, - "theme.docs.sidebar.responsiveOpenButtonLabel": { - "message": "Open menu", - "description": "The ARIA label for open button of mobile doc sidebar" - }, - "theme.docs.sidebar.navAriaLabel": { - "message": "Sidebar navigation", - "description": "The ARIA label for documentation menu" - }, "theme.docs.versions.unreleasedVersionLabel": { "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", "description": "The label used to tell the user that he's browsing an unreleased doc version" @@ -133,10 +121,10 @@ }, "theme.docs.versions.latestVersionSuggestionLabel": { "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", - "description": "The label userd to tell the user that he's browsing an unmaintained doc version" + "description": "The label used to tell the user to check the latest version" }, "theme.docs.versions.latestVersionLinkLabel": { - "message": "latest version", + "message": "dernière version", "description": "The label used for the latest version suggestion link label" }, "theme.common.editThisPage": { @@ -148,21 +136,29 @@ "description": "Title for link to heading" }, "theme.lastUpdated.atDate": { - "message": " on {date}", + "message": " le {date}", "description": "The words used to describe on which date a page has been last updated" }, "theme.lastUpdated.byUser": { - "message": " by {user}", + "message": " par {user}", "description": "The words used to describe by who the page has been last updated" }, "theme.lastUpdated.lastUpdatedAtBy": { "message": "Last updated{atDate}{byUser}", "description": "The sentence used to display when a page has been last updated, and by who" }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Retour au menu principal", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, "theme.common.skipToMainContent": { "message": "Skip to main content", "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "Sur cette page", + "description": "The label used by the button on the collapsible TOC component" + }, "theme.SearchPage.documentsFound.plurals": { "message": "One document found|{count} documents found", "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" @@ -180,7 +176,7 @@ "description": "The placeholder for search page input" }, "theme.SearchPage.inputLabel": { - "message": "Search", + "message": "Rechercher", "description": "The ARIA label for search page input" }, "theme.SearchPage.algoliaLabel": { @@ -196,7 +192,7 @@ "description": "The paragraph for fetching new search results" }, "theme.SearchBar.label": { - "message": "Search", + "message": "Rechercher", "description": "The ARIA label and placeholder for search button" } } \ No newline at end of file diff --git a/content/fr-FR/website/i18n/docusaurus-plugin-content-blog/options.json b/content/fr-FR/website/i18n/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000000..94a4ebed2d7a2 --- /dev/null +++ b/content/fr-FR/website/i18n/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Electron's blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Keep up to date with what's going on with the Electron project", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Latest posts", + "description": "The label for the left sidebar" + } +} \ No newline at end of file diff --git a/content/fr-FR/website/i18n/docusaurus-theme-classic/footer.json b/content/fr-FR/website/i18n/docusaurus-theme-classic/footer.json index 8b26237397c6f..19001fdd483e8 100644 --- a/content/fr-FR/website/i18n/docusaurus-theme-classic/footer.json +++ b/content/fr-FR/website/i18n/docusaurus-theme-classic/footer.json @@ -1,10 +1,14 @@ { "link.title.Docs": { - "message": "Docs", + "message": "Documentation", "description": "The title of the footer links column with title=Docs in the footer" }, + "link.title.Checklists": { + "message": "Listes de vérifications", + "description": "The title of the footer links column with title=Checklists in the footer" + }, "link.title.Community": { - "message": "Community", + "message": "Communauté", "description": "The title of the footer links column with title=Community in the footer" }, "link.title.More": { @@ -13,11 +17,19 @@ }, "link.item.label.Getting Started": { "message": "Getting Started", - "description": "The label of footer link with label=Getting Started linking to /" + "description": "The label of footer link with label=Getting Started linking to /docs/latest/" }, - "link.item.label.Stack Overflow": { - "message": "Stack Overflow", - "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + "link.item.label.API Reference": { + "message": "Référence des APIs", + "description": "The label of footer link with label=API Reference linking to /docs/latest/api/app" + }, + "link.item.label.Performance": { + "message": "Performance", + "description": "The label of footer link with label=Performance linking to /docs/latest/tutorial/performance" + }, + "link.item.label.Security": { + "message": "Sécurité", + "description": "The label of footer link with label=Security linking to /docs/latest/tutorial/security" }, "link.item.label.Discord": { "message": "Discord", @@ -27,12 +39,20 @@ "message": "Twitter", "description": "The label of footer link with label=Twitter linking to https://twitter.com/electronjs" }, + "link.item.label.Stack Overflow": { + "message": "Stack Overflow", + "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + }, "link.item.label.GitHub": { "message": "GitHub", "description": "The label of footer link with label=GitHub linking to https://github.com/electron/electron" }, + "link.item.label.Open Collective": { + "message": "Open Collective", + "description": "The label of footer link with label=Open Collective linking to https://opencollective.com/electron" + }, "copyright": { - "message": "Copyright © 2021 My Project, Inc. Built with Docusaurus.", + "message": "Copyright © 2021 OpenJS Foundation et les contributeurs Electron.", "description": "The footer copyright" } } \ No newline at end of file diff --git a/content/fr-FR/website/i18n/docusaurus-theme-classic/navbar.json b/content/fr-FR/website/i18n/docusaurus-theme-classic/navbar.json index d8a8da1e22d1e..db03bc019e4d8 100644 --- a/content/fr-FR/website/i18n/docusaurus-theme-classic/navbar.json +++ b/content/fr-FR/website/i18n/docusaurus-theme-classic/navbar.json @@ -4,7 +4,7 @@ "description": "The title in the navbar" }, "item.label.Docs": { - "message": "Docs", + "message": "Documentation", "description": "Navbar item with label Docs" }, "item.label.API": { @@ -15,6 +15,10 @@ "message": "Exemples", "description": "Navbar item with label Examples" }, + "item.label.Blog": { + "message": "Blog", + "description": "Navbar item with label Blog" + }, "item.label.GitHub": { "message": "GitHub", "description": "Navbar item with label GitHub" diff --git a/content/fr-FR/website/locale.yml b/content/fr-FR/website/locale.yml index 7afb0eb1dc87f..70809f9630186 100644 --- a/content/fr-FR/website/locale.yml +++ b/content/fr-FR/website/locale.yml @@ -1,279 +1,281 @@ -tagline: Build cross-platform desktop apps with JavaScript, HTML, and CSS +tagline: Développez des applications desktop multi-plateformes avec JavaScript, HTML et CSS nav: apps: Apps blog: Blog code_of_conduct: Code de conduite - security: Security + security: Sécurité community: Communauté contact: Contact - docs: Docs - donors: Donors - languages: Languages - license: License - releases: Releases - search: Search + docs: Documentation + donors: Donateurs + languages: Langues + license: Licence + releases: Versions + search: Rechercher userland: Userland - governance: Governance + governance: Gouvernance keyboard_modal: title: Raccourcis clavier - key: Key + key: Clé action: Action - focus_search: Focus the search bar - focus_and_clear: Focus the search bar and cleans it - scroll_down: Select the next search result - scroll_up: Select the previous search result - open: Open the selected search result - open_new_tab: Open the selected search result in a new tab + focus_search: Focus sur la barre de recherche + focus_and_clear: Focus sur la barre de recherche et la vide + scroll_down: Sélectionne le prochain résultat de recherche + scroll_up: Sélectionne le résultat de recherche précédent + open: Ouvrir le résultat de recherche sélectionné + open_new_tab: Ouvrir le résultat de recherche sélectionné dans un nouvel onglet docs: - title: Electron Documentation - guides: "Guides: Getting Started with Electron" - api_reference: API Reference + title: Documentation d'Electron + guides: "Guides: Premiers pas avec Electron" + api_reference: Référence des APIs api_structures: API Structures - advanced: Advanced - detailed: In Detail - custom_dom: Custom DOM Elements - main_proc_modules: Main Process Modules - renderer_proc_modules: Renderer Process Modules - both_proc_modules: Modules for Both Process Types - propose_change: Improve this doc - version_history: Version history - translate: Translate this doc + advanced: Avancé + detailed: En détail + custom_dom: Éléments DOM Personnalisé  + main_proc_modules: Modules pour le Main Process + renderer_proc_modules: Modules pour le Renderer Process + both_proc_modules: Modules pour les deux types de processus + propose_change: Améliorer ce document + version_history: Historique des versions + translate: Traduire ce document languages: - choose_language: Choose Your Site Language - view_more_details: View More Language Details - translation_progress: Translation Progress - current: current selection + choose_language: Choisissez votre langue pour le site + view_more_details: Voir plus de détails sur les langues + translation_progress: Progrès de la traduction + current: sélectionné community: - title: Electron Community - description: Resources for connecting with people working on Electron. + title: Communauté d'Electron + description: Ressources pour rentrer en contact avec des développeurs travaillant sur Electron. channels: - get_started: "Get started building an app by reading the quick-start guide." - updates: "Stay up to date by following @electronjs on Twitter and subscribing to the blog feed." - localized_docs: "Read docs in your native language by visiting the languages page." - help: "Get help and feedback by joining the Discord server, or visiting Stack Overflow." - security: "Report security issues by emailing security@electronjs.org." - bugs: "Report bugs by opening issues on the electron/electron repository." - feature_requests: "Request features by opening issues on the electron/electron repository." - code_of_conduct: "Report Code of Conduct violations by emailing coc@electronjs.org." - donations: "Donate on our OpenCollective page." - other: "For all other inquiries, email info@electronjs.org." + get_started: "Démarrez à construire une application en lisant le tutoriel d'introduction." + updates: "Tenez vous au courant des dernières actualités en suivant @electronjs sur Twitter et en souscrivant au fil d'actualité du blog." + localized_docs: "Lisez la documentation dans votre langue maternelle en visitant la page des langues." + help: "Vous pouvez obtenir de l'aide et des commentaires en rejoignant le serveur Discord ou en allant sur Stack Overflow." + security: "Signalez des problèmes de sécurités par mail à l'adresse security@electronjs.org." + bugs: "Signalez un bug en ouvrant une issue sur le repertoire git electron/electron." + feature_requests: "Demandez des fonctionalités en ouvrant une issue sur le repertoire git electron/electron." + code_of_conduct: "Signalez une violation du Code de Conduite par mai à l'adresse coc@electronjs.org." + donations: "Faire un don sur notre page OpenCollective." + other: "Pour toute autre demande, vous pouvez envoyer un mail à info@electronjs.org." language_communities: - title: Language Communities - description: "The Electron community spans the globe, and English is not everyone's first language. Find documentation in your language, or join one of the language communities below:" - tools: Tools - boilerplates: Boilerplates - components: Components - videos: Videos - meetups: Meetups - awesome_notice: This list is generated from @sindresorhus's Awesome Electron repository.
    Something missing? Make a pull request. - meetup_notice: To add a meetup, edit data/meetups.json and make a pull request. + title: Communautés de langue + description: "La communauté Electron fait le tour du monde, et l'Anglais n'est pas la langue maternelle de chacun. Trouvez la documentation correspondant à votre langue, ou rejoignez une communauté de langue ci-dessous:" + tools: Outils + boilerplates: Exemples d'utilisation + components: Composants + videos: Vidéos + meetups: Lieux de réunion + awesome_notice: Cette liste est générée depuis le repository Awesome Electron de @sindresorhus.
    Quelque chose manque ? Faites une pull request. + meetup_notice: Pour ajouter une réunion, éditez data/meetups.json et faites une pull request. releases: - show_releases: "Show Releases:" - show_only_releases_from: "Show Only Releases From:" - all_versions: All Versions - stable_releases: Stable Releases - stable_desc: Regular, supported releases - beta_releases: Beta Releases - beta_desc: Test your app with upcoming changes - nightly_releases: Nightly Releases - nightly_desc: Experiment with the latest features - next: Next - next_page: Next Page - previous: Previous - previous_page: Previous Page + show_releases: "Afficher les versions :" + show_only_releases_from: "Afficher uniquement les versions :" + all_versions: Toutes les versions + stable_releases: Versions stables + stable_desc: Versions régulières et supportées + beta_releases: Versions bêta + beta_desc: Testez votre application avec les changements à venir + alpha_releases: Versions alpha + alpha_desc: Tester un peu plus de fonctionnalités sur le bord + nightly_releases: Versions Nightly + nightly_desc: Expérimenter les dernières fonctionnalités + next: Suivant + next_page: Page suivante + previous: Précédent + previous_page: Page précédente page: Page - all_releases: All Releases - back_to_index: Back to index + all_releases: Toutes les versions + back_to_index: Retour à l'accueil electron_is_good: - title: Apps users love, built with Electron - description: Thousands of organizations spanning all industries use Electron to build cross-platform software. + title: Applications construites avec Electron que les utilisateurs adorent + description: Des milliers d’organisations couvrant toutes les industries utilisent Electron pour construire des logiciels multiplateformes. electron_is_easy: - title: It's easier than you think - description: If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application. + title: C'est plus facile que vous ne le pensez + description: Si vous savez développer un site, alors vous savez développer une application desktop. Electron est un framework pour créer des applications natives avec les technologies web comme JavaScript, HTML et CSS. Electron s'occupe de la partie technique pour que vous puissiez vous concentrer sur le cœur de votre application. web_technologies: - title: Web Technologies - description: Electron uses Chromium and Node.js so you can build your app with HTML, CSS, and JavaScript. + title: Technologies Web + description: Electron utilise Chromium et Node.js pour que vous puissiez développer avec HTML, CSS et JavaScript. open_source: title: Open Source - description: Electron is an open source project maintained by the OpenJS Foundation and an active community of contributors. + description: Electron est un projet open source maintenu par la fondation OpenJS et par une communauté active de contributeurs. cross_platform: - title: Cross Platform - description: Compatible with Mac, Windows, and Linux, Electron apps build and run on three platforms. + title: Multi-Plateformes + description: Compatible avec Mac, Windows et Linux, les applications Electron sont développées et utilisées sur ces trois plateformes. benefits: - hard_parts_made_easy: The hard parts made easy - automatic_updates: Automatic updates - native_menus_and_notifications: Native menus & notifications - crash_reporting: Crash reporting - debugging_and_profiling: Debugging & profiling - windows_installers: Windows installers + hard_parts_made_easy: Fini les détails trop techniques + automatic_updates: Mises à jour automatiques + native_menus_and_notifications: Notifications & menus natifs + crash_reporting: Rapport de plantage + debugging_and_profiling: Débogage et analyse de performance + windows_installers: Installateurs Windows get_started: - title: Get started - description: To get started with Electron, check out the resources below. Learn how to wrap your web app with Electron, access all the APIs, and generate installers. + title: Premiers pas + description: Pour commencer avec Electron, consultez les ressources ci-dessous. Vous apprendrez comment développer votre app web avec Electron, accéder aux APIs et générer des installateurs. explore: - fiddle_title: Try powerful experiments with Electron Fiddle - see_more_info: See more info -download: Download -download_from_github: Download from GitHub + fiddle_title: Expérimentez encore plus loin avec Electron Fiddle + see_more_info: Voir plus d'infos +download: Télécharger +download_from_github: Télécharger depuis GitHub quick_start: - title: "Spin up the Quick Start app to see Electron in action:" - description: A minimal Electron app with helpful notations. - clone: Clone the Quick Start repository - go_into_repo: Go into the repository - install_deps: Install the dependencies and run - dive_deeper: Or dive deeper and read the documentation. + title: "Faites tourner l'application Quick Start pour voir Electron en action :" + description: Une application Electron minimale avec des notes utiles. + clone: Clonez le dépôt Quick Start + go_into_repo: Allez dans le dépôt + install_deps: Installez les dépendances et lancez l'app + dive_deeper: Ou allez plus loin en lisant la documentation. need_help: - title: Need Help? - description: Ask questions in the Discord server. Follow @electronjs on Twitter for important announcements. Need to privately reach out? Email info@electronjs.org. + title: Besoin d'aide ? + description: Posez des questions sur le serveur Discord. Suivez @electronjs sur Twitter les annonces importantes. Sinon pour un contact plus privé par e-mail à info@electronjs.org. headings: - languages: Languages + languages: Langues taglines: - languages: Localized content from our awesome global developer community. - announcement: 'Black Lives Matter. Support the Equal Justice Initiative and read our statement here.' -help_translate: "Help translate" + languages: Contenu multilingue de notre fantastique communauté mondiale de développeurs. + announcement: 'Black Lives Matter. Soutenez Equal Justice Initiative et lisez notre déclaration ici.' +help_translate: "Aider à traduire" footer: - see_the_faq: See the frequently asked questions + see_the_faq: Consulter la foire aux questions apps: - something_missing: Something missing? - edit_this_app: Edit this app. - search_app: Filter apps by name, description, etc… - categories: Categories - add_app_link: 'Make a Pull Request to add your application.' + something_missing: Quelque chose manque ? + edit_this_app: Éditer cette app. + search_app: Filtrer les apps par nom, description, etc… + categories: Catégories + add_app_link: 'Faîtes une Pull Request pour ajouter votre application.' #App show page specific localization strings - website: Website - repository: Repository - category: Category - downloads: Downloads - keywords: Keywords - license: License - latest_release: Latest Release + website: Site web + repository: Dépôt + category: Catégorie + downloads: Téléchargements + keywords: Mots clés + license: Licence + latest_release: Dernière version blog: - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Blog d'Electron + description: Toutes les dernières nouvelles de l'équipe d'Electron et de la communauté. #Post show page specific localization strings - feedback: Have feedback on this post? Let @electronjs know on Twitter. - help: Need help or found a bug? Contact us. + feedback: Un commentaire sur cet article ? Faîtes le savoir à @electronjs sur Twitter. + help: Besoin d'aide ou un bug à partager ? Contactez-nous. clipboard: - copy: Copy - copy_to_clipboard: Copy to Clipboard - copied: Copied + copy: Copier + copy_to_clipboard: Copier dans le presse-papiers + copied: Copié fiddle_launch_button: - launch: Launch - launch_in_fiddle: Launch in Fiddle + launch: Démarrer + launch_in_fiddle: Démarrer dans Fiddle pages: '/': - title: Electron | Build cross-platform desktop apps with JavaScript, HTML, and CSS. - description: 'Build cross-platform desktop apps with JavaScript, HTML, and CSS.' + title: Electron | Développez des applications desktop multi-plateformes avec JavaScript, HTML et CSS. + description: 'Développez des applications desktop multi-plateformes avec JavaScript, HTML et CSS.' '/apps': - title: Electron Apps - description: Apps Built on Electron + title: Applications Electron + description: Applications développées avec Electron '/docs': title: Documentation - description: Guides and API reference documentation for the latest Electron release + description: Guides et documentation de référence des APIs pour la dernière version d'Electron '/docs/api': title: API - description: API reference documentation for the latest Electron release + description: Documentation de l'API pour la dernière version d'Electron '/docs/development': title: Développement - description: Developing with Electron + description: Développer avec Electron '/docs/tutorial': - title: Tutorial - description: Guides and tutorials for the latest Electron release + title: Tutoriel + description: Guides et tutoriels pour la dernière version d'Electron '/blog': - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Blog d'Electron + description: Toutes les dernières nouvelles de l'équipe d'Electron et de la communauté. '/community': title: Communauté '/releases': - title: Releases + title: Versions '/contact': title: Contact - description: Get in touch with the Electron team on Twitter, Slack, GitHub, or via email. + description: Entrez en contact avec l'équipe d'Electron sur Twitter, Slack, GitHub, ou par e-mail. '/languages': - title: Languages + title: Langues '/userland': title: Userland '/devtron': title: Devtron - description: Devtron is an open source tool to help you inspect, monitor, and debug your Electron app. Built on top of the amazing Chrome Developer Tools. + description: Devtron est un outil open source pour vous aider à inspecter, monitorer et déboguer votre application Electron. S'appuie sur les incroyables Outils de Développement Chrome. '/spectron': title: Spectron - description: Spectron is an open source framework for easily writing integrations tests for your Electron app. Built on top of ChromeDriver and WebDriverIO. + description: Spectron est un framework open source pour écrire facilement des tests d'intégrations pour votre application Electron. Intégré dans ChromeDriver et WebDriverIO. '/fiddle': - title: Electron Fiddle - description: The easiest way to get started with Electron + title: Fiddle Electron + description: La méthode la plus simple pour démarrer avec Electron '/governance': - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. + title: Gouvernance Electron + description: Le système de gouvernance d'Electron est composé de groupes de travail qui supervisent différents aspects de l'écosystème d'Electron, et d'un groupe de travail administratif s'occupant de résoudre les conflits entre eux. '/donors': - title: Donors + title: Donateurs '/blacklivesmatter': title: Black Lives Matter landing: - get_started: Get started + get_started: Premiers pas fiddle: - lead_desc: The easiest way to get started with Electron - different_os: "Not the right operating system? See:" - create_app: Create your app - description: Electron Fiddle lets you create and play with small Electron experiments. It greets you with a quick-start template after opening – change a few things, choose the version of Electron you want to run it with, and play around. Then, save your Fiddle either as a GitHub Gist or to a local folder. Once pushed to GitHub, anyone can quickly try your Fiddle out by just entering it in the address bar. - explore: Explore Electron - explore_desc: "Try Electron without installing any dependencies: Fiddle includes everything you'll need to explore the platform. It also includes examples for every API available in Electron, so if you want to quickly see what a BrowserView is or how the desktopCapturer works, Fiddle has got you covered." - code_with_types: Code with Types - code_with_types_desc: Fiddle includes Microsoft's excellent Monaco Editor, the same editor powering Visual Studio Code. It also installs the type definitions for the currently selected version of Electron automatically, ensuring that you always have all Electron APIs only a few keystrokes away. - compile_and_package: Compile and Package - compile_and_package_desc: Fiddle can automatically turn your experiment into binaries you can share with your friends, coworkers, or grandparents. It does so thanks to electron-forge, allowing you to package your fiddle as an app for Windows, macOS, or Linux. - easy_start: Start with Fiddle, Continue Wherever - easy_start_desc: Fiddle is not an IDE – it is however an excellent starting point. Once your fiddle has grown up, export it as a project with or without electron-forge. Then, use your favorite editor and take on the world! + lead_desc: La méthode la plus simple pour démarrer avec Electron + different_os: "Pas le bon système d'exploitation ? Voir :" + create_app: Créez votre application + description: Electron Fiddle vous permet de créer et de jouer avec de petites expériences Electron. Il vous accueille avec un modèle qui vous permettra de vite démarrer - changez quelques éléments, choisissez la version d'Electron que vous désirez et amusez-vous ! Ensuite, sauvegardez votre Fiddle en tant que GitHub Gist ou dans un dossier local. Une fois qu'il sera push sur GitHub, n'importe qui pourra essayer votre Fiddle en utilisant son URL. + explore: Explorer Electron + explore_desc: "Essayez Electron sans installer de dépendances : Fiddle inclut tout ce dont vous aurez besoin pour explorer la plateforme. Il inclut également des exemples pour toutes les API disponibles dans Electron. Si vous voulez rapidement vérifier ce que fait une BrowserView ou comment fonctionne le desktopCapturer, Fiddle a ce qu'il vous faut." + code_with_types: Développez avec les Types + code_with_types_desc: Fiddle inclut l'excellent Monaco Editor de Microsoft, le même éditeur qui sert de base à Visual Studio Code. De plus, il installe automatiquement les définitions de type pour la version actuellement sélectionnée d'Electron, vous assurant de toujours garder les APIs d'Electron à quelques coups de clavier de distance. + compile_and_package: Compiler et empaqueter + compile_and_package_desc: Fiddle peut automatiquement convertir votre expérimentation en fichiers que vous pourrez partager à vos amis, collègues ou grand-parents. Cette fonctionnalité est rendue possible par electron-forge, vous permettant de convertir votre fiddle entre application Windows, macOS ou Linux. + easy_start: Commencez par Fiddle, puis continuez où vous voulez + easy_start_desc: Fiddle n'est pas un IDE – c'est cependant un excellent point de départ. Une fois votre fiddle grandi, exportez-le comme un projet avec ou sans electron-forge. Ensuite, utilisez votre éditeur préféré et prenez le monde ! governance: - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. - wgs: Working Groups + title: Gouvernance Electron + description: Le système de gouvernance d'Electron est composé de groupes de travail qui supervisent différents aspects de l'écosystème d'Electron, et d'un groupe de travail administratif s'occupant de résoudre les conflits entre eux. + wgs: Groupes de travail ecosystem: - title: Ecosystem - description: Oversees the projects that make Electron app development easier. + title: Écosystème + description: Supervise les projets facilitant le développement des applications Electron. outreach: - title: Outreach - description: Grows the Electron community + title: Sensibilisation + description: Développement de la communauté Electron releases: - title: Releases - description: Oversees all release branches, and tooling to support releases. + title: Versions + description: Supervise toutes les branches de release et l'outillage pour soutenir les releases. upgrades: - title: Upgrades - description: Oversees upgrades of upstream dependencies; specifically Chromium and Node. + title: Améliorations + description: Supervise les mises à niveau des dépendances en amont, en particulier Chromium et Node. cmsf: - title: Community & Safety - description: Oversees removal/bans from community. + title: Communauté et sécurité + description: Supervise le retrait ou le bannissement de la communauté. security: - title: Security - description: Proactively ensures the Security of Electron as a project, responds to incoming incidents, and oversees rollout of fixes. + title: Sécurité + description: Assure proactivement la sécurité d'Electron en tant que projet, répond aux incidents signalés et supervise le déploiement des correctifs. admins: - title: Administrative - description: The Administrative Working Group oversees the entire governance and project. + title: Administratif + description: Le groupe de travail administratif supervise l'ensemble de la gouvernance et du projet. api: title: API - description: Oversees public API design based on project principles. + description: Supervise la conception des API publiques selon des principes communs à tous les projets. global: overview: Vue d'ensemble - associated_repos: Associated Repositories - notes: Meeting Notes + associated_repos: Dépôts associés + notes: Notes de réunion definitions: - title: Definitions + title: Définitions list: - - A maintainer is anyone who plays an active role in governance. - - A collaborator is active in the community, but not in governance. - - A participant is anyone who is a maintainer or collaborator. - - A working group is a group of maintainers that is formed to take responsibility for certain aspects of the Electron project. Normally these groups will meet regularly but in some cases will only meet as required to fulfill their responsibilities. - - 'A chair leads a working group.' + - Un mainteneur est quiconque jouant un rôle actif dans la gouvernance. + - Un collaborateur est actif dans la communauté, mais pas dans la gouvernance. + - Un participant est un mainteneur ou un collaborateur. + - Un groupe de travail est un groupe de mainteneurs formés pour prendre la responsabilité de certains aspects du projet Electron. Normalement, ces groupes se rencontreront régulièrement mais dans certains cas, ils ne se réuniront que si nécessaire pour assumer leurs responsabilités. + - 'Un représentant mène un groupe de travail.' responsibilities: - title: Responsibilities - listdescription: "All Working Groups have these core responsibilities:" + title: Responsabilités + listdescription: "Tous les groupes de travail ont ces responsabilités fondamentales :" list: - - They shall decide for themselves, and publicly post, their rules, e.g. how decisions are made, when meetings are held, and who may attend. - - 'They shall select a chair to represent the group.' - - They shall keep meeting notes, including agenda items, discussion points, and outcomes for everyone to review. - - 'They shall be collaborative and work in good faith with other Working Groups.' - see_charter: See charter for more information. - code_of_conduct: The Electron organization and all repos therein adhere to the following Code of Conduct. - license: Electron is licensed with the MIT License. - repository: Check out the Governance Repository to find more information about the governance structure. + - Ils décident d'eux-mêmes et publient publiquement leurs règles, par exemple la façon dont les décisions sont prises, lorsque des réunions sont organisées et qui peuvent y assister. + - 'Ils vont sélectionner un représentant pour représenter le groupe.' + - Ils gardent les notes de réunion, y compris les ordres du jour, les points de discussion et les conclusions de la réunion pour que tout le monde puisse les consulter. + - 'Ils devront collaborer et travailler de bonne foi avec les autres Groupes de travail.' + see_charter: Consultez la charte pour plus d'informations. + code_of_conduct: L'organisation Electron et tous ses dépôts adhèrent au code de conduite suivant . + license: Electron est sous licence MIT . + repository: Consultez le dépôt de gouvernance pour obtenir plus d'informations sur la structure de gouvernance. _404: - page_not_found: Page not found. + page_not_found: Page non trouvée. diff --git a/content/ja-JP/docs/api/app.md b/content/ja-JP/docs/api/app.md index e68b9380bed31..e6d376b670609 100644 --- a/content/ja-JP/docs/api/app.md +++ b/content/ja-JP/docs/api/app.md @@ -420,54 +420,6 @@ app.on('session-created', (session) => { `webContents` のレンダラープロセス内で `desktopCapture.getSources()` が呼ばれたときに発生します。 `event.preventDefault()` を呼び出すと、空のソースを返します。 -### イベント: 'remote-require' _非推奨_ - -戻り値: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `モジュール名` String - -`webContents` のレンダラープロセス内で `remote.require()` が呼ばれたときに発生します。 `event.preventDefault()` を呼ぶとモジュールの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - -### イベント: 'remote-get-global' _非推奨_ - -戻り値: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `globalName` String - -`webContents` のレンダラープロセス内で `remote.getGlobal()` が呼ばれたときに発生します。 `event.preventDefault()` を呼ぶとグローバルの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - -### イベント: 'remote-get-builtin' _非推奨_ - -戻り値: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `モジュール名` String - -`webContents` のレンダラープロセス内で `remote.getBuiltin()` が呼ばれたときに発生します。 `event.preventDefault()` を呼ぶとモジュールの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - -### イベント: 'remote-get-current-window' _非推奨_ - -戻り値: - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -`webContents` のレンダラープロセス内で `remote.getCurrentWindow()` が呼ばれたときに発生します。 `event.preventDefault()` を呼ぶとオブジェクトの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - -### イベント: 'remote-get-current-web-contents' _非推奨_ - -戻り値: - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -`webContents` のレンダラープロセス内で `remote.getCurrentWebContents()` が呼ばれたときに発生します。 `event.preventDefault()` を呼ぶとオブジェクトの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - ## メソッド `app` オブジェクトには以下のメソッドがあります。 @@ -981,7 +933,7 @@ if (!gotTheLock) { macOS では Dock アイコンに表示されます。 Linux では Unity ランチャーでのみ動作します。 -**注:** Unity ランチャーで動作させるには `.desktop` ファイルの存在が必要です。詳細は [デスクトップ環境への統合][unity-requirement] をお読みください。 +**注意:** Unity ランチャーは動作にあたって `.desktop` ファイルを必要とします。 詳しい情報は、[Unity 統合ドキュメント][unity-requirement] をご覧ください。 ### `app.getBadgeCount()` _Linux_ _macOS_ @@ -1183,7 +1135,7 @@ app.moveToApplicationsFolder({ macOS では、ゼロ以外の整数を設定すると、ドックアイコンに表示されます。 Linux では Unity ランチャーでのみ動作します。 -**注:** Unity ランチャーで動作させるには `.desktop` ファイルの存在が必要です。詳細は [デスクトップ環境への統合][unity-requirement] をお読みください。 +**注意:** Unity ランチャーは動作にあたって `.desktop` ファイルを必要とします。 詳しい情報は、[Unity 統合ドキュメント][unity-requirement] をご覧ください。 **注意:** macOS でこのプロパティを有効にするには、アプリケーションに通知を表示する権限があるかどうか確認する必要があります。 @@ -1211,12 +1163,6 @@ macOS では、ゼロ以外の整数を設定すると、ドックアイコン これは、`webContents` または `session` レベルでユーザーエージェントが設定されていない場合に使用されるユーザーエージェントです。 アプリ全体が同じユーザーエージェントを持っていることを確認するのに役立ちます。 オーバーライドされた値が確実に使用されるように、アプリの初期化のできるだけ早い段階でカスタム値に設定してください。 -### `app.allowRendererProcessReuse` - -この `Boolean` が `true` のとき、ナビゲーションごとにレンダラープロセスが確実に再起動されるように Electron が設定している、そのオーバーライドを無効にします。 このプロパティの現在の既定値は `true` です。 - -これらのオーバーライドがデフォルトで無効になることを意図しているので、将来的にはこのプロパティは削除される予定です。 このプロパティはレンダラープロセス内で使用できるネイティブモジュールに影響します。 Electron がレンダラープロセスを再起動して、レンダラープロセスでネイティブモジュールを使用する方針についての詳細は、この [Tacking Issue](https://github.com/electron/electron/issues/18397) をご覧ください。 - ### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ `Boolean` 型で、`true` の場合アプリが [Rosetta 変換環境](https://en.wikipedia.org/wiki/Rosetta_(software)) 下で動作していることを示します。 @@ -1231,7 +1177,7 @@ macOS では、ゼロ以外の整数を設定すると、ドックアイコン [LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType -[unity-requirement]: ../tutorial/desktop-environment-integration.md#unity-launcher +[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher [mas-builds]: ../tutorial/mac-app-store-submission-guide.md [Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows [JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx diff --git a/content/ja-JP/docs/api/auto-updater.md b/content/ja-JP/docs/api/auto-updater.md index 8436439befa1b..0cb768d01dc31 100644 --- a/content/ja-JP/docs/api/auto-updater.md +++ b/content/ja-JP/docs/api/auto-updater.md @@ -97,6 +97,8 @@ Windowsでは `releaseName` のみ利用可能です。 更新があるかどうかサーバーに問い合わせます。 この API を使用する前に `setFeedURL` を呼び出す必要があります。 +**注意:** アップデート可能であれは、自動でダウンロードされます。 `autoUpdater.checkForUpdates()` を 2 回呼び出すと、更新データを 2 回ダウンロードすることになります。 + ### `autoUpdater.quitAndInstall()` ダウンロード後にアプリを再起動し、更新をインストールします。 `update-downloaded` が発生した後でしか呼び出さないでください。 diff --git a/content/ja-JP/docs/api/browser-window.md b/content/ja-JP/docs/api/browser-window.md index 5a549d01a3042..d2089e84a3eda 100644 --- a/content/ja-JP/docs/api/browser-window.md +++ b/content/ja-JP/docs/api/browser-window.md @@ -14,7 +14,7 @@ const win = new BrowserWindow({ width: 800, height: 600 }) win.loadURL('https://github.com') // またはローカルの HTML ファイルを読み込む -win.loadURL(`file://${__dirname}/app/index.html`) +win.loadURL('index.html') ``` ## フレームレスウィンドウ @@ -143,7 +143,7 @@ child.once('ready-to-show', () => { * `frame` Boolean (任意) - `false` を指定すると [フレームレスウインドウ](frameless-window.md) を生成します。 省略値は `true` です。 * `parent` BrowserWindow (任意) - 親ウインドウを指定します。 省略値は `null` です。 * `modal` Boolean (任意) - これをモーダルウインドウにするかどうか。 これは、このウインドウが子ウインドウの場合にのみ機能します。 省略値は `false` です。 - * `acceptFirstMouse` Boolean (任意) - ウインドウをアクティブにした一回のマウスダウンイベントをウェブビューが同時に受け付けるかどうか。 省略値は `false` です。 + * `acceptFirstMouse` Boolean (任意) - 非アクティブのウインドウをクリックしたとき、ウェブコンテンツにもクリックを渡すかどうか。 macOS での既定値は `false` です。 このオプションは他プラットフォームでは設定できません。 * `disableAutoHideCursor` Boolean (任意) - タイプ中にカーソルを非表示にするかどうか。 省略値は `false` です。 * `autoHideMenuBar` Boolean (任意) - `Alt` キーが押されていなければ、メニューバーを自動で非表示にします。 省略値は `false` です。 * `enableLargerThanScreen` Boolean (任意) - ウインドウを画面よりも大きいサイズに変更できるようにします。 他の OS はデフォルトで画面よりも大きなウィンドウを許可するため、macOS にのみ関係します。 省略値は `false` です。 @@ -157,11 +157,11 @@ child.once('ready-to-show', () => { * `followWindow` - ウィンドウがアクティブなときにはアクティブに、そうでないときには非アクティブになるよう背景が自動的に表示されます。 これが既定値です。 * `active` - 背景が常にアクティブに表示されます。 * `inactive` - 背景が常に非アクティブに表示されます。 - * `titleBarStyle` String (任意) - ウインドウタイトルバーのスタイル。 省略値は `default` です。 以下は取りうる値です。 - * `default` - 標準の灰色不透明なMacのタイトルバーになります。 - * `hidden` - タイトルバーが非表示かつフルサイズのコンテンツウインドウになりますが、タイトルバーには、まだ標準のウインドウコントロール ("信号") が左上にあります。 - * `hiddenInset` - ウインドウの端から信号ボタンが少し埋め込まれた別の見た目でタイトルバーが非表示になります。 - * `customButtonsOnHover` - タイトルバーが非表示になり、フルサイズコンテンツのウインドウが表示されます。ウィンドウの左上にカーソルを置くと信号機ボタンが表示されるようになります。 **注:** 現在、これは実験的な機能です。 + * `titleBarStyle` String (任意) _macOS_ _Windows_ - ウインドウのタイトルバーのスタイル。 省略値は `default` です。 以下は取りうる値です。 + * `default` - macOS や Windows ごとの標準的なタイトルバーになります。 + * `hidden` - タイトルバーが隠れ、フルサイズのコンテンツウインドウになります。 macOS では、ウインドウの左上に標準ウインドウコントロール ("信号機ボタン") が付きます。 Windows では、`titleBarOverlay: true` と合わせることでウインドウコントロールオーバーレイ (詳細は `titleBarOverlay` を参照) が有効になり、さもなくばウインドウコントロールは表示されません。 + * `hiddenInset` - macOS 限定で、タイトルバーが非表示になり、信号機ボタンがウインドウ端から少し離れたところに表示されるようになります。 + * `customButtonsOnHover` - macOS 限定で、タイトルバーが非表示になり、フルサイズコンテンツのウインドウが表示されます。ウィンドウの左上にカーソルを置くと信号機ボタンが表示されるようになります。 **注:** 現在、これは実験的な機能です。 * `trafficLightPosition` [Point](structures/point.md) (任意) - フレームレスウインドウにおける信号機ボタンのカスタム位置を設定します。 * `roundedCorners` Boolean (任意) - macOS でのフレームレスウインドウが丸角であるべきかどうか。 省略値は `true` です。 * `fullscreenWindowTitle` Boolean (任意) _非推奨_ - macOSで titleBarStyle が `hiddenInset` のフルスクリーンモードでタイトルバーにタイトルを表示するかどうか。 省略値は `false` です。 @@ -176,10 +176,8 @@ child.once('ready-to-show', () => { * `nodeIntegrationInSubFrames` Boolean (任意) - iframe や子ウインドウのようなサブフレーム内で Node.js サポートを有効にする実験的な機能です。 すべてのプリロードは iframe 毎にロードされます。メインフレーム内かそうでないか判断するには `process.isMainFrame` が使用できます。 * `preload` String (任意) - 他のスクリプトがページで実行される前にロードされるスクリプトを指定します。 このスクリプトは、Node統合がオンまたはオフであるかに関係なく常にNode APIにアクセスできます。 値は、スクリプトへの絶対ファイルパスにする必要があります。 Node統合がオフのときでも、プレロードされたスクリプトは、Nodeのグローバルシンボルをグローバルスコープに再導入できます。 [ここ](context-bridge.md#exposing-node-global-symbols) の例を参照してください。 * `sandbox` Boolean (任意) - 設定された場合、ウインドウと関連付けられているレンダラーをサンドボックス化します。これは、ChromiumのOSレベルのサンドボックスと互換性を持ち、Node.jsエンジンを無効化します。 これは `nodeIntegration` オプションと同じではなく、プレロードスクリプトで利用可能なAPIよりもさらに制限がかかります。 このオプションの詳細については、[ここ](../tutorial/sandbox.md) をお読みください。 - * `enableRemoteModule` Boolean (任意) - [`remote`](remote.md) モジュールを有効にするかどうか。 省略値は `false` です。 * `session` [Session](session.md#class-session) (任意) - ページで使用されるセッションを設定します。 Session オブジェクトを直接引き渡す代わりに、パーティション文字列を受け付ける `partition` オプションを使用することを選択することもできます。 `session` と `partition` の両方が指定されたときは、`session` が優先されます。 省略値は、既定のセッションです。 * `partition` String (任意) - セッションのパーティション文字列に従って、ページで使用されるセッションを設定します。 `partition` が `persist:` 始まりの場合、ページはアプリの全ページで利用可能な永続的なセッションを同じ `partition` で使用します。 `persist:` プレフィックスがない場合、ページは、インメモリセッションを使用します。 同じ `partition` を割り当てることによって、複数のページが同じセッションを共有できます。 省略値は、既定のセッションです。 - * `affinity` String (任意) - 指定されると、同じ `affinity` のウェブページは同じレンダラープロセス内で実行します。 レンダラープロセスを再利用することにより、`preload`、`sandbox`、`nodeIntegration` などの異なる値を指定した場合でも、特定の `webPreferences` オプションがウェブページ間で共有されることに注意してください。 したがって、同じ `affinity` を持つウェブページに対しては、全く同じ `webPreferences` を使用することをお勧めします。 _非推奨_ * `zoomFactor` Number (任意) - ページの既定のズーム倍率で、`3.0` は `300%` を表します。 省略値は `1.0` です。 * `javascript` Boolean (任意) - JavaScript サポートを有効にします。 省略値は `true` です。 * `webSecurity` Boolean (任意) - `false` のとき、同一オリジンポリシー (通常、テスト用Webサイトを使用します) が無効になり、ユーザによって設定されない場合、`allowRunningInsecureContent` が `true` に設定されます。 省略値は `true` です。 @@ -206,8 +204,7 @@ child.once('ready-to-show', () => { * `backgroundThrottling` Boolean (任意) - ページがバックグラウンドになったとき、アニメーションやタイマーを抑制するかどうか。 これは [Page Visibility API](#page-visibility) にも影響を与えます。 省略値は `true` です。 * `offscreen` Boolean (任意) - ブラウザウィンドウでオフスクリーンレンダリングを有効にするかどうか。 省略値は `false` 。 詳細については、[オフスクリーンレンダリングのチュートリアル](../tutorial/offscreen-rendering.md) を参照してください。 * `contextIsolation` Boolean (任意) - Electron APIと指定された `preload` スクリプトを別々のJavaScriptコンテキストで実行するかどうか。 省略値は `true` です。 `preload` スクリプトが実行されるコンテキストでは、専用の `document` および `window` グローバルと、独自の JavaScript ビルドインのセット (`Array`, `Object`, `JSON` など) にのみアクセスできます。これらすべてはロードされたコンテンツからは見えません。 Electron API は `preload` スクリプトでのみ利用可能で、読み込まれたページでは利用できません。 このオプションは、信頼できない可能性のあるリモートコンテンツをロードする際に使用します。ロードされたコンテンツが `preload` スクリプトや使用する Electron API を改ざんできないようにするためです。 このオプションは、[Chrome のコンテンツスクリプト][chrome-content-scripts] のものと同じ技術を使用しています。 Console タブの一番上のコンボボックスの中にある 'Electron Isolated Context' という項目を選択することによって、開発者ツールでこのコンテキストにアクセスできます。 - * `worldSafeExecuteJavaScript` Boolean (optional) - true の場合、`contextIsolation` を使用しているときに、JS の値がワールド間を安全に行き来できるように、`webFrame.executeJavaScript` から返される値はサニタイズされます。 省略値は `true` です。 _非推奨_ - * `nativeWindowOpen` Boolean (任意) - ネイティブの `window.open()` を使用するかどうか。 省略値は `false` 。 子ウインドウは、`nodeIntegrationInSubFrames` が true でなければ node integration は無効化されます。 **注:** 現在、これは実験的な機能です。 + * `nativeWindowOpen` Boolean (任意) - ネイティブの `window.open()` を使用するかどうか。 省略値は `false` 。 子ウインドウは、`nodeIntegrationInSubFrames` が true でなければ node integration は無効化されます。 **注:** 省略値は Electron 15 で `true` に変更される予定です。 * `webviewTag` Boolean (任意) - [`` タグ](webview-tag.md) を有効にするかどうか。 省略値は `false` 。 **注:** `` に設定された `preload` スクリプトは、実行時にNode統合が有効になるので、潜在的に悪意のある `preload` スクリプトを含む `` タグをリモート/信頼できないコンテンツに作成させないようにする必要があります。 `preload` スクリプトを除去したり、検証したり、`` の初期設定を変更したりするために、[webContents](web-contents.md) の `will-attach-webview` イベントを使うことができます。 * `additionalArguments` String[] (任意) - このアプリケーションのレンダラープロセスで `process.argv` に追加される文字列のリスト。 小規模なデータをレンダラープロセスのプリロードスクリプトに渡すのに便利です。 * `safeDialogs` Boolean (任意) - ブラウザによる連続ダイアログ保護を有効にするかどうか。 省略値は `false` です。 @@ -225,6 +222,7 @@ child.once('ready-to-show', () => { * `bypassHeatCheck` - ヒューリスティックのコードキャッシュをバイパスしつつ遅延コンパイル * `bypassHeatCheckAndEagerCompile` - 上と同じにしつつ先行コンパイルします。 既定のポリシーは `code` です。 * `enablePreferredSizeMode` Boolean (任意) - 優先サイズモードを有効にするかどうか。 優先サイズとは、document のレイアウトをスクロール無しで格納するにあたって必要な最小サイズのことです。 これを有効にすると、優先サイズが変更されたときに `WebContents`で`preferred-size-changed`イベントが発生します。 省略値は `false` です。 + * `titleBarOverlay` [OverlayOptions](structures/overlay-options.md) | Boolean (任意) - フレームレスウインドウを macOS の`win.setWindowButtonVisibility(true)` と組み合わせて使用している場合や、`titleBarStyle` を使用して標準ウインドウコントロール (macOS では "信号機ボタン") が表示されている場合、このプロパティはウインドウコントロールオーバーレイで [JavaScript API][overlay-javascript-apis] と [CSS 環境変数][overlay-css-env-vars] を有効にします。 `true` を指定すると、オーバーレイはデフォルトのシステムカラーになります。 省略値は `false` です。 Windows では、真偽値の代わりに [OverlayOptions](structures/overlay-options.md) でオーバーレイの色を指定できます。 `minWidth`/`maxWidth`/`minHeight`/`maxHeight` で最小もしくは最大のウインドウサイズを設定するのは、ユーザを束縛するだけです。 サイズ制約に関係しないサイズを `setBounds`/`setSize` や `BrowserWindow` のコンストラクタに渡すことは差し支えありません。 @@ -544,6 +542,10 @@ win.loadURL('https://github.com') `Boolean` 型のプロパティです。これは、ウィンドウがフルスクリーンモードかどうかを決定します。 +#### `win.focusable` _Windows_ _macOS_ + +`Boolean` 型のプロパティです。ウィンドウにフォーカスできるどうかを決定します。 + #### `win.visibleOnAllWorkspaces` `Boolean` 型のプロパティです。これは、ウィンドウがすべてのワークスペースで表示されるどうかを決定します。 @@ -957,7 +959,7 @@ Z オーダーの意味で、ウィンドウをソースウィンドウの上に #### `win.center()` -Moves window to the center of the screen. +ウインドウを画面の中央に移動します。 #### `win.setPosition(x, y[, animate])` @@ -965,30 +967,30 @@ Moves window to the center of the screen. * `y` Integer * `animate` Boolean (任意) _macOS_ -Moves window to `x` and `y`. +ウインドウを `x` と `y` に移動します。 #### `win.getPosition()` -Returns `Integer[]` - Contains the window's current position. +戻り値 `Integer[]` - ウインドウの現在の位置を含みます。 #### `win.setTitle(title)` * `title` String -Changes the title of native window to `title`. +ネイティブのウインドウのタイトルを `title` に変更します。 #### `win.getTitle()` -Returns `String` - The title of the native window. +戻り値 `String` - ネイティブのウインドウのタイトル。 -**Note:** The title of the web page can be different from the title of the native window. +**注:** Web ページのタイトルはネイティブのウインドウのタイトルとは異なる可能性があります。 #### `win.setSheetOffset(offsetY[, offsetX])` _macOS_ * `offsetY` Float * `offsetX` Float (optional) -Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. 以下がその例です。 +macOS においてシートを設置する位置を変更します。 既定では、シートはウィンドウフレームのすぐ下に設置されますが、 HTML で表示されたツールバーの下に表示することもできます。 以下がその例です。 ```javascript const { BrowserWindow } = require('electron') @@ -1002,88 +1004,88 @@ win.setSheetOffset(toolbarRect.height) * `flag` Boolean -Starts or stops flashing the window to attract user's attention. +ユーザの注意を引きつけるためにウインドウの点滅を開始または停止します。 #### `win.setSkipTaskbar(skip)` * `skip` Boolean -Makes the window not show in the taskbar. +ウインドウがタスクバーに表示されなくなります。 #### `win.setKiosk(flag)` * `flag` Boolean -Enters or leaves kiosk mode. +キオスクモードに入ったり出たりします。 #### `win.isKiosk()` -Returns `Boolean` - Whether the window is in kiosk mode. +戻り値 `Boolean` - ウインドウがキオスクモードであるかどうか。 #### `win.isTabletMode()` _Windows_ -Returns `Boolean` - Whether the window is in Windows 10 tablet mode. +戻り値 `Boolean` - ウインドウが Windows 10 タブレットモードであるかどうか。 -Since Windows 10 users can [use their PC as tablet](https://support.microsoft.com/en-us/help/17210/windows-10-use-your-pc-like-a-tablet), under this mode apps can choose to optimize their UI for tablets, such as enlarging the titlebar and hiding titlebar buttons. +Windows 10 ユーザーは [PC をタブレットとして使用できる](https://support.microsoft.com/en-us/help/17210/windows-10-use-your-pc-like-a-tablet) ので、アプリはこのモードの際にタイトルバーを大きくしたり、タイトルバーのボタンを非表示にしたりと、タブレット用に UI を最適化できます。 -This API returns whether the window is in tablet mode, and the `resize` event can be be used to listen to changes to tablet mode. +この API は、ウインドウがタブレットモードかどうかを返します。`resize` イベントでタブレットモードへの変更をリッスンすることもできます。 #### `win.getMediaSourceId()` -Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1324:0". +戻り値 `String` - DesktopCapturerSource の ID の形式のウィンドウ ID。 例えば "window:1324:0" 。 -More precisely the format is `window:id:other_id` where `id` is `HWND` on Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on Linux. `other_id` is used to identify web contents (tabs) so within the same top level window. +より正確には、フォーマットは ` window:id:other_id` です。ここでの `id` は、Windows では `HWND`、macOS では `CGWindowID` (`uint64_t`)、Linux では `Window` (`unsigned long`) です。 `other_id` は、同じトップレベルウィンドウ内のウェブコンテンツ (タブ) を識別するために使用されます。 #### `win.getNativeWindowHandle()` -Returns `Buffer` - The platform-specific handle of the window. +戻り値 `Buffer` - ウインドウのプラットフォーム固有のハンドル。 -The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and `Window` (`unsigned long`) on Linux. +ハンドルのネイティブな型は、Windowsでは `HWND`、macOSでは `NSView*`、Linuxでは `Window` (`unsigned long`) です。 #### `win.hookWindowMessage(message, callback)` _Windows_ * `message` Integer * `callback` Function - * `wParam` any - The `wParam` provided to the WndProc - * `lParam` any - The `lParam` provided to the WndProc + * `wParam` any - WndProc に指定された `wParam` + * `lParam` any - WndProc に指定された `lParam` -Hooks a windows message. The `callback` is called when the message is received in the WndProc. +ウィンドウメッセージをフックします。 メッセージが WndProc で受信されると、 `callback` が呼び出されます。 #### `win.isWindowMessageHooked(message)` _Windows_ * `message` Integer -Returns `Boolean` - `true` or `false` depending on whether the message is hooked. +戻り値 `Boolean` - メッセージがフックされているかどうかによって、`true` または `false` 。 #### `win.unhookWindowMessage(message)` _Windows_ * `message` Integer -Unhook the window message. +ウインドウメッセージのフックを解除します。 #### `win.unhookAllWindowMessages()` _Windows_ -Unhooks all of the window messages. +すべてのウインドウメッセージのフックを解除します。 #### `win.setRepresentedFilename(filename)` _macOS_ * `filename` String -Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar. +ウインドウが表すファイルのパス名を設定します。ファイルのアイコンがウインドウのタイトルバーに表示されます。 #### `win.getRepresentedFilename()` _macOS_ -Returns `String` - The pathname of the file the window represents. +戻り値 `String` - ウインドウが表すファイルのパス名。 #### `win.setDocumentEdited(edited)` _macOS_ * `edited` Boolean -Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to `true`. +ウインドウのドキュメントが編集されたかどうかを指定します。`true` に設定すると、タイトルバーのアイコンがグレーになります。 #### `win.isDocumentEdited()` _macOS_ -Returns `Boolean` - Whether the window's document has been edited. +戻り値 `Boolean` - ウインドウのドキュメントが編集されたかどうか。 #### `win.focusOnWebView()` @@ -1091,29 +1093,29 @@ Returns `Boolean` - Whether the window's document has been edited. #### `win.capturePage([rect])` -* `rect` [Rectangle](structures/rectangle.md) (optional) - The bounds to capture +* `rect` [Rectangle](structures/rectangle.md) (任意) - キャプチャする範囲 -Returns `Promise` - Resolves with a [NativeImage](native-image.md) +戻り値 `Promise` - [NativeImage](native-image.md) を解決します -Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty. +`rect` 内のページのスナップショットをキャプチャします。 `rect` を省略すると、表示されているページ全体をキャプチャします。 ページが表示されない場合、 `rect` が空である可能性があります。 #### `win.loadURL(url[, options])` * `url` String * `options` Object (任意) - * `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL. - * `userAgent` String (optional) - A user agent originating the request. - * `extraHeaders` String (optional) - Extra headers separated by "\n" - * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional) - * `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files. + * `httpReferrer` (String | [Referrer](structures/referrer.md)) (任意) - HTTP リファラの URL。 + * `userAgent` String (任意) - リクエスト元のユーザーエージェント。 + * `extraHeaders` String (任意) - "\n" で区切られた追加のヘッダー + * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (任意) + * `baseURLForDataURL` String (任意) - データ URL によってロードされたファイルの (最後のパス区切り文字を含む) ベース URL。 これは指定された `url` がデータ URL で、他のファイルをロードする必要がある場合のみ必要です。 -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +戻り値 `Promise` - ページ読み込みが完了した時 ([`did-finish-load`](web-contents.md#event-did-finish-load) を参照) に解決され、ページの読み込みに失敗した時 ([`did-fail-load`](web-contents.md#event-did-fail-load) を参照) に拒否される Promise。 -Same as [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options). +[`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options) と同じです。 -The `url` can be a remote address (e.g. `http://`) or a path to a local HTML file using the `file://` protocol. +`url` は、リモートアドレス (例えば、`http://`) または `file://` プロトコルを使ってローカルのHTMLファイルのパスにすることができます。 -To ensure that file URLs are properly formatted, it is recommended to use Node's [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject) method: +ファイルのURLが正しく構成されているようにするため、Nodeの [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject) メソッドを使用することを推奨します。 ```javascript const url = require('url').format({ @@ -1125,7 +1127,7 @@ const url = require('url').format({ win.loadURL(url) ``` -You can load a URL using a `POST` request with URL-encoded data by doing the following: +次のようにすることによって、URLエンコードされたデータで `POST` リクエストを使用してURLをロードすることができます。 ```javascript win.loadURL('http://localhost:8000/post', { @@ -1141,309 +1143,313 @@ win.loadURL('http://localhost:8000/post', { * `filePath` String * `options` Object (任意) - * `query` Record (optional) - Passed to `url.format()`. - * `search` String (optional) - Passed to `url.format()`. - * `hash` String (optional) - Passed to `url.format()`. + * `search` Record<String, String> (任意) - `url.format()` に渡されます。 + * `search` String (任意) - `url.format()` に渡されます。 + * `hash` String (任意) - `url.format()` に渡されます。 -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +戻り値 `Promise` - ページ読み込みが完了した時 ([`did-finish-load`](web-contents.md#event-did-finish-load) を参照) に解決され、ページの読み込みに失敗した時 ([`did-fail-load`](web-contents.md#event-did-fail-load) を参照) に拒否される Promise。 -Same as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information. +`webContents.loadFile` と同じく、 `filePath` はアプリケーションのルートからの HTML ファイルへの相対パスである必要があります。 詳しくは、 `webContents` ドキュメントを参照してください。 #### `win.reload()` -Same as `webContents.reload`. +`webContents.reload` と同じです。 #### `win.setMenu(menu)` _Linux_ _Windows_ * `menu` Menu | null -Sets the `menu` as the window's menu bar. +`menu` をウインドウのメニューバーとして設定します。 #### `win.removeMenu()` _Linux_ _Windows_ -Remove the window's menu bar. +ウインドウのメニューバーを消去します。 #### `win.setProgressBar(progress[, options])` * `progress` Double * `options` Object (任意) - * `mode` String _Windows_ - Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or `paused`. + * `mode` String _Windows_ - プログレスバーのモード。 `none` 、 `normal` 、 `indeterminate` 、 `error` 、 `paused` のいずれかが使用できます。 -Sets progress value in progress bar. Valid range is [0, 1.0]. +プログレスバーの進捗を設定します。 有効な範囲は [0, 1.0] です。 -Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1. +進捗 < 0 の場合、プログレスバーは削除されます。進捗 > 1 の場合、不確定モードに変更します。 -On Linux platform, only supports Unity desktop environment, you need to specify the `*.desktop` file name to `desktopName` field in `package.json`. By default, it will assume `{app.name}.desktop`. +Linuxプラットフォームでは、Unityデスクトップ環境のみがサポートされ、`package.json` の `desktopName` フィールドに `*.desktop` ファイル名を指定する必要があります。 既定では、`{app.name}.desktop` であるとみなされます。 -On Windows, a mode can be passed. Accepted values are `none`, `normal`, `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a mode set (but with a value within the valid range), `normal` will be assumed. +Windowsでは、モードを渡すことができます。 有効な値は、`none`、`normal`、`indeterminate`、`error` と `paused` です。 モードを設定せずに (ただし、有効範囲内の値で) `setProgressBar` を呼び出した場合、`normal` とみなされます。 #### `win.setOverlayIcon(overlay, description)` _Windows_ -* `overlay` [NativeImage](native-image.md) | null - the icon to display on the bottom right corner of the taskbar icon. If this parameter is `null`, the overlay is cleared -* `description` String - a description that will be provided to Accessibility screen readers +* `overlay` [NativeImage](native-image.md) | null - タスクバーアイコンの右下隅に表示されるアイコン。 この引数が `null` の場合、オーバーレイは消去されます。 +* `description` String - アクセシビリティスクリーンリーダーに提供される説明 -Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user. +現在のタスクバーアイコンの上に、通常、何らかのアプリケーションステータスを伝えたり、ユーザーに控えめに通知したりするのに使われる16 x 16ピクセルのオーバレイを設定します。 #### `win.setHasShadow(hasShadow)` * `hasShadow` Boolean -Sets whether the window should have a shadow. +ウインドウに影を付けるべきかどうかを設定します。 #### `win.hasShadow()` -Returns `Boolean` - Whether the window has a shadow. +戻り値 `Boolean` - ウインドウに影を表示させているかどうか。 #### `win.setOpacity(opacity)` _Windows_ _macOS_ -* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque) +* `opacity` Number - 0.0 (完全に透明) と 1.0 (完全に不透明) の間 -Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the [0, 1] range. +ウィンドウの不透明度を設定します。 Linux では何もしません。 範囲外の値は [0, 1] に収められます。 #### `win.getOpacity()` -Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1. +戻り値 `Number` - 0.0 (完全に透明) と 1.0 (完全に不透明) の間。 Linuxでは常に 1 を返します。 -#### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_ +#### `win.setShape(rects)` _Windows_ _Linux_ _実験的_ -* `rects` [Rectangle[]](structures/rectangle.md) - Sets a shape on the window. Passing an empty list reverts the window to being rectangular. +* `rects` [Rectangle[]](structures/rectangle.md) - ウィンドウの形。 空のリストを渡すと、ウィンドウが四角形に戻ります。 -Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window. +ウィンドウの形を設定すると、システム内で描画とユーザ操作が許可されているウィンドウ内の領域が決まります。 与えられた領域の外側のピクセルでは描画されず、マウスイベントも登録されません。 領域外のマウスイベントはそのウィンドウでは受信されませんが、ウィンドウの後ろにあるものにそのイベントがフォールスルーします。 #### `win.setThumbarButtons(buttons)` _Windows_ * `buttons` [ThumbarButton[]](structures/thumbar-button.md) -Returns `Boolean` - Whether the buttons were added successfully +戻り値 `Boolean` - ボタンを追加するのに成功したかどうか -Add a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a `Boolean` object indicates whether the thumbnail has been added successfully. +タスクバーボタンレイアウトのウインドウのサムネイルイメージに指定されたボタンのセットと一緒にサムネイルツールバーを追加します。 返却される `Boolean` オブジェクトは、サムネイルを追加するのに成功したかどうかを示します。 -The number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform's limitation. But you can call the API with an empty array to clean the buttons. +限られた空間のため、サムネイルツールバーのボタン数は、7以下にしてください。 一度、サムネイルツールバーをセットアップすると、プラットフォームの制約のため、ツールバーを削除することはできません。 しかしながら、ボタンを取り除くためにAPIを空の配列で呼び出すことはできます。 -The `buttons` is an array of `Button` objects: +`buttons` は、`Button` オブジェクトの配列です。 * `Button` Object - * `icon` [NativeImage](native-image.md) - The icon showing in thumbnail toolbar. + * `icon` [NativeImage](native-image.md) - サムネイルツールバーで表示されるアイコン。 * `click` Function - * `tooltip` String (optional) - The text of the button's tooltip. - * `flags` String[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`. + * `tooltip` String (任意) - ボタンのツールチップのテキスト。 + * `flags` String[] (任意) - ボタンの特定の状態や動作を制御します。 省略値は、`['enabled']` です。 -The `flags` is an array that can include following `String`s: +`flags` は、以下の `String` を含めることができる配列です。 -* `enabled` - The button is active and available to the user. -* `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action. -* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately. -* `nobackground` - Do not draw a button border, use only the image. -* `hidden` - The button is not shown to the user. -* `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification. +* `enabled` - ボタンはアクティブで、ユーザーが使用できます。 +* `disabled` - そのボタンは無効化されます。 存在しますが、ユーザ操作に応答しないことを示す視覚的な状態です。 +* `dismissonclick` - そのボタンをクリックすると、サムネイルウインドウがすぐに閉じます。 +* `nobackground` - そのボタンの縁を描画しません。画像にのみ使用してください。 +* `hidden` - そのボタンはユーザに表示されません。 +* `noninteractive` - そのボタンは有効ですが、反応せず、押されたボタンの状態も描画されません。 この値は、例えば通知内で使用するボタンに使用されます。 #### `win.setThumbnailClip(region)` _Windows_ -* `region` [Rectangle](structures/rectangle.md) - Region of the window +* `region` [Rectangle](structures/rectangle.md) - ウインドウの領域 -Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0 }`. +タスクバーのウインドウの上でホバリングするときに表示されるサムネイルイメージとして表示するウインドウの領域を設定します。 空の領域: `{ x: 0, y: 0, width: 0, height: 0 }` を指定することで、サムネイルをウインドウ全体にリセットすることができます。 #### `win.setThumbnailToolTip(toolTip)` _Windows_ * `toolTip` String -Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar. +タスクバーのウインドウサムネイルでホバリングするときに表示されるツールチップを設定します。 #### `win.setAppDetails(options)` _Windows_ * `options` Object - * `appId` String (optional) - Window's [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx). It has to be set, otherwise the other options will have no effect. - * `appIconPath` String (optional) - Window's [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx). - * `appIconIndex` Integer (optional) - Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set. 省略値は `0` です。 - * `relaunchCommand` String (optional) - Window's [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx). - * `relaunchDisplayName` String (optional) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx). + * `appId` String (任意) - ウインドウの[アプリユーザーモデルID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx)。 設定されないと、他のオプションは無効です。 + * `appIconPath` String (任意) - ウインドウの[再起動アイコン](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx)。 + * `appIconIndex` Integer (任意) - `appIconPath` でのアイコンのインデックス。 `appIconPath` が設定されていない場合は無視されます。 省略値は `0` です。 + * `relaunchCommand` String (任意) - ウインドウの[再起動コマンド](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx)。 + * `relaunchDisplayName` String (任意) - ウインドウの[再起動表示名](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx)。 -Sets the properties for the window's taskbar button. +ウインドウのタスクバーボタンのプロパティを設定します。 -**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set together. If one of those properties is not set, then neither will be used. +**注:** `relaunchCommand` と `relaunchDisplayName` は一緒に設定する必要があります。 いずれかが設定されていない場合、どちらも使用されません。 #### `win.showDefinitionForSelection()` _macOS_ -Same as `webContents.showDefinitionForSelection()`. +`webContents.showDefinitionForSelection()` と同じです。 #### `win.setIcon(icon)` _Windows_ _Linux_ * `icon` [NativeImage](native-image.md) | String -Changes window icon. +ウインドウのアイコンを変更します。 #### `win.setWindowButtonVisibility(visible)` _macOS_ * `visible` Boolean -Sets whether the window traffic light buttons should be visible. +ウインドウの信号ボタンを表示するかどうかを設定します。 #### `win.setAutoHideMenuBar(hide)` * `hide` Boolean -Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single `Alt` key. +ウィンドウのメニューバーを自動的に非表示にするかどうかを設定します。 一度設定されると、メニューバーはユーザが単独で `Alt` キーを押したときのみに表示されます。 -If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately. +メニューバーが既に表示されている場合、`setAutoHideMenuBar(true)` を呼び出してもすぐに非表示にはなりません。 #### `win.isMenuBarAutoHide()` -Returns `Boolean` - Whether menu bar automatically hides itself. +戻り値 `Boolean` - メニューバーを自動的に非表示にするかどうか。 #### `win.setMenuBarVisibility(visible)` _Windows_ _Linux_ * `visible` Boolean -Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key. +メニューバーを表示するかどうかを設定します。 メニューバーが自動的に非表示にされている場合でも、ユーザが単に `Alt` キーを押下すれば、依然としてメニューバーを表示させることができます。 #### `win.isMenuBarVisible()` -Returns `Boolean` - Whether the menu bar is visible. +戻り値 `Boolean` - メニューバーを表示しているかどうか。 #### `win.setVisibleOnAllWorkspaces(visible[, options])` * `visible` Boolean * `options` Object (任意) - * `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether the window should be visible above fullscreen windows. - * `skipTransformProcessType` Boolean (optional) _macOS_ - Calling setVisibleOnAllWorkspaces will by default transform the process type between UIElementApplication and ForegroundApplication to ensure the correct behavior. However, this will hide the window and dock for a short time every time it is called. If your window is already of type UIElementApplication, you can bypass this transformation by passing true to skipTransformProcessType. + * `visibleOnFullScreen` Boolean (任意) _macOS_ - ウインドウをフルスクリーンウィンドウの上で表示するかどうかを設定します。 + * `skipTransformProcessType` Boolean (任意) _macOS_ - setVisibleOnAllWorkspaces を呼ぶと、デフォルトでは UIElementApplication と ForegroundApplication の間でプロセスタイプが変換され、正しい動作を保証します。 しかし、これでは呼び出されるたびに短時間だけウインドウが非表示になり、Dock も非表示になってしまいます。 ウインドウが既に UIElementApplication 型である場合、skipTransformProcessType に true を渡すことでこの変換をバイパスできます。 -Sets whether the window should be visible on all workspaces. +ウインドウをすべてのワークスペースで表示させるかどうかを設定します。 -**Note:** This API does nothing on Windows. +**注:** このAPIはWindowsでは何もしません。 #### `win.isVisibleOnAllWorkspaces()` -Returns `Boolean` - Whether the window is visible on all workspaces. +戻り値 `Boolean` - ウインドウがすべてのワークスペースで表示されているかどうか。 -**Note:** This API always returns false on Windows. +**注:** このAPIはWindowsの場合、常にfalseを返します。 #### `win.setIgnoreMouseEvents(ignore[, options])` * `ignore` Boolean * `options` Object (任意) - * `forward` Boolean (optional) _macOS_ _Windows_ - If true, forwards mouse move messages to Chromium, enabling mouse related events such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false, forwarding is always disabled regardless of this value. + * `forward` Boolean (任意) _macOS_ _Windows_ - true の場合、マウスの移動メッセージが Chromium に転送され、`mouseleave` のようなマウス関連のイベントが有効になります。 `ignore` がtrueのときだけ使用されます。 `ignore` がfalseの場合、この値に関わらず、転送は常に無効です。 -Makes the window ignore all mouse events. +ウインドウがすべてのマウスイベントを無視するようにします。 -All mouse events happened in this window will be passed to the window below this window, but if this window has focus, it will still receive keyboard events. +このウインドウで発生するすべてのマウスイベントは、このウインドウの下にあるウインドウに渡されますが、このウインドウにフォーカスがある場合、依然としてキーボードイベントは受信されます。 #### `win.setContentProtection(enable)` _macOS_ _Windows_ * `enable` Boolean -Prevents the window contents from being captured by other apps. +他のアプリによってウインドウのコンテンツがキャプチャされるのを防止します。 -On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10 version 2004 and up the window will be removed from capture entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window. +macOS では、NSWindow の共有タイプを NSWindowSharingNone に設定します。 Windows では、 SetWindowDisplayAffinity を `WDA_EXCLUDEFROMCAPTURE` で呼び出します。 Windows 10 バージョン 2004 以降からウインドウのキャプチャが完全に削除されましたが、古い Windows バージョンで `WDA_MONITOR` が適用された場合は黒いウィンドウをキャプチャするように動作します。 #### `win.setFocusable(focusable)` _macOS_ _Windows_ * `focusable` Boolean -Changes whether the window can be focused. +ウインドウにフォーカスできるかどうかを変更します。 + +macOS ではウィンドウからフォーカスは除去されません。 + +#### `win.isFocusable()` _macOS_ _Windows_ -On macOS it does not remove the focus from the window. +ウインドウにフォーカスできるかどうかを返します。 #### `win.setParentWindow(parent)` * `parent` BrowserWindow | null -Sets `parent` as current window's parent window, passing `null` will turn current window into a top-level window. +現在のウインドウの親ウインドウとして `parent` を設定します。`null` を渡すと、現在のウインドウをトップレベルウインドウにします。 #### `win.getParentWindow()` -Returns `BrowserWindow` - The parent window. +戻り値 `BrowserWindow` - 親ウインドウ。 #### `win.getChildWindows()` -Returns `BrowserWindow[]` - All child windows. +戻り値 `BrowserWindow[]` - すべての子ウインドウ。 #### `win.setAutoHideCursor(autoHide)` _macOS_ * `autoHide` Boolean -Controls whether to hide cursor when typing. +タイプしているときにカーソルを非表示にするかどうかを制御します。 #### `win.selectPreviousTab()` _macOS_ -Selects the previous tab when native tabs are enabled and there are other tabs in the window. +ネイティブのタブが有効で、ウインドウに他のタブがあるとき、一つ前のタブを選択します。 #### `win.selectNextTab()` _macOS_ -Selects the next tab when native tabs are enabled and there are other tabs in the window. +ネイティブのタブが有効で、ウインドウに他のタブがあるとき、次のタブを選択します。 #### `win.mergeAllWindows()` _macOS_ -Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window. +ネイティブのタブが有効で複数の開いているウインドウがあるとき、すべてのウインドウを複数のタブで1つのウインドウにマージします。 #### `win.moveTabToNewWindow()` _macOS_ -Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window. +ネイティブのタブが有効で現在のウインドウに複数のタブがあるとき、現在のタブを新しいウインドウに移動します。 #### `win.toggleTabBar()` _macOS_ -Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window. +ネイティブのタブが有効で現在のウインドウにタブが1つだけしかないとき、タブバーを表示するかどうかを切り替えます。 #### `win.addTabbedWindow(browserWindow)` _macOS_ * `browserWindow` BrowserWindow -Adds a window as a tab on this window, after the tab for the window instance. +ウインドウインスタンスのタブの後ろに、このウインドウのタブとしてウインドウを追加します。 #### `win.setVibrancy(type)` _macOS_ -* `type` String | null - Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See the [macOS documentation][vibrancy-docs] for more details. +* `type` String | null - `appearance-based`、`light`、`dark`、`titlebar`、`selection`、`menu`、`popover`、`sidebar`、`medium-light`、`ultra-dark`、`header`、`sheet`、`window`、`hud`、`fullscreen-ui`、`tooltip`、`content`、`under-window` または `under-page` にすることができます。 詳細については、[macOSのドキュメント][vibrancy-docs] を参照してください。 -Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window. +ブラウザウィンドウにバイブレンシーエフェクトを追加します。 `null` または空の文字列を渡すと、ウィンドウのバイブレンシーエフェクトを削除します。 -Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS. +注意として、`appearance-based`、`light`、`dark`、`medium-light` と `ultra-dark` は非推奨であり、macOS の今後のバージョンで削除されます。 #### `win.setTrafficLightPosition(position)` _macOS_ * `position` [Point](structures/point.md) -Set a custom position for the traffic light buttons in frameless window. +フレームレスウインドウにおける信号機ボタンのカスタム位置を設定します。 #### `win.getTrafficLightPosition()` _macOS_ -Returns `Point` - The custom position for the traffic light buttons in frameless window. +戻り値 `Point` - フレームレスウインドウにおける現在の信号機ボタンの位置。 #### `win.setTouchBar(touchBar)` _macOS_ * `touchBar` TouchBar | null -Sets the touchBar layout for the current window. Specifying `null` or `undefined` clears the touch bar. This method only has an effect if the machine has a touch bar and is running on macOS 10.12.1+. +現在のウインドウのTouchBarレイアウトを設定します。 `null` または `undefined` を指定すると、TouchBarがクリアされます。 このメソッドはTouchBarがあって、macOS 10.12.1以上を実行しているマシンでのみ、有効です。 -**Note:** The TouchBar API is currently experimental and may change or be removed in future Electron releases. +**Note:** TouchBar API は現在実験的な機能です。そのため、将来的には変更されたり削除されたりする可能性があります。 #### `win.setBrowserView(browserView)` _Experimental_ -* `browserView` [BrowserView](browser-view.md) | null - Attach `browserView` to `win`. If there are other `BrowserView`s attached, they will be removed from this window. +* `browserView` [BrowserView](browser-view.md) | null - `browserView` を `win` へアタッチします。 他の `BrowserView` がアタッチされている場合、それはこのウィンドウから削除されます。 -#### `win.getBrowserView()` _Experimental_ +#### `win.getBrowserView()` _実験的_ -Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null` if one is not attached. Throws an error if multiple `BrowserView`s are attached. +戻り値 `BrowserView | null` - `win` にアタッチされた `BrowserView`。 アタッチされていない場合は `null` を返します。 複数の `BrowserView` がアタッチされている場合、エラーを送出します。 -#### `win.addBrowserView(browserView)` _Experimental_ +#### `win.addBrowserView(browserView)` _実験的_ * `browserView` [BrowserView](browser-view.md) -Replacement API for setBrowserView supporting work with multi browser views. +複数の BrowserView をサポートする setBrowserView の置換 API。 -#### `win.removeBrowserView(browserView)` _Experimental_ +#### `win.removeBrowserView(browserView)` _実験的_ * `browserView` [BrowserView](browser-view.md) -#### `win.setTopBrowserView(browserView)` _Experimental_ +#### `win.setTopBrowserView(browserView)` _実験的_ * `browserView` [BrowserView](browser-view.md) -Raises `browserView` above other `BrowserView`s attached to `win`. Throws an error if `browserView` is not attached to `win`. +`browserView` を `win` にアタッチされた他の `BrowserView` の上へと持ち上げます。 `browserView` が `win` にアタッチされていない場合, エラーを送出します。 -#### `win.getBrowserViews()` _Experimental_ +#### `win.getBrowserViews()` _実験的_ -Returns `BrowserView[]` - an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. +戻り値 `BrowserView[]` - `addBrowserView` または `setBrowserView` でアタッチされたすべての BrowserView の配列。 -**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases. +**注:** 現在のところ、BrowserView APIは実験的な機能であり、将来のElectronのリリースで変更されたり、削除されたりする可能性があります。 [runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 [page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API @@ -1452,3 +1458,5 @@ Returns `BrowserView[]` - an array of all BrowserViews that have been attached w [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/ja-JP/docs/api/clipboard.md b/content/ja-JP/docs/api/clipboard.md index dd3ed761ee99f..d13292b8ec7d9 100644 --- a/content/ja-JP/docs/api/clipboard.md +++ b/content/ja-JP/docs/api/clipboard.md @@ -1,10 +1,10 @@ # clipboard -> Perform copy and paste operations on the system clipboard. +> システムのクリップボードでコピーやペーストの操作を行います。 -Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) +プロセス: [メイン](../glossary.md#main-process), [レンダラー](../glossary.md#renderer-process) -On Linux, there is also a `selection` clipboard. To manipulate it you need to pass `selection` to each method: +Linux には、 `selection` クリップボードも存在します。 これを操作するには、各メソッドに `selection` を渡す必要があります。 ```javascript const { clipboard } = require('electron') @@ -15,15 +15,15 @@ console.log(clipboard.readText('selection')) ## メソッド -The `clipboard` module has the following methods: +`clipboard` モジュールには以下のメソッドがあります。 -**Note:** Experimental APIs are marked as such and could be removed in future. +**注:** 実験的なAPIにはそのように注記があり、将来的に削除される可能性があります。 ### `clipboard.readText([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (任意) - `selection` または `clipboard` 。既定値は 'clipboard' です。 `selection` は Linux のみで有効です。 -Returns `String` - The content in the clipboard as plain text. +戻り値 `String` - プレーンテキストでのクリップボード内のコンテンツ。 ```js const { clipboard } = require('electron') @@ -38,9 +38,9 @@ console.log(text) ### `clipboard.writeText(text[, type])` * `text` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (任意) - `selection` または `clipboard` 。既定値は 'clipboard' です。 `selection` は Linux のみで有効です。 -Writes the `text` into the clipboard as plain text. +プレーンテキストとしてクリップボードに `text` を書き込みます。 ```js const { clipboard } = require('electron') @@ -51,9 +51,9 @@ clipboard.writeText(text) ### `clipboard.readHTML([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (任意) - `selection` または `clipboard` 。既定値は 'clipboard' です。 `selection` は Linux のみで有効です。 -Returns `String` - The content in the clipboard as markup. +戻り値 `String` - マークアップでのクリップボード内のコンテンツ。 ```js const { clipboard } = require('electron') @@ -68,9 +68,9 @@ console.log(html) ### `clipboard.writeHTML(markup[, type])` * `markup` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (任意) - `selection` または `clipboard` 。既定値は 'clipboard' です。 `selection` は Linux のみで有効です。 -Writes `markup` to the clipboard. +クリップボードに `markup` を書き込みます。 ```js const { clipboard } = require('electron') @@ -80,22 +80,22 @@ clipboard.writeHTML('Hiselection

    ') console.log(hasFormat) -// 'true' or 'false +// 'true' か 'false' ``` -### `clipboard.read(format)` _Experimental_ +### `clipboard.read(format)` _実験的_ * `format` String -Returns `String` - Reads `format` type from the clipboard. +戻り値 `String` - クリップボードから `format` 形式で読み出します。 -### `clipboard.readBuffer(format)` _Experimental_ +`format` は有効な ASCII 文字を含み、`/` で区切られている必要があります。 `a/c`, `a/bc` は有効ですが、`/abc`, `abc/`, `a/`, `/a`, `a` は無効です。 + +### `clipboard.readBuffer(format)` _実験的_ * `format` String -Returns `Buffer` - Reads `format` type from the clipboard. +戻り値 `Buffer` - クリップボードから `format` 形式で読み出します。 ```js const { clipboard } = require('electron') const buffer = Buffer.from('this is binary', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) -const ret = clipboard.readBuffer('public.utf8-plain-text') +const ret = clipboard.readBuffer('public/utf8-plain-text') console.log(buffer.equals(out)) // true ``` -### `clipboard.writeBuffer(format, buffer[, type])` _Experimental_ +### `clipboard.writeBuffer(format, buffer[, type])` _実験的_ * `format` String * `buffer` Buffer -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (任意) - `selection` または `clipboard` 。既定値は 'clipboard' です。 `selection` は Linux のみで有効です。 -Writes the `buffer` into the clipboard as `format`. +`format` でクリップボードに `buffer` を書き込みます。 ```js const { clipboard } = require('electron') const buffer = Buffer.from('writeBuffer', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) ``` ### `clipboard.write(data[, type])` * `data` Object - * `text` String (optional) - * `html` String (optional) - * `image` [NativeImage](native-image.md) (optional) - * `rtf` String (optional) - * `bookmark` String (optional) - The title of the URL at `text`. -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. - -Writes `data` to the clipboard. + * `text` String (任意) + * `html` String (任意) + * `image` [NativeImage](native-image.md) (任意) + * `rtf` String (任意) + * `bookmark` String (任意) - URL のタイトルの `text`。 +* `type` String (任意) - `selection` または `clipboard` 。既定値は 'clipboard' です。 `selection` は Linux のみで有効です。 + +クリップボードに `data` を書き込みます。 ```js const { clipboard } = require('electron') diff --git a/content/ja-JP/docs/api/command-line-switches.md b/content/ja-JP/docs/api/command-line-switches.md index 5a40b9bf9baef..43bf162aee14a 100644 --- a/content/ja-JP/docs/api/command-line-switches.md +++ b/content/ja-JP/docs/api/command-line-switches.md @@ -59,17 +59,18 @@ Chromiumが隠れたページのレンダラープロセスの優先順位を下 以下の API の呼び出し元スタックログを有効にします (イベントのフィルタリング)。 * `desktopCapturer.getSources()` / `desktop-capturer-get-sources` -* `remote.require()` / `remote-require` -* `remote.getGlobal()` / `remote-get-builtin` -* `remote.getBuiltin()` / `remote-get-global` -* `remote.getCurrentWindow()` / `remote-get-current-window` -* `remote.getCurrentWebContents()` / `remote-get-current-web-contents` -### --enable-logging +### --enable-logging[=file] -コンソールにChromiumのログを出力します。 +標準エラー出力 (またはログファイル) に Chromium のログを出力します。 -このスイッチは、ユーザのアプリがロードされるよりも早く解析されるため、`app.commandLine.appendSwitch` で使用することはできませんが、同じ効果を得るために `ELECTRON_ENABLE_LOGGING` 環境変数を設定することができます。 +`ELECTRON_ENABLE_LOGGING` 環境変数への設定は `--enable-logging` を渡すのと同じ効果です。 + +`--enable-logging` を渡すと、標準エラー出力にログを出力すます。 `--enable-logging=file` を渡すと、ログは `--log-file=...` で指定したファイルに、`--log-file` が未指定の場合はユーザデータディレクトリの `electron_debug.log` に保存されます。 + +> **注意:** Windows では、子プロセスからのログを標準エラー出力に送信できません。 Windows でのログ収集は、ファイルへのログ出力が最も信頼できる方法です。 + +`--log-file`, `--log-level`, `--v`, `--vmodule` もご参照ください。 ### --force-fieldtrials=`trials` @@ -116,10 +117,26 @@ $ electron --js-flags="--harmony_proxies --harmony_collections" your-app カスタムロケールを設定します。 +### --log-file=`path` + +`--enable-logging` が指定された場合、ログを指定のパスに書き込みます。 その親ディレクトリは存在していなければなりません。 + +環境変数 `ELECTRON_LOG_FILE` への設定は、このフラグを渡すことと等価です。 両方とも存在する場合はコマンドラインスイッチを優先します。 + ### --log-net-log=`path` 保存されるネットワークログイベントを有効にし、`path` にそれらを書き込みます。 +### --log-level=`N` + +`--enable-logging` と一緒に使用することで、ログの詳細度を設定します。 `N` は [ChromeのLogSeverities][severities] のいずれかでなければなりません。 + +注意として、Chromium の 2 つの相補的なログメカニズムである `LOG()` と `VLOG()` は、それぞれ別のスイッチで制御しています。 `--log-level` は `LOG()` のメッセージを制御しますが、`--v` と `--vmodule` は `VLOG()` のメッセージを制御します。 そのため、必要な詳細度やウォッチしようとしているコードで行われているロギング呼び出しに応じて、これら 3 つのスイッチを組み合わせて使用するとよいでしょう。 + +`LOG()` と `VLOG()` の相互作用の詳細については、[Chromium ロギングのソース][logging] をご参照ください。 大まかに言えば、`VLOG()` は大量の `LOG(INFO)` データを制御する `LOG(INFO)` 内部のサブレベル / モジュールごとのレベルと考えられます。 + +`--enable-logging`, `--log-level`, `--v`, `--vmodule` もご参照ください。 + ### --no-proxy-server プロキシサーバを使わず、常に直接接続を行います。 他に与えられたプロキシサーバのフラグをすべて上書きします。 @@ -159,6 +176,8 @@ app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com このスイッチは、`--enable-logging` が一緒に渡されたときのみ機能します。 +`--enable-logging`, `--log-level`, `--vmodule` もご参照ください。 + ### --vmodule=`pattern` `--v` で指定された値を上書きするモジュール単位の最大のVログレベルを指定します。 以下は例です。 `my_module=2,foo*=3` は、`my_module.*` と `foo*.*` のソースファイルにあるすべてのコードのログレベルを変更します。 @@ -167,6 +186,8 @@ app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com このスイッチは、`--enable-logging` が一緒に渡されたときのみ機能します。 +`--enable-logging`, `--log-level`, `--v` もご参照ください。 + ### --force_high_performance_gpu 複数のGPUが利用可能な場合、離散GPUを強制的に使用します。 @@ -214,5 +235,7 @@ V8 インスペクタの統合により、Chrome デベロッパー ツールや [ready]: app.md#event-ready [play-silent-audio]: https://github.com/atom/atom/pull/9485/files [debugging-main-process]: ../tutorial/debugging-main-process.md +[logging]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h [node-cli]: https://nodejs.org/api/cli.html [node-cli]: https://nodejs.org/api/cli.html +[severities]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h?q=logging::LogSeverity&ss=chromium diff --git a/content/ja-JP/docs/api/dialog.md b/content/ja-JP/docs/api/dialog.md index 7ba4d5ce06963..ba3e8401f9298 100644 --- a/content/ja-JP/docs/api/dialog.md +++ b/content/ja-JP/docs/api/dialog.md @@ -186,8 +186,6 @@ dialog.showOpenDialog(mainWindow, { * `defaultId` Integer (任意) - メッセージボックスを開いたとき、既定で選択されるボタンの配列の中のボタンのインデックス。 * `title` String (任意) - メッセージボックスのタイトル。いくつかのプラットフォームでは表示されません。 * `detail` String (任意) - メッセージの追加情報。 - * `checkboxLabel` String (任意) - 指定した場合、メッセージボックスには、指定したラベルを持つチェックボックスが含まれます。 - * `checkboxChecked` Boolean (任意) - チェックボックスの初期のチェック状態。 省略値は `false` です。 * `icon` ([NativeImage](native-image.md) | String) (任意) * `cancelId` Integer (任意) - `Esc` キー経由でダイアログをキャンセルするのに使用されるボタンのインデックス。 既定では、これはラベルとして "cancel" または "no" の付いた最初のボタンに割り当てられます。 そのようにラベル付けされたボタンがなく、このオプションが設定されていない場合、`0` が戻り値として使用されます。 * `noLink` Boolean (任意) - WindowsでElectronはどの `buttons` が ("Cancel" や "Yes" のような) 一般的なボタンかを把握し、その他をダイアログでコマンドリンクとして表示しようとします。 これにより、モダンなWindowsアプリのスタイルでダイアログを表示させることができます。 この動作が気に入らない場合、`noLink` を `true` に設定することができます。 diff --git a/content/ja-JP/docs/api/environment-variables.md b/content/ja-JP/docs/api/environment-variables.md index 17d013dbcf14d..5b0426c09d1ee 100644 --- a/content/ja-JP/docs/api/environment-variables.md +++ b/content/ja-JP/docs/api/environment-variables.md @@ -104,7 +104,15 @@ Linux でゴミの実装を設定します。 既定値は `gio` です。 ### `ELECTRON_ENABLE_LOGGING` -コンソールにChromeの内部ログを出力します。 +コンソールに Chromium の内部ログを出力します。 + +この変数への設定は、コマンドラインで `--enable-logging` を渡すのと同じです。 詳しくは、[コマンドラインスイッチ](./command-line-switches.md#enable-loggingfile) の `--enable-logging` をご覧ください。 + +### `ELECTRON_LOG_FILE` + +Chromium の内部ログの保存先ファイルを設定します。 + +この変数への設定は、コマンドラインで `--log-file` を渡すのと同じです。 詳細は、 [コマンドラインスイッチ](./command-line-switches.md#log-filepath) の `--log-file` をご参照ください。 ### `ELECTRON_DEBUG_DRAG_REGIONS` diff --git a/content/ja-JP/docs/api/extensions.md b/content/ja-JP/docs/api/extensions.md index 91eeb62cc4b4f..6c8a8f34b6fa5 100644 --- a/content/ja-JP/docs/api/extensions.md +++ b/content/ja-JP/docs/api/extensions.md @@ -64,6 +64,7 @@ session.loadExtension('path/to/unpacked/extension').then(({ id }) => { - `chrome.runtime.getURL` - `chrome.runtime.connect` - `chrome.runtime.sendMessage` +- `chrome.runtime.reload` `chrome.runtime` のうち以下のイベントがサポートされています。 diff --git a/content/ja-JP/docs/api/frameless-window.md b/content/ja-JP/docs/api/frameless-window.md index fbf5634303db1..c6aa777b18f80 100644 --- a/content/ja-JP/docs/api/frameless-window.md +++ b/content/ja-JP/docs/api/frameless-window.md @@ -14,13 +14,13 @@ const win = new BrowserWindow({ width: 800, height: 600, frame: false }) win.show() ``` -### macOSでの他の方法 +### 代替手段 -枠のないウインドウを指定する他の方法があります。 タイトルバーとウインドウコントロールの両方が無効になる `frame` を `false` に設定する方法の代わりに、タイトルバーを非表示にし、コンテンツをフルウインドウサイズに拡大しつつ、標準のウインドウアクションのためにウインドウコントロール ("信号ボタン") を保持し続けることもできます。 `titleBarStyle` オプションを指定すると、そのようにすることができます。 +macOS と Windows ではフレームレスウインドウを指定する方法が他にあります。 タイトルバーとウインドウコントロールの両方が無効になる `frame` を `false` に設定する方法の代わりに、タイトルバーを非表示にし、コンテンツをフルウインドウサイズに拡大しつつ、標準のウインドウアクションのためにウインドウコントロール (macOS での "信号ボタン") を保持し続けることもできます。 `titleBarStyle` オプションを指定すると、そのようにすることができます。 #### `hidden` -タイトルバーが非表示かつフルサイズのコンテンツウインドウになりますが、タイトルバーには、まだ標準のウインドウコントロール ("信号") が左上にあります。 +タイトルバーが隠れ、フルサイズのコンテンツウインドウになります。 macOS では、タイトルバーの左上に標準ウインドウコントロール ("信号機ボタン") が付きます。 ```javascript const { BrowserWindow } = require('electron') @@ -28,6 +28,8 @@ const win = new BrowserWindow({ titleBarStyle: 'hidden' }) win.show() ``` +### macOSでの他の方法 + #### `hiddenInset` ウインドウの端から信号ボタンが少し埋め込まれた別の見た目でタイトルバーが非表示になります。 @@ -48,6 +50,33 @@ const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: fa win.show() ``` +## ウインドウコントロールオーバーレイ + +フレームレスウインドウを macOS の `win.setWindowButtonVisibility(true)` と組み合わせて使用したり、信号機ボタンが見えるように上述の `titleBarStyle` のいずれかを使用したり、Windows の `titleBarStyle: hidden` を使用したりしているとき、`titleBarOverlay` のオプションを true に設定するとウィンドウコントロールオーバーレイ [JavaScript API][overlay-javascript-apis] と [CSS 環境変数][overlay-css-env-vars] にアクセスできます。 `true` を指定すると、オーバーレイはデフォルトのシステムカラーになります。 + +Windows では、`color` と `symbolColor` のオプションで作った `titleBarOverlay` オブジェクトを設定することで、オーバーレイとそのシンボルの色指定もできます。 以下のようにオプションを指定しない場合、ウインドウコントロールボタンの色はデフォルトでシステムカラーになります。 + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: true +}) +win.show() +``` + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: { + color: '#2f3241', + symbolColor: '#74b1be' + } +}) +win.show() +``` + ## 透明なウインドウ `transparent` オプションを `true` に設定することで、フレームレスウインドウを透明にすることもできます。 @@ -142,3 +171,5 @@ button { いくつかのプラットフォームでは、ドラッグ可能な領域は非クライアントのフレームとして扱われます。そのため、ドラッグ可能な領域を右クリックすると、システムメニューが現れます。 すべてのプラットフォームでコンテキストメニューが正しく動作するようにするには、絶対にカスタムのコンテキストメニューをドラッグ可能な領域で使用しないようにしてください。 [ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options +[overlay-javascript-apis]: https://github. com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/ja-JP/docs/api/ipc-main.md b/content/ja-JP/docs/api/ipc-main.md index 6636d04856948..815f9efbda42e 100644 --- a/content/ja-JP/docs/api/ipc-main.md +++ b/content/ja-JP/docs/api/ipc-main.md @@ -32,6 +32,8 @@ ipcMain.on('synchronous-message', (event, arg) => { ```javascript // レンダラープロセス(ウェブページ) +// 備考: Electron の API は、contextIsolation が無効でない限りプリロードからのみアクセスできます。 +// 詳細は https://www.electronjs.org/docs/tutorial/process-model#preload-scripts をご参照ください。 const { ipcRenderer } = require('electron') console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // "pong"を表示 diff --git a/content/ja-JP/docs/api/menu-item.md b/content/ja-JP/docs/api/menu-item.md index 342a83fd5fd54..202492ace1729 100644 --- a/content/ja-JP/docs/api/menu-item.md +++ b/content/ja-JP/docs/api/menu-item.md @@ -13,7 +13,7 @@ * `menuItem` MenuItem * `browserWindow` [BrowserWindow](browser-window.md) | undefined - ウインドウが開かれていないときは undefined になります。 * `event` [KeyboardEvent](structures/keyboard-event.md) - * `role` String (任意) - `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow`, `windowMenu` のいずれかにできます。メニューアイテムのアクションを定義します。指定すると `click` プロパティは無視されます。 [役割 (roles)](#roles) を参照してください。 + * `role` String (任意) - `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow`, `windowMenu` のいずれかにできます。メニューアイテムのアクションを定義します。指定すると `click` プロパティは無視されます。 [役割 (roles)](#roles) を参照してください。 * `type` String (任意) - `normal`、`separator`、`submenu`、`checkbox`、`radio` にできる。 * `label` String (任意) * `sublabel` String (任意) @@ -128,7 +128,7 @@ MenuItem がクリックイベントを受け取った時に発火される `Fun #### `menuItem.role` -セットされている場合、アイテムの役割を示す `String` (任意)。 `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow`, `windowMenu` のいずれかにできます。 +セットされている場合、アイテムの役割を示す `String` (任意)。 `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow`, `windowMenu` のいずれかにできます。 #### `menuItem.accelerator` diff --git a/content/ja-JP/docs/api/menu.md b/content/ja-JP/docs/api/menu.md index 78a14b9788614..02760ee2c9810 100644 --- a/content/ja-JP/docs/api/menu.md +++ b/content/ja-JP/docs/api/menu.md @@ -143,7 +143,7 @@ const template = [ { role: 'services' }, { type: 'separator' }, { role: 'hide' }, - { role: 'hideothers' }, + { role: 'hideOthers' }, { role: 'unhide' }, { type: 'separator' }, { role: 'quit' } diff --git a/content/ja-JP/docs/api/power-monitor.md b/content/ja-JP/docs/api/power-monitor.md index 324e307eee4d1..0a87a76564bd4 100644 --- a/content/ja-JP/docs/api/power-monitor.md +++ b/content/ja-JP/docs/api/power-monitor.md @@ -8,11 +8,11 @@ `powerMonitor` モジュールでは以下のイベントが発生します。 -### イベント: 'suspend' _macOS_ _Windows_ +### イベント: 'suspend' システムがサスペンドするときに発生します。 -### イベント: 'resume' _macOS_ _Windows_ +### イベント: 'resume' システムが再開するときに発生します。 diff --git a/content/ja-JP/docs/api/session.md b/content/ja-JP/docs/api/session.md index e8979c974a6aa..a531cdf6267f2 100644 --- a/content/ja-JP/docs/api/session.md +++ b/content/ja-JP/docs/api/session.md @@ -160,7 +160,7 @@ hunspell 辞書ファイルのダウンロードに成功したときに発生 hunspell 辞書ファイルのダウンロードが失敗したときに発生します。 失敗の詳細は、netlog を収集してダウンロードリクエストを調べる必要があります。 -#### イベント: 'select-serial-port' _実験的_ +#### イベント: 'select-serial-port' 戻り値: @@ -172,21 +172,15 @@ hunspell 辞書ファイルのダウンロードが失敗したときに発生 `navigator.serial.requestPort` の呼び出し時にシリアルポートを選択する必要がある場合に発生します。 `callback` は選んだ `portId` で呼び出されなければなりません。空の文字列を `callback` に渡すとリクエストがキャンセルされます。 さらに、[ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler) を `serial` パーミッションで使用することで `navigator.serial` のパーミッションを管理できます。 -これは実験的な機能であるため、デフォルトでは無効になっています。 この機能を有効にするには、`--enable-features=ElectronSerialChooser` コマンドラインスイッチを使用する必要があります。 加えて、これは実験的な Chromium の機能なので、BrowserWindow を開くとき`webPreferences` プロパティに `enableBlinkFeatures: 'Serial'` を設定する必要があります。 - ```javascript const { app, BrowserWindow } = require('electron') let win = null -app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser') app.whenReady().then(() => { win = new BrowserWindow({ width: 800, - height: 600, - webPreferences: { - enableBlinkFeatures: 'Serial' - } + height: 600 }) win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => { event.preventDefault() @@ -202,7 +196,7 @@ app.whenReady().then(() => { }) ``` -#### イベント: 'serial-port-added' _Experimental_ +#### イベント: 'serial-port-added' 戻り値: @@ -212,7 +206,7 @@ app.whenReady().then(() => { `navigator.serial.requestPort` が呼び出され新しいシリアルポートが利用可能になった場合に、`select-serial-port` が発生した後に発生します。 例えば、このイベントは新しい USB デバイスが接続されたときに発生します。 -#### イベント: 'serial-port-removed' _実験的_ +#### イベント: 'serial-port-removed' 戻り値: @@ -452,7 +446,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents #### `ses.setPermissionCheckHandler(handler)` * `handler` Function\ | null - * `webContents` ([WebContents](web-contents.md) | null) - 権限を確認している WebContents リクエストがサブフレームからのものである場合、リクエストのオリジンを確認するためには `requestingUrl` を使用する必要があることに注意してください。 権限を確認しているのがクロスオリジンのサブフレームの場合、このハンドラには `null` の webContents が渡されます。 `embeddingOrigin` と `requestingOrigin` を使用して、所有しているフレームと要求しているフレームがそれぞれどのオリジンにあるかを判断する必要があります。 + * `webContents` ([WebContents](web-contents.md) | null) - 権限を確認している WebContents リクエストがサブフレームからのものである場合、リクエストのオリジンを確認するためには `requestingUrl` を使用する必要があることに注意してください。 すべてのクロスオリジンサブフレームによる権限の確認はハンドラの webContents に `null` が渡されますが、`notifications` の確認のような、ある特定の権限の確認では常に `null` が渡されます。 `embeddingOrigin` と `requestingOrigin` を使用して、所有しているフレームと要求しているフレームがそれぞれどのオリジンにあるかを判断する必要があります。 * `permission` String - 権限確認の種別です。 有効な値は `midiSysex`、`notifications`、`geolocation`、`media`、`mediaKeySystem`、`midi`、`pointerLock`、`fullscreen`、`openExternal`、`serial` です。 * `requestingOrigin` String - 権限チェックのオリジン URL * `details` Object - このプロパティの一部は、特定の権限タイプでのみ使用できます。 diff --git a/content/ja-JP/docs/api/structures/overlay-options.md b/content/ja-JP/docs/api/structures/overlay-options.md new file mode 100644 index 0000000000000..e4a25ed0c1d82 --- /dev/null +++ b/content/ja-JP/docs/api/structures/overlay-options.md @@ -0,0 +1,4 @@ +# OverlayOptions オブジェクト + +* `color` String (任意) _Windows_ - 有効化されたウインドウコントロールオーバーレイの CSS の色。 既定値はシステムカラーです。 +* `symbolColor` String (任意) _Windows_ - 有効化されたウインドウコントロールオーバーレイ内の記号の CSS の色。 既定値はシステムカラーです。 diff --git a/content/ja-JP/docs/api/structures/user-default-types.md b/content/ja-JP/docs/api/structures/user-default-types.md new file mode 100644 index 0000000000000..5cd64511aa2dd --- /dev/null +++ b/content/ja-JP/docs/api/structures/user-default-types.md @@ -0,0 +1,12 @@ +# UserDefaultTypes オブジェクト + +* `string` String +* `boolean` Boolean +* `integer` Number +* `float` Number +* `double` Number +* `url` String +* `array` Array\ +* `dictionary` Record\ + +この型はヘルパーエイリアスであり、この型のオブジェクトが存在することはありません。 diff --git a/content/ja-JP/docs/api/system-preferences.md b/content/ja-JP/docs/api/system-preferences.md index aa6c902121cf0..c70dc76cc92b6 100644 --- a/content/ja-JP/docs/api/system-preferences.md +++ b/content/ja-JP/docs/api/system-preferences.md @@ -147,12 +147,12 @@ macOS のネイティブ通知として `event` を送信します。 `userInfo` アプリケーションの `NSUserDefaults` へ指定したデフォルトを追加します。 -### `systemPreferences.getUserDefault(key, type)` _macOS_ +### `systemPreferences.getUserDefault(key, type)` _macOS_ * `key` String -* `type` String - `string`、`boolean`、`integer`、`float`、`double`、`url`、`array` または `dictionary` にできます。 +* `type` Type - `string`、`boolean`、`integer`、`float`、`double`、`url`、`array`、`dictionary` のいずれかにできます。 -戻り値 `any` - `NSUserDefaults` 内の `key` の値。 +戻り値 [`UserDefaultTypes[Type]`](structures/user-default-types.md) - `NSUserDefaults` 内の `key` の値。 いくつかの一般的な `key` と `value` は以下です。 diff --git a/content/ja-JP/docs/api/touch-bar-scrubber.md b/content/ja-JP/docs/api/touch-bar-scrubber.md index b40972b232005..16b97f3c6471a 100644 --- a/content/ja-JP/docs/api/touch-bar-scrubber.md +++ b/content/ja-JP/docs/api/touch-bar-scrubber.md @@ -14,7 +14,7 @@ * `highlightedIndex` Integer - ユーザがタッチしたアイテムのインデックス. * `selectedStyle` String (任意) - 選択したアイテムのスタイル。 `background`、`outline`、`none` のいずれかにできます。 省略値は `none` です。 * `overlayStyle` String (任意) - 選択したオーバーレイアイテムのスタイル。 `background`、`outline`、`none` のいずれかにできます。 省略値は `none` です。 - * `showArrowButtons` Boolean (任意) - 省略値は、`false` になります。 + * `showArrowButtons` Boolean (任意) - 矢印ボタンを表示するかどうか。 省略値は `false` で、`items` が空でない場合にのみ表示されます。 * `mode` String (任意) - `fixed` か `free` にできます。 省略値は `free` です。 * `continuous` Boolean (任意) - 省略値は、`true` になります。 diff --git a/content/ja-JP/docs/api/web-contents.md b/content/ja-JP/docs/api/web-contents.md index e7936823cf49c..051eed8687072 100644 --- a/content/ja-JP/docs/api/web-contents.md +++ b/content/ja-JP/docs/api/web-contents.md @@ -39,6 +39,24 @@ console.log(webContents) 戻り値 `WebContents` | undefined - 指定 ID の WebContents インスタンス。指定 ID に関連付けられた WebContents が存在しない場合は `undefined` です。 +### `webContents.fromDevToolsTargetId(targetId)` + +* `targetId` String - WebContents インスタンスに関連付けられた Chrome デベロッパー ツールプロトコルの [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID)。 + +戻り値 `WebContents` | undefined - 指定 TargetID の WebContents インスタンス。指定 TargetID に関連付けられた WebContents が存在しない場合は `undefined` です。 + +[Chrome デベロッパー ツールプロトコル](https://chromedevtools.github.io/devtools-protocol/) と通信する際に、割り当てられた TargetID で WebContents インスタンスを検索すると便利な場合があります。 + +```js +async function lookupTargetId (browserWindow) { + const wc = browserWindow.webContents + await wc.debugger.attach('1.3') + const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo') + const { targetId } = targetInfo + const targetWebContents = await webContents.fromDevToolsTargetId(targetId) +} +``` + ## クラス: WebContents > BrowserWindow インスタンスのコンテンツを、描画し、制御します。 @@ -134,7 +152,7 @@ console.log(webContents) * `frameName` String * `disposition` String - `default`、`foreground-tab`、`background-tab`、`new-window`、`save-to-disk`、`other` にできる。 * `options` BrowserWindowConstructorOptions - 新しい [`BrowserWindow`](browser-window.md) を作成するのに使われるオプション。 -* `additionalFeatures` String[] - `window.open()` に与えられている、標準でない機能 (Chromium や Electron によって処理されない機能)。 +* `additionalFeatures` String[] - `window.open()` に与えられている、標準でない機能 (Chromium や Electron によって処理されない機能)。 非推奨であり、現在は必ず空の配列 `[]` になります。 * `referrer` [Referrer](structures/referrer.md) - 新しいウィンドウへ渡される Referrer。 Referrer のポリシーに依存しているので、`Referrer` ヘッダを送信されるようにしてもしなくてもかまいません。 * `postBody` [PostBody](structures/post-body.md) (任意) - 新しいウィンドウに送信する POST データと、それにセットする適切なヘッダ。 送信する POST データが無い場合、値は `null` になります。 これは `target=_blank` を設定したフォームによってウィンドウが作成されている場合にのみセットされます。 @@ -178,8 +196,7 @@ myBrowserWindow.webContents.on('new-window', (event, url, frameName, disposition * `details` Object * `url` String - 作成したウインドウの URL。 * `frameName` String - `window.open()` の呼び出しで作成したウインドウに指定した名前。 - * `options` BrowserWindowConstructorOptions - その BrowserWindow の作成に使用したオプション。 これはマージされたもので、親ウインドウから継承したオプション、`window.open()` の `features` 文字列から解析したオプション、[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler) で指定したオプションの順で優先されます。 認識できないオプションが取り除かれることはありません。 - * `additionalFeatures` String[] - 非標準の機能 (この機能は Chromium や Electron によって処理されません) _非推奨_ + * `options` BrowserWindowConstructorOptions - その BrowserWindow の作成に使用したオプション。 これらは、`window.open()` の `features` 文字列から解析されたオプション、親ウインドウから継承されたセキュリティ関連の webPreferences、[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler) で与えられたオプションなどが優先度の高い順に結合されたものです。 認識できないオプションが取り除かれることはありません。 * `referrer` [Referrer](structures/referrer.md) - 新しいウィンドウへ渡される Referrer。 リファラのポリシーに応じた `Referer` ヘッダーが送信されるとは限りません。 * `postBody` [PostBody](structures/post-body.md) (任意) - 新しいウィンドウに送信される POST データと、設定される適切なヘッダです。 送信する POST データが無い場合、値は `null` になります。 これは `target=_blank` を設定したフォームによってウィンドウが作成されている場合にのみセットされます。 * `disposition` String - `default`、`foreground-tab`、`background-tab`、`new-window`、`save-to-disk`、`other` にできます。 @@ -320,6 +337,8 @@ win.webContents.on('will-prevent-unload', (event) => { }) ``` +**注意:** これは `BrowserView` に対して発生しますが、尊重 _されません_。これは、[仕様](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) にあるように、`BrowserView` のライフサイクルはそれを所有する BrowserWindow に結び付けないとしたためです。 + #### イベント: 'crashed' _非推奨_ 戻り値: @@ -726,49 +745,6 @@ win.loadURL('http://github.com') レンダラープロセス内で `desktopCapture.getSources()` が呼ばれたときに発生します。 `event.preventDefault()` を呼び出すと、空のソースを返します。 -#### イベント: 'remote-require' _非推奨_ - -戻り値: - -* `event` IpcMainEvent -* `モジュール名` String - -レンダラープロセス内で `remote.require()` が呼ばれたときに発行されます。 `event.preventDefault()` を呼ぶとモジュールの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - -#### イベント: 'remote-get-global' _非推奨_ - -戻り値: - -* `event` IpcMainEvent -* `globalName` String - -レンダラープロセス内で `remote.getGlobal()` が呼ばれたときに発行されます。 `event.preventDefault()` を呼ぶとグローバルの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - -#### イベント: 'remote-get-builtin' _非推奨_ - -戻り値: - -* `event` IpcMainEvent -* `モジュール名` String - -レンダラープロセス内で `remote.getBuiltin()` が呼ばれたときに発生します。 `event.preventDefault()` を呼ぶとモジュールの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - -#### イベント: 'remote-get-current-window' _非推奨_ - -戻り値: - -* `event` IpcMainEvent - -レンダラープロセス内で `remote.getCurrentWindow()` が呼ばれたときに発生します。 `event.preventDefault()` を呼ぶとオブジェクトの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - -#### イベント: 'remote-get-current-web-contents' _非推奨_ - -戻り値: - -* `event` IpcMainEvent - -レンダラープロセス内で `remote.getCurrentWebContents()` が呼ばれたときに発生します。 `event.preventDefault()` を呼ぶとオブジェクトの返却が阻害されます。 `event.returnValue` にセットすることでカスタムな値を返すことが出来ます。 - #### イベント: 'preferred-size-changed' 戻り値: @@ -1040,7 +1016,7 @@ contents.executeJavaScript('fetch("https://jsonplaceholder.typicode.com/users/1" 戻り値 `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` を返すと新規ウインドウの作成をキャンセルします。 `allow` を返すと新規ウインドウが作成されます。 `overrideBrowserWindowOptions` を指定すると、作成されるウィンドウをカスタマイズできます。 null、undefined、規定の 'action' の値を持たないオブジェクトといった認識されない値を返すと、コンソールエラーになり、`{action: 'deny'}` を返すのと同じ効果となります。 -レンダラーから `window.open()` が呼び出されたときに、ウィンドウの作成前に呼び出されます。 詳細や `did-create-window` と併せた使用方法については [`window.open()`](window-open.md) をご参照ください。 +`window.open()`、`target="_blank"` のリンク、リンクのシフトクリック、`` のフォーム送信などによりレンダラーが新しいウインドウを要求すると、ウインドウ作成前に呼び出されます。 詳細や `did-create-window` と併せた使用方法については [`window.open()`](window-open.md) をご参照ください。 #### `contents.setAudioMuted(muted)` diff --git a/content/ja-JP/docs/api/web-frame-main.md b/content/ja-JP/docs/api/web-frame-main.md index 78c6ca0a2abd4..a34a8cb358c48 100644 --- a/content/ja-JP/docs/api/web-frame-main.md +++ b/content/ja-JP/docs/api/web-frame-main.md @@ -154,3 +154,9 @@ ipcRenderer.on('port', (e, msg) => { #### `frame.routingId` _読み出し専用_ 現在のレンダラープロセスでの一意なフレーム ID を表す `Integer`。 同じ基底フレームを参照する `WebFrameMain` インスタンスすべては、それぞれ同じ `routingId` になります。 + +#### `frame.visibilityState` _読み出し専用_ + +`string` 型で、そのフレームの [可視性の状態](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) を表します。 + +[Page 可視性 API](browser-window.md#page-visibility) が他の Electron API から受ける影響についてもご覧ください。 diff --git a/content/ja-JP/docs/api/web-request.md b/content/ja-JP/docs/api/web-request.md index 64d132927ddb2..c1f4fabd7f0ef 100644 --- a/content/ja-JP/docs/api/web-request.md +++ b/content/ja-JP/docs/api/web-request.md @@ -46,17 +46,14 @@ session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback * `webContentsId` Integer (任意) * `webContents` WebContents (任意) * `frame` WebFrameMain (任意) - * `resourceType` String + * `resourceType` String - `mainFrame`、`subFrame`、`stylesheet`、`script`、`image`、`font`、`object`、`xhr`、`ping`、`cspReport`、`media`、`webSocket`、`other` のいずれかにできます。 * `referrer` String * `timestamp` Double - * `uploadData` - -UploadD[ata[]](structures/upload-data.md) - - * `callback` Function - * `response` Object - * `cancel` Boolean (任意) - * `redirectURL` String (任意) - 元のリクエストは送信または終了されず、代わりに指定された URL にリダイレクトされます。 + * `uploadData` [UploadData[]](structures/upload-data.md) + * `callback` Function + * `response` Object + * `cancel` Boolean (任意) + * `redirectURL` String (任意) - 元のリクエストは送信または終了されず、代わりに指定された URL にリダイレクトされます。 `listener` は、リクエストが発生しようとしているときに `listener(details, callback)` で呼ばれます。 @@ -66,8 +63,6 @@ UploadD[ata[]](structures/upload-data.md) いくつか有効な `url` の例を示します。 - - ```js 'http://foo:1234/' 'http://foo.com/' @@ -81,171 +76,137 @@ UploadD[ata[]](structures/upload-data.md) '*://www.foo.com/' ``` - - - #### `webRequest.onBeforeSendHeaders([filter, ]listener)` * `filter` Object (任意) - - * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 + * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 * `listener` Function | null - - * `details` Object - * `id` Integer + * `details` Object + * `id` Integer * `url` String * `method` String * `webContentsId` Integer (任意) * `webContents` WebContents (任意) * `frame` WebFrameMain (任意) - * `resourceType` String + * `resourceType` String - `mainFrame`、`subFrame`、`stylesheet`、`script`、`image`、`font`、`object`、`xhr`、`ping`、`cspReport`、`media`、`webSocket`、`other` のいずれかにできます。 * `referrer` String * `timestamp` Double * `requestHeaders` Record - * `callback` Function - * `beforeSendResponse` Object - * `cancel` Boolean (任意) + * `callback` Function + * `beforeSendResponse` Object + * `cancel` Boolean (任意) * `requestHeaders` Record (任意) - 指定すると、これらのヘッダでリクエストが作成されます。 リクエストヘッダが利用可能になると、HTTP リクエストを送信する前に `listener` が `listener(details, callback)` で呼び出されます。 これは、サーバーに TCP 接続が行われた後、HTTP データが送信される前に発生する可能性があります。 `callback` は、`response` オブジェクトで呼ぶ必要があります。 - - #### `webRequest.onSendHeaders([filter, ]listener)` * `filter` Object (任意) - - * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 + * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 * `listener` Function | null - - * `details` Object - * `id` Integer + * `details` Object + * `id` Integer * `url` String * `method` String * `webContentsId` Integer (任意) * `webContents` WebContents (任意) * `frame` WebFrameMain (任意) - * `resourceType` String + * `resourceType` String - `mainFrame`、`subFrame`、`stylesheet`、`script`、`image`、`font`、`object`、`xhr`、`ping`、`cspReport`、`media`、`webSocket`、`other` のいずれかにできます。 * `referrer` String * `timestamp` Double * `requestHeaders` Record `listener` は、リクエストがサーバに送信される直前に `listener(details)` で呼び出され、以前の `onBeforeSendHeaders` レスポンスの変更は、このリスナが起動される時までに表示されます。 - - #### `webRequest.onHeadersReceived([filter, ]listener)` * `filter` Object (任意) - - * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 + * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 * `listener` Function | null - - * `details` Object - * `id` Integer + * `details` Object + * `id` Integer * `url` String * `method` String * `webContentsId` Integer (任意) * `webContents` WebContents (任意) * `frame` WebFrameMain (任意) - * `resourceType` String + * `resourceType` String - `mainFrame`、`subFrame`、`stylesheet`、`script`、`image`、`font`、`object`、`xhr`、`ping`、`cspReport`、`media`、`webSocket`、`other` のいずれかにできます。 * `referrer` String * `timestamp` Double * `statusLine` String * `statusCode` Integer * `responseHeaders` Record (任意) * `callback` Function - - * `headersReceivedResponse` Object - - * `cancel` Boolean (任意) + * `headersReceivedResponse` Object + * `cancel` Boolean (任意) * `responseHeaders` Record (任意) - 指定すると、サーバはこれらのヘッダでレスポンスしたものとみなされます。 - * `statusLine` String (任意) - ヘッダのステータスを変更するために `responseHeaders` をオーバーライドする場合に指定する必要があります。そうしないと、元の応答ヘッダのステータスが使用されます。 `listener` は、HTTP リクエストのレスポンスヘッダを受信したときに `listener(details, callback)` で呼ばれます。 `callback` は、`response` オブジェクトで呼ぶ必要があります。 - - #### `webRequest.onResponseStarted([filter, ]listener)` * `filter` Object (任意) - - * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 + * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 * `listener` Function | null - - * `details` Object - - * `id` Integer + * `details` Object + * `id` Integer * `url` String * `method` String * `webContentsId` Integer (任意) * `webContents` WebContents (任意) * `frame` WebFrameMain (任意) - * `resourceType` String + * `resourceType` String - `mainFrame`、`subFrame`、`stylesheet`、`script`、`image`、`font`、`object`、`xhr`、`ping`、`cspReport`、`media`、`webSocket`、`other` のいずれかにできます。 * `referrer` String * `timestamp` Double * `responseHeaders` Record (任意) * `fromCache` Boolean - レスポンスがディスクキャッシュからフェッチされたかどうかを示します。 - * `statusCode` Integer - * `statusLine` String `listener` は、レスポンスボディの最初のバイトを受信したときに `listener(details)` で呼ばれます。 HTTP リクエストの場合、これはステータスラインとレスポンスヘッダが使用可能であることを意味します。 - - #### `webRequest.onBeforeRedirect([filter, ]listener)` * `filter` Object (任意) - - * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 + * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 * `listener` Function | null - - * `details` Object - - * `id` Integer + * `details` Object + * `id` Integer * `url` String * `method` String * `webContentsId` Integer (任意) * `webContents` WebContents (任意) * `frame` WebFrameMain (任意) - * `resourceType` String + * `resourceType` String - `mainFrame`、`subFrame`、`stylesheet`、`script`、`image`、`font`、`object`、`xhr`、`ping`、`cspReport`、`media`、`webSocket`、`other` のいずれかにできます。 * `referrer` String * `timestamp` Double * `redirectURL` String * `statusCode` Integer * `statusLine` String * `ip` String (任意) - リクエストが実際に送信されたサーバーの IP アドレス。 - * `fromCache` Boolean - * `responseHeaders` Record (任意) `listener` は、サーバーが始めたリダイレクトが発生しようとしているときに `listener(details)` で呼ばれます。 - - #### `webRequest.onCompleted([filter, ]listener)` * `filter` Object (任意) - - * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 + * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 * `listener` Function | null - - * `details` Object - * `id` Integer + * `details` Object + * `id` Integer * `url` String * `method` String * `webContentsId` Integer (任意) * `webContents` WebContents (任意) * `frame` WebFrameMain (任意) - * `resourceType` String + * `resourceType` String - `mainFrame`、`subFrame`、`stylesheet`、`script`、`image`、`font`、`object`、`xhr`、`ping`、`cspReport`、`media`、`webSocket`、`other` のいずれかにできます。 * `referrer` String * `timestamp` Double * `responseHeaders` Record (任意) @@ -256,23 +217,19 @@ UploadD[ata[]](structures/upload-data.md) `listener` は、リクエストが終了したときに `listener(details)` で呼ばれます。 - - #### `webRequest.onErrorOccurred([filter, ]listener)` * `filter` Object (任意) - - * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 + * `urls` String[] - URL パターンと一致しないリクエストを除去するために使用される URL パターンの配列。 * `listener` Function | null - - * `details` Object - * `id` Integer + * `details` Object + * `id` Integer * `url` String * `method` String * `webContentsId` Integer (任意) * `webContents` WebContents (任意) * `frame` WebFrameMain (任意) - * `resourceType` String + * `resourceType` String - `mainFrame`、`subFrame`、`stylesheet`、`script`、`image`、`font`、`object`、`xhr`、`ping`、`cspReport`、`media`、`webSocket`、`other` のいずれかにできます。 * `referrer` String * `timestamp` Double * `fromCache` Boolean diff --git a/content/ja-JP/docs/api/webview-tag.md b/content/ja-JP/docs/api/webview-tag.md index 3def7ee6a0ecb..9aa1cc3da5e32 100644 --- a/content/ja-JP/docs/api/webview-tag.md +++ b/content/ja-JP/docs/api/webview-tag.md @@ -94,14 +94,6 @@ Electron の `webview` タグは [Chromium の `webview`][chrome-webview] に基 この `Boolean` は `webview` 内の iframe などのサブフレームで NodeJS サポートを有効にするための実験的オプションです。 すべてのプリロードは iframe 毎にロードされます。メインフレーム内かそうでないか判断するには `process.isMainFrame` が使用できます。 デフォルトではゲストページ内のこのオプションは無効化されています。 -### `enableremotemodule` - -```html - -``` - -`Boolean`。 この属性が `false` の場合、`webview` 内のゲストページは [`remote`](remote.md) モジュールにアクセスできません。 remote モジュールはデフォルトで利用不可です。 - ### `plugins` ```html @@ -737,6 +729,18 @@ webview.addEventListener('new-window', async (e) => { `event.preventDefault()` を呼んでも効果は __ありません__。 +### イベント: 'did-start-navigation' + +戻り値: + +* `url` String +* `isInPlace` Boolean +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +フレーム (メインを含む) がナビゲーションを始めているときに発生します。 ページ内ナビゲーションの場合、`isInPlace` が `true` になります。 + ### イベント: 'did-navigate' 戻り値: @@ -747,6 +751,21 @@ webview.addEventListener('new-window', async (e) => { このイベントは、アンカーリンクのクリックや `window.location.hash` の更新のような、ページ内ナビゲーションでは発行されません。 これを意図する場合は `did-navigate-in-page` を使用して下さい。 +### イベント: 'did-frame-navigate' + +戻り値: + +* `url` String +* `httpResponseCode` Integer - HTTP ナビゲーションが無い場合は-1 +* `httpStatusText` String - HTTP ナビゲーションが無い場合は空。 +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +フレームのナビゲーションが完了したときに発生します。 + +このイベントは、アンカーリンクのクリックや `window.location.hash` の更新のような、ページ内ナビゲーションでは発行されません。 これを意図する場合は `did-navigate-in-page` を使用して下さい。 + ### イベント: 'did-navigate-in-page' 戻り値: diff --git a/content/ja-JP/docs/api/window-open.md b/content/ja-JP/docs/api/window-open.md index 5795f7271619b..14af5d2c560de 100644 --- a/content/ja-JP/docs/api/window-open.md +++ b/content/ja-JP/docs/api/window-open.md @@ -11,7 +11,7 @@ Electron は、このネイティブの Chrome `Window` と BrowserWindow をペアリングします。 レンダラーで作成されたウインドウに対して `webContents.setWindowOpenHandler()` を使用することで、メインプロセスでの BrowserWindow 作成と同じすべてのカスタマイズを活用できます。 -BrowserWindow コンストラクタのオプションは、親から継承したオプション、`window.open()` の `features` 文字列から解析したオプション、親から継承したセキュリティ関連の webPreferences、[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler) の順で指定したものが設定されます。 注意として、`webContents.setWindowOpenHandler` はメインプロセスで呼び出されるため、最終的な決定権と完全なアクセス権限があります。 +BrowserWindow コンストラクタのオプションは、`window.open()` の `features` 文字列からパースされたオプション、親ウインドウから継承されたセキュリティ関連の webPreferences、[`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler) で与えられたオプションの順に設定されます。 注意として、`webContents.setWindowOpenHandler` はメインプロセスで呼び出されるため、最終的な決定権と完全なアクセス権限があります。 ### `window.open(url[, frameName][, features])` @@ -36,7 +36,8 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn * Node integration は、親ウィンドウで無効になっている場合は、開いた `window` でも常に無効になります。 * コンテキストイソレーションは、親ウィンドウで有効になっている場合は、開いた `window` で常に有効になります。 * JavaScript は、親ウィンドウで無効になっている場合は、開いた `window` でも常に無効になります。 -* `features` で指定された非標準機能 (Chromium や Electron によって処理されない) は、`additionalFeatures` 引数内の登録された `webContents` の `did-create-window` イベントハンドラに渡されます。 +* `features` で指定された非標準機能 (Chromium や Electron によって処理されない) は、`options` 引数内の登録された `webContents` の `did-create-window` イベントハンドラに渡されます。 +* `frameName` は、[ネイティブのドキュメント](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) にある `windowName` の仕様に従います。 ウインドウの作成をカスタマイズまたはキャンセルするにあたって、メインプロセスから `webContents.setWindowOpenHandler()` でオーバーライドハンドラーを任意設定できます。 `false` を返すとそのウインドウをキャンセルし、オブジェクトを返すとそのウインドウ作成時に使用する `BrowserWindowConstructorOptions` に返したオブジェクトを設定します。 これは、オプションを features 文字列に渡すよりも強力であることに注意しましょう。 レンダラーがセキュリティ設定を決定する場合は、メインプロセスよりも権限が制限されています。 @@ -56,7 +57,7 @@ mainWindow.webContents.setWindowOpenHandler(({ url }) => { mainWindow.webContents.on('did-create-window', (childWindow) => { // 例えば... - childWindow.webContents('will-navigate', (e) => { + childWindow.webContents.on('will-navigate', (e) => { e.preventDefault() }) }) diff --git a/content/ja-JP/docs/breaking-changes.md b/content/ja-JP/docs/breaking-changes.md index 41226cddb5496..d99b5ddc5bf18 100644 --- a/content/ja-JP/docs/breaking-changes.md +++ b/content/ja-JP/docs/breaking-changes.md @@ -12,9 +12,29 @@ * **非推奨:** API は非推奨になりました。 この API は引き続き機能しますが、非推奨の警告を発し、将来のリリースで削除されます。 * **削除:** API または機能が削除され、Electron でサポートされなくなりました。 +## 予定されている破壊的なAPIの変更 (15.0) + +### 省略値変更: `nativeWindowOpen` の省略値を `true` に + +Electron 15 より前の `window.open` は既定で `BrowserWindowProxy` を使用していました。 このため、`window.open('about:blank')` では同期的にスクリプトで操作可能な子ウィンドウを開くことができないなどといった、非互換性がありました。 `nativeWindowOpen: true` は実験的でなくなり、既定値になります。 + +詳細については [Electron での window.open](api/window-open.md) をご参照ください + ## 予定されている破壊的なAPIの変更 (14.0) -### API 変更: `window.(open)` +### 削除: `app.allowRendererProcessReuse` + +`app.allowRendererProcessReuse` プロパティは、セキュリティ、パフォーマンス、保守性のために Chromium のプロセスモデルとより密接に連携する計画の一環として削除されます。 + +詳細は [#18397](https://github.com/electron/electron/issues/18397) を参照してください。 + +### 削除: Browser Window の Affinity + +`BrowserWindow` を新規構築する際の `affinity` オプションは、セキュリティ、パフォーマンス、保守性のために Chromium のプロセスモデルとの共同連携計画の一環として削除されます。 + +詳細は [#18397](https://github.com/electron/electron/issues/18397) を参照してください。 + +### API 変更: `window.open()` 任意引数 `frameName` は、ウィンドウのタイトルに設定されなくなります。 これにより、[ネイティブの document](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) に対応するパラメータ `windowName` で説明されている仕様に従うことになりました。 @@ -27,6 +47,44 @@ Electron 14 では、 `worldSafeExecuteJavaScript` が削除されます。 代 `webFrame.executeJavaScript` か `webFrame.executeJavaScriptInIsolatedWorld` のいずれかを使用している場合、この変更の影響を受けます。 これらのメソッドは同じ値渡しセマンティクスを使用しているため、[Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) がサポートしている戻り値かどうかを確認する必要があります。 +### 削除: 親ウインドウからの BrowserWindowConstructorOptions の継承 + +Electron 14 より前は、`window.open` で開いたウインドウは、親ウインドウから `transparent` や `resizable` などの BrowserWindow コンストラクタのオプションを継承していました。 Electron 14 以降ではこの動作は削除され、ウインドウは親から BrowserWindow コンストラクタのオプションを継承しません。 + +代わりに、`setWindowOpenHandler` で以下のように新しいウインドウのオプションを明示的に設定してください。 + +```js +webContents.setWindowOpenHandler((details) => { + return { + action: 'allow', + overrideBrowserWindowOptions: { + // ... + } + } +}) +``` + +### 削除: `additionalFeatures` + +WebContents の `new-window` イベントと `did-create-window` イベントの、非推奨となっていた `additionalFeatures` プロパティは削除されました。 `new-window` は引数の順番があるのでこの引数はまだ残りますが、常に空の配列 `[]` になります。 (ただし注意として、`new-window` イベント自体は非推奨であり `setWindowOpenHandler` に置き換えられます。) ウインドウ機能のキーに値が無い場合は、オプションオブジェクトで `true` の値を持つキーとして表示されるようになりました。 + +```js +// Electron 14 で削除 +// window.open('...', '', 'my-key') で動く +webContents.on('did-create-window', (window, details) => { + if (details.additionalFeatures.includes('my-key')) { + // ... + } +}) + +// こちらに置換 +webContents.on('did-create-window', (window, details) => { + if (details.options['my-key']) { + // ... + } +}) +``` + ## 予定されている破壊的なAPIの変更 (13.0) ### API 変更: `session.setPermissionCheckHandler(handler)` @@ -286,12 +344,6 @@ app.getPath('crashDumps') `crashReporter.start` に `{ compress: false }` を指定することは非推奨です。 ほぼすべてのクラッシュ収集サーバーは gzip 圧縮をサポートしているためです。 このオプションは将来バージョンの Electron で削除されます。 -### 削除: Browser Window の Affinity - -`BrowserWindow` を新規構築する際の `affinity` オプションは、セキュリティ、パフォーマンス、保守性のために Chromium のプロセスモデルとの共同連携計画の一環として削除されます。 - -詳細は [#18397](https://github.com/electron/electron/issues/18397) を参照してください。 - ### 省略値変更: `enableRemoteModule` の省略値を `false` に Electron 9 では、`enableRemoteModule` WebPreferences オプションによって明示的に有効にせずに remote モジュールを使用すると、警告を出すようになりました。 Electron 10 では、remote モジュールはデフォルトで利用できなくなります。 remote モジュールを使用するには、以下のように WebPreferences で `enableRemoteModule: true` を指定する必要があります。 diff --git a/content/ja-JP/docs/development/pull-requests.md b/content/ja-JP/docs/development/pull-requests.md index 5dfd9127bc4af..92d5f3f578de4 100644 --- a/content/ja-JP/docs/development/pull-requests.md +++ b/content/ja-JP/docs/development/pull-requests.md @@ -92,7 +92,6 @@ $ git commit * perf: パフォーマンスを改善するコード変更 * refactor: バグ修正や機能追加の無いコード変更 * style: コードの意味を変えない変更 (lint) -* vendor: libchromiumcontent や node のような依存関係の更新 その他、コミットメッセージを作成するときに留意すること: diff --git a/content/ja-JP/docs/development/source-code-directory-structure.md b/content/ja-JP/docs/development/source-code-directory-structure.md index 590e12376c1a7..74e237e66fdd6 100644 --- a/content/ja-JP/docs/development/source-code-directory-structure.md +++ b/content/ja-JP/docs/development/source-code-directory-structure.md @@ -78,7 +78,6 @@ Electron * **.circleci** - CircleCI を使用した CI のコンフィグファイル。 * **.github** - Issue のテンプレートとコード所有者を含む GitHub 指定のコンフィグファイル。 * **dist** - 配布用に作成したときに `script/create-dist.py` スクリプトが作成する一時的なディレクトリ。 -* **external_binaries** - `gn`によるビルドがサポートされていない第三者のフレームワークのバイナリでダウンロードしたもの。 * **node_modules** - ビルドに使用する第三者のnodeモジュール。 * **npm** - npm を介した Electron のインストールロジック。 * **out** - `ninja`の一時的な出力用ディレクトリ。 @@ -94,4 +93,3 @@ script/ - Electron がさまざまな目的で実行するすべてのスクリ ``` * **typings** - Electron 内部コードの TypeScript 型定義。 -* **vendor** - サードパーティの依存関係のソースコード。 diff --git a/content/ja-JP/docs/tutorial/application-debugging.md b/content/ja-JP/docs/tutorial/application-debugging.md index 2e7c0da10d239..c4a6b4def59d1 100644 --- a/content/ja-JP/docs/tutorial/application-debugging.md +++ b/content/ja-JP/docs/tutorial/application-debugging.md @@ -29,7 +29,7 @@ V8 コンテキストがクラッシュした場合、デベロッパー ツー Chromium のログは `ELECTRON_ENABLE_LOGGING` 環境変数を介して有効にできます。 詳しい情報は [環境変数ドキュメント](../api/environment-variables.md#electron_enable_logging) を参照してください。 -代替として、`--enable-logging` コマンドライン引数を渡すことでもできます。 詳しい情報は [コマンドラインスイッチドキュメント](../api/command-line-switches.md#--enable-logging) を参照してください。 +代替として、`--enable-logging` コマンドライン引数を渡すことでもできます。 詳しい情報は [コマンドラインスイッチドキュメント](../api/command-line-switches.md#--enable-loggingfile) を参照してください。 [node-inspect]: https://nodejs.org/en/docs/inspector/ [devtools]: https://developer.chrome.com/devtools diff --git a/content/ja-JP/docs/tutorial/code-signing.md b/content/ja-JP/docs/tutorial/code-signing.md index 0c02cb93ca293..e42effacdea8b 100644 --- a/content/ja-JP/docs/tutorial/code-signing.md +++ b/content/ja-JP/docs/tutorial/code-signing.md @@ -102,7 +102,7 @@ Electron Builder にはアプリケーションに署名するためのカスタ Forge や Builder のような統合されたビルドパイプラインを使用しない場合、[`electron-packager`][] を使用することが多く、これは [`electron-osx-sign`][] や [`electron-notarize`][] を同梱しています。 -Packager の API を使用している場合、[アプリケーションに署名と公証の両方を行う設定](https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html) を渡すことができます。 +Packager の API を使用している場合、[アプリケーションに署名と公証の両方を行う設定](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html) を渡すことができます。 ```js const packager = require('electron-packager') @@ -155,7 +155,6 @@ Windows ビルドに署名する前に、以下のことをしなければなり * [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm) * [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing) -* [GoDaddy](https://au.godaddy.com/web-security/code-signing-certificate) * とりわけ、あなたのニーズに合ったものを見つけるのであれば探してみてください。Google は友達です 😄 パッケージアプリケーションに署名するためのツールは以下のようにたくさんあります。 diff --git a/content/ja-JP/docs/tutorial/dark-mode.md b/content/ja-JP/docs/tutorial/dark-mode.md index 290e7fcbca6dd..a1f05d1db08a1 100644 --- a/content/ja-JP/docs/tutorial/dark-mode.md +++ b/content/ja-JP/docs/tutorial/dark-mode.md @@ -56,9 +56,9 @@ Electron > 8.0.0 を使用中でオプトアウトしたい場合は、`Info. ``` -そして `style.css` ファイルです。 +そして `styles.css` ファイルです。 -```css title='style.css' +```css title='styles.css' @media (prefers-color-scheme: dark) { body { background: #333; color: white; } } @@ -160,6 +160,6 @@ Electron Fiddle を使ってサンプルを実行してみましょう。"Toggle [system-wide-dark-mode]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/ [electron-forge]: https://www.electronforge.io/ [electron-packager]: https://github.com/electron/electron-packager -[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport +[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#darwindarkmodesupport [prefers-color-scheme]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme [event-listeners]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener diff --git a/content/ja-JP/docs/tutorial/in-app-purchases.md b/content/ja-JP/docs/tutorial/in-app-purchases.md index e9f8cf85d852a..e95a84a9db17e 100644 --- a/content/ja-JP/docs/tutorial/in-app-purchases.md +++ b/content/ja-JP/docs/tutorial/in-app-purchases.md @@ -1,4 +1,4 @@ -# App内課金 (macOS) +# App 内課金 (macOS) ## 下準備 diff --git a/content/ja-JP/docs/tutorial/installation.md b/content/ja-JP/docs/tutorial/installation.md index e75f711321fce..cdb2b273ad3db 100644 --- a/content/ja-JP/docs/tutorial/installation.md +++ b/content/ja-JP/docs/tutorial/installation.md @@ -1,4 +1,4 @@ -# インストール +# 高度なインストール手順 Electron のビルド済みバイナリをインストールするには、[`npm`][npm] を使用します。 アプリの開発用依存関係として Electron をインストールする方法を推奨します。 diff --git a/content/ja-JP/docs/tutorial/launch-app-from-url-in-another-app.md b/content/ja-JP/docs/tutorial/launch-app-from-url-in-another-app.md index c300c74ba34b8..29c751b6b944c 100644 --- a/content/ja-JP/docs/tutorial/launch-app-from-url-in-another-app.md +++ b/content/ja-JP/docs/tutorial/launch-app-from-url-in-another-app.md @@ -1,5 +1,5 @@ --- -title: launch-app-from-URL-in-another-app +title: 他アプリ内の URL から自分の Electron アプリを起動する description: このガイドでは、Electron アプリを特定のプロトコルのデフォルトハンドラとして設定する手順を説明します。 slug: launch-app-from-url-in-another-app hide_title: true @@ -122,31 +122,25 @@ macOS でのこの機能は、アプリがパッケージ化されていると ### Plist ```XML -

    -

    macOS plist
    -
    
    -    
    -        
    -            
    -                
    -                    CFBundleURLTypes
    -                    
    -                        
    -                            CFBundleURLSchemes
    -                            
    -                                electron-api-demos
    -                            
    -                            CFBundleURLName
    -                            Electron API Demos Protocol
    -                        
    -                    
    -                    ElectronTeamID
    -                    VEKTX9H2N7
    -                
    -            
    -        
    -    
    -

    + + + + + CFBundleURLTypes + + + CFBundleURLSchemes + + electron-api-demos + + CFBundleURLName + Electron API Demos Protocol + + + ElectronTeamID + VEKTX9H2N7 + + ``` ## おわりに diff --git a/content/ja-JP/docs/tutorial/linux-desktop-actions.md b/content/ja-JP/docs/tutorial/linux-desktop-actions.md index 960e65c4d117e..48b43053b5101 100644 --- a/content/ja-JP/docs/tutorial/linux-desktop-actions.md +++ b/content/ja-JP/docs/tutorial/linux-desktop-actions.md @@ -1,4 +1,4 @@ -# カスタム Linux デスクトップランチャーアクション +# デスクトップランチャーアクション (Linux) ## 概要 diff --git a/content/ja-JP/docs/tutorial/macos-dock.md b/content/ja-JP/docs/tutorial/macos-dock.md index 0077e4dd918a2..b9acba3440f9e 100644 --- a/content/ja-JP/docs/tutorial/macos-dock.md +++ b/content/ja-JP/docs/tutorial/macos-dock.md @@ -1,4 +1,4 @@ -# macOS Dock の設定 +# Dock (macOS) Electron には macOS Dock 内のアプリアイコンを設定する API があります。 カスタム Dock メニューを作成するための macOS 専用 API は存在しますが、Electron は [最近使った書類][recent-documents] や [アプリケーションのプログレス][progress-bar] などのクロスプラットフォーム機能のエントリポイントにアプリの Dock アイコンを使用します。 diff --git a/content/ja-JP/docs/tutorial/notifications.md b/content/ja-JP/docs/tutorial/notifications.md index 44191e4dae135..1c85a6ad069be 100644 --- a/content/ja-JP/docs/tutorial/notifications.md +++ b/content/ja-JP/docs/tutorial/notifications.md @@ -1,4 +1,4 @@ -# 通知 (Windows、Linux、macOS) +# 通知 ## 概要 diff --git a/content/ja-JP/docs/tutorial/progress-bar.md b/content/ja-JP/docs/tutorial/progress-bar.md index 1aad8a366facb..fca7ec00aac9e 100644 --- a/content/ja-JP/docs/tutorial/progress-bar.md +++ b/content/ja-JP/docs/tutorial/progress-bar.md @@ -1,4 +1,4 @@ -# タスクバーで示すプログレスバー (Windows, macOS, Unity) +# タスクバーのプログレスバー (Windows & macOS) ## 概要 diff --git a/content/ja-JP/docs/tutorial/represented-file.md b/content/ja-JP/docs/tutorial/represented-file.md index 48516ce66e3e7..0dbef6a7c9ebe 100644 --- a/content/ja-JP/docs/tutorial/represented-file.md +++ b/content/ja-JP/docs/tutorial/represented-file.md @@ -1,4 +1,4 @@ -# macOS の BrowserWindow の Represented File +# BrowserWindow が表すファイル (macOS) ## 概要 diff --git a/content/ja-JP/docs/tutorial/security.md b/content/ja-JP/docs/tutorial/security.md index 80b1728aa8909..d5ef46dca40dd 100644 --- a/content/ja-JP/docs/tutorial/security.md +++ b/content/ja-JP/docs/tutorial/security.md @@ -18,7 +18,7 @@ Electron は、Chromiumのリリースとは交互に更新しています。 あなたの Electron アプリケーションのセキュリティは、フレームワーク (*Chromium*、*Node.js*)、Electron 自身、NPM の依存関係、あなたのコード のセキュリティの結果であることを覚えておくことが大事です。 そのため、いくつかの重要なベストプラックティスに従う、責任があります。 -* **あなたのアプリケーションは最新リリースの Electron フレームワークを使う。** あなたはプロダクトをリリースしたとき、Electron、 Chromium 共有ライブラリ、Node.js を組み込んでリリースしています。 これらのコンポーネントに影響する脆弱性は、あなたのアプリケーションのセキュリティに影響する可能性があります。 Electronを最新バージョンにアップデートすることで、あなたはクリティカルな脆弱性(例えば *nodeIntegration bypasses*) にパッチを当てた状態にして、あなたのアプリケーションで発現しないようにできます。 詳細については、"[現行バージョンの Electron を使う](#15-use-a-current-version-of-electron)" を参照してください。 +* **あなたのアプリケーションは最新リリースの Electron フレームワークを使う。** あなたはプロダクトをリリースしたとき、Electron、 Chromium 共有ライブラリ、Node.js を組み込んでリリースしています。 これらのコンポーネントに影響する脆弱性は、あなたのアプリケーションのセキュリティに影響する可能性があります。 Electronを最新バージョンにアップデートすることで、あなたはクリティカルな脆弱性(例えば *nodeIntegration bypasses*) にパッチを当てた状態にして、あなたのアプリケーションで発現しないようにできます。 詳細については、"[現行バージョンの Electron を使う](#16-use-a-current-version-of-electron)" を参照してください。 * **あなたのアプリの依存関係の評価する。** NPM は 50万もの再利用できるパッケージを提供しています。一方、あなたは信頼するサードパーティのライブラリを選択する責任があります。 あなたが既知の脆弱性の影響を受けるライブラリを利用する場合や、あまりメンテナンスされていないコードに頼る場合、あなたのアプリケーションのセキュリティは低下し危険な状態になります。 @@ -43,18 +43,19 @@ Electron 2.0 からでは、開発者は、開発者コンソールに出力さ 1. [セキュアなコンテンツのみを読み込む](#1-only-load-secure-content) 2. [リモートコンテンツを表示する全てのレンダラーで、Node.js integration を無効にする](#2-do-not-enable-nodejs-integration-for-remote-content) 3. [リモートコンテンツを表示するすべてのレンダラーで、コンテキストイソレーションを有効にする](#3-enable-context-isolation-for-remote-content) -4. [リモートのコンテンツを表示するすべてのセッションで `ses.setPermissionRequestHandler()` を利用する](#4-handle-session-permission-requests-from-remote-content) -5. [`webSecurity` を無効にしない](#5-do-not-disable-websecurity) -6. [`Content-Security-Policy` を定義](#6-define-a-content-security-policy)して、スクリプトの読み込み元を制限する (例: `script-src 'self'`) -7. [`allowRunningInsecureContent` を `true` にしない](#7-do-not-set-allowrunninginsecurecontent-to-true) -8. [実験的な機能を有効にしない](#8-do-not-enable-experimental-features) -9. [`enableBlinkFeatures` を使用しない](#9-do-not-use-enableblinkfeatures) -10. [``: `allowpopups` を使用しない](#10-do-not-use-allowpopups) -11. [``: オプションとパラメータを検証する](#11-verify-webview-options-before-creation) -12. [ナビゲーションを無効化か制限](#12-disable-or-limit-navigation) -13. [新規ウインドウの作成を無効化か制限](#13-disable-or-limit-creation-of-new-windows) -14. [信用されないコンテンツで `openExternal` を使用しない](#14-do-not-use-openexternal-with-untrusted-content) -15. [現行バージョンの Electron を使う](#15-use-a-current-version-of-electron) +4. [サンドボックス化を有効にする](#4-enable-sandboxing) +5. [リモートのコンテンツを表示するすべてのセッションで `ses.setPermissionRequestHandler()` を利用する](#5-handle-session-permission-requests-from-remote-content) +6. [`webSecurity` を無効にしない](#6-do-not-disable-websecurity) +7. [`Content-Security-Policy` を定義](#7-define-a-content-security-policy)して、スクリプトの読み込み元を制限する (例: `script-src 'self'`) +8. [`allowRunningInsecureContent` を `true` にしない](#8-do-not-set-allowrunninginsecurecontent-to-true) +9. [実験的な機能を有効にしない](#9-do-not-enable-experimental-features) +10. [`enableBlinkFeatures` を使用しない](#10-do-not-use-enableblinkfeatures) +11. [``: `allowpopups` を使用しない](#11-do-not-use-allowpopups) +12. [``: オプションとパラメータを検証する](#12-verify-webview-options-before-creation) +13. [ナビゲーションを無効化か制限](#13-disable-or-limit-navigation) +14. [新規ウインドウの作成を無効化か制限](#14-disable-or-limit-creation-of-new-windows) +15. [信用されないコンテンツで `openExternal` を使用しない](#15-do-not-use-openexternal-with-untrusted-content) +16. [現行バージョンの Electron を使う](#16-use-a-current-version-of-electron) 設定ミスやセキュアでないパターンを自動的に検出するには、[electronegativity](https://github.com/doyensec/electronegativity)が使用できます。 Electronを使用したアプリケーション開発時の潜在的な脆弱性やバグの埋め込みについてのより詳しい情報は、[開発者承認者向けガイドguide for developers and auditors](https://doyensec.com/resources/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf)を参照してください。 @@ -158,7 +159,23 @@ Electron は Chromium の [コンテンツスクリプト](https://developer.chr `contextIsolation` が何であるのか及びこれを有効にする方法についての情報は、[コンテキスト隔離](context-isolation.md) ドキュメントをご参照ください。 -## 4) リモートのコンテンツからセッション権限リクエストを利用する +## 4) サンドボックス化を有効にする + +[サンドボックス化](sandbox.md) は Chromium の機能で、オペレーティングシステムを利用してレンダラープロセスのアクセス範囲を大幅に制限します。 すべてのレンダラーでサンドボックスを有効にするべきです。 メインプロセスを含むサンドボックス化されていないプロセスでは、信頼されないコンテンツをロードしたり、読んだり、処理したりすることはお勧めしません。 + +### どうすればいいの? + +ウインドウ作成時に、以下のように `webPreferences` に `sandbox: true` オプションを渡します。 + +```js +const win = new BrowserWindow({ + webPreferences: { + sandbox: true + } +}) +``` + +## 5) リモートのコンテンツからセッション権限リクエストを利用する Chromeを使用しているときに許可リクエストが表示されていることがあります――ユーザーが手動で承認する必要がある機能 (通知など) をウェブサイトが使用しようとするたびにポップアップが表示されます。 @@ -191,7 +208,7 @@ session }) ``` -## 5) webSecurity を無効にしない +## 6) webSecurity を無効にしない _Electron のデフォルトを推奨しています_ @@ -227,7 +244,7 @@ const mainWindow = new BrowserWindow() ``` -## 6) Content-Security-Policy を定義する +## 7) Content-Security-Policy を定義する Content Security Policy (CSP) は、クロスサイトスクリプティング攻撃やデータインジェクション攻撃から保護する副層です。 Electron 内でロードする任意のウェブサイトで有効にすることを推奨します。 @@ -270,7 +287,7 @@ CSP の推奨伝達メカニズムは HTTP ヘッダですが、`file://` プロ ``` -## 7) `allowRunningInsecureContent` を `true` にしない +## 8) `allowRunningInsecureContent` を `true` にしない _Electron のデフォルトを推奨しています_ @@ -298,7 +315,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 8) 実験的な機能を有効にしない +## 9) 実験的な機能を有効にしない _Electron のデフォルトを推奨しています_ @@ -326,7 +343,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 9) `enableBlinkFeatures` を使用しない +## 10) `enableBlinkFeatures` を使用しない _Electron のデフォルトを推奨しています_ @@ -352,7 +369,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow() ``` -## 10) `allowpopups` を使用しない +## 11) `allowpopups` を使用しない _Electron のデフォルトを推奨しています_ @@ -372,7 +389,7 @@ _Electron のデフォルトを推奨しています_ ``` -## 11) 作成前に WebView のオプションを確認する +## 12) 作成前に WebView のオプションを確認する Node.js integration が有効になっていないレンダラープロセスで作成された WebView は、integration 自体を有効にすることはできません。 しかし、WebView は常に独自の `webPreferences` を使用して、独立したレンダラープロセスを作成します。 @@ -408,7 +425,7 @@ app.on('web-contents-created', (event, contents) => { 繰り返しになりますが、このリストは単にリスクを最小化するだけで、除去するものではありません。 ウェブサイトを表示することが目的であれば、ブラウザの方が安全性の高い選択肢になります。 -## 12) ナビゲーションを無効化か制限 +## 13) ナビゲーションを無効化か制限 アプリにナビゲートする必要がない場合、または既知のページにナビゲートするだけの場合は、ナビゲーションをその既知の範囲に完全に制限し、他の種類のナビゲーションを禁止することをお勧めします。 @@ -438,7 +455,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 13) 新規ウインドウの作成を無効化か制限 +## 14) 新規ウインドウの作成を無効化か制限 既知の一連のウインドウがある場合は、アプリ内での追加ウインドウの作成を制限することをお勧めします。 @@ -473,7 +490,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 14) 信用されないコンテンツで `openExternal` を使用しない +## 15) 信用されないコンテンツで `openExternal` を使用しない Shellの [`openExternal`][open-external] はデスクトップのネィティブユーティリティの指定した protocol URI で開けるようにします。 例えば、macOSの`open` ターミナルコマンドユーティリティに似た機能で、URIとそのファイルタイプの関連に基づいた特定のアプリケーションで開きます。 @@ -495,7 +512,7 @@ const { shell } = require('electron') shell.openExternal('https://example.com/index.html') ``` -## 15) 現行バージョンの Electron を使う +## 16) 現行バージョンの Electron を使う 常に最新バージョンの Electron を使用するように努力してください。 新しいメジャーバージョンがリリースされる度に、できるだけ早くアプリを更新しましょう。 diff --git a/content/ja-JP/docs/tutorial/snapcraft.md b/content/ja-JP/docs/tutorial/snapcraft.md index 0582b6abcdd01..81c57e9fa29d7 100644 --- a/content/ja-JP/docs/tutorial/snapcraft.md +++ b/content/ja-JP/docs/tutorial/snapcraft.md @@ -1,4 +1,4 @@ -# Snapcraft ガイド (Ubuntu Software Center & 他) +# Snapcraft ガイド (Linux) このガイドは、Ubuntu Software Centerを含む、Snapcraft環境向けにあなたのElectronアプリケーションをパッケージする方法を提供します。 diff --git a/content/ja-JP/docs/tutorial/support.md b/content/ja-JP/docs/tutorial/support.md index c8b15818a38b9..8aa3bbda20b07 100644 --- a/content/ja-JP/docs/tutorial/support.md +++ b/content/ja-JP/docs/tutorial/support.md @@ -41,9 +41,9 @@ _**注:** 2021 年 9 月の Electron 15 から、Electron チームは最新か ### 現在のサポート対象バージョン +* 14.x.y * 13.x.y * 12.x.y -* 11.x.y ### End-of-life diff --git a/content/ja-JP/docs/tutorial/updates.md b/content/ja-JP/docs/tutorial/updates.md index a68fe0c635b94..3f316855c8aa6 100644 --- a/content/ja-JP/docs/tutorial/updates.md +++ b/content/ja-JP/docs/tutorial/updates.md @@ -35,14 +35,14 @@ require('update-electron-app')() ニーズに応じて、次のいずれかから選択できます。 -- [Hazel][hazel] – [今すぐ][now]に無料でデプロイできるプライベートまたはオープンソースのアプリ用にサーバーを更新します。 それは [GitHub Releases][gh-releases] から引き出され、GitHub の CDN の力を活用します。 +- [Hazel][hazel] – [Vercel][vercel] 上に無料デプロイできる、非公開またはオープンソースのアプリのための更新サーバーです。 それは [GitHub Releases][gh-releases] から引き出され、GitHub の CDN の力を活用します。 - [Nuts][nuts] – [GitHub Releases][gh-releases] も使用しますが、アプリの更新をディスクにキャッシュし、プライベートリポジトリをサポートします。 - [electron-release-server][electron-release-server] – リリースを処理するためのダッシュボードを提供します。リリースを GitHub で作成する必要はありません。 - [Nucleus][nucleus] – Atlassian がメンテナンスしている Electron アプリのための完全なアップデートサーバー。 複数のアプリケーションとチャンネルをサポートします。サーバーのコストを最小限に抑えるために静的ファイルストアを使用します。 ## アプリケーションでの更新の実装 -アップデートサーバをデプロイしたら、コードに必要なモジュールをインポートします。 次のコードはサーバソフトウェアによって異なる場合がありますが、[Hazel](https://github.com/zeit/hazel) を使用したときの説明のように機能します。 +アップデートサーバをデプロイしたら、コードに必要なモジュールをインポートします。 次のコードはサーバソフトウェアによって異なる場合がありますが、[Hazel][hazel] を使用したときの説明のように機能します。 **重要:** 以下のコードは、開発中ではなく、パッケージ化されたアプリでのみ実行されるようにしてください。 [electron-is-dev](https://github.com/sindresorhus/electron-is-dev) を使って環境をチェックすることができます。 @@ -102,8 +102,8 @@ autoUpdater.on('error', message => { 自動更新によるリクエストは直接管理されていないため、対応が難しい状況が発生することがあります (更新サーバーが認証下にある場合など)。 `url` フィールドはファイルをサポートしていますので、工夫次第でサーバーとの通信を回避できます。 [こちらにその動作例があります](https://github.com/electron/electron/issues/5020#issuecomment-477636990)。 -[now]: https://zeit.co/now -[hazel]: https://github.com/zeit/hazel +[vercel]: https://vercel.com +[hazel]: https://github.com/vercel/hazel [nuts]: https://github.com/GitbookIO/nuts [gh-releases]: https://help.github.com/articles/creating-releases/ [electron-release-server]: https://github.com/ArekSredzki/electron-release-server diff --git a/content/ja-JP/docs/tutorial/using-native-node-modules.md b/content/ja-JP/docs/tutorial/using-native-node-modules.md index bd4ed68c51055..1a8298cfb5165 100644 --- a/content/ja-JP/docs/tutorial/using-native-node-modules.md +++ b/content/ja-JP/docs/tutorial/using-native-node-modules.md @@ -1,4 +1,4 @@ -# ネイティブのNodeモジュールを使用する +# ネイティブ Node モジュール Electron ではネイティブ Node.js モジュールがサポートされていますが、Electron は (OpenSSL ではなく Chromium の BoringSSL を使用するなどの違いにより) 指定の Node.js バイナリと異なる [アプリケーションバイナリインターフェイス (ABI)][abi] であるため、使用するネイティブモジュールを Electron 向けに再コンパイルする必要があります。 そうしなければ、以下の類のエラーが実行しようとしたときに発生します。 @@ -74,7 +74,7 @@ HOME=~/.electron-gyp node-gyp rebuild --target=1.2.3 --arch=x64 --dist-url=https 公開されているリリースと一致しない Electron のカスタムビルドに対してネイティブの Node モジュールをコンパイルするには、カスタムビルドにバンドルされている Node のバージョンを使用するように `npm` に指示します。 ```sh -npm rebuild --nodedir=/path/to/electron/vendor/node +npm rebuild --nodedir=/path/to/src/out/Default/gen/node_headers ``` ## トラブルシューティング diff --git a/content/ja-JP/docs/tutorial/using-pepper-flash-plugin.md b/content/ja-JP/docs/tutorial/using-pepper-flash-plugin.md index 80fc6c3ba6260..3c3ad1e11dc67 100644 --- a/content/ja-JP/docs/tutorial/using-pepper-flash-plugin.md +++ b/content/ja-JP/docs/tutorial/using-pepper-flash-plugin.md @@ -1,4 +1,4 @@ -# Pepper Flash プラグインを使用する +# Pepper Flash プラグイン Chrome がサポートを終了したため、Electron は Pepper Flash プラグインをサポートしていません。 diff --git a/content/ja-JP/docs/tutorial/using-selenium-and-webdriver.md b/content/ja-JP/docs/tutorial/using-selenium-and-webdriver.md index ee59ac50350ff..5b7f017e0db83 100644 --- a/content/ja-JP/docs/tutorial/using-selenium-and-webdriver.md +++ b/content/ja-JP/docs/tutorial/using-selenium-and-webdriver.md @@ -1,4 +1,4 @@ -# SeleniumとWebDriverを使用する +# Selenium と WebDriver [ChromeDriver - クローム向けのWebDriver][chrome-driver]: diff --git a/content/ja-JP/docs/tutorial/windows-arm.md b/content/ja-JP/docs/tutorial/windows-arm.md index 09a383a38f135..f1f25eac198e4 100644 --- a/content/ja-JP/docs/tutorial/windows-arm.md +++ b/content/ja-JP/docs/tutorial/windows-arm.md @@ -1,4 +1,4 @@ -# Arm 版 Windows 10 +# Arm 版 Windows アプリを Electron 6.0.8 以降で実行している場合、Arm 版 Windows 10 向けにビルドできます。 これによりパフォーマンスが大幅に向上しますが、アプリで使用されているネイティブモジュールを再コンパイルする必要があります。 また、ビルドおよびパッケージ化スクリプトの小さな修正が必要になる場合があります。 diff --git a/content/ja-JP/docs/tutorial/windows-taskbar.md b/content/ja-JP/docs/tutorial/windows-taskbar.md index e356734c4ee95..c604c9ffdc245 100644 --- a/content/ja-JP/docs/tutorial/windows-taskbar.md +++ b/content/ja-JP/docs/tutorial/windows-taskbar.md @@ -1,4 +1,4 @@ -# Windows のタスクバー +# タスクバーのカスタマイズ (Windows) ## 概要 diff --git a/content/ja-JP/website/blog/webview2.md b/content/ja-JP/website/blog/webview2.md new file mode 100644 index 0000000000000..8c5c03fc52001 --- /dev/null +++ b/content/ja-JP/website/blog/webview2.md @@ -0,0 +1,81 @@ +--- +title: WebView2 と Electron +author: + - electron +date: '2021-07-22' +--- + +この数週間で、新しい [WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) と Electron の違いについていくつかご質問をいただきました。 + +両チームとも、ウェブ技術をデスクトップ上で最高のものにするという目標を掲げているため、共通点の総合的な比較を検討してみましょう。 + +Electron と WebView2 は、行動が早く、常に進化しているプロジェクトです。 現在の Electron と WebView2 の共通点と相違点を簡単にまとめてみました。 + +--- + +## アーキテクチャの概要 + +Electron と WebView2 はどちらも、ウェブコンテンツのレンダリングに Chromium ソースを使用しています。 厳密には WebView2 は Edge のソースからビルドされています。しかし、Edge は Chromium のソースをフォークしてビルドされています。 Electron は Chrome と DLL を共有していません。 WebView2 のバイナリは、Edge (Edge 90 の安定チャンネル) をハードリンクしているので、ディスクや一部の動作セットを共有しています。 詳細は [Evergreen ディストリビューションモード](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#evergreen-distribution-mode) をご参照ください。 + +Electron アプリは、常に開発時のバージョンの Electron をバンドルして頒布しています。 WebView2 では、頒布にあたって 2 つの選択肢があります。 アプリケーションが開発された WebView2 ライブラリをそのままバンドルすることもできますし、システム上に既存の共有ランタイム版を使用することもできます。 WebView2 は、共有ランタイムが見つからない場合のブートストラップインストーラーを含む、各手段向けのツールを提供しています。 WebView2 は、Windows 11 から _標準で_ 付属します。 + +フレームワークをバンドルしているアプリケーションは、マイナーなセキュリティリリースを含め、そのフレームワークをアップデートする責任があります。 共有 WebView2 ランタイムを使用しているアプリの場合、WebView2 には Chrome や Edge に似た独自の更新機能が用意されており、アプリとは独立して実行されます。 Electron と同じく、アプリケーションのコードやその他の依存関係の更新は開発者の責任です。 Electron も WebView2 も Windows Update では管理されません。 + +Electron と WebView2 は、どちらも Chromium のマルチプロセスアーキテクチャを継承しています。つまり、1 つのメインプロセスが 1 つ以上のレンダラープロセスと通信します。 これらのプロセスは、システム上で動作している他のアプリケーションと完全に分離されます。 すべての Electron アプリケーションは、ルートのブラウザプロセス、いくつかのユーティリティプロセス、0 個以上のレンダープロセスを含む、独立したプロセスツリーを構成します。 同じ [ユーザーデータフォルダ](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder) を使用している WebView2 アプリ (スイートアプリのようなもの) は、レンダラープロセス以外を共有します。 異なるデータフォルダを使用している WebView2 アプリは、プロセスを共有しません。 + +* ElectronJS プロセスモデル: + + ![ElectronJS プロセスモデル図](/images/Electron-Architecture.png) +* WebView2 ベースのアプリケーションプロセスモデル: + + ![WebView2 プロセスモデル図](/images/WebView2-Architecture.png) + +[WebView2 のプロセスモデル](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/process-model) と [Electron のプロセスモデル](https://www.electronjs.org/docs/tutorial/process-model) についてはこちらをご覧ください。 + +Electron は、メニュー、ファイルシステムへのアクセス、通知など、デスクトップアプリケーションの一般的需要に応える API を提供します。 WebView2 は、WinForms、WPF、WinUI、Win32 などのアプリケーションフレームワークに統合されることを目的としたコンポーネントです。 WebView2 は JavaScript によるウェブ規格外の OS API を提供しません。 + +Electron は Node.js を統合しています。 Electron アプリケーションは、レンダラープロセスやメインプロセスから Node.js API、モジュール、Node ネイティブアドオンを利用できます。 WebView2 アプリケーションは、アプリケーションの他の部分が書かれている言語やフレームワークを前提にしていません。 JavaScript コードからオペレーティングシステムへアクセスするには、アプリケーションホストプロセスを介する必要があります。 + +Electron は、[Fugu Project](https://fugu-tracker.web.app/) が開発した API を含むウェブ API との互換性を維持するよう努めています。 [こちらに Electron の Fugu API 対応状況のスナップショット](https://docs.google.com/spreadsheets/d/1APQalp8HCa-lXVOqyul369G-wjM2RcojMujgi67YaoE/edit?usp=sharing) を用意しました。 WebView2 では、[Edge との API の違い](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/browser-features) について同様のリストを作成しています。 + +Electron でのウェブコンテンツのセキュリティモデルは、フルアクセスからフルサンドボックスまで設定可能です。 WebView2 のコンテンツは常にサンドボックス化されます。 Electron はセキュリティモデルの選択について、[包括的なセキュリティドキュメント](https://www.electronjs.org/docs/tutorial/security) を用意しています。 WebView2 にも [セキュリティのベストプラクティス](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/security) が用意されています。 + +Electron のソースは GitHub 上でメンテンスされており、自由に利用できます。 アプリケーションは、Electron の独自 _ブランド_ を構築できるように変更を加えられます。 WebView2 のソースは GitHub 上で利用できません。 + +簡単な概要: + +| | Electron | WebView2 | +| ------------------- | ---------------:| --------------------:| +| ビルドの依存関係 | Chromium | エッジ | +| GitHub 上でコードが利用可能 | あり | なし | +| Edge/Chrome DLL の共有 | なし | あり (Edge 90 のもの) | +| アプリケーション間でのランタイム共有 | なし | 任意 | +| アプリケーション API | あり | なし | +| Node.js | あり | なし | +| サンドボックス | 任意 | 常時 | +| アプリケーションフレームワークの必要性 | なし | あり | +| サポートされているプラットフォーム | Mac, Win, Linux | Win (Mac/Linux は計画中) | +| アプリ間でのプロセス共有 | なし | 任意 | +| フレームワークの更新機構 | アプリケーション | WebView2 | + +## パフォーマンスの議論 + +ウェブコンテンツのレンダリングに関しては、Electron、WebView2、その他 Chromium ベースのレンダラーの間におけるパフォーマンスの差はほとんどないと考えています。 私たちは、潜在的なパフォーマンスの違いを調査するご興味のある方向けに [Electron、C++ + WebView2、C# + WebView2 で構築したアプリの土台](https://github.com/crossplatform-dev/xplat-challenges) を作成しました。 + +ウェブコンテンツのレンダリング _以外_ にもいくつかの違いがあり、Electron、WebView2、Edge などの関係者は、PWA を含めた詳細な比較を行うことに興味を示しています。 + +### プロセス間通信 (IPC) + +_プロセス間通信は、Electron アプリでのパフォーマンスを考慮する必要があるでしょう。これにはすぐに強調すべき違いがあります。_ + +Chromium では、サンドボックス化したレンダラーとシステムの他の部分との間で、ブラウザプロセスが IPC ブローカーとして機能します。 Electron ではサンドボックスのないレンダープロセスにできますが、多くのアプリはセキュリティ強化のためにサンドボックスを有効にしています。 WebView2 は常にサンドボックスが有効なので、ほとんどの Electron および WebView2 アプリでは IPC が全体のパフォーマンスに影響を与えます。 + +Electron と WebView2 はプロセスモデルが似ていますが、基礎の IPC が異なります。 JavaScript と C++ や C# の間で通信するには、[マーシャリング](https://en.wikipedia.org/wiki/Marshalling_(computer_science)) が必要です。最も一般的なのは JSON 文字列への変換でしょう。 JSON のシリアライズ/パースは重い処理であり、この IPC のボトルネックはパフォーマンスに悪影響を及ぼします。 Edge 93 以降、WV2 はネットワークイベントに [CBOR](https://en.wikipedia.org/wiki/CBOR) を使用します。 + +Electron は [MessagePorts](https://www.electronjs.org/docs/latest/tutorial/message-ports) API を介した直接の IPC を任意の 2 つのプロセス間でサポートしており、これは [構造化複製アルゴリズム](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) を利用しています。 これを活用するアプリケーションは、プロセス間でオブジェクトを送信する際の JSON シリアライズのコストを回避できます。 + +## 概要 + +Electron と WebView2 にはいくつかの違いがありますが、ウェブコンテンツのレンダリング方法に関しては大きな違いはありません。 最終的には、アプリケーションのアーキテクチャと JavaScript ライブラリ/フレームワークが、メモリとパフォーマンスに何よりも大きな影響を与えます。なぜなら、実行箇所に関わらず _Chromium は Chromium_ だからです。 + +この記事をレビューしてくださり、WebView2 アーキテクチャの最新情報を提供して頂いた WebView2 チームに感謝します。 WebView2 チームの皆さんは [プロジェクトのフィードバック](https://github.com/MicrosoftEdge/WebView2Feedback) を歓迎しています。 diff --git a/content/ja-JP/website/i18n/code.json b/content/ja-JP/website/i18n/code.json index 8291b10512852..375fbaeb3a09f 100644 --- a/content/ja-JP/website/i18n/code.json +++ b/content/ja-JP/website/i18n/code.json @@ -1,202 +1,198 @@ { "theme.NotFound.title": { - "message": "Page Not Found", + "message": "ページが見つかりませんでした", "description": "The title of the 404 page" }, "theme.NotFound.p1": { - "message": "We could not find what you were looking for.", + "message": "お探しのものは見つかりませんでした。", "description": "The first paragraph of the 404 page" }, "theme.NotFound.p2": { - "message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.", + "message": "リンク元の URL があるサイトの所有者に、リンクが壊れていることを知らせてください。", "description": "The 2nd paragraph of the 404 page" }, "theme.AnnouncementBar.closeButtonAriaLabel": { - "message": "Close", + "message": "クローズ", "description": "The ARIA label for close button of announcement bar" }, "theme.blog.paginator.navAriaLabel": { - "message": "Blog list page navigation", + "message": "ブログ一覧ページのナビゲーション", "description": "The ARIA label for the blog pagination" }, "theme.blog.paginator.newerEntries": { - "message": "Newer Entries", + "message": "新しいエントリ", "description": "The label used to navigate to the newer blog posts page (previous page)" }, "theme.blog.paginator.olderEntries": { - "message": "Older Entries", + "message": "過去のエントリ", "description": "The label used to navigate to the older blog posts page (next page)" }, "theme.blog.post.readingTime.plurals": { - "message": "One min read|{readingTime} min read", + "message": "読むのにかかる時間 1 分|読むのにかかる時間 {readingTime} 分", "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" }, "theme.tags.tagsListLabel": { - "message": "Tags:", + "message": "タグ:", "description": "The label alongside a tag list" }, "theme.blog.post.readMore": { - "message": "Read More", + "message": "続きを読む", "description": "The label used in blog post item excerpts to link to full blog posts" }, "theme.blog.post.paginator.navAriaLabel": { - "message": "Blog post page navigation", + "message": "ブログ記事ページのナビゲーション", "description": "The ARIA label for the blog posts pagination" }, "theme.blog.post.paginator.newerPost": { - "message": "Newer Post", + "message": "新しい記事", "description": "The blog post button label to navigate to the newer/previous post" }, "theme.blog.post.paginator.olderPost": { - "message": "Older Post", + "message": "過去の記事", "description": "The blog post button label to navigate to the older/next post" }, - "theme.blog.sidebar.navAriaLabel": { - "message": "Blog recent posts navigation", - "description": "The ARIA label for recent posts in the blog sidebar" - }, "theme.tags.tagsPageTitle": { - "message": "Tags", + "message": "タグ", "description": "The title of the tag list page" }, + "theme.blog.sidebar.navAriaLabel": { + "message": "最近のブログ記事のナビゲーション", + "description": "The ARIA label for recent posts in the blog sidebar" + }, "theme.blog.post.plurals": { - "message": "One post|{count} posts", + "message": "1 件の投稿|{count} 件の投稿", "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" }, "theme.blog.tagTitle": { - "message": "{nPosts} tagged with \"{tagName}\"", + "message": "\"{tagName}\" タグの記事が {nPosts} 件あります", "description": "The title of the page for a blog tag" }, "theme.tags.tagsPageLink": { - "message": "View All Tags", + "message": "全てのタグを表示", "description": "The label of the link targeting the tag list page" }, "theme.CodeBlock.copyButtonAriaLabel": { - "message": "Copy code to clipboard", + "message": "クリップボードにコードをコピー", "description": "The ARIA label for copy code blocks button" }, "theme.CodeBlock.copied": { - "message": "Copied", + "message": "コピーしました", "description": "The copied button label on code blocks" }, "theme.CodeBlock.copy": { - "message": "Copy", + "message": "コピー", "description": "The copy button label on code blocks" }, "theme.docs.sidebar.expandButtonTitle": { - "message": "Expand sidebar", + "message": "サイドバーを開く", "description": "The ARIA label and title attribute for expand button of doc sidebar" }, "theme.docs.sidebar.expandButtonAriaLabel": { - "message": "Expand sidebar", + "message": "サイドバーを開く", "description": "The ARIA label and title attribute for expand button of doc sidebar" }, "theme.docs.paginator.navAriaLabel": { - "message": "Docs pages navigation", + "message": "ドキュメントページのナビゲーション", "description": "The ARIA label for the docs pagination" }, "theme.docs.paginator.previous": { - "message": "Previous", + "message": "前", "description": "The label used to navigate to the previous doc" }, "theme.docs.paginator.next": { - "message": "Next", + "message": "次", "description": "The label used to navigate to the next doc" }, "theme.docs.sidebar.collapseButtonTitle": { - "message": "Collapse sidebar", + "message": "サイドバーを隠す", "description": "The title attribute for collapse button of doc sidebar" }, "theme.docs.sidebar.collapseButtonAriaLabel": { - "message": "Collapse sidebar", + "message": "サイドバーを隠す", "description": "The title attribute for collapse button of doc sidebar" }, - "theme.docs.sidebar.responsiveCloseButtonLabel": { - "message": "Close menu", - "description": "The ARIA label for close button of mobile doc sidebar" - }, - "theme.docs.sidebar.responsiveOpenButtonLabel": { - "message": "Open menu", - "description": "The ARIA label for open button of mobile doc sidebar" - }, - "theme.docs.sidebar.navAriaLabel": { - "message": "Sidebar navigation", - "description": "The ARIA label for documentation menu" - }, "theme.docs.versions.unreleasedVersionLabel": { - "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", + "message": "これは {siteTitle} {versionLabel} 版の未公開ドキュメントです。", "description": "The label used to tell the user that he's browsing an unreleased doc version" }, "theme.docs.versions.unmaintainedVersionLabel": { - "message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.", + "message": "これは {siteTitle} {versionLabel} 版のドキュメントであり、活発にメンテナンスされていません。", "description": "The label used to tell the user that he's browsing an unmaintained doc version" }, "theme.docs.versions.latestVersionSuggestionLabel": { - "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", - "description": "The label userd to tell the user that he's browsing an unmaintained doc version" + "message": "最新のドキュメントは、{latestVersionLink} ({versionLabel}) をご覧ください。", + "description": "The label used to tell the user to check the latest version" }, "theme.docs.versions.latestVersionLinkLabel": { - "message": "latest version", + "message": "最新バージョン", "description": "The label used for the latest version suggestion link label" }, "theme.common.editThisPage": { - "message": "Edit this page", + "message": "このページを編集", "description": "The link label to edit the current page" }, "theme.common.headingLinkTitle": { - "message": "Direct link to heading", + "message": "見出しへの直接リンク", "description": "Title for link to heading" }, "theme.lastUpdated.atDate": { - "message": " on {date}", + "message": " 最終更新日 {date}", "description": "The words used to describe on which date a page has been last updated" }, "theme.lastUpdated.byUser": { - "message": " by {user}", + "message": " 最終更新者 {user}", "description": "The words used to describe by who the page has been last updated" }, "theme.lastUpdated.lastUpdatedAtBy": { - "message": "Last updated{atDate}{byUser}", + "message": "最終更新{atDate}{byUser}", "description": "The sentence used to display when a page has been last updated, and by who" }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← メインメニューへ戻る", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, "theme.common.skipToMainContent": { - "message": "Skip to main content", + "message": "メインコンテンツへ飛ぶ", "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "目次", + "description": "The label used by the button on the collapsible TOC component" + }, "theme.SearchPage.documentsFound.plurals": { - "message": "One document found|{count} documents found", + "message": "1 件のドキュメントが見つかりました|{count} 件のドキュメントが見つかりました", "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" }, "theme.SearchPage.existingResultsTitle": { - "message": "Search results for \"{query}\"", + "message": "\"{query}\" の検索結果", "description": "The search page title for non-empty query" }, "theme.SearchPage.emptyResultsTitle": { - "message": "Search the documentation", + "message": "ドキュメントを検索", "description": "The search page title for empty query" }, "theme.SearchPage.inputPlaceholder": { - "message": "Type your search here", + "message": "検索ワードを入力", "description": "The placeholder for search page input" }, "theme.SearchPage.inputLabel": { - "message": "Search", + "message": "検索", "description": "The ARIA label for search page input" }, "theme.SearchPage.algoliaLabel": { - "message": "Search by Algolia", + "message": "Algolia 検索", "description": "The ARIA label for Algolia mention" }, "theme.SearchPage.noResultsText": { - "message": "No results were found", + "message": "何も見つかりませんでした。", "description": "The paragraph for empty search result" }, "theme.SearchPage.fetchingNewResults": { - "message": "Fetching new results...", + "message": "新しい検索結果を取得中...", "description": "The paragraph for fetching new search results" }, "theme.SearchBar.label": { - "message": "Search", + "message": "検索", "description": "The ARIA label and placeholder for search button" } } \ No newline at end of file diff --git a/content/ja-JP/website/i18n/docusaurus-plugin-content-blog/options.json b/content/ja-JP/website/i18n/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000000..3931aec90c8a5 --- /dev/null +++ b/content/ja-JP/website/i18n/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Electron のブログ", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Electron プロジェクトの最新情報をお届けします", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "最新の投稿", + "description": "The label for the left sidebar" + } +} \ No newline at end of file diff --git a/content/ja-JP/website/i18n/docusaurus-theme-classic/footer.json b/content/ja-JP/website/i18n/docusaurus-theme-classic/footer.json index 8b26237397c6f..2325636af2bda 100644 --- a/content/ja-JP/website/i18n/docusaurus-theme-classic/footer.json +++ b/content/ja-JP/website/i18n/docusaurus-theme-classic/footer.json @@ -1,23 +1,35 @@ { "link.title.Docs": { - "message": "Docs", + "message": "ドキュメント", "description": "The title of the footer links column with title=Docs in the footer" }, + "link.title.Checklists": { + "message": "チェックリスト", + "description": "The title of the footer links column with title=Checklists in the footer" + }, "link.title.Community": { - "message": "Community", + "message": "コミュニティ", "description": "The title of the footer links column with title=Community in the footer" }, "link.title.More": { - "message": "More", + "message": "その他", "description": "The title of the footer links column with title=More in the footer" }, "link.item.label.Getting Started": { - "message": "Getting Started", - "description": "The label of footer link with label=Getting Started linking to /" + "message": "始めましょう", + "description": "The label of footer link with label=Getting Started linking to /docs/latest/" }, - "link.item.label.Stack Overflow": { - "message": "Stack Overflow", - "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + "link.item.label.API Reference": { + "message": "API リファレンス", + "description": "The label of footer link with label=API Reference linking to /docs/latest/api/app" + }, + "link.item.label.Performance": { + "message": "パフォーマンス", + "description": "The label of footer link with label=Performance linking to /docs/latest/tutorial/performance" + }, + "link.item.label.Security": { + "message": "セキュリティ", + "description": "The label of footer link with label=Security linking to /docs/latest/tutorial/security" }, "link.item.label.Discord": { "message": "Discord", @@ -27,12 +39,20 @@ "message": "Twitter", "description": "The label of footer link with label=Twitter linking to https://twitter.com/electronjs" }, + "link.item.label.Stack Overflow": { + "message": "Stack Overflow", + "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + }, "link.item.label.GitHub": { "message": "GitHub", "description": "The label of footer link with label=GitHub linking to https://github.com/electron/electron" }, + "link.item.label.Open Collective": { + "message": "Open Collective", + "description": "The label of footer link with label=Open Collective linking to https://opencollective.com/electron" + }, "copyright": { - "message": "Copyright © 2021 My Project, Inc. Built with Docusaurus.", + "message": "Copyright © 2021 OpenJS Foundation and Electron contributors.", "description": "The footer copyright" } } \ No newline at end of file diff --git a/content/ja-JP/website/i18n/docusaurus-theme-classic/navbar.json b/content/ja-JP/website/i18n/docusaurus-theme-classic/navbar.json index 43efe67cadabe..861e18ffc94c6 100644 --- a/content/ja-JP/website/i18n/docusaurus-theme-classic/navbar.json +++ b/content/ja-JP/website/i18n/docusaurus-theme-classic/navbar.json @@ -4,7 +4,7 @@ "description": "The title in the navbar" }, "item.label.Docs": { - "message": "Docs", + "message": "ドキュメント", "description": "Navbar item with label Docs" }, "item.label.API": { @@ -15,6 +15,10 @@ "message": "サンプル", "description": "Navbar item with label Examples" }, + "item.label.Blog": { + "message": "ブログ", + "description": "Navbar item with label Blog" + }, "item.label.GitHub": { "message": "GitHub", "description": "Navbar item with label GitHub" diff --git a/content/ja-JP/website/locale.yml b/content/ja-JP/website/locale.yml index eb3f5106ef009..815c7b917b255 100644 --- a/content/ja-JP/website/locale.yml +++ b/content/ja-JP/website/locale.yml @@ -1,279 +1,281 @@ -tagline: Build cross-platform desktop apps with JavaScript, HTML, and CSS +tagline: JavaScript, HTML, CSS でクロスプラットフォームなデスクトップアプリ開発 nav: - apps: Apps + apps: アプリ blog: ブログ code_of_conduct: 行動規範 - security: Security + security: セキュリティ community: コミュニティ - contact: Contact - docs: Docs - donors: Donors - languages: Languages - license: License - releases: Releases - search: Search - userland: Userland - governance: Governance + contact: お問い合わせ + docs: ドキュメント + donors: スポンサー + languages: 言語 + license: ライセンス + releases: リリース + search: 検索 + userland: ユーザーランド + governance: ガバナンス keyboard_modal: title: キーボード ショート カット - key: Key - action: Action - focus_search: Focus the search bar - focus_and_clear: Focus the search bar and cleans it - scroll_down: Select the next search result - scroll_up: Select the previous search result - open: Open the selected search result - open_new_tab: Open the selected search result in a new tab + key: キー + action: アクション + focus_search: 検索バーにフォーカス + focus_and_clear: 検索バーにフォーカスし、削除する + scroll_down: 次の検索結果を選択 + scroll_up: 前の検索結果を選択 + open: 選択した検索結果を開く + open_new_tab: 選択した検索結果を新しいタブで開く docs: - title: Electron Documentation - guides: "Guides: Getting Started with Electron" - api_reference: API Reference - api_structures: API Structures - advanced: Advanced - detailed: In Detail - custom_dom: Custom DOM Elements - main_proc_modules: Main Process Modules - renderer_proc_modules: Renderer Process Modules - both_proc_modules: Modules for Both Process Types - propose_change: Improve this doc - version_history: Version history - translate: Translate this doc + title: Electron ドキュメント + guides: "ガイド: Electron のはじめかた" + api_reference: API リファレンス + api_structures: API の構造体 + advanced: 発展的なドキュメント + detailed: 詳細 + custom_dom: カスタム DOM 要素 + main_proc_modules: メインプロセスモジュール + renderer_proc_modules: レンダラープロセスモジュール + both_proc_modules: 両プロセスタイプのモジュール + propose_change: このドキュメントを改善する + version_history: 過去のバージョン + translate: ドキュメントの翻訳に参加する languages: - choose_language: Choose Your Site Language - view_more_details: View More Language Details - translation_progress: Translation Progress - current: current selection + choose_language: 言語選択 + view_more_details: 言語の詳細をもっと表示する + translation_progress: 翻訳状態 + current: 選択中 community: - title: Electron Community - description: Resources for connecting with people working on Electron. + title: コミュニティ + description: Electron に関する活動を行う人々のための情報 channels: - get_started: "Get started building an app by reading the quick-start guide." - updates: "Stay up to date by following @electronjs on Twitter and subscribing to the blog feed." - localized_docs: "Read docs in your native language by visiting the languages page." - help: "Get help and feedback by joining the Discord server, or visiting Stack Overflow." - security: "Report security issues by emailing security@electronjs.org." - bugs: "Report bugs by opening issues on the electron/electron repository." - feature_requests: "Request features by opening issues on the electron/electron repository." - code_of_conduct: "Report Code of Conduct violations by emailing coc@electronjs.org." - donations: "Donate on our OpenCollective page." - other: "For all other inquiries, email info@electronjs.org." + get_started: "はじめる: クイックスタートガイド を読みながら、はじめての Electron アプリを構築しましょう。" + updates: "最新情報を入手: Twitter で@electronjs \n をフォローしたり、ブログのフィードをご購読ください。" + localized_docs: "翻訳されたドキュメント: 言語ページからアクセスできます。" + help: "ヘルプやフィードバック は, Discord サーバー に参加したり、Stack Overflow を訪れることで受けられます。" + security: "セキュリティの問題を報告する: security@electronjs.org までメールでお知らせください。" + bugs: "バグの報告: electron/electron リポジトリに Issue を作成してください。" + feature_requests: "機能の要望: GitHub の electron/electron リポジトリに Issue を作成してください。" + code_of_conduct: "行動規範への違反を報告: coc@electronjs.org までメールでご連絡ください。" + donations: "寄付: OpenCollectiveページにてご寄付をお待ちしております。" + other: "これ以外のお問い合わせ内容については、info@electronjs.org までメールでご連絡ください。" language_communities: - title: Language Communities - description: "The Electron community spans the globe, and English is not everyone's first language. Find documentation in your language, or join one of the language communities below:" - tools: Tools - boilerplates: Boilerplates - components: Components - videos: Videos - meetups: Meetups - awesome_notice: This list is generated from @sindresorhus's Awesome Electron repository.
    Something missing? Make a pull request. - meetup_notice: To add a meetup, edit data/meetups.json and make a pull request. + title: 言語別のコミュニティ + description: "Electron のコミュニティは世界中に広がっており、英語が母語でないユーザもたくさんいます。翻訳されたドキュメントを閲覧できるほか、以下の言語別コミュニティに参加することも出来ます。" + tools: ツール + boilerplates: ボイラープレート + components: コンポーネント + videos: 動画 + meetups: ミートアップイベント + awesome_notice: このリストは @sindresorhus による Awesome Electron リポジトリ から生成されています。
    もし不足しているものがあれば、プルリクエストにてお知らせください。 + meetup_notice: ミートアップイベントの情報をこのページに追加するには、data/meetups.json を編集した上で プルリクエストを送信してください。 releases: - show_releases: "Show Releases:" - show_only_releases_from: "Show Only Releases From:" - all_versions: All Versions - stable_releases: Stable Releases - stable_desc: Regular, supported releases - beta_releases: Beta Releases - beta_desc: Test your app with upcoming changes - nightly_releases: Nightly Releases - nightly_desc: Experiment with the latest features - next: Next - next_page: Next Page - previous: Previous - previous_page: Previous Page - page: Page - all_releases: All Releases - back_to_index: Back to index + show_releases: "リリー スの表示:" + show_only_releases_from: "表示するリリースのバージョン" + all_versions: 全てのバージョン + stable_releases: 安定版 + stable_desc: 定期かつサポートされるリリース + beta_releases: ベータリリース + beta_desc: 変更予定をアプリでテストしましょう + alpha_releases: アルファリリース + alpha_desc: 新機能を少しずつテストする + nightly_releases: Nightly リリース + nightly_desc: 最新機能の体験 + next: 次 + next_page: 次のページ + previous: 前 + previous_page: 前のページ + page: ページ + all_releases: 全リリース + back_to_index: インデックスに戻る electron_is_good: - title: Apps users love, built with Electron - description: Thousands of organizations spanning all industries use Electron to build cross-platform software. + title: Electron 製のアプリは、ユーザーに愛されています + description: あらゆる業界の何千もの組織が、Electron を使用してクロスプラットフォームソフトウェアを構築しています。 electron_is_easy: - title: It's easier than you think - description: If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application. + title: 簡単に開発できます + description: Webサイトを作成する感覚でデスクトップアプリを開発できます。Electron は JavaScript, HTML, CSS といったWeb技術を利用してネイティブアプリケーションを作成するためのフレームワークです。開発者はアプリの重要な部分の実装に集中して、面倒な部分はElectronにお任せください。 web_technologies: - title: Web Technologies - description: Electron uses Chromium and Node.js so you can build your app with HTML, CSS, and JavaScript. + title: Web技術 + description: Electron は ChromiumとNode.jsを利用しているため、HTML, CSS, JavaScriptを利用してアプリを開発することができます。 open_source: - title: Open Source - description: Electron is an open source project maintained by the OpenJS Foundation and an active community of contributors. + title: オープンソース + description: Electron は OpenJS Foundation と活発な貢献者コミュニティがメンテナンスするオープンソースプロジェクトです。 cross_platform: - title: Cross Platform - description: Compatible with Mac, Windows, and Linux, Electron apps build and run on three platforms. + title: クロスプラットフォーム + description: Mac, Windows, Linuxに対応。Electronアプリは3つのプラットフォームでビルド・動作します。 benefits: - hard_parts_made_easy: The hard parts made easy - automatic_updates: Automatic updates - native_menus_and_notifications: Native menus & notifications - crash_reporting: Crash reporting - debugging_and_profiling: Debugging & profiling - windows_installers: Windows installers + hard_parts_made_easy: 面倒な処理はおまかせください + automatic_updates: 自動更新 + native_menus_and_notifications: ネイティブなメニューと通知 + crash_reporting: クラッシュレポート + debugging_and_profiling: デバッグ と プロファイリング + windows_installers: Windows用インストーラー get_started: - title: Get started - description: To get started with Electron, check out the resources below. Learn how to wrap your web app with Electron, access all the APIs, and generate installers. + title: 始めましょう! + description: Electronでの開発を始めるには、こちらの情報をチェックしてください。Electronを用いたWebアプリのパッケージ化、APIへのアクセス、インストーラの作成方法などが解説されています。 explore: - fiddle_title: Try powerful experiments with Electron Fiddle - see_more_info: See more info -download: Download -download_from_github: Download from GitHub + fiddle_title: Electron Fiddle の強力な実験機能を試しましょう + see_more_info: 詳細 +download: ダウンロード +download_from_github: GitHub からダウンロード quick_start: - title: "Spin up the Quick Start app to see Electron in action:" - description: A minimal Electron app with helpful notations. - clone: Clone the Quick Start repository - go_into_repo: Go into the repository - install_deps: Install the dependencies and run - dive_deeper: Or dive deeper and read the documentation. + title: "Quick Start アプリで実際に動く Electron を見てみましょう" + description: 親切なコメント文とともに、最低限の機能だけが実装された Electron アプリをお試しください + clone: Quick Start リポジトリを clone する + go_into_repo: リポジトリに移動 + install_deps: 依存ライブラリをインストールし、実行 + dive_deeper: さらに詳細な情報が必要であればドキュメントを参照することもできます。 need_help: - title: Need Help? - description: Ask questions in the Discord server. Follow @electronjs on Twitter for important announcements. Need to privately reach out? Email info@electronjs.org. + title: お困りですか? + description: Discord サーバー で質問してみましょう。重要なお知らせは Twitter @electronjs をフォローしてください。非公開での連絡をご希望ですか? info@electronjs.org までメールでお問い合わせください。 headings: - languages: Languages + languages: 言語 taglines: - languages: Localized content from our awesome global developer community. - announcement: 'Black Lives Matter. Support the Equal Justice Initiative and read our statement here.' -help_translate: "Help translate" + languages: 世界中の素晴らしい開発者コミュニティによってローカライズされたコンテンツ + announcement: 'Black Lives Matter。平等と正義の発意 を援助しましょう。私たちの声明もご一読ください。' +help_translate: "翻訳に参加する" footer: - see_the_faq: See the frequently asked questions + see_the_faq: よくある質問(FAQ) apps: - something_missing: Something missing? - edit_this_app: Edit this app. - search_app: Filter apps by name, description, etc… - categories: Categories - add_app_link: 'Make a Pull Request to add your application.' + something_missing: 何か見つかりませんか? + edit_this_app: アプリを編集する + search_app: 名前、説明などでアプリをフィルタリング + categories: カテゴリ + add_app_link: 'あなたのアプリケーションにプルリクエストを作成。' #App show page specific localization strings - website: Website - repository: Repository - category: Category - downloads: Downloads - keywords: Keywords - license: License - latest_release: Latest Release + website: ウェブサイト + repository: リポジトリ + category: カテゴリ + downloads: ダウンロード + keywords: キーワード + license: ライセンス + latest_release: 最新リリース blog: - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Electron ブログ + description: Electron チームとコミュニティからの最新情報 #Post show page specific localization strings - feedback: Have feedback on this post? Let @electronjs know on Twitter. - help: Need help or found a bug? Contact us. + feedback: この記事に対してフィードバックをお持ちですか?Twitterにて@electronjsまでお知らせください。 + help: サポートが必要ですか、または不具合を見つけましたか?お問い合わせ. clipboard: - copy: Copy - copy_to_clipboard: Copy to Clipboard - copied: Copied + copy: コピー + copy_to_clipboard: クリップボードにコピー + copied: コピーしました fiddle_launch_button: - launch: Launch - launch_in_fiddle: Launch in Fiddle + launch: 動かす + launch_in_fiddle: Fiddle で動かす pages: '/': - title: Electron | Build cross-platform desktop apps with JavaScript, HTML, and CSS. - description: 'Build cross-platform desktop apps with JavaScript, HTML, and CSS.' + title: Electron | JavaScript, HTML, CSSによるクロスプラットフォームなデスクトップアプリ開発 + description: 'JavaScript, HTML, CSS でクロスプラットフォームなデスクトップアプリ開発。' '/apps': - title: Electron Apps - description: Apps Built on Electron + title: Electron アプリ + description: Electronで開発されたアプリ '/docs': title: ドキュメント - description: Guides and API reference documentation for the latest Electron release + description: 最新の Electron に関するガイドと API リファレンス '/docs/api': title: API - description: API reference documentation for the latest Electron release + description: 最新の Electron のための API リファレンス '/docs/development': title: 開発 - description: Developing with Electron + description: Electronを用いた開発 '/docs/tutorial': - title: Tutorial - description: Guides and tutorials for the latest Electron release + title: チュートリアル + description: 最新の Electron のためのガイドとチュートリアル '/blog': - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Electron ブログ + description: Electron チームとコミュニティからの最新情報 '/community': title: コミュニティ '/releases': - title: Releases + title: リリース '/contact': - title: Contact - description: Get in touch with the Electron team on Twitter, Slack, GitHub, or via email. + title: お問い合わせ + description: Electron チームとは Twitter, Slack, GitHub または emailで連絡がとれます。 '/languages': - title: Languages + title: 言語 '/userland': - title: Userland + title: ユーザーランド '/devtron': title: Devtron - description: Devtron is an open source tool to help you inspect, monitor, and debug your Electron app. Built on top of the amazing Chrome Developer Tools. + description: Devtron はあなたのElectronアプリを インスペクト、モニタ、デバッグすることを支援するオープンソースのツールです。Chrome Developer Tools上にビルドされます。 '/spectron': title: Spectron - description: Spectron is an open source framework for easily writing integrations tests for your Electron app. Built on top of ChromeDriver and WebDriverIO. + description: Spectron は、 Electron アプリのインテグレーションテスト用コードを手軽に書くためのオープンソースフレームワークです。ChromeDriver と WebDriverIO を利用して構成されています。 '/fiddle': title: Electron Fiddle - description: The easiest way to get started with Electron + description: やさしい Electron のはじめかた '/governance': - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. + title: Electron のガバナンス + description: Electron ガバナンスシステムは、Electron エコシステムのさまざまな側面を監督するワーキンググループと、それらの間の衝突を解決するように機能する管理ワーキンググループで構成されています。 '/donors': - title: Donors + title: スポンサー '/blacklivesmatter': title: Black Lives Matter landing: - get_started: Get started + get_started: 始めましょう! fiddle: - lead_desc: The easiest way to get started with Electron - different_os: "Not the right operating system? See:" - create_app: Create your app - description: Electron Fiddle lets you create and play with small Electron experiments. It greets you with a quick-start template after opening – change a few things, choose the version of Electron you want to run it with, and play around. Then, save your Fiddle either as a GitHub Gist or to a local folder. Once pushed to GitHub, anyone can quickly try your Fiddle out by just entering it in the address bar. - explore: Explore Electron - explore_desc: "Try Electron without installing any dependencies: Fiddle includes everything you'll need to explore the platform. It also includes examples for every API available in Electron, so if you want to quickly see what a BrowserView is or how the desktopCapturer works, Fiddle has got you covered." - code_with_types: Code with Types - code_with_types_desc: Fiddle includes Microsoft's excellent Monaco Editor, the same editor powering Visual Studio Code. It also installs the type definitions for the currently selected version of Electron automatically, ensuring that you always have all Electron APIs only a few keystrokes away. - compile_and_package: Compile and Package - compile_and_package_desc: Fiddle can automatically turn your experiment into binaries you can share with your friends, coworkers, or grandparents. It does so thanks to electron-forge, allowing you to package your fiddle as an app for Windows, macOS, or Linux. - easy_start: Start with Fiddle, Continue Wherever - easy_start_desc: Fiddle is not an IDE – it is however an excellent starting point. Once your fiddle has grown up, export it as a project with or without electron-forge. Then, use your favorite editor and take on the world! + lead_desc: やさしい Electron のはじめかた + different_os: "他のオペレーティングシステムはこちら:" + create_app: あなたのアプリを作る + description: Electron Fiddle では、小さな Electron の実験を作成して遊ぶことができます。 開くとクイックスタートテンプレートが表示されます。いくつか変更して、実行したい Electron のバージョンを選択してから試してみましょう。すると、GitHub Gist やローカルフォルダーに Fiddle を保存できます。GitHub にプッシュされたものは、アドレスバーに入力するだけで誰でもすぐに Fiddle を試すことができます。 + explore: Electron に触れる + explore_desc: "一切の依存関係をインストールせずに Electron を試しましょう。Fiddle にはプラットフォームに触れるためのすべてが含まれています。Electron で利用可能なすべての API の例も含まれているので、BrowserView とは何か、または desktopCapturer がどのように機能するのかをすぐに確認したい場合でも、Fiddle はカバーしています。" + code_with_types: 型付きコーディング + code_with_types_desc: Fiddle には、Microsoft の 優れた Monaco Editor が含まれています。これは、Visual Studio Code と同じ力を持つエディタです。 また、現在選択されているバージョンの Electron の型定義も自動的にインストールされるので、すべての Electron API を常に数回のキー操作だけで利用できます。 + compile_and_package: コンパイルとパッケージ化 + compile_and_package_desc: Fiddle は自動であなたの実験を友人や同僚や祖父母と共有できるバイナリに変換できます。electoron-forge のおかげで、Windows、macOS、または Linux 向けのアプリとして Fiddle をパッケージ化可能になっています。 + easy_start: Fiddle で始めて、続きはどこでも + easy_start_desc: Fiddle は IDE ではありません。優れた出発点です。あなたの Fiddle が成熟したら、electron-forge がなくてもプロジェクトとしてエクスポートできます。それから、好きなエディタを使って世界に発信しましょう。 governance: - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. - wgs: Working Groups + title: Electron のガバナンス + description: Electron ガバナンスシステムは、Electron エコシステムのさまざまな側面を監督するワーキンググループと、それらの間の衝突を解決するように機能する管理ワーキンググループで構成されています。 + wgs: ワーキンググループ ecosystem: - title: Ecosystem - description: Oversees the projects that make Electron app development easier. + title: エコシステム + description: Electron アプリ開発が容易になるようにプロジェクトを監督します。 outreach: - title: Outreach - description: Grows the Electron community + title: 支援 + description: Electron コミュニティを成長させます releases: - title: Releases - description: Oversees all release branches, and tooling to support releases. + title: リリース + description: すべてのリリースブランチと、リリースをサポートするツールを監督します。 upgrades: - title: Upgrades - description: Oversees upgrades of upstream dependencies; specifically Chromium and Node. + title: アップグレード + description: 上流の依存関係、特に Chromium と Node のアップグレードを監督します。 cmsf: - title: Community & Safety - description: Oversees removal/bans from community. + title: コミュニティ & 安全性 + description: コミュニティからの削除・禁止を監督します。 security: - title: Security - description: Proactively ensures the Security of Electron as a project, responds to incoming incidents, and oversees rollout of fixes. + title: セキュリティ + description: プロジェクトとしての Electron のセキュリティを積極的に保証し、生じるインシデントに対応し、修正のロールアウトを監督します。 admins: - title: Administrative - description: The Administrative Working Group oversees the entire governance and project. + title: 管理 + description: 管理ワーキンググループはガバナンスとプロジェクト全体を監督します。 api: title: API - description: Oversees public API design based on project principles. + description: プロジェクトの原則に基づいて公開 API 設計を監督します。 global: overview: 概要 - associated_repos: Associated Repositories - notes: Meeting Notes + associated_repos: 関連レポジトリ + notes: 議事録 definitions: - title: Definitions + title: 定義 list: - - A maintainer is anyone who plays an active role in governance. - - A collaborator is active in the community, but not in governance. - - A participant is anyone who is a maintainer or collaborator. - - A working group is a group of maintainers that is formed to take responsibility for certain aspects of the Electron project. Normally these groups will meet regularly but in some cases will only meet as required to fulfill their responsibilities. - - 'A chair leads a working group.' + - メンテナ は、ガバナンスにおいて積極的な役割を果たす人です。 + - コラボレータ はコミュニティで活動していますが、ガバナンスでは活動していない人です。 + - パーティシパント は、メンテナかコラボレータのことです。 + - ワーキンググループ は、Electron プロジェクトの特定の側面に責任を持つように形成されたメンテナのグループです。 通常、これらのグループは定期的に会合しますが、場合によっては、それぞれの責任を果たすのに必要な場合にだけ会合します。 + - '議長 がワーキンググループを率います。' responsibilities: - title: Responsibilities - listdescription: "All Working Groups have these core responsibilities:" + title: 責務 + listdescription: "すべてのワーキンググループはこれらの中核的な責任があります。" list: - - They shall decide for themselves, and publicly post, their rules, e.g. how decisions are made, when meetings are held, and who may attend. - - 'They shall select a chair to represent the group.' - - They shall keep meeting notes, including agenda items, discussion points, and outcomes for everyone to review. - - 'They shall be collaborative and work in good faith with other Working Groups.' - see_charter: See charter for more information. - code_of_conduct: The Electron organization and all repos therein adhere to the following Code of Conduct. - license: Electron is licensed with the MIT License. - repository: Check out the Governance Repository to find more information about the governance structure. + - 自身らで議決するため、規則を公開投稿しなければなりません。決議がどのように行われ、いつミーティングを開き、誰が参加するのか、というような規則です。 + - 'そのグループを 代表 する議長を 選出 します。' + - 議題項目を含む会議メモ、話し合いの要点、全員が見直すための成果を保管します。 + - '協力し合い、他のワーキンググループと 誠意を持って 仕事をします。' + see_charter: より詳しくは 憲章 を参照してください。 + code_of_conduct: Electron の組織とその中のすべてのリポジトリは、この 行動規範 を遵守しています。 + license: Electron は MIT License でライセンスされています。 + repository: ガバナンス構造の詳細については、ガバナンスリポジトリ を確認してください。 _404: - page_not_found: Page not found. + page_not_found: ページが見つかりません。 diff --git a/content/pt-BR/docs/api/app.md b/content/pt-BR/docs/api/app.md index c4cbd0a9ab5ce..4c2ab6c2dd67d 100644 --- a/content/pt-BR/docs/api/app.md +++ b/content/pt-BR/docs/api/app.md @@ -420,54 +420,6 @@ Retorna: Este evento será emitido quando `desktopCapturer.getSources()` é chamado no processo de renderização do `webContents`. Calling `event.preventDefault()` will make it return empty sources. -### Event: 'remote-require' _Deprecated_ - -Retorna: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -Este evento será emitido quando `remote.require()` é chamado no processo de renderização do `webContents`. Evocando `event.preventDefault()` irá prevenir o módulo de ser retornado. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - -### Event: 'remote-get-global' _Deprecated_ - -Retorna: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `globalName` String - -Este evento será emitido quando `remote.getGlobal()` é chamado no processo de renderização do `webContents`. Evocando `event.preventDefault()` irá previnir o global ser retornado. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - -### Event: 'remote-get-builtin' _Deprecated_ - -Retorna: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -É emitido quando `remote.getBuiltin()` é chamado pelo processo de renderização de `webContents`. Evocando `event.preventDefault()` irá prevenir o módulo de ser retornado. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - -### Event: 'remote-get-current-window' _Deprecated_ - -Retorna: - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -Este evento será emitido quando `remote.getCurrentWindow()` é chamado no processo de renderização do `webContents`. Calling `event.preventDefault()` will prevent the object from being returned. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - -### Event: 'remote-get-current-web-contents' _Deprecated_ - -Retorna: - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -Este evento será emitido quando `remote.getCurrentWebContents()` é chamado no processo de renderização do `webContents`. Calling `event.preventDefault()` will prevent the object from being returned. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - ## Métodos O objeto `app` tem os seguintes métodos: @@ -981,7 +933,7 @@ Sets the counter badge for current app. Setting the count to `0` will hide the b On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher. -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**Note:** Unity launcher requires a `.desktop` file to work. For more information, please read the [Unity integration documentation][unity-requirement]. ### `app.getBadgeCount()` _Linux_ _macOS_ @@ -1183,7 +1135,7 @@ An `Integer` property that returns the badge count for current app. Setting the On macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher. -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**Note:** Unity launcher requires a `.desktop` file to work. For more information, please read the [Unity integration documentation][unity-requirement]. **Note:** On macOS, you need to ensure that your application has the permission to display notifications for this property to take effect. @@ -1211,12 +1163,6 @@ A `String` which is the user agent string Electron will use as a global fallback This is the user agent that will be used when no user agent is set at the `webContents` or `session` level. It is useful for ensuring that your entire app has the same user agent. Set to a custom value as early as possible in your app's initialization to ensure that your overridden value is used. -### `app.allowRendererProcessReuse` - -A `Boolean` which when `true` disables the overrides that Electron has in place to ensure renderer processes are restarted on every navigation. The current default value for this property is `true`. - -The intention is for these overrides to become disabled by default and then at some point in the future this property will be removed. This property impacts which native modules you can use in the renderer process. For more information on the direction Electron is going with renderer process restarts and usage of native modules in the renderer process please check out this [Tracking Issue](https://github.com/electron/electron/issues/18397). - ### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ A `Boolean` which when `true` indicates that the app is currently running under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)). @@ -1231,7 +1177,7 @@ You can use this property to prompt users to download the arm64 version of your [LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType -[unity-requirement]: ../tutorial/desktop-environment-integration.md#unity-launcher +[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher [mas-builds]: ../tutorial/mac-app-store-submission-guide.md [Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows [JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx diff --git a/content/pt-BR/docs/api/auto-updater.md b/content/pt-BR/docs/api/auto-updater.md index e5f434c765a33..b2809968264e0 100644 --- a/content/pt-BR/docs/api/auto-updater.md +++ b/content/pt-BR/docs/api/auto-updater.md @@ -97,6 +97,8 @@ Returns `String` - The current update feed URL. Pergunta para o servidor se há alguma atualização. Você precisa chamar o `setFeedURL` antes de usar esta API. +**Note:** If an update is available it will be downloaded automatically. Calling `autoUpdater.checkForUpdates()` twice will download the update two times. + ### `autoUpdater.quitAndInstall()` Reinicia o aplicativo e instala a atualização após ela ter sido baixada. Deve ser chamado apenas após o evento `update-downloaded` ter sido emitido. diff --git a/content/pt-BR/docs/api/browser-window.md b/content/pt-BR/docs/api/browser-window.md index 4535cbcd47952..3459789900663 100644 --- a/content/pt-BR/docs/api/browser-window.md +++ b/content/pt-BR/docs/api/browser-window.md @@ -14,7 +14,7 @@ const win = new BrowserWindow({ width: 800, height: 600 }) win.loadURL('https://github.com') // Or load a local HTML file -win.loadURL(`file://${__dirname}/app/index.html`) +win.loadFile('index.html') ``` ## Janela sem frame @@ -143,7 +143,7 @@ O mesmo cria um novo `BrowserWindow` com propriedades nativas informadas como a * `frame` Boolean (optional) - Specify `false` to create a [Frameless Window](frameless-window.md). Por padrão é `true`. * `parent` BrowserWindow (optional) - Specify parent window. Por padrão é `null`. * `modal` Boolean (optional) - Whether this is a modal window. This only works when the window is a child window. Por padrão é `false`. - * `acceptFirstMouse` Boolean (optional) - Whether the web view accepts a single mouse-down event that simultaneously activates the window. Default is `false`. + * `acceptFirstMouse` Boolean (optional) - Whether clicking an inactive window will also click through to the web contents. Default is `false` on macOS. This option is not configurable on other platforms. * `disableAutoHideCursor` Boolean (optional) - Whether to hide cursor when typing. Por padrão é `false`. * `autoHideMenuBar` Boolean (optional) - Auto hide the menu bar unless the `Alt` key is pressed. Por padrão é `false`. * `enableLargerThanScreen` Boolean (optional) - Enable the window to be resized larger than screen. Only relevant for macOS, as other OSes allow larger-than-screen windows by default. Por padrão é `false`. @@ -157,11 +157,11 @@ O mesmo cria um novo `BrowserWindow` com propriedades nativas informadas como a * `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default. * `active` - The backdrop should always appear active. * `inactive` - The backdrop should always appear inactive. - * `titleBarStyle` String (optional) - The style of window title bar. Por padrão é `default`. Possible values are: - * `default` - Results in the standard gray opaque Mac title bar. - * `hidden` - Results in a hidden title bar and a full size content window, yet the title bar still has the standard window controls ("traffic lights") in the top left. - * `hiddenInset` - Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge. - * `customButtonsOnHover` - Results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. **Note:** This option is currently experimental. + * `titleBarStyle` String (optional) _macOS_ _Windows_ - The style of window title bar. Por padrão é `default`. Possible values are: + * `default` - Results in the standard title bar for macOS or Windows respectively. + * `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown. + * `hiddenInset` - Only on macOS, results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge. + * `customButtonsOnHover` - Only on macOS, results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. **Note:** This option is currently experimental. * `trafficLightPosition` [Point](structures/point.md) (optional) - Set a custom position for the traffic light buttons in frameless windows. * `roundedCorners` Boolean (optional) - Whether frameless window should have rounded corners on macOS. Por padrão é `true`. * `fullscreenWindowTitle` Boolean (optional) _Deprecated_ - Shows the title in the title bar in full screen mode on macOS for `hiddenInset` titleBarStyle. Por padrão é `false`. @@ -176,10 +176,8 @@ O mesmo cria um novo `BrowserWindow` com propriedades nativas informadas como a * `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 use `process.isMainFrame` to determine if you are in the main frame or not. * `preload` String (optional) - Specifies a script that will be loaded before other scripts run in the page. This script will always have access to node APIs no matter whether node integration is turned on or off. The value should be the absolute file path to the script. When node integration is turned off, the preload script can reintroduce Node global symbols back to the global scope. See example [here](context-bridge.md#exposing-node-global-symbols). * `sandbox` Boolean (optional) - If set, this will sandbox the renderer associated with the window, making it compatible with the Chromium OS-level sandbox and disabling the Node.js engine. This is not the same as the `nodeIntegration` option and the APIs available to the preload script are more limited. Read more about the option [here](../tutorial/sandbox.md). - * `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module. Por padrão é `false`. * `session` [Session](session.md#class-session) (optional) - Sets the session used by the page. Instead of passing the Session object directly, you can also choose to use the `partition` option instead, which accepts a partition string. When both `session` and `partition` are provided, `session` will be preferred. Default is the default session. * `partition` String (optional) - Sets the session used by the page according to the session's partition string. If `partition` starts 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. Default is the default session. - * `affinity` String (optional) - When specified, web pages with the same `affinity` will run in the same renderer process. Note that due to reusing the renderer process, certain `webPreferences` options will also be shared between the web pages even when you specified different values for them, including but not limited to `preload`, `sandbox` and `nodeIntegration`. So it is suggested to use exact same `webPreferences` for web pages with the same `affinity`. _Descontinuado_ * `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents `300%`. Por padrão é `1.0`. * `javascript` Boolean (optional) - Enables JavaScript support. Por padrão é `true`. * `webSecurity` Boolean (optional) - When `false`, it will disable the same-origin policy (usually using testing websites by people), and set `allowRunningInsecureContent` to `true` if this options has not been set by user. Por padrão é `true`. @@ -206,8 +204,7 @@ O mesmo cria um novo `BrowserWindow` com propriedades nativas informadas como a * `backgroundThrottling` Boolean (optional) - Whether to throttle animations and timers when the page becomes background. This also affects the [Page Visibility API](#page-visibility). Defaults to `true`. * `offscreen` Boolean (optional) - Whether to enable offscreen rendering for the browser window. Defaults to `false`. See the [offscreen rendering tutorial](../tutorial/offscreen-rendering.md) for more details. * `contextIsolation` Boolean (optional) - Whether to run Electron APIs and the specified `preload` script in a separate JavaScript context. Defaults to `true`. The context that the `preload` script runs in will only have access to its own dedicated `document` and `window` 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 the `preload` 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 the `preload` script and any Electron APIs being used. This option uses the same technique used by [Chrome Content Scripts][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. - * `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values can't unsafely cross between worlds when using `contextIsolation`. Defaults to `true`. _Descontinuado_ - * `nativeWindowOpen` Boolean (optional) - Whether to use native `window.open()`. Defaults to `false`. Child windows will always have node integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently experimental. + * `nativeWindowOpen` Boolean (optional) - Whether to use native `window.open()`. Defaults to `false`. Child windows will always have node integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** The default value will be changing to `true` in Electron 15. * `webviewTag` Boolean (optional) - Whether to enable the [`` tag](webview-tag.md). Defaults to `false`. **Note:** The `preload` script configured for the `` will have node integration enabled when it is executed so you should ensure remote/untrusted content is not able to create a `` tag with a possibly malicious `preload` script. You can use the `will-attach-webview` event on [webContents](web-contents.md) to strip away the `preload` script and to validate or alter the ``'s initial settings. * `additionalArguments` String[] (optional) - A list of strings that will be appended to `process.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. Por padrão é `false`. @@ -225,6 +222,7 @@ O mesmo cria um novo `BrowserWindow` com propriedades nativas informadas como a * `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation * `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager. Default policy is `code`. * `enablePreferredSizeMode` Boolean (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 the `preferred-size-changed` event to be emitted on the `WebContents` when the preferred size changes. Por padrão é `false`. + * `titleBarOverlay` [OverlayOptions](structures/overlay-options.md) | Boolean (optional) - When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. Por padrão é `false`. On Windows, the [OverlayOptions](structures/overlay-options.md) can be used instead of a boolean to specify colors for the overlay. When setting minimum or maximum window size with `minWidth`/`maxWidth`/ `minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from passing a size that does not follow size constraints to `setBounds`/`setSize` or to the constructor of `BrowserWindow`. @@ -544,6 +542,10 @@ A `Boolean` property that determines whether the window is in simple (pre-Lion) A `Boolean` property that determines whether the window is in fullscreen mode. +#### `win.focusable` _Windows_ _macOS_ + +A `Boolean` property that determines whether the window is focusable. + #### `win.visibleOnAllWorkspaces` A `Boolean` property that determines whether the window is visible on all workspaces. @@ -1224,18 +1226,18 @@ The number of buttons in thumbnail toolbar should be no greater than 7 due to th The `buttons` is an array of `Button` objects: * `Button` Object - * `icon` [NativeImage](native-image.md) - The icon showing in thumbnail toolbar. + * `icon` [NativeImage](native-image.md) - O icone exibido na barra de ferramentas de miniaturas. * `click` Function - * `tooltip` String (optional) - The text of the button's tooltip. + * `tooltip` String (opcional) - O texto do tooltip do botão. * `flags` String[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`. -The `flags` is an array that can include following `String`s: +As `flags` são um array que pode conter as seguintes `String`s: -* `enabled` - The button is active and available to the user. +* `enabled` - O botão está ativo e disponível ao usuário. * `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action. -* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately. -* `nobackground` - Do not draw a button border, use only the image. -* `hidden` - The button is not shown to the user. +* `dismissonclick` - Quando o botão é clicado, o janela da miniatura é fechada imediatamente. +* `nobackground` - Não desenha a borda do botão, utiliza apenas a imagem. +* `hidden` - O botão não é exibido ao usuário. * `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification. #### `win.setThumbnailClip(region)` _Windows_ @@ -1344,6 +1346,10 @@ Changes whether the window can be focused. On macOS it does not remove the focus from the window. +#### `win.isFocusable()` _macOS_ _Windows_ + +Returns whether the window can be focused. + #### `win.setParentWindow(parent)` * `parent` BrowserWindow | null @@ -1358,33 +1364,33 @@ Returns `BrowserWindow` - The parent window. Returns `BrowserWindow[]` - All child windows. -#### `win.setAutoHideCursor(autoHide)` _macOS_ +#### `win.setAutoHideCursor(autoHide)` no _macOS_ * `autoHide` Boolean Controls whether to hide cursor when typing. -#### `win.selectPreviousTab()` _macOS_ +#### `win.selectPreviousTab()` no _macOS_ Selects the previous tab when native tabs are enabled and there are other tabs in the window. -#### `win.selectNextTab()` _macOS_ +#### `win.selectNextTab()` no _macOS_ Selects the next tab when native tabs are enabled and there are other tabs in the window. -#### `win.mergeAllWindows()` _macOS_ +#### `win.mergeAllWindows()` no _macOS_ Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window. -#### `win.moveTabToNewWindow()` _macOS_ +#### `win.moveTabToNewWindow()` no _macOS_ Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window. -#### `win.toggleTabBar()` _macOS_ +#### `win.toggleTabBar()` no _macOS_ Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window. -#### `win.addTabbedWindow(browserWindow)` _macOS_ +#### `win.addTabbedWindow(browserWindow)` no _macOS_ * `browserWindow` BrowserWindow @@ -1398,17 +1404,17 @@ Adds a vibrancy effect to the browser window. Passing `null` or an empty string Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS. -#### `win.setTrafficLightPosition(position)` _macOS_ +#### `win.setTrafficLightPosition(position)` no _macOS_ * `position` [Point](structures/point.md) Set a custom position for the traffic light buttons in frameless window. -#### `win.getTrafficLightPosition()` _macOS_ +#### `win.getTrafficLightPosition()` no _macOS_ Returns `Point` - The custom position for the traffic light buttons in frameless window. -#### `win.setTouchBar(touchBar)` _macOS_ +#### `win.setTouchBar(touchBar)` no _macOS_ * `touchBar` TouchBar | null @@ -1444,7 +1450,7 @@ Raises `browserView` above other `BrowserView`s attached to `win`. Throws an err Returns `BrowserView[]` - an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. -**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases. +**Nota:** A API BrowserView atualmente é experimental e pode mudar ou ser removida em versões futuras do Electron. [runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 [page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API @@ -1453,3 +1459,5 @@ Returns `BrowserView[]` - an array of all BrowserViews that have been attached w [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/pt-BR/docs/api/clipboard.md b/content/pt-BR/docs/api/clipboard.md index 55cb2dd628c99..fa92ff9350f9c 100644 --- a/content/pt-BR/docs/api/clipboard.md +++ b/content/pt-BR/docs/api/clipboard.md @@ -193,7 +193,7 @@ const { clipboard } = require('electron') const hasFormat = clipboard.has('

    selection

    ') console.log(hasFormat) -// 'true' or 'false +// 'true' or 'false' ``` ### `clipboard.read(format)` _Experimental_ @@ -202,6 +202,8 @@ console.log(hasFormat) Returns `String` - Reads `format` type from the clipboard. +`format` should contain valid ASCII characters and have `/` separator. `a/c`, `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid. + ### `clipboard.readBuffer(format)` _Experimental_ * `format` String @@ -212,9 +214,9 @@ Returns `Buffer` - Reads `format` type from the clipboard. const { clipboard } = require('electron') const buffer = Buffer.from('this is binary', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) -const ret = clipboard.readBuffer('public.utf8-plain-text') +const ret = clipboard.readBuffer('public/utf8-plain-text') console.log(buffer.equals(out)) // true @@ -232,7 +234,7 @@ Writes the `buffer` into the clipboard as `format`. const { clipboard } = require('electron') const buffer = Buffer.from('writeBuffer', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) ``` ### `clipboard.write(data[, type])` diff --git a/content/pt-BR/docs/api/command-line-switches.md b/content/pt-BR/docs/api/command-line-switches.md index 049a352d512f4..6143bc8880394 100644 --- a/content/pt-BR/docs/api/command-line-switches.md +++ b/content/pt-BR/docs/api/command-line-switches.md @@ -59,17 +59,18 @@ Força o máximo de espaço em disco a ser usado pelo cache de disco, em bytes. Enables caller stack logging for the following APIs (filtering events): * `desktopCapturer.getSources()` / `desktop-capturer-get-sources` -* `remote.require()` / `remote-require` -* `remote.getGlobal()` / `remote-get-builtin` -* `remote.getBuiltin()` / `remote-get-global` -* `remote.getCurrentWindow()` / `remote-get-current-window` -* `remote.getCurrentWebContents()` / `remote-get-current-web-contents` -### --enable-logging +### --enable-logging[=file] -Prints Chromium's logging into console. +Prints Chromium's logging to stderr (or a log file). -This switch can not be used in `app.commandLine.appendSwitch` since it is parsed earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING` environment variable to achieve the same effect. +The `ELECTRON_ENABLE_LOGGING` environment variable has the same effect as passing `--enable-logging`. + +Passing `--enable-logging` will result in logs being printed on stderr. Passing `--enable-logging=file` will result in logs being saved to the file specified by `--log-file=...`, or to `electron_debug.log` in the user-data directory if `--log-file` is not specified. + +> **Note:** On Windows, logs from child processes cannot be sent to stderr. Logging to a file is the most reliable way to collect logs on Windows. + +See also `--log-file`, `--log-level`, `--v`, and `--vmodule`. ### --force-fieldtrials=`trials` @@ -116,10 +117,26 @@ See the [Node.js documentation][node-cli] or run `node --help` in your terminal Definir uma localidade customizada. +### --log-file=`path` + +If `--enable-logging` is specified, logs will be written to the given path. The parent directory must exist. + +Setting the `ELECTRON_LOG_FILE` environment variable is equivalent to passing this flag. If both are present, the command-line switch takes precedence. + ### --log-net-log=`path` Enables net log events to be saved and writes them to `path`. +### --log-level=`N` + +Sets the verbosity of logging when used together with `--enable-logging`. `N` should be one of [Chrome's LogSeverities][severities]. + +Note that two complimentary logging mechanisms in Chromium -- `LOG()` and `VLOG()` -- are controlled by different switches. `--log-level` controls `LOG()` messages, while `--v` and `--vmodule` control `VLOG()` messages. So you may want to use a combination of these three switches depending on the granularity you want and what logging calls are made by the code you're trying to watch. + +See [Chromium Logging source][logging] for more information on how `LOG()` and `VLOG()` interact. Loosely speaking, `VLOG()` can be thought of as sub-levels / per-module levels inside `LOG(INFO)` to control the firehose of `LOG(INFO)` data. + +See also `--enable-logging`, `--log-level`, `--v`, and `--vmodule`. + ### --no-proxy-server Don't use a proxy server and always make direct connections. Overrides any other proxy server flags that are passed. @@ -159,6 +176,8 @@ Gives the default maximal active V-logging level; 0 is the default. Normally pos This switch only works when `--enable-logging` is also passed. +See also `--enable-logging`, `--log-level`, and `--vmodule`. + ### --vmodule=`pattern` Gives the per-module maximal V-logging levels to override the value given by `--v`. Ex. `my_module=2,foo*=3` would change the logging level for all code in source files `my_module.*` and `foo*.*`. @@ -167,6 +186,8 @@ Any pattern containing a forward or backward slash will be tested against the wh This switch only works when `--enable-logging` is also passed. +See also `--enable-logging`, `--log-level`, and `--v`. + ### --force_high_performance_gpu Force using discrete GPU when there are multiple GPUs available. @@ -214,5 +235,7 @@ By default inspector websocket url is available in stderr and under /json/list e [ready]: app.md#event-ready [play-silent-audio]: https://github.com/atom/atom/pull/9485/files [debugging-main-process]: ../tutorial/debugging-main-process.md +[logging]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h [node-cli]: https://nodejs.org/api/cli.html [node-cli]: https://nodejs.org/api/cli.html +[severities]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h?q=logging::LogSeverity&ss=chromium diff --git a/content/pt-BR/docs/api/dialog.md b/content/pt-BR/docs/api/dialog.md index 75b6523638387..a850ac0e401b8 100644 --- a/content/pt-BR/docs/api/dialog.md +++ b/content/pt-BR/docs/api/dialog.md @@ -186,8 +186,6 @@ Os `filters` especificam um array de tipos de arquivo que podem ser exibidos, ve * `defaultId` Integer (opcional) - Indicador do botão na array de botões que será selecionado como padrão quando a caixa de mensagem abrir. * `title` String (opcional) - Título da caixa de mensagem, algumas plataformas não o exibirão. * `detail` String (opcional) - Informações adicionais da mensagem. - * `checkboxLabel` String (optional) - If provided, the message box will include a checkbox with the given label. - * `checkboxChecked` Boolean (optional) - Initial checked state of the checkbox. `false` by default. * `icon` ([NativeImage](native-image.md) | String) (opcional) * `cancelId` Integer (opcional) - O indicador do botão será usado para cancelar o diálogo, por via da tecla `Esc`. Por padrão é atribuído ao primeiro botão como "cancelar" ou "não" como rótulos. If no such labeled buttons exist and this option is not set, `0` will be used as the return value. * `noLink` Boolean (opcional) - No Windows, o Electron tentará identificar qual dos `buttons` são botões comuns (como "cancelar" ou "sim"), e exibir os outros como links de comandos no diálogo. Ele pode fazer o diálogo ser apresentado com o estilo dos aplicativos modernos do Windows. Se você não deseja esse comportamento, você pode definir `noLink` para `true`. diff --git a/content/pt-BR/docs/api/environment-variables.md b/content/pt-BR/docs/api/environment-variables.md index c8d082b86cfaa..3e7c290093b26 100644 --- a/content/pt-BR/docs/api/environment-variables.md +++ b/content/pt-BR/docs/api/environment-variables.md @@ -104,7 +104,15 @@ As seguintes variáveis de ambiente são destinadas principalmente para fins de ### `ELECTRON_ENABLE_LOGGING` -Imprime o log interno do Chrome para o console. +Prints Chromium's internal logging to the console. + +Setting this variable is the same as passing `--enable-logging` on the command line. For more info, see `--enable-logging` in [command-line switches](./command-line-switches.md#enable-loggingfile). + +### `ELECTRON_LOG_FILE` + +Sets the file destination for Chromium's internal logging. + +Setting this variable is the same as passing `--log-file` on the command line. For more info, see `--log-file` in [command-line switches](./command-line-switches.md#log-filepath). ### `ELECTRON_DEBUG_DRAG_REGIONS` @@ -112,7 +120,7 @@ Adds coloration to draggable regions on [`BrowserView`](./browser-view.md)s on m ### `ELECTRON_DEBUG_NOTIFICATIONS` -Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common actions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. +Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common a tions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. Sample output: diff --git a/content/pt-BR/docs/api/extensions.md b/content/pt-BR/docs/api/extensions.md index 5cec82018d9f2..e2ababb0bdb6f 100644 --- a/content/pt-BR/docs/api/extensions.md +++ b/content/pt-BR/docs/api/extensions.md @@ -64,6 +64,7 @@ The following methods of `chrome.runtime` are supported: - `chrome.runtime.getURL` - `chrome.runtime.connect` - `chrome.runtime.sendMessage` +- `chrome.runtime.reload` The following events of `chrome.runtime` are supported: diff --git a/content/pt-BR/docs/api/frameless-window.md b/content/pt-BR/docs/api/frameless-window.md index 812b6c750a323..feae8968b1832 100644 --- a/content/pt-BR/docs/api/frameless-window.md +++ b/content/pt-BR/docs/api/frameless-window.md @@ -14,13 +14,13 @@ const win = new BrowserWindow({ width: 800, height: 600, frame: false }) win.show() ``` -### Alternativas no macOS +### Alternatives -There's an alternative way to specify a chromeless window. Instead of setting `frame` to `false` which disables both the titlebar and window controls, you may want to have the title bar hidden and your content extend to the full window size, yet still preserve the window controls ("traffic lights") for standard window actions. Você pode fazê-lo, especificando a opção `titleBarStyle`: +There's an alternative way to specify a chromeless window on macOS and Windows. Instead of setting `frame` to `false` which disables both the titlebar and window controls, you may want to have the title bar hidden and your content extend to the full window size, yet still preserve the window controls ("traffic lights" on macOS) for standard window actions. Você pode fazê-lo, especificando a opção `titleBarStyle`: #### `hidden` -Resultando em uma janela com a barra do título escondida e o conteúdo ocupando o tamanho inteiro da janela, no entanto, a janela ainda possuirá os controles no canto superior esquerdo. +Results in a hidden title bar and a full size content window. On macOS, the title bar still has the standard window controls (“traffic lights”) in the top left. ```javascript const { BrowserWindow } = require('electron') @@ -28,6 +28,8 @@ const win = new BrowserWindow({ titleBarStyle: 'hidden' }) win.show() ``` +### Alternativas no macOS + #### `hiddenInset` Resulta em uma barra de título escondida com uma aparência alternativa, onde os botões de controle da janela estão um pouco mais dentro do limite da janela. @@ -48,6 +50,33 @@ const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: fa win.show() ``` +## Windows Control Overlay + +When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS, using one of the `titleBarStyle`s as described above so that the traffic lights are visible, or using `titleBarStyle: hidden` on Windows, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true. Specifying `true` will result in an overlay with default system colors. + +On Windows, you can also specify the color of the overlay and its symbols by setting `titleBarOverlay` to an object with the options `color` and `symbolColor`. If an option is not specified, the color will default to its system color for the window control buttons: + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: true +}) +win.show() +``` + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: { + color: '#2f3241', + symbolColor: '#74b1be' + } +}) +win.show() +``` + ## Janela transparente Definindo a opção `transparent` como `true` você também pode fazer a frameless window transparente: @@ -142,3 +171,5 @@ In a frameless window the dragging behavior may conflict with selecting text. Fo On some platforms, the draggable area will be treated as a non-client frame, so when you right click on it a system menu will pop up. To make the context menu behave correctly on all platforms you should never use a custom context menu on draggable areas. [ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/pt-BR/docs/api/ipc-main.md b/content/pt-BR/docs/api/ipc-main.md index b0e383e9ec822..58af3e9a525c3 100644 --- a/content/pt-BR/docs/api/ipc-main.md +++ b/content/pt-BR/docs/api/ipc-main.md @@ -32,6 +32,8 @@ ipcMain.on('synchronous-message', (event, arg) => { ```javascript // In renderer process (web page). +// NB. Electron APIs are only accessible from preload, unless contextIsolation is disabled. +// See https://www.electronjs.org/docs/tutorial/process-model#preload-scripts for more details. const { ipcRenderer } = require('electron') console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints "pong" diff --git a/content/pt-BR/docs/api/menu-item.md b/content/pt-BR/docs/api/menu-item.md index f87f807b13d63..1da909c65a214 100644 --- a/content/pt-BR/docs/api/menu-item.md +++ b/content/pt-BR/docs/api/menu-item.md @@ -13,7 +13,7 @@ Veja [`Menu`](menu.md) para exemplos. * `menuItem` MenuItem * `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open. * `event` [KeyboardEvent](structures/keyboard-event.md) - * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. See [roles](#roles). + * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. See [roles](#roles). * `type` String (opcional) - Pode ser `normal`, `separator`, `submenu`, `checkbox` ou `radio`. * `label` String (optional) * `sublabel` String (optional) @@ -128,7 +128,7 @@ A `String` indicating the type of the item. Can be `normal`, `separator`, `subme #### `menuItem.role` -A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` +A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` #### `menuItem.accelerator` diff --git a/content/pt-BR/docs/api/menu.md b/content/pt-BR/docs/api/menu.md index 40c70fd823408..9e6be187d9ab9 100644 --- a/content/pt-BR/docs/api/menu.md +++ b/content/pt-BR/docs/api/menu.md @@ -143,7 +143,7 @@ const template = [ { role: 'services' }, { type: 'separator' }, { role: 'hide' }, - { role: 'hideothers' }, + { role: 'hideOthers' }, { role: 'unhide' }, { type: 'separator' }, { role: 'quit' } diff --git a/content/pt-BR/docs/api/power-monitor.md b/content/pt-BR/docs/api/power-monitor.md index f246f2099da20..f16274015c478 100644 --- a/content/pt-BR/docs/api/power-monitor.md +++ b/content/pt-BR/docs/api/power-monitor.md @@ -8,11 +8,11 @@ Processo: [Main](../glossary.md#main-process) O módulo `powerMonitor` emite os seguintes eventos: -### Evento: 'suspend' _macOS_ _Windows_ +### Event: 'suspend' Emitted when the system is suspending. -### Evento: 'resume' _macOS_ _Windows_ +### Event: 'resume' Emitted when system is resuming. diff --git a/content/pt-BR/docs/api/session.md b/content/pt-BR/docs/api/session.md index 957af14afc226..30df0fa1fb749 100644 --- a/content/pt-BR/docs/api/session.md +++ b/content/pt-BR/docs/api/session.md @@ -160,7 +160,7 @@ Retorna: Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request. -#### Event: 'select-serial-port' _Experimental_ +#### Event: 'select-serial-port' Retorna: @@ -172,21 +172,15 @@ Retorna: Emitted when a serial port needs to be selected when a call to `navigator.serial.requestPort` is made. `callback` should be called with `portId` to be selected, passing an empty string to `callback` will cancel the request. Additionally, permissioning on `navigator.serial` can be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler) with the `serial` permission. -Because this is an experimental feature it is disabled by default. To enable this feature, you will need to use the `--enable-features=ElectronSerialChooser` command line switch. Additionally because this is an experimental Chromium feature you will need to set `enableBlinkFeatures: 'Serial'` on the `webPreferences` property when opening a BrowserWindow. - ```javascript const { app, BrowserWindow } = require('electron') let win = null -app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser') app.whenReady().then(() => { win = new BrowserWindow({ width: 800, - height: 600, - webPreferences: { - enableBlinkFeatures: 'Serial' - } + height: 600 }) win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => { event.preventDefault() @@ -202,7 +196,7 @@ app.whenReady().then(() => { }) ``` -#### Event: 'serial-port-added' _Experimental_ +#### Event: 'serial-port-added' Retorna: @@ -212,7 +206,7 @@ Retorna: Emitted after `navigator.serial.requestPort` has been called and `select-serial-port` has fired if a new serial port becomes available. For example, this event will fire when a new USB device is plugged in. -#### Event: 'serial-port-removed' _Experimental_ +#### Event: 'serial-port-removed' Retorna: @@ -452,7 +446,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents #### `ses.setPermissionCheckHandler(handler)` * `handler` Função\ | null - * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. Cross origin sub frames making permission checks will pass a `null` webContents to this handler. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. + * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. All cross origin sub frames making permission checks will pass a `null` webContents to this handler, while certain other permission checks such as `notifications` checks will always pass `null`. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. * `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, or `serial`. * `requestingOrigin` String - The origin URL of the permission check * `details` Object - Some properties are only available on certain permission types. diff --git a/content/pt-BR/docs/api/structures/overlay-options.md b/content/pt-BR/docs/api/structures/overlay-options.md new file mode 100644 index 0000000000000..9e0e4815ea59c --- /dev/null +++ b/content/pt-BR/docs/api/structures/overlay-options.md @@ -0,0 +1,4 @@ +# OverlayOptions Object + +* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color. +* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color. diff --git a/content/pt-BR/docs/api/structures/user-default-types.md b/content/pt-BR/docs/api/structures/user-default-types.md new file mode 100644 index 0000000000000..febfff7acbffe --- /dev/null +++ b/content/pt-BR/docs/api/structures/user-default-types.md @@ -0,0 +1,12 @@ +# UserDefaultTypes Object + +* `string` String +* `boolean` Boolean +* `integer` Number +* `float` Number +* `double` Number +* String `url` +* `array` Array\ +* `dictionary` Record\ + +This type is a helper alias, no object will never exist of this type. diff --git a/content/pt-BR/docs/api/system-preferences.md b/content/pt-BR/docs/api/system-preferences.md index 37af3d2597664..7a7811a7311a0 100644 --- a/content/pt-BR/docs/api/system-preferences.md +++ b/content/pt-BR/docs/api/system-preferences.md @@ -147,12 +147,12 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace. Add the specified defaults to your application's `NSUserDefaults`. -### `systemPreferences.getUserDefault(key, type)` _macOS_ +### `systemPreferences.getUserDefault(key, type)` _macOS_ * `key` String -* `type` String - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. +* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. -Returns `any` - The value of `key` in `NSUserDefaults`. +Returns [`UserDefaultTypes[Type]`](structures/user-default-types.md) - The value of `key` in `NSUserDefaults`. Some popular `key` and `type`s are: diff --git a/content/pt-BR/docs/api/touch-bar-scrubber.md b/content/pt-BR/docs/api/touch-bar-scrubber.md index f3b30cce21e0e..bc26b95bd2b0b 100644 --- a/content/pt-BR/docs/api/touch-bar-scrubber.md +++ b/content/pt-BR/docs/api/touch-bar-scrubber.md @@ -14,7 +14,7 @@ Processo: [Main](../glossary.md#main-process) * `highlightedIndex` Integer - The index of the item the user touched. * `selectedStyle` String (optional) - Selected item style. Can be `background`, `outline` or `none`. O padrão é `none`. * `overlayStyle` String (optional) - Selected overlay item style. Can be `background`, `outline` or `none`. O padrão é `none`. - * `showArrowButtons` Boolean (optional) - Defaults to `false`. + * `showArrowButtons` Boolean (optional) - Whether to show arrow buttons. Defaults to `false` and is only shown if `items` is non-empty. * `mode` String (optional) - Can be `fixed` or `free`. O padrão é `free`. * `continuous` Boolean (optional) - Defaults to `true`. diff --git a/content/pt-BR/docs/api/web-contents.md b/content/pt-BR/docs/api/web-contents.md index 3f6d5c838c317..4a21945dd4591 100644 --- a/content/pt-BR/docs/api/web-contents.md +++ b/content/pt-BR/docs/api/web-contents.md @@ -39,6 +39,24 @@ Returns `WebContents` - The web contents that is focused in this application, ot Returns `WebContents` | undefined - A WebContents instance with the given ID, or `undefined` if there is no WebContents associated with the given ID. +### `webContents.fromDevToolsTargetId(targetId)` + +* `targetId` String - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance. + +Returns `WebContents` | undefined - A WebContents instance with the given TargetID, or `undefined` if there is no WebContents associated with the given TargetID. + +When communicating with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), it can be useful to lookup a WebContents instance based on its assigned TargetID. + +```js +async function lookupTargetId (browserWindow) { + const wc = browserWindow.webContents + await wc.debugger.attach('1.3') + const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo') + const { targetId } = targetInfo + const targetWebContents = await webContents.fromDevToolsTargetId(targetId) +} +``` + ## Class: WebContents > Render and control the contents of a BrowserWindow instance. @@ -134,7 +152,7 @@ Retorna: * `frameName` String * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. * `options` BrowserWindowConstructorOptions - The options which will be used for creating the new [`BrowserWindow`](browser-window.md). -* `additionalFeatures` String[] - The non-standard features (features not handled by Chromium or Electron) given to `window.open()`. +* `additionalFeatures` String[] - The non-standard features (features not handled by Chromium or Electron) given to `window.open()`. Deprecated, and will now always be the empty array `[]`. * `referrer` [Referrer](structures/referrer.md) - The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. @@ -178,8 +196,7 @@ Retorna: * Objeto `details` * `url` String - URL for the created window. * `frameName` String - Name given to the created window in the `window.open()` call. - * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: options inherited from the parent, parsed options from the `features` string from `window.open()`, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. - * `additionalFeatures` String[] - The non-standard features (features not handled Chromium or Electron) _Deprecated_ + * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. * `referrer` [Referrer](structures/referrer.md) - The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. @@ -320,6 +337,8 @@ win.webContents.on('will-prevent-unload', (event) => { }) ``` +**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the [specification](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). + #### Event: 'crashed' _Deprecated_ Retorna: @@ -726,49 +745,6 @@ Retorna: Emitted when `desktopCapturer.getSources()` is called in the renderer process. Calling `event.preventDefault()` will make it return empty sources. -#### Event: 'remote-require' _Deprecated_ - -Retorna: - -* `event` IpcMainEvent -* `moduleName` String - -Emitted when `remote.require()` is called in the renderer process. Evocando `event.preventDefault()` irá prevenir o módulo de ser retornado. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - -#### Event: 'remote-get-global' _Deprecated_ - -Retorna: - -* `event` IpcMainEvent -* `globalName` String - -Emitted when `remote.getGlobal()` is called in the renderer process. Evocando `event.preventDefault()` irá previnir o global ser retornado. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - -#### Event: 'remote-get-builtin' _Deprecated_ - -Retorna: - -* `event` IpcMainEvent -* `moduleName` String - -Emitted when `remote.getBuiltin()` is called in the renderer process. Evocando `event.preventDefault()` irá prevenir o módulo de ser retornado. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - -#### Event: 'remote-get-current-window' _Deprecated_ - -Retorna: - -* `event` IpcMainEvent - -Emitted when `remote.getCurrentWindow()` is called in the renderer process. Calling `event.preventDefault()` will prevent the object from being returned. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - -#### Event: 'remote-get-current-web-contents' _Deprecated_ - -Retorna: - -* `event` IpcMainEvent - -Emitted when `remote.getCurrentWebContents()` is called in the renderer process. Calling `event.preventDefault()` will prevent the object from being returned. Valores personalizados podem ser retornados pela configuração `event.returnValue`. - #### Event: 'preferred-size-changed' Retorna: @@ -1040,7 +1016,7 @@ Ignore application menu shortcuts while this web contents is focused. Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window. Returning an unrecognized value such as a null, undefined, or an object without a recognized 'action' value will result in a console error and have the same effect as returning `{action: 'deny'}`. -Called before creating a window when `window.open()` is called from the renderer. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. +Called before creating a window a new window is requested by the renderer, e.g. by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or submitting a form with ``. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. #### `contents.setAudioMuted(muted)` diff --git a/content/pt-BR/docs/api/web-frame-main.md b/content/pt-BR/docs/api/web-frame-main.md index 132a97c3d2074..b31896e919aae 100644 --- a/content/pt-BR/docs/api/web-frame-main.md +++ b/content/pt-BR/docs/api/web-frame-main.md @@ -154,3 +154,9 @@ An `Integer` representing the Chromium internal `pid` of the process which owns #### `frame.routingId` _Readonly_ An `Integer` representing the unique frame id in the current renderer process. Distinct `WebFrameMain` instances that refer to the same underlying frame will have the same `routingId`. + +#### `frame.visibilityState` _Readonly_ + +A `string` representing the [visibility state](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) of the frame. + +See also how the [Page Visibility API](browser-window.md#page-visibility) is affected by other Electron APIs. diff --git a/content/pt-BR/docs/api/web-request.md b/content/pt-BR/docs/api/web-request.md index dd15ff85c52ad..ae261dc46d56b 100644 --- a/content/pt-BR/docs/api/web-request.md +++ b/content/pt-BR/docs/api/web-request.md @@ -46,7 +46,7 @@ The following methods are available on instances of `WebRequest`: * `webContentsId` Integer (opcional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `uploadData` [UploadData[]](structures/upload-data.md) @@ -88,7 +88,7 @@ Alguns exemplos de `urls` válidas: * `webContentsId` Integer (opcional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `requestHeaders` Record @@ -113,7 +113,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (opcional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `requestHeaders` Record @@ -132,7 +132,7 @@ The `listener` will be called with `listener(details)` just before a request is * `webContentsId` Integer (opcional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `statusLine` String @@ -160,7 +160,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (opcional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -182,7 +182,7 @@ The `listener` will be called with `listener(details)` when first byte of the re * `webContentsId` Integer (opcional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `redirectURL` String @@ -206,7 +206,7 @@ The `listener` will be called with `listener(details)` when a server initiated r * `webContentsId` Integer (opcional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -229,7 +229,7 @@ The `listener` will be called with `listener(details)` when a request is complet * `webContentsId` Integer (opcional) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `fromCache` Boolean diff --git a/content/pt-BR/docs/api/webview-tag.md b/content/pt-BR/docs/api/webview-tag.md index a113cc9b72913..f81c99b01bdb0 100644 --- a/content/pt-BR/docs/api/webview-tag.md +++ b/content/pt-BR/docs/api/webview-tag.md @@ -94,14 +94,6 @@ A `Boolean`. When this attribute is present the guest page in `webview` will hav A `Boolean` for the experimental option for enabling NodeJS support in sub-frames such as iframes inside the `webview`. All your preloads will load for every iframe, you can use `process.isMainFrame` to determine if you are in the main frame or not. This option is disabled by default in the guest page. -### `enableremotemodule` - -```html - -``` - -A `Boolean`. When this attribute is `false` the guest page in `webview` will not have access to the [`remote`](remote.md) module. The remote module is unavailable by default. - ### `plugins` ```html @@ -737,6 +729,18 @@ It is also not emitted during in-page navigation, such as clicking anchor links Calling `event.preventDefault()` does __NOT__ have any effect. +### Event: 'did-start-navigation' + +Retorna: + +* String `url` +* `isInPlace` Boolean +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitted when any frame (including main) starts navigating. `isInPlace` will be `true` for in-page navigations. + ### Event: 'did-navigate' Retorna: @@ -747,6 +751,21 @@ Emitted when a navigation is done. This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. +### Event: 'did-frame-navigate' + +Retorna: + +* String `url` +* `httpResponseCode` Integer - -1 for non HTTP navigations +* `httpStatusText` String - empty for non HTTP navigations, +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitted when any frame navigation is done. + +This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. + ### Event: 'did-navigate-in-page' Retorna: diff --git a/content/pt-BR/docs/api/window-open.md b/content/pt-BR/docs/api/window-open.md index 250fda4abf747..bb7d71d67dceb 100644 --- a/content/pt-BR/docs/api/window-open.md +++ b/content/pt-BR/docs/api/window-open.md @@ -11,7 +11,7 @@ However, when the `sandbox` (or directly, `nativeWindowOpen`) option is set, a ` Electron pairs this native Chrome `Window` with a BrowserWindow under the hood. You can take advantage of all the customization available when creating a BrowserWindow in the main process by using `webContents.setWindowOpenHandler()` for renderer-created windows. -BrowserWindow constructor options are set by, in increasing precedence order: options inherited from the parent, parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. +BrowserWindow constructor options are set by, in increasing precedence order: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. ### `window.open(url[, frameName][, features])` @@ -36,7 +36,8 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn * Node integration will always be disabled in the opened `window` if it is disabled on the parent window. * Context isolation will always be enabled in the opened `window` if it is enabled on the parent window. * JavaScript will always be disabled in the opened `window` if it is disabled on the parent window. -* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `additionalFeatures` argument. +* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `options` argument. +* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters). To customize or cancel the creation of the window, you can optionally set an override handler with `webContents.setWindowOpenHandler()` from the main process. Returning `false` cancels the window, while returning an object sets the `BrowserWindowConstructorOptions` used when creating the window. Note that this is more powerful than passing options through the feature string, as the renderer has more limited privileges in deciding security preferences than the main process. @@ -56,7 +57,7 @@ mainWindow.webContents.setWindowOpenHandler(({ url }) => { mainWindow.webContents.on('did-create-window', (childWindow) => { // For example... - childWindow.webContents('will-navigate', (e) => { + childWindow.webContents.on('will-navigate', (e) => { e.preventDefault() }) }) diff --git a/content/pt-BR/docs/breaking-changes.md b/content/pt-BR/docs/breaking-changes.md index ec002cb894bc7..649b988548708 100644 --- a/content/pt-BR/docs/breaking-changes.md +++ b/content/pt-BR/docs/breaking-changes.md @@ -12,9 +12,29 @@ This document uses the following convention to categorize breaking changes: * **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release. * **Removed:** An API or feature was removed, and is no longer supported by Electron. +## Alterações planejadas na API (15.0) + +### Default Changed: `nativeWindowOpen` defaults to `true` + +Prior to Electron 15, `window.open` was by default shimmed to use `BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work to open synchronously scriptable child windows, among other incompatibilities. `nativeWindowOpen: true` is no longer experimental, and is now the default. + +See the documentation for [window.open in Electron](api/window-open.md) for more details. + ## Alterações planejadas na API (14.0) -### API Changed: `window.(open)` +### Removido: `app.allowRendererProcessReuse` + +The `app.allowRendererProcessReuse` property will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. + +For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). + +### Removed: Browser Window Affinity + +The `affinity` option when constructing a new `BrowserWindow` will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. + +For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). + +### API Changed: `window.open()` The optional parameter `frameName` will no longer set the title of the window. This now follows the specification described by the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) under the corresponding parameter `windowName`. @@ -22,11 +42,49 @@ If you were using this parameter to set the title of a window, you can instead u ### Removido: `worldSafeExecuteJavaScript` -In Electron 14, `worldSafeExecuteJavaScript` will be removed. There is no alternative, please ensure your code works with this property enabled. It has been enabled by default since Electron +No Electron 14, `worldSafeExecuteJavaScript` será removido. There is no alternative, please ensure your code works with this property enabled. It has been enabled by default since Electron 12. You will be affected by this change if you use either `webFrame.executeJavaScript` or `webFrame.executeJavaScriptInIsolatedWorld`. You will need to ensure that values returned by either of those methods are supported by the [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) as these methods use the same value passing semantics. +### Removed: BrowserWindowConstructorOptions inheriting from parent windows + +Prior to Electron 14, windows opened with `window.open` would inherit BrowserWindow constructor options such as `transparent` and `resizable` from their parent window. Beginning with Electron 14, this behavior is removed, and windows will not inherit any BrowserWindow constructor options from their parents. + +Instead, explicitly set options for the new window with `setWindowOpenHandler`: + +```js +webContents.setWindowOpenHandler((details) => { + return { + action: 'allow', + overrideBrowserWindowOptions: { + // ... + } + } +}) +``` + +### Removido: `additionalFeatures` + +The deprecated `additionalFeatures` property in the `new-window` and `did-create-window` events of WebContents has been removed. Since `new-window` uses positional arguments, the argument is still present, but will always be the empty array `[]`. (Though note, the `new-window` event itself is deprecated, and is replaced by `setWindowOpenHandler`.) Bare keys in window features will now present as keys with the value `true` in the options object. + +```js +// Removed in Electron 14 +// Triggered by window.open('...', '', 'my-key') +webContents.on('did-create-window', (window, details) => { + if (details.additionalFeatures.includes('my-key')) { + // ... + } +}) + +// Replace with +webContents.on('did-create-window', (window, details) => { + if (details.options['my-key']) { + // ... + } +}) +``` + ## Alterações planejadas na API (13.0) ### API Changed: `session.setPermissionCheckHandler(handler)` @@ -285,12 +343,6 @@ See [#23265](https://github.com/electron/electron/pull/23265) for more details. Setting `{ compress: false }` in `crashReporter.start` is deprecated. Nearly all crash ingestion servers support gzip compression. This option will be removed in a future version of Electron. -### Removed: Browser Window Affinity - -The `affinity` option when constructing a new `BrowserWindow` will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. - -For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). - ### Default Changed: `enableRemoteModule` defaults to `false` In Electron 9, using the remote module without explicitly enabling it via the `enableRemoteModule` WebPreferences option began emitting a warning. In Electron 10, the remote module is now disabled by default. To use the remote module, `enableRemoteModule: true` must be specified in WebPreferences: diff --git a/content/pt-BR/docs/development/pull-requests.md b/content/pt-BR/docs/development/pull-requests.md index 805019852188c..d105ca57f12fa 100644 --- a/content/pt-BR/docs/development/pull-requests.md +++ b/content/pt-BR/docs/development/pull-requests.md @@ -92,7 +92,6 @@ Common prefixes: * perf: A code change that improves performance * refactor: A code change that neither fixes a bug nor adds a feature * style: Changes that do not affect the meaning of the code (linting) -* vendor: Bumping a dependency like libchromiumcontent or node Other things to keep in mind when writing a commit message: diff --git a/content/pt-BR/docs/development/source-code-directory-structure.md b/content/pt-BR/docs/development/source-code-directory-structure.md index 5fd3de4801a84..a802e7f2f0b2a 100644 --- a/content/pt-BR/docs/development/source-code-directory-structure.md +++ b/content/pt-BR/docs/development/source-code-directory-structure.md @@ -79,7 +79,6 @@ Electron * **.circleci** - Config file for CI with CircleCI. * **.github** - GitHub-specific config files including issues templates and CODEOWNERS. * **dist** - Temporary directory created by `script/create-dist.py` script when creating a distribution. -* **external_binaries** - Downloaded binaries of third-party frameworks which do not support building with `gn`. * **node_modules** - Third party node modules used for building. * **npm** - Logic for installation of Electron via npm. * **out** - Temporary output directory of `ninja`. @@ -95,4 +94,3 @@ script/ - The set of all scripts Electron runs for a variety of purposes. ``` * **typings** - TypeScript typings for Electron's internal code. -* **vendor** - Source code for some third party dependencies. diff --git a/content/pt-BR/docs/tutorial/application-debugging.md b/content/pt-BR/docs/tutorial/application-debugging.md index bfa45d84b464d..bc8f3c8b6e164 100644 --- a/content/pt-BR/docs/tutorial/application-debugging.md +++ b/content/pt-BR/docs/tutorial/application-debugging.md @@ -29,7 +29,7 @@ Se o contexto V8 parar de funcionar, as ferramentas de desenvolvimento mostratã Logs para Chromium podem ser habilitados através da variável de ambiente `ELECTRON_ENABLE_LOGGING`. Para mais informações, consulte o documento [Variáveis de ambiente](../api/environment-variables.md#electron_enable_logging). -Alternativamente, o argumento da linha de comando `--enable-logging` pode ser passado. Mais informações estão disponíveis na documentação de [Alteradores de linha de comando](../api/command-line-switches.md#--enable-logging). +Alternativamente, o argumento da linha de comando `--enable-logging` pode ser passado. Mais informações estão disponíveis na documentação de [Alteradores de linha de comando](../api/command-line-switches.md#--enable-loggingfile). [node-inspect]: https://nodejs.org/en/docs/inspector/ [devtools]: https://developers. google. com/web/tools/chrome-devtools/ diff --git a/content/pt-BR/docs/tutorial/code-signing.md b/content/pt-BR/docs/tutorial/code-signing.md index 21d59ddb26b86..22d4a46c2970f 100644 --- a/content/pt-BR/docs/tutorial/code-signing.md +++ b/content/pt-BR/docs/tutorial/code-signing.md @@ -103,7 +103,7 @@ Electron Builder comes with a custom solution for signing your application. You If you're not using an integrated build pipeline like Forge or Builder, you are likely using [`electron-packager`][], which includes [`electron-osx-sign`][] and [`electron-notarize`][]. -If you're using Packager's API, you can pass [in configuration that both signs and notarizes your application](https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html). +If you're using Packager's API, you can pass [in configuration that both signs and notarizes your application](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html). ```js const packager = require('electron-packager') @@ -156,7 +156,6 @@ Você pode obter um certificado de assinatura de um grande número de revendedor * [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm) * [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing) -* [GoDaddy](https://au.godaddy.com/web-security/code-signing-certificate) * Amongst others, please shop around to find one that suits your needs, Google is your friend 😄 There are a number of tools for signing your packaged app: diff --git a/content/pt-BR/docs/tutorial/dark-mode.md b/content/pt-BR/docs/tutorial/dark-mode.md index e4f85d3c4d2b6..771abcbb93437 100644 --- a/content/pt-BR/docs/tutorial/dark-mode.md +++ b/content/pt-BR/docs/tutorial/dark-mode.md @@ -56,9 +56,9 @@ Starting with the `index.html` file: ``` -And the `style.css` file: +And the `styles.css` file: -```css title='style.css' +```css title='styles.css' @media (prefers-color-scheme: dark) { body { background: #333; color: white; } } @@ -160,6 +160,6 @@ Run the example using Electron Fiddle and then click the "Toggle Dark Mode" butt [system-wide-dark-mode]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/ [electron-forge]: https://www.electronforge.io/ [electron-packager]: https://github.com/electron/electron-packager -[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport +[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#darwindarkmodesupport [prefers-color-scheme]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme [event-listeners]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener diff --git a/content/pt-BR/docs/tutorial/in-app-purchases.md b/content/pt-BR/docs/tutorial/in-app-purchases.md index 1709942d4b42f..9a9eebe83c1b5 100644 --- a/content/pt-BR/docs/tutorial/in-app-purchases.md +++ b/content/pt-BR/docs/tutorial/in-app-purchases.md @@ -1,4 +1,4 @@ -# Compra no app (macOS) +# In-App Purchases (macOS) ## Preparando diff --git a/content/pt-BR/docs/tutorial/installation.md b/content/pt-BR/docs/tutorial/installation.md index 380c97de32c89..e8ddc2110e289 100644 --- a/content/pt-BR/docs/tutorial/installation.md +++ b/content/pt-BR/docs/tutorial/installation.md @@ -1,4 +1,4 @@ -# Instalação +# Advanced Installation Instructions npm install electron --save-dev The preferred method is to install Electron as a development dependency in your app: @@ -131,13 +131,13 @@ If the above error persists, the [unsafe-perm][unsafe-perm] flag may need to be sudo npm install electron --unsafe-perm=true ``` -Em redes mais lentas, pode ser aconselhável usar o sinalizador `--verbose para -mostrar o progresso do download:

    +Em redes mais lentas, pode ser aconselhável usar o sinalizador `--verbose` para mostrar o progresso do download: -
    npm install --verbose electron
    -`
    +```sh +npm install --verbose electron +``` -Se você precisar forçar um novo download do ativo e o arquivo SHASUM, defina a variável force_no_cache do ambiente para true.

    +Se você precisar forçar um novo download do ativo e o arquivo SHASUM, defina a variável `force_no_cache` do ambiente para `true`. [versioning]: ./electron-versioning.md [npx]: https://docs.npmjs.com/cli/v7/commands/npx diff --git a/content/pt-BR/docs/tutorial/launch-app-from-url-in-another-app.md b/content/pt-BR/docs/tutorial/launch-app-from-url-in-another-app.md index 25f805048b75e..d1fe7c1bb7d31 100644 --- a/content/pt-BR/docs/tutorial/launch-app-from-url-in-another-app.md +++ b/content/pt-BR/docs/tutorial/launch-app-from-url-in-another-app.md @@ -1,5 +1,5 @@ --- -title: launch-app-from-URL-in-another-app +title: Launching Your Electron App From A URL In Another App description: This guide will take you through the process of setting your electron app as the default handler for a specific protocol. slug: launch-app-from-url-in-another-app hide_title: true @@ -123,31 +123,25 @@ This feature will only work on macOS when your app is packaged. It will not work ### Plist ```XML -

    -

    macOS plist
    -
    
    -    
    -        
    -            
    -                
    -                    CFBundleURLTypes
    -                    
    -                        
    -                            CFBundleURLSchemes
    -                            
    -                                electron-api-demos
    -                            
    -                            CFBundleURLName
    -                            Electron API Demos Protocol
    -                        
    -                    
    -                    ElectronTeamID
    -                    VEKTX9H2N7
    -                
    -            
    -        
    -    
    -

    + + + + + CFBundleURLTypes + + + CFBundleURLSchemes + + electron-api-demos + + CFBundleURLName + Electron API Demos Protocol + + + ElectronTeamID + VEKTX9H2N7 + + ``` ## Conclusão diff --git a/content/pt-BR/docs/tutorial/linux-desktop-actions.md b/content/pt-BR/docs/tutorial/linux-desktop-actions.md index cb1372ced67a6..8c77251c458b6 100644 --- a/content/pt-BR/docs/tutorial/linux-desktop-actions.md +++ b/content/pt-BR/docs/tutorial/linux-desktop-actions.md @@ -1,4 +1,4 @@ -# Custom Linux Desktop Launcher Actions +# Desktop Launcher Actions (Linux) ## Visão Geral diff --git a/content/pt-BR/docs/tutorial/macos-dock.md b/content/pt-BR/docs/tutorial/macos-dock.md index 94899a3c21137..619bd181d1dfc 100644 --- a/content/pt-BR/docs/tutorial/macos-dock.md +++ b/content/pt-BR/docs/tutorial/macos-dock.md @@ -1,4 +1,4 @@ -# Configuring the macOS Dock +# Dock (macOS) Electron possui API's para configurar ícones de aplicativos no dock do macOS. A macOS-only API exists to create a custom dock menu, but Electron also uses the app dock icon as the entry point for cross-platform features like [recent documents][recent-documents] and [application progress][progress-bar]. diff --git a/content/pt-BR/docs/tutorial/notifications.md b/content/pt-BR/docs/tutorial/notifications.md index 9476201cc7cd2..ab4e2c9185998 100644 --- a/content/pt-BR/docs/tutorial/notifications.md +++ b/content/pt-BR/docs/tutorial/notifications.md @@ -1,4 +1,4 @@ -# Notificações (Windows, Linux, macOS) +# Notificações ## Visão Geral diff --git a/content/pt-BR/docs/tutorial/progress-bar.md b/content/pt-BR/docs/tutorial/progress-bar.md index 22175af234673..99997ce5e3bd0 100644 --- a/content/pt-BR/docs/tutorial/progress-bar.md +++ b/content/pt-BR/docs/tutorial/progress-bar.md @@ -1,4 +1,4 @@ -# Barra de Progresso na Barra de Tarefas (Windows, macOS, Unity) +# Taskbar Progress Bar (Windows & macOS) ## Visão Geral diff --git a/content/pt-BR/docs/tutorial/represented-file.md b/content/pt-BR/docs/tutorial/represented-file.md index 0e773cb372f02..fb3a177ead2d1 100644 --- a/content/pt-BR/docs/tutorial/represented-file.md +++ b/content/pt-BR/docs/tutorial/represented-file.md @@ -1,4 +1,4 @@ -# Arquivo Representado para o macOS BrowserWindows +# Representing Files in a BrowserWindow (macOS) ## Visão Geral diff --git a/content/pt-BR/docs/tutorial/security.md b/content/pt-BR/docs/tutorial/security.md index 7b24ecc8a3e75..de0c6fb2e2c14 100644 --- a/content/pt-BR/docs/tutorial/security.md +++ b/content/pt-BR/docs/tutorial/security.md @@ -18,7 +18,7 @@ Electron keeps up to date with alternating Chromium releases. For more informati It is important to remember that the security of your Electron application is the result of the overall security of the framework foundation (*Chromium*, *Node.js*), Electron itself, all NPM dependencies and your code. As such, it is your responsibility to follow a few important best practices: -* **Mantenha sua aplicação atualizada com a última versão do framework Electron.** Ao lançar seu produto, você também está enviando um pacote composto pelo Electron, Biblioteca Compartilhada do Chromium e Node.js. Vulnerabilidades afetando estes componentes podem afetar a segurança do seu aplicativo. Ao atualizar o Electron para a versão mais recente, você garante que as vulnerabilidades críticas (como *nodeIntegration bypasses*) já estão corrigidas e não podem ser exploradas em seu aplicativo. For more information, see "[Use a current version of Electron](#15-use-a-current-version-of-electron)". +* **Mantenha sua aplicação atualizada com a última versão do framework Electron.** Ao lançar seu produto, você também está enviando um pacote composto pelo Electron, Biblioteca Compartilhada do Chromium e Node.js. Vulnerabilidades afetando estes componentes podem afetar a segurança do seu aplicativo. Ao atualizar o Electron para a versão mais recente, você garante que as vulnerabilidades críticas (como *nodeIntegration bypasses*) já estão corrigidas e não podem ser exploradas em seu aplicativo. For more information, see "[Use a current version of Electron](#16-use-a-current-version-of-electron)". * **Avalie suas dependências.** O NPM fornece meio milhão de pacotes reutilizáveis, mas é sua responsabilidade escolher bibliotecas de terceiros confiáveis. Se você usar bibliotecas desatualizadas afetadas por vulnerabilidades conhecidas ou se depender de código mal mantido, a segurança do aplicativo pode estar comprometida. @@ -43,18 +43,19 @@ You should at least follow these steps to improve the security of your applicati 1. [Only load secure content](#1-only-load-secure-content) 2. [Disable the Node.js integration in all renderers that display remote content](#2-do-not-enable-nodejs-integration-for-remote-content) 3. [Enable context isolation in all renderers that display remote content](#3-enable-context-isolation-for-remote-content) -4. [Use `ses.setPermissionRequestHandler()` in all sessions that load remote content](#4-handle-session-permission-requests-from-remote-content) -5. [Do not disable `webSecurity`](#5-do-not-disable-websecurity) -6. [Define a `Content-Security-Policy`](#6-define-a-content-security-policy) and use restrictive rules (i.e. `script-src 'self'`) -7. [Do not set `allowRunningInsecureContent` to `true`](#7-do-not-set-allowrunninginsecurecontent-to-true) -8. [Do not enable experimental features](#8-do-not-enable-experimental-features) -9. [Do not use `enableBlinkFeatures`](#9-do-not-use-enableblinkfeatures) -10. [``: Do not use `allowpopups`](#10-do-not-use-allowpopups) -11. [``: Verify options and params](#11-verify-webview-options-before-creation) -12. [Disable or limit navigation](#12-disable-or-limit-navigation) -13. [Disable or limit creation of new windows](#13-disable-or-limit-creation-of-new-windows) -14. [Do not use `openExternal` with untrusted content](#14-do-not-use-openexternal-with-untrusted-content) -15. [Use a current version of Electron](#15-use-a-current-version-of-electron) +4. [Enable sandboxing](#4-enable-sandboxing) +5. [Use `ses.setPermissionRequestHandler()` in all sessions that load remote content](#5-handle-session-permission-requests-from-remote-content) +6. [Do not disable `webSecurity`](#6-do-not-disable-websecurity) +7. [Define a `Content-Security-Policy`](#7-define-a-content-security-policy) and use restrictive rules (i.e. `script-src 'self'`) +8. [Do not set `allowRunningInsecureContent` to `true`](#8-do-not-set-allowrunninginsecurecontent-to-true) +9. [Do not enable experimental features](#9-do-not-enable-experimental-features) +10. [Do not use `enableBlinkFeatures`](#10-do-not-use-enableblinkfeatures) +11. [``: Do not use `allowpopups`](#11-do-not-use-allowpopups) +12. [``: Verify options and params](#12-verify-webview-options-before-creation) +13. [Disable or limit navigation](#13-disable-or-limit-navigation) +14. [Disable or limit creation of new windows](#14-disable-or-limit-creation-of-new-windows) +15. [Do not use `openExternal` with untrusted content](#15-do-not-use-openexternal-with-untrusted-content) +16. [Use a current version of Electron](#16-use-a-current-version-of-electron) To automate the detection of misconfigurations and insecure patterns, it is possible to use [electronegativity](https://github.com/doyensec/electronegativity). For additional details on potential weaknesses and implementation bugs when developing applications using Electron, please refer to this [guide for developers and auditors](https://doyensec.com/resources/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf) @@ -158,7 +159,23 @@ Even when `nodeIntegration: false` is used, to truly enforce strong isolation an For more information on what `contextIsolation` is and how to enable it please see our dedicated [Context Isolation](context-isolation.md) document. -## 4) Handle Session Permission Requests From Remote Content +## 4) Enable Sandboxing + +[Sandboxing](sandbox.md) is a Chromium feature that uses the operating system to significantly limit what renderer processes have access to. You should enable the sandbox in all renderers. Loading, reading or processing any untrusted content in an unsandboxed process, including the main process, is not advised. + +### Como? + +When creating a window, pass the `sandbox: true` option in `webPreferences`: + +```js +const win = new BrowserWindow({ + webPreferences: { + sandbox: true + } +}) +``` + +## 5) Handle Session Permission Requests From Remote Content You may have seen permission requests while using Chrome: They pop up whenever the website attempts to use a feature that the user has to manually approve ( like notifications). @@ -191,7 +208,7 @@ session }) ``` -## 5) Do Not Disable WebSecurity +## 6) Do Not Disable WebSecurity _Recommendation is Electron's default_ @@ -227,7 +244,7 @@ const mainWindow = new BrowserWindow() ``` -## 6) Define a Content Security Policy +## 7) Define a Content Security Policy A Content Security Policy (CSP) is an additional layer of protection against cross-site-scripting attacks and data injection attacks. We recommend that they be enabled by any website you load inside Electron. @@ -270,7 +287,7 @@ CSP's preferred delivery mechanism is an HTTP header, however it is not possible ``` -## 7) Do Not Set `allowRunningInsecureContent` to `true` +## 8) Do Not Set `allowRunningInsecureContent` to `true` _Recommendation is Electron's default_ @@ -298,7 +315,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 8) Do Not Enable Experimental Features +## 9) Do Not Enable Experimental Features _Recommendation is Electron's default_ @@ -326,7 +343,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 9) Do Not Use `enableBlinkFeatures` +## 10) Do Not Use `enableBlinkFeatures` _Recommendation is Electron's default_ @@ -352,7 +369,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow() ``` -## 10) Do Not Use `allowpopups` +## 11) Do Not Use `allowpopups` _Recommendation is Electron's default_ @@ -372,7 +389,7 @@ If you do not need popups, you are better off not allowing the creation of new [ ``` -## 11) Verify WebView Options Before Creation +## 12) Verify WebView Options Before Creation A WebView created in a renderer process that does not have Node.js integration enabled will not be able to enable integration itself. However, a WebView will always create an independent renderer process with its own `webPreferences`. @@ -408,7 +425,7 @@ app.on('web-contents-created', (event, contents) => { Again, this list merely minimizes the risk, it does not remove it. If your goal is to display a website, a browser will be a more secure option. -## 12) Disable or limit navigation +## 13) Disable or limit navigation If your app has no need to navigate or only needs to navigate to known pages, it is a good idea to limit navigation outright to that known scope, disallowing any other kinds of navigation. @@ -438,7 +455,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 13) Disable or limit creation of new windows +## 14) Disable or limit creation of new windows If you have a known set of windows, it's a good idea to limit the creation of additional windows in your app. @@ -473,7 +490,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 14) Do not use `openExternal` with untrusted content +## 15) Do not use `openExternal` with untrusted content Shell's [`openExternal`][open-external] allows opening a given protocol URI with the desktop's native utilities. On macOS, for instance, this function is similar to the `open` terminal command utility and will open the specific application based on the URI and filetype association. @@ -495,7 +512,7 @@ const { shell } = require('electron') shell.openExternal('https://example.com/index.html') ``` -## 15) Use a current version of Electron +## 16) Use a current version of Electron You should strive for always using the latest available version of Electron. Whenever a new major version is released, you should attempt to update your app as quickly as possible. diff --git a/content/pt-BR/docs/tutorial/snapcraft.md b/content/pt-BR/docs/tutorial/snapcraft.md index 255be46d6dbd1..b101cec2a0acf 100644 --- a/content/pt-BR/docs/tutorial/snapcraft.md +++ b/content/pt-BR/docs/tutorial/snapcraft.md @@ -1,4 +1,4 @@ -# Snapcraft Guide (Ubuntu Software Center & More) +# Snapcraft Guide (Linux) This guide provides information on how to package your Electron application for any Snapcraft environment, including the Ubuntu Software Center. diff --git a/content/pt-BR/docs/tutorial/support.md b/content/pt-BR/docs/tutorial/support.md index 9f0b4a14c4748..d621f31db4344 100644 --- a/content/pt-BR/docs/tutorial/support.md +++ b/content/pt-BR/docs/tutorial/support.md @@ -41,9 +41,9 @@ When an API is changed or removed in a way that breaks existing functionality, t ### Currently supported versions +* 14.x.y * 13.x.y * 12.x.y -* 11.x.y ### End-of-life diff --git a/content/pt-BR/docs/tutorial/updates.md b/content/pt-BR/docs/tutorial/updates.md index af22bab57dc3e..d86b0c645f4d9 100644 --- a/content/pt-BR/docs/tutorial/updates.md +++ b/content/pt-BR/docs/tutorial/updates.md @@ -35,14 +35,14 @@ If you're developing a private Electron application, or if you're not publishing Dependendo de suas necessidades, você pode escolher um destes: -- [Hazel][hazel] - Um servidor de atualizações para aplicativos de código aberto ou privado, e pode ser implantado gratuitamente no [Now][now]. Ele puxa do [GitHub Releases][gh-releases] e utiliza o poder dos GitHub CDN. +- [Hazel][hazel] – Update server for private or open-source apps which can be deployed for free on [Vercel][vercel]. Ele puxa do [GitHub Releases][gh-releases] e utiliza o poder dos GitHub CDN. - [Nuts][nuts] - Também usar [GitHub Releases][gh-releases], mas armazena em cache as atualizações do app no disco e suporta repositórios. - [electron-resease-server][electron-release-server] - Fornece um painel para a manipulação de versões e não requer lançamentos que se originam do GitHub. - [Nucleus][nucleus] - Um servidor de atualização completo para Electron apps mantido pela Atlassian. Suporta múltiplas aplicações e canais; usar um armazenamento de arquivo estático para diminuir o custo do servidor. ## Implementando Atualizações em Seu App -Uma vez que implantou em seu servidor de atualização, continue com a importação dos módulos em seu código. The following code might vary for different server software, but it works like described when using [Hazel](https://github.com/zeit/hazel). +Uma vez que implantou em seu servidor de atualização, continue com a importação dos módulos em seu código. The following code might vary for different server software, but it works like described when using [Hazel][hazel]. **Important:** Please ensure that the code below will only be executed in your packaged app, and not in development. You can use [electron-is-dev](https://github.com/sindresorhus/electron-is-dev) to check for the environment. @@ -102,8 +102,8 @@ autoUpdater.on('error', message => { Because the requests made by Auto Update aren't under your direct control, you may find situations that are difficult to handle (such as if the update server is behind authentication). The `url` field does support files, which means that with some effort, you can sidestep the server-communication aspect of the process. [Here's an example of how this could work](https://github.com/electron/electron/issues/5020#issuecomment-477636990). -[now]: https://zeit.co/now -[hazel]: https://github.com/zeit/hazel +[vercel]: https://vercel.com +[hazel]: https://github.com/vercel/hazel [nuts]: https://github.com/GitbookIO/nuts [gh-releases]: https://help.github.com/articles/creating-releases/ [electron-release-server]: https://github.com/ArekSredzki/electron-release-server diff --git a/content/pt-BR/docs/tutorial/using-native-node-modules.md b/content/pt-BR/docs/tutorial/using-native-node-modules.md index 6dea26ca8c771..79f2624d1cfcc 100644 --- a/content/pt-BR/docs/tutorial/using-native-node-modules.md +++ b/content/pt-BR/docs/tutorial/using-native-node-modules.md @@ -1,4 +1,4 @@ -# Usando Módulos Nativos do Node +# Native Node Modules Módulos Node,js nativos são suportados pelo Electron, mas, como Electron tem uma [interface binária de aplicação (ABI)][abi] diferente da interface do Node.js (devido a diferenças como o uso do BoringSSL do Chromium ao invés do OpenSSL), os módulos nativos que você usar precisam ser recompilados para Electron. Otherwise, you will get the following class of error when you try to run your app: @@ -74,7 +74,7 @@ HOME=~/.electron-gyp node-gyp rebuild --target=1.2.3 --arch=x64 --dist-url=https To compile native Node modules against a custom build of Electron that doesn't match a public release, instruct `npm` to use the version of Node you have bundled with your custom build. ```sh -npm rebuild --nodedir=/path/to/electron/vendor/node +npm rebuild --nodedir=/path/to/src/out/Default/gen/node_headers ``` ## Solução de Problemas diff --git a/content/pt-BR/docs/tutorial/using-pepper-flash-plugin.md b/content/pt-BR/docs/tutorial/using-pepper-flash-plugin.md index d699cb55a6405..f09a9f2d2fdaa 100644 --- a/content/pt-BR/docs/tutorial/using-pepper-flash-plugin.md +++ b/content/pt-BR/docs/tutorial/using-pepper-flash-plugin.md @@ -1,4 +1,4 @@ -# Usando o Plugin Pepper Flash +# Pepper Flash Plugin Electron no longer supports the Pepper Flash plugin, as Chrome has removed support. diff --git a/content/pt-BR/docs/tutorial/using-selenium-and-webdriver.md b/content/pt-BR/docs/tutorial/using-selenium-and-webdriver.md index 776dd1637ca6c..d201bb7a65cb5 100644 --- a/content/pt-BR/docs/tutorial/using-selenium-and-webdriver.md +++ b/content/pt-BR/docs/tutorial/using-selenium-and-webdriver.md @@ -1,4 +1,4 @@ -# Usando Selenium e WebDriver +# Selenium and WebDriver From [ChromeDriver - WebDriver for Chrome][chrome-driver]: diff --git a/content/pt-BR/docs/tutorial/web-embeds.md b/content/pt-BR/docs/tutorial/web-embeds.md index cbc0aeee98b77..2ded477fc7896 100644 --- a/content/pt-BR/docs/tutorial/web-embeds.md +++ b/content/pt-BR/docs/tutorial/web-embeds.md @@ -1,4 +1,4 @@ -# Web embeds +# Web Embeds ## Visão Geral diff --git a/content/pt-BR/docs/tutorial/windows-arm.md b/content/pt-BR/docs/tutorial/windows-arm.md index 94dbff798cb60..e76f8e25d1f25 100644 --- a/content/pt-BR/docs/tutorial/windows-arm.md +++ b/content/pt-BR/docs/tutorial/windows-arm.md @@ -1,4 +1,4 @@ -# Windows 10 no ARM +# Windows on ARM Se seu aplicativo roda com o Electron 6.0.8 ou superior, agora você pode construí-lo para o Windows 10 no ARM. This considerably improves performance, but requires recompilation of any native modules used in your app. It may also require small fixups to your build and packaging scripts. diff --git a/content/pt-BR/docs/tutorial/windows-taskbar.md b/content/pt-BR/docs/tutorial/windows-taskbar.md index 1ebcc706cc76d..4f84efa9afdde 100644 --- a/content/pt-BR/docs/tutorial/windows-taskbar.md +++ b/content/pt-BR/docs/tutorial/windows-taskbar.md @@ -1,4 +1,4 @@ -# Windows Taskbar +# Taskbar Customization (Windows) ## Visão Geral diff --git a/content/pt-BR/website/blog/webview2.md b/content/pt-BR/website/blog/webview2.md new file mode 100644 index 0000000000000..0b9ff9e415829 --- /dev/null +++ b/content/pt-BR/website/blog/webview2.md @@ -0,0 +1,81 @@ +--- +title: WebView2 and Electron +author: + - electron +date: '2021-07-22' +--- + +Over the past weeks, we’ve received several questions about the differences between the new [WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) and Electron. + +Both teams have the expressed goal of making web-tech the best it can be on the Desktop, and a shared comprehensive comparison is being discussed. + +Electron and WebView2 are fast-moving and constantly evolving projects. We have assembled a brief snapshot of similarities and differences between Electron and WebView2 as they exist today. + +--- + +## Architecture Overview + +Electron and WebView2 both build from the Chromium source for rendering web content. Strictly speaking, WebView2 builds from the Edge source, but Edge is built using a fork of the Chromium source. Electron does not share any DLLs with Chrome. WebView2 binaries hard link against Edge (Stable channel as of Edge 90), so they share disk and some working set. See [Evergreen distribution mode](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#evergreen-distribution-mode) for more info. + +Electron apps always bundle and distribute the exact version of Electron with which they were developed. WebView2 has two options in distribution. You can bundle the exact WebView2 library your application was developed with, or you can use a shared-runtime version that may already be present on the system. WebView2 provides tools for each approach, including a bootstrapping installer in case the shared runtime is missing. WebView2 is shipped _inbox_ starting with Windows 11. + +Applications that bundle their frameworks are responsible for updating those frameworks, including minor security releases. For apps using the shared WebView2 runtime, WebView2 has its own updater, similar to Chrome or Edge, that runs independent of your application. Updating the application's code or any of its other dependencies is still a responsibility for the developer, same as with Electron. Neither Electron nor WebView2 is managed by Windows Update. + +Both Electron and WebView2 inherit Chromium’s multi-process architecture - namely, a single main process that communicates with one-or-more renderer processes. These processes are entirely separate from other applications running on the system. Every Electron application is a separate process tree, containing a root browser-process, some utility processes, and zero or more render processes. WebView2 apps that use the same [user data folder](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder) (like a suite of apps would do), share non-renderer processes. WebView2 apps using different data folders do not share processes. + +* ElectronJS Process Model: + + ![ElectronJS Process Model Diagram](/images/Electron-Architecture.png) +* WebView2 Based Application Process Model: + + ![WebView2 Process Model Diagram](/images/WebView2-Architecture.png) + +Read more about [WebView2’s process model](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/process-model) and [Electron’s process model](https://www.electronjs.org/docs/tutorial/process-model) here. + +Electron provides APIs for common desktop application needs such as menus, file system access, notifications, and more. WebView2 is a component meant to be integrated into an application framework such as WinForms, WPF, WinUI, or Win32. WebView2 does not provide operating system APIs outside the web standard via JavaScript. + +Node.js is integrated into Electron. Electron applications may use any Node.js API, module, or node-native-addon from the renderer and main processes. A WebView2 application does not assume which language or framework the rest of your application is written in. Your JavaScript code must proxy any operating system access through the application-host process. + +Electron strives to maintain compatibility with the web API, including APIs developed from the [Fugu Project](https://fugu-tracker.web.app/). We have a [snapshot of Electron’s Fugu API compatibility](https://docs.google.com/spreadsheets/d/1APQalp8HCa-lXVOqyul369G-wjM2RcojMujgi67YaoE/edit?usp=sharing). WebView2 maintains a similar list of [API differences from Edge](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/browser-features). + +Electron has a configurable security model for web content, from full-access to full-sandbox. WebView2 content is always sandboxed. Electron has [comprehensive security documentation](https://www.electronjs.org/docs/tutorial/security) on choosing your security model. WebView2 also has [security best practices](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/security). + +The Electron source is maintained and available on GitHub. Applications can modify can build their own _brands_ of Electron. The WebView2 source is not available on GitHub. + +Quick Summary: + +| | Electron | WebView2 | +| ----------------------------------- | ---------------:| -----------------------:| +| Build Dependency | Chromium | Borda | +| Source Available on GitHub | Sim | Não | +| Shares Edge/Chrome DLLs | Não | Yes (as of Edge 90) | +| Shared Runtime Between Applications | Não | Opcional | +| Application APIs | Sim | Não | +| Node.js | Sim | Não | +| Sandbox | Opcional | Sempre | +| Requires an Application Framework | Não | Sim | +| Plataformas Suportadas | Mac, Win, Linux | Win (Mac/Linux planned) | +| Process Sharing Between Apps | Never | Opcional | +| Framework Updates Managed By | Application | WebView2 | + +## Performance Discussion + +When it comes to rendering your web content, we expect little performance difference between Electron, WebView2, and any other Chromium-based renderer. We created [scaffolding for apps built using Electron, C++ + WebView2, and C# + WebView2](https://github.com/crossplatform-dev/xplat-challenges) for those interested to investigate potential performance differences. + +There are a few differences that come into play _outside_ of rendering web content, and folks from Electron, WebView2, Edge, and others have expressed interest in working on a detailed comparison including PWAs. + +### Inter-Process Communication (IPC) + +_There is one difference we want to highlight immediately, as we believe it is often a performance consideration in Electron apps._ + +In Chromium, the browser process acts as an IPC broker between sandboxed renderers and the rest of the system. While Electron allows unsandboxed render processes, many apps choose to enable the sandbox for added security. WebView2 always has the sandbox enabled, so for most Electron and WebView2 apps IPC can impact overall performance. + +Even though Electron and WebView2 have a similar process models, the underlying IPC differs. Communicating between JavaScript and C++ or C# requires [marshalling](https://en.wikipedia.org/wiki/Marshalling_(computer_science)), most commonly to a JSON string. JSON serialization/parsing is an expensive operation, and IPC-bottlenecks can negatively impact performance. Starting with Edge 93, WV2 will use [CBOR](https://en.wikipedia.org/wiki/CBOR) for network events. + +Electron supports direct IPC between any two processes via the [MessagePorts](https://www.electronjs.org/docs/latest/tutorial/message-ports) API, which utilize [the structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). Applications which leverage this can avoid paying the JSON-serialization tax when sending objects between processes. + +## Sumário + +Electron and WebView2 have a number of differences, but don't expect much difference with respect to how they perform rendering web content. Ultimately, an app’s architecture and JavaScript libraries/frameworks have a larger impact on memory and performance than anything else because _Chromium is Chromium_ regardless of where it is running. + +Special thanks to the WebView2 team for reviewing this post, and ensuring we have an up-to-date view of the WebView2 architecture. They welcome any [feedback on the project](https://github.com/MicrosoftEdge/WebView2Feedback). diff --git a/content/pt-BR/website/i18n/code.json b/content/pt-BR/website/i18n/code.json index 8291b10512852..d9bc1e02f39b4 100644 --- a/content/pt-BR/website/i18n/code.json +++ b/content/pt-BR/website/i18n/code.json @@ -12,7 +12,7 @@ "description": "The 2nd paragraph of the 404 page" }, "theme.AnnouncementBar.closeButtonAriaLabel": { - "message": "Close", + "message": "Fechar", "description": "The ARIA label for close button of announcement bar" }, "theme.blog.paginator.navAriaLabel": { @@ -51,14 +51,14 @@ "message": "Older Post", "description": "The blog post button label to navigate to the older/next post" }, - "theme.blog.sidebar.navAriaLabel": { - "message": "Blog recent posts navigation", - "description": "The ARIA label for recent posts in the blog sidebar" - }, "theme.tags.tagsPageTitle": { "message": "Tags", "description": "The title of the tag list page" }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Blog recent posts navigation", + "description": "The ARIA label for recent posts in the blog sidebar" + }, "theme.blog.post.plurals": { "message": "One post|{count} posts", "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" @@ -76,11 +76,11 @@ "description": "The ARIA label for copy code blocks button" }, "theme.CodeBlock.copied": { - "message": "Copied", + "message": "Copiado", "description": "The copied button label on code blocks" }, "theme.CodeBlock.copy": { - "message": "Copy", + "message": "Copiar", "description": "The copy button label on code blocks" }, "theme.docs.sidebar.expandButtonTitle": { @@ -96,11 +96,11 @@ "description": "The ARIA label for the docs pagination" }, "theme.docs.paginator.previous": { - "message": "Previous", + "message": "Anterior", "description": "The label used to navigate to the previous doc" }, "theme.docs.paginator.next": { - "message": "Next", + "message": "Avançar", "description": "The label used to navigate to the next doc" }, "theme.docs.sidebar.collapseButtonTitle": { @@ -111,18 +111,6 @@ "message": "Collapse sidebar", "description": "The title attribute for collapse button of doc sidebar" }, - "theme.docs.sidebar.responsiveCloseButtonLabel": { - "message": "Close menu", - "description": "The ARIA label for close button of mobile doc sidebar" - }, - "theme.docs.sidebar.responsiveOpenButtonLabel": { - "message": "Open menu", - "description": "The ARIA label for open button of mobile doc sidebar" - }, - "theme.docs.sidebar.navAriaLabel": { - "message": "Sidebar navigation", - "description": "The ARIA label for documentation menu" - }, "theme.docs.versions.unreleasedVersionLabel": { "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", "description": "The label used to tell the user that he's browsing an unreleased doc version" @@ -133,7 +121,7 @@ }, "theme.docs.versions.latestVersionSuggestionLabel": { "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", - "description": "The label userd to tell the user that he's browsing an unmaintained doc version" + "description": "The label used to tell the user to check the latest version" }, "theme.docs.versions.latestVersionLinkLabel": { "message": "latest version", @@ -159,10 +147,18 @@ "message": "Last updated{atDate}{byUser}", "description": "The sentence used to display when a page has been last updated, and by who" }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Back to main menu", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, "theme.common.skipToMainContent": { "message": "Skip to main content", "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "On this page", + "description": "The label used by the button on the collapsible TOC component" + }, "theme.SearchPage.documentsFound.plurals": { "message": "One document found|{count} documents found", "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" @@ -180,7 +176,7 @@ "description": "The placeholder for search page input" }, "theme.SearchPage.inputLabel": { - "message": "Search", + "message": "Pesquisar", "description": "The ARIA label for search page input" }, "theme.SearchPage.algoliaLabel": { @@ -196,7 +192,7 @@ "description": "The paragraph for fetching new search results" }, "theme.SearchBar.label": { - "message": "Search", + "message": "Pesquisar", "description": "The ARIA label and placeholder for search button" } } \ No newline at end of file diff --git a/content/pt-BR/website/i18n/docusaurus-plugin-content-blog/options.json b/content/pt-BR/website/i18n/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000000..94a4ebed2d7a2 --- /dev/null +++ b/content/pt-BR/website/i18n/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Electron's blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Keep up to date with what's going on with the Electron project", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Latest posts", + "description": "The label for the left sidebar" + } +} \ No newline at end of file diff --git a/content/pt-BR/website/i18n/docusaurus-theme-classic/footer.json b/content/pt-BR/website/i18n/docusaurus-theme-classic/footer.json index 8b26237397c6f..0040aea338e37 100644 --- a/content/pt-BR/website/i18n/docusaurus-theme-classic/footer.json +++ b/content/pt-BR/website/i18n/docusaurus-theme-classic/footer.json @@ -1,10 +1,14 @@ { "link.title.Docs": { - "message": "Docs", + "message": "Documentação", "description": "The title of the footer links column with title=Docs in the footer" }, + "link.title.Checklists": { + "message": "Checklists", + "description": "The title of the footer links column with title=Checklists in the footer" + }, "link.title.Community": { - "message": "Community", + "message": "Comunidade", "description": "The title of the footer links column with title=Community in the footer" }, "link.title.More": { @@ -12,12 +16,20 @@ "description": "The title of the footer links column with title=More in the footer" }, "link.item.label.Getting Started": { - "message": "Getting Started", - "description": "The label of footer link with label=Getting Started linking to /" + "message": "Introdução", + "description": "The label of footer link with label=Getting Started linking to /docs/latest/" }, - "link.item.label.Stack Overflow": { - "message": "Stack Overflow", - "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + "link.item.label.API Reference": { + "message": "Referência da API", + "description": "The label of footer link with label=API Reference linking to /docs/latest/api/app" + }, + "link.item.label.Performance": { + "message": "Performance", + "description": "The label of footer link with label=Performance linking to /docs/latest/tutorial/performance" + }, + "link.item.label.Security": { + "message": "Segurança", + "description": "The label of footer link with label=Security linking to /docs/latest/tutorial/security" }, "link.item.label.Discord": { "message": "Discord", @@ -27,12 +39,20 @@ "message": "Twitter", "description": "The label of footer link with label=Twitter linking to https://twitter.com/electronjs" }, + "link.item.label.Stack Overflow": { + "message": "Stack Overflow", + "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + }, "link.item.label.GitHub": { "message": "GitHub", "description": "The label of footer link with label=GitHub linking to https://github.com/electron/electron" }, + "link.item.label.Open Collective": { + "message": "Open Collective", + "description": "The label of footer link with label=Open Collective linking to https://opencollective.com/electron" + }, "copyright": { - "message": "Copyright © 2021 My Project, Inc. Built with Docusaurus.", + "message": "Copyright © 2021 OpenJS Foundation and Electron contributors.", "description": "The footer copyright" } } \ No newline at end of file diff --git a/content/pt-BR/website/i18n/docusaurus-theme-classic/navbar.json b/content/pt-BR/website/i18n/docusaurus-theme-classic/navbar.json index 3d2f38b26dbbf..3c7230b9314ea 100644 --- a/content/pt-BR/website/i18n/docusaurus-theme-classic/navbar.json +++ b/content/pt-BR/website/i18n/docusaurus-theme-classic/navbar.json @@ -4,7 +4,7 @@ "description": "The title in the navbar" }, "item.label.Docs": { - "message": "Docs", + "message": "Documentação", "description": "Navbar item with label Docs" }, "item.label.API": { @@ -15,6 +15,10 @@ "message": "Exemplos", "description": "Navbar item with label Examples" }, + "item.label.Blog": { + "message": "Blog", + "description": "Navbar item with label Blog" + }, "item.label.GitHub": { "message": "GitHub", "description": "Navbar item with label GitHub" diff --git a/content/pt-BR/website/locale.yml b/content/pt-BR/website/locale.yml index 1cd46666de888..a8390af4dd7ed 100644 --- a/content/pt-BR/website/locale.yml +++ b/content/pt-BR/website/locale.yml @@ -1,279 +1,281 @@ -tagline: Build cross-platform desktop apps with JavaScript, HTML, and CSS +tagline: Crie aplicativos desktop multiplataforma com JavaScript, HTML e CSS nav: - apps: Apps + apps: Aplicativos blog: Blog code_of_conduct: Código de Conduta - security: Security + security: Segurança community: Comunidade - contact: Contact - docs: Docs - donors: Donors - languages: Languages - license: License - releases: Releases - search: Search + contact: Contato + docs: Documentação + donors: Doadores + languages: Idiomas + license: Licença + releases: Versões + search: Pesquisar userland: Userland - governance: Governance + governance: Governança keyboard_modal: title: Atalhos do Teclado - key: Key - action: Action - focus_search: Focus the search bar - focus_and_clear: Focus the search bar and cleans it - scroll_down: Select the next search result - scroll_up: Select the previous search result - open: Open the selected search result - open_new_tab: Open the selected search result in a new tab + key: Tecla + action: Ação + focus_search: Foco na caixa de pesquisa + focus_and_clear: Foque na barra de pesquisa e apague o texto + scroll_down: Selecione o próximo resultado da pesquisa + scroll_up: Selecione o resultado da pesquisa anterior + open: Abra o resultado da pesquisa selecionada + open_new_tab: Abra o resultado da pesquisa selecionada em uma nova aba docs: - title: Electron Documentation - guides: "Guides: Getting Started with Electron" - api_reference: API Reference - api_structures: API Structures - advanced: Advanced - detailed: In Detail - custom_dom: Custom DOM Elements - main_proc_modules: Main Process Modules - renderer_proc_modules: Renderer Process Modules - both_proc_modules: Modules for Both Process Types - propose_change: Improve this doc - version_history: Version history - translate: Translate this doc + title: Documentação do Electron + guides: "Guias: Começar com o Electron" + api_reference: Referência da API + api_structures: Estruturas da API + advanced: Avançado + detailed: Em Detalhes + custom_dom: Elementos de DOM Personalizado + main_proc_modules: Módulos do Processo Principais + renderer_proc_modules: Módulos do Processo de Renderização + both_proc_modules: Módulos para Ambos os Tipos de Processos + propose_change: Melhorar este documento + version_history: Histórico de versões + translate: Traduzir este documento languages: - choose_language: Choose Your Site Language - view_more_details: View More Language Details - translation_progress: Translation Progress - current: current selection + choose_language: Escolha o seu idioma + view_more_details: Ver Mais Detalhes da Linguagem + translation_progress: Progresso da Tradução + current: seleção atual community: - title: Electron Community - description: Resources for connecting with people working on Electron. + title: Comunidade do Electron + description: Recursos para se conectar com pessoas que trabalham no Electron. channels: - get_started: "Get started building an app by reading the quick-start guide." - updates: "Stay up to date by following @electronjs on Twitter and subscribing to the blog feed." - localized_docs: "Read docs in your native language by visiting the languages page." + get_started: "Comece agora a construir um app conferindo o guia de início rápido." + updates: "Mantenha-se atualizado seguindo o @electronjs no Twitter e assinando o feed do nosso blog." + localized_docs: "Leia a documentação em seu idioma nativo visitando a página de idiomas." help: "Get help and feedback by joining the Discord server, or visiting Stack Overflow." - security: "Report security issues by emailing security@electronjs.org." - bugs: "Report bugs by opening issues on the electron/electron repository." - feature_requests: "Request features by opening issues on the electron/electron repository." - code_of_conduct: "Report Code of Conduct violations by emailing coc@electronjs.org." - donations: "Donate on our OpenCollective page." - other: "For all other inquiries, email info@electronjs.org." + security: "Comunique problemas de segurança enviando um e-mail para security@electronjs.org." + bugs: "Informe bugs abrindo issues no nosso repositório electron/electron." + feature_requests: "Solicite novos recursos abrindo issues em nosso repositório electron/electron." + code_of_conduct: "Relate violações do Código de Conduta enviando um e-mail para coc@electronjs.org." + donations: "Faça doações na nossa página do OpenCollective." + other: "Para todas as outras perguntas, envie um email para info@electronjs.org." language_communities: - title: Language Communities - description: "The Electron community spans the globe, and English is not everyone's first language. Find documentation in your language, or join one of the language communities below:" - tools: Tools + title: Comunidades Linguísticas + description: "A comunidade do Electron abrange o globo, e o inglês não é o idioma nativo de todo mundo. Veja a documentação em seu idioma ou junte-se a uma das comunidades linguísticas abaixo:" + tools: Ferramentas boilerplates: Boilerplates - components: Components - videos: Videos - meetups: Meetups - awesome_notice: This list is generated from @sindresorhus's Awesome Electron repository.
    Something missing? Make a pull request. - meetup_notice: To add a meetup, edit data/meetups.json and make a pull request. + components: Componentes + videos: Vídeos + meetups: Encontros + awesome_notice: Esta lista é gerada a partir do repositório @sindresorhus's Awesome Electron.
    Falta alguma coisa? Crie um pedido. + meetup_notice: Para adicionar um encontro, edite o data/meetups.json e crie um pedido. releases: - show_releases: "Show Releases:" - show_only_releases_from: "Show Only Releases From:" - all_versions: All Versions - stable_releases: Stable Releases - stable_desc: Regular, supported releases - beta_releases: Beta Releases - beta_desc: Test your app with upcoming changes - nightly_releases: Nightly Releases - nightly_desc: Experiment with the latest features - next: Next - next_page: Next Page - previous: Previous - previous_page: Previous Page - page: Page - all_releases: All Releases - back_to_index: Back to index + show_releases: "Mostrar Versões:" + show_only_releases_from: "Mostrar Somente Versões de:" + all_versions: Todas as Versões + stable_releases: Versões Estáveis + stable_desc: Versões regulares e com suporte + beta_releases: Versões Betas + beta_desc: Teste seu aplicativo com as próximas alterações + alpha_releases: Alpha Releases + alpha_desc: Test features slightly more on the edge + nightly_releases: Versões Nightly + nightly_desc: Experimente os últimos recursos disponíveis + next: Avançar + next_page: Próxima página + previous: Anterior + previous_page: Página Anterior + page: Página + all_releases: Todas as versões + back_to_index: Voltar para o início electron_is_good: - title: Apps users love, built with Electron - description: Thousands of organizations spanning all industries use Electron to build cross-platform software. + title: Aplicativos que os usuários adoram, construídos com Electron + description: Milhares de organizações abrangendo todas as indústrias utilizam Electron para construir softwares multiplataforma. electron_is_easy: - title: It's easier than you think - description: If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application. + title: É mais fácil do que você pensa + description: Se você pode construir um website, você pode construir um aplicativo desktop. Electron é um framework para criação de aplicações nativas utilizando tecnologias web como JavaScript, HTML e CSS. Ele cuida das partes mais difíceis para que você possa se concentrar somente com o principal da aplicação. web_technologies: - title: Web Technologies - description: Electron uses Chromium and Node.js so you can build your app with HTML, CSS, and JavaScript. + title: Tecnologias Web + description: O Electron usa o Chromium e o Node.js, assim você pode construir sua aplicação com HTML, CSS e JavaScript. open_source: - title: Open Source + title: Código Aberto description: Electron is an open source project maintained by the OpenJS Foundation and an active community of contributors. cross_platform: - title: Cross Platform - description: Compatible with Mac, Windows, and Linux, Electron apps build and run on three platforms. + title: Multiplataforma + description: Compatíveis com Mac, Windows, e Linux, aplicativos Electron são construídos e executados nas três plataformas. benefits: - hard_parts_made_easy: The hard parts made easy - automatic_updates: Automatic updates - native_menus_and_notifications: Native menus & notifications - crash_reporting: Crash reporting - debugging_and_profiling: Debugging & profiling - windows_installers: Windows installers + hard_parts_made_easy: As partes difíceis são feitas facilmente + automatic_updates: Atualizações automáticas + native_menus_and_notifications: Notificações e menus nativos + crash_reporting: Relatório de falhas + debugging_and_profiling: Depuração & criação de perfil + windows_installers: Instaladores do Windows get_started: - title: Get started - description: To get started with Electron, check out the resources below. Learn how to wrap your web app with Electron, access all the APIs, and generate installers. + title: Começar + description: Para começar com o Electron, confira os recursos abaixo. Saiba como envolver o seu aplicativo web com o Electron, acessar todas as APIs e gerar instaladores. explore: fiddle_title: Try powerful experiments with Electron Fiddle - see_more_info: See more info -download: Download -download_from_github: Download from GitHub + see_more_info: Ver mais informações +download: Baixar +download_from_github: Baixar no GitHub quick_start: - title: "Spin up the Quick Start app to see Electron in action:" - description: A minimal Electron app with helpful notations. - clone: Clone the Quick Start repository - go_into_repo: Go into the repository - install_deps: Install the dependencies and run - dive_deeper: Or dive deeper and read the documentation. + title: "Inicie com o app Quick Start para ver o Electron em ação:" + description: Um pequeno aplicativo Electron com notações úteis. + clone: Clone o repositório Quick Start + go_into_repo: Ir para o repositório + install_deps: Instale as dependências e execute + dive_deeper: Ou você pode ir mais fundo e ler a documentação. need_help: - title: Need Help? + title: Precisa de Ajuda? description: Ask questions in the Discord server. Follow @electronjs on Twitter for important announcements. Need to privately reach out? Email info@electronjs.org. headings: - languages: Languages + languages: Idiomas taglines: - languages: Localized content from our awesome global developer community. - announcement: 'Black Lives Matter. Support the Equal Justice Initiative and read our statement here.' -help_translate: "Help translate" + languages: Conteúdo traduzido pela nossa incrível comunidade de desenvolvedores. + announcement: 'Black Lives Matter. Apoie a Iniciativa de Justiça Igual e leia nossa declaração aqui.' +help_translate: "Ajude a traduzir" footer: - see_the_faq: See the frequently asked questions + see_the_faq: Veja as perguntas frequentes apps: - something_missing: Something missing? - edit_this_app: Edit this app. - search_app: Filter apps by name, description, etc… - categories: Categories - add_app_link: 'Make a Pull Request to add your application.' + something_missing: Faltando alguma coisa? + edit_this_app: Editar esse aplicativo. + search_app: Filtrar aplicativos por nome, descrição e etc… + categories: Categorias + add_app_link: 'Faça um Pull Request para adicionar seu aplicativo.' #App show page specific localization strings website: Website - repository: Repository - category: Category - downloads: Downloads - keywords: Keywords - license: License - latest_release: Latest Release + repository: Repositório + category: Categoria + downloads: Baixar + keywords: Palavras-chave + license: Licença + latest_release: Última versão blog: - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Blog do Electron + description: Todas as últimas notícias da equipe e comunidade do Electron. #Post show page specific localization strings - feedback: Have feedback on this post? Let @electronjs know on Twitter. - help: Need help or found a bug? Contact us. + feedback: Você tem um feedback sobre este post? Deixe o @electronjs saber no Twitter. + help: Precisa de ajuda ou encontrou um bug? Contacte-nos. clipboard: - copy: Copy - copy_to_clipboard: Copy to Clipboard - copied: Copied + copy: Copiar + copy_to_clipboard: Copiar para Área de Transferência + copied: Copiado fiddle_launch_button: - launch: Launch - launch_in_fiddle: Launch in Fiddle + launch: Abrir + launch_in_fiddle: Abrir no Fiddle pages: '/': - title: Electron | Build cross-platform desktop apps with JavaScript, HTML, and CSS. - description: 'Build cross-platform desktop apps with JavaScript, HTML, and CSS.' + title: Electron | Crie aplicativos desktop multiplataforma com JavaScript, HTML e CSS. + description: 'Crie aplicativos desktop multiplataforma com JavaScript, HTML e CSS.' '/apps': - title: Electron Apps - description: Apps Built on Electron + title: Apps Electron + description: Aplicativos feitos com Electron '/docs': title: Documentação - description: Guides and API reference documentation for the latest Electron release + description: Documentação de referência da API e guias da versão mais recente do Electron '/docs/api': title: API - description: API reference documentation for the latest Electron release + description: Documentação de referência da API da versão mais recente do Electron '/docs/development': title: Desenvolvimento - description: Developing with Electron + description: Desenvolvendo com Electron '/docs/tutorial': title: Tutorial - description: Guides and tutorials for the latest Electron release + description: Guias e tutoriais para a versão mais recente do Electron '/blog': - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Blog do Electron + description: Todas as últimas notícias da equipe e comunidade do Electron. '/community': title: Comunidade '/releases': - title: Releases + title: Versões '/contact': - title: Contact - description: Get in touch with the Electron team on Twitter, Slack, GitHub, or via email. + title: Contato + description: Entre em contato com a equipe do Electron através do Twitter, Slack, GitHub ou por email. '/languages': - title: Languages + title: Idiomas '/userland': title: Userland '/devtron': title: Devtron - description: Devtron is an open source tool to help you inspect, monitor, and debug your Electron app. Built on top of the amazing Chrome Developer Tools. + description: Devtron é uma ferramenta de código aberto feita para ajudá-lo a inspecionar, monitorar e depurar seu aplicativo. Construído com base no incrível Chrome Developer Tools. '/spectron': title: Spectron - description: Spectron is an open source framework for easily writing integrations tests for your Electron app. Built on top of ChromeDriver and WebDriverIO. + description: Spectron é uma framework de código aberto para facilmente escrever testes de integração para seu aplicativo. Construído em cima do ChromeDriver e WebDriverIO. '/fiddle': title: Electron Fiddle - description: The easiest way to get started with Electron + description: Maneira mais fácil de começar com Electron '/governance': - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. + title: Governança do Electron + description: O sistema de governança Electron é composto por grupos de trabalho que supervisionam diferentes aspectos do ecossistema Electron, e um grupo de trabalho Administrativo que funciona para resolver conflitos entre eles. '/donors': - title: Donors + title: Doadores '/blacklivesmatter': title: Black Lives Matter landing: - get_started: Get started + get_started: Começar fiddle: - lead_desc: The easiest way to get started with Electron - different_os: "Not the right operating system? See:" - create_app: Create your app - description: Electron Fiddle lets you create and play with small Electron experiments. It greets you with a quick-start template after opening – change a few things, choose the version of Electron you want to run it with, and play around. Then, save your Fiddle either as a GitHub Gist or to a local folder. Once pushed to GitHub, anyone can quickly try your Fiddle out by just entering it in the address bar. + lead_desc: Maneira mais fácil de começar com Electron + different_os: "Não é o sistema operacional correto? Veja:" + create_app: Crie seu aplicativo + description: Electron Fiddle permite que você crie e inicie com pequenas experiências do Electron. Ele te cumprimenta com um modelo de início rápido após a abertura – altere algumas coisas, escolha a versão do Electron com que você quer executá-lo e inicie. Então, salve seu Fiddle como um Gist do GitHub ou para uma pasta local. Uma vez lançado para o GitHub, qualquer um pode rapidamente experimentar seu Fiddle inserindo-o na barra de endereços. explore: Explore Electron - explore_desc: "Try Electron without installing any dependencies: Fiddle includes everything you'll need to explore the platform. It also includes examples for every API available in Electron, so if you want to quickly see what a BrowserView is or how the desktopCapturer works, Fiddle has got you covered." - code_with_types: Code with Types - code_with_types_desc: Fiddle includes Microsoft's excellent Monaco Editor, the same editor powering Visual Studio Code. It also installs the type definitions for the currently selected version of Electron automatically, ensuring that you always have all Electron APIs only a few keystrokes away. - compile_and_package: Compile and Package - compile_and_package_desc: Fiddle can automatically turn your experiment into binaries you can share with your friends, coworkers, or grandparents. It does so thanks to electron-forge, allowing you to package your fiddle as an app for Windows, macOS, or Linux. - easy_start: Start with Fiddle, Continue Wherever - easy_start_desc: Fiddle is not an IDE – it is however an excellent starting point. Once your fiddle has grown up, export it as a project with or without electron-forge. Then, use your favorite editor and take on the world! + explore_desc: "Experimente o Electron sem instalar quaisquer dependências: Fiddle inclui tudo o que você precisará explorar a plataforma. Ele também inclui exemplos para cada API disponível no Electron, então se você quiser ver rapidamente o que é um BrowserView ou como o desktopCapturer funciona, o Fiddle te mostrar." + code_with_types: Código com Tipos + code_with_types_desc: Fiddle inclui o excelente Monaco Editor da Microsoft o mesmo editor que é usado no Visual Studio Code. Ele também instala as definições de tipo para a versão atualmente selecionada do Electron automaticamente, garantindo que você sempre tem todas as APIs Electron apenas alguns keystrokes. + compile_and_package: Compilação e Empacotamento + compile_and_package_desc: Fiddle pode automaticamente transformar seu experimento em binários para você compartilhar com seus amigos, colegas de trabalho e parentes. Isso é feito graças ao electron-forge, permitindo que você empacote seu Fiddle como um app para Windows, macOS ou Linux. + easy_start: Comece com Fiddle e Continue Onde Quiser + easy_start_desc: Fiddle não é uma IDE – no entanto é um excelente ponto de partida. Uma vez que suas fibras crescerem, exporte-o como um projeto com ou sem electron-forge. Então, use seu editor favorito e capture o mundo! governance: - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. - wgs: Working Groups + title: Governança do Electron + description: O sistema de governança Electron é composto por grupos de trabalho que supervisionam diferentes aspectos do ecossistema Electron, e um grupo de trabalho Administrativo que funciona para resolver conflitos entre eles. + wgs: Grupos de Trabalho ecosystem: - title: Ecosystem - description: Oversees the projects that make Electron app development easier. + title: Ecossistema + description: Supervisiona os projetos que facilitam o desenvolvimento de aplicativos Electron. outreach: - title: Outreach - description: Grows the Electron community + title: Alcance + description: Cresce a Comunidade do Electron releases: - title: Releases - description: Oversees all release branches, and tooling to support releases. + title: Versões + description: Supervisiona todas as ramos de lançamento e ferramentas para apoiar lançamentos. upgrades: - title: Upgrades - description: Oversees upgrades of upstream dependencies; specifically Chromium and Node. + title: Atualizações + description: Supervisiona atualizações de dependências upstream; especificamente Chromium e Node. cmsf: - title: Community & Safety - description: Oversees removal/bans from community. + title: Comunidade & Segurança + description: Supervisiona remoções/proibições da comunidade. security: - title: Security - description: Proactively ensures the Security of Electron as a project, responds to incoming incidents, and oversees rollout of fixes. + title: Segurança + description: Garante proativamente a Segurança do Electron como um projeto, responde a incidentes recebidos e supervisiona a implementação de correções. admins: - title: Administrative - description: The Administrative Working Group oversees the entire governance and project. + title: Administração + description: O Grupo de Trabalho Administrativo supervisiona toda a governação e o projeto. api: title: API - description: Oversees public API design based on project principles. + description: Supervisiona o design de API pública com base nos princípios do projeto. global: overview: Visão Geral - associated_repos: Associated Repositories - notes: Meeting Notes + associated_repos: Repositórios associados + notes: Anotações de Reunião definitions: - title: Definitions + title: Definições list: - - A maintainer is anyone who plays an active role in governance. - - A collaborator is active in the community, but not in governance. - - A participant is anyone who is a maintainer or collaborator. - - A working group is a group of maintainers that is formed to take responsibility for certain aspects of the Electron project. Normally these groups will meet regularly but in some cases will only meet as required to fulfill their responsibilities. - - 'A chair leads a working group.' + - Um mantenedor é qualquer um que desempenha um papel ativo na governança. + - Um colaborador é ativo na comunidade, mas não na governança. + - Um participante é qualquer pessoa que seja um mantenedor ou colaborador. + - Um grupo de trabalho é um grupo de mantenedores que é formado para assumir responsabilidade por certos aspectos do projeto Electron. Normalmente, estes grupos reunir-se-ão com regularidade, mas em alguns casos só cumprirão as suas obrigações conforme exigido. + - 'Uma cadeira lidera um grupo de trabalho.' responsibilities: - title: Responsibilities - listdescription: "All Working Groups have these core responsibilities:" + title: Responsabilidades + listdescription: "Todos os grupos de trabalho têm as seguintes responsabilidades fundamentais:" list: - - They shall decide for themselves, and publicly post, their rules, e.g. how decisions are made, when meetings are held, and who may attend. - - 'They shall select a chair to represent the group.' - - They shall keep meeting notes, including agenda items, discussion points, and outcomes for everyone to review. - - 'They shall be collaborative and work in good faith with other Working Groups.' - see_charter: See charter for more information. - code_of_conduct: The Electron organization and all repos therein adhere to the following Code of Conduct. - license: Electron is licensed with the MIT License. - repository: Check out the Governance Repository to find more information about the governance structure. + - Eles decidem por si e divulgam as suas regras publicamente; por exemplo, como são tomadas decisões quando se realizam reuniões e quem pode comparecer. + - 'Eles devem selecionar uma cadeira para representar o grupo.' + - Eles devem manter notas de reunião, incluindo itens da agenda, pontos de discussão e resultados para que todos possam revisar. + - 'Eles serão colaborativos e trabalharão de boa fé com outros Grupos de Trabalho.' + see_charter: Veja charter para mais informações. + code_of_conduct: A organização Electron e todos os seus repositórios aderem ao seguinte Código de Conduta. + license: O Electron é licenciado pela MIT License. + repository: Confira o Repositório de Governança para encontrar mais informações sobre a estrutura de governança. _404: - page_not_found: Page not found. + page_not_found: Página não encontrada. diff --git a/content/ru-RU/docs/api/app.md b/content/ru-RU/docs/api/app.md index 1e21d2855cfc6..dc0b341a7a102 100644 --- a/content/ru-RU/docs/api/app.md +++ b/content/ru-RU/docs/api/app.md @@ -420,54 +420,6 @@ app.on('session-created', (session) => { Возникает, когда `desktopCapturer.getSources()` вызывается в процессе рендерера `webContents`. Вызов `event.preventDefault()` вернет пустые источники. -### Event: 'remote-require' _Deprecated_ - -Возвращает: - -* Событие типа `event` -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -Происходит когда функция `remote.require()` вызвана в процессе рендеринга `webContents`. Вызов `event.preventDefault()` предотвращает возврат модуля. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - -### Event: 'remote-get-global' _Deprecated_ - -Возвращает: - -* Событие типа `event` -* `webContents` [WebContents](web-contents.md) -* `globalName` String - -Происходит когда функция `remote.getGlobal()` вызвана в процессе рендеринга `webContents`. Вызов `event.preventDefault()` предотвращает возврат глобального значения. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - -### Event: 'remote-get-builtin' _Deprecated_ - -Возвращает: - -* Событие типа `event` -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -Происходит когда функция `remote.getBuiltin()` вызвана в процессе рендеринга `webContents`. Вызов `event.preventDefault()` предотвращает возврат модуля. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - -### Event: 'remote-get-current-window' _Deprecated_ - -Возвращает: - -* Событие типа `event` -* `webContents` [WebContents](web-contents.md) - -Происходит когда функция `remote.getCurrentWindow()` вызвана в процессе рендеринга `webContents`. Вызов `event.preventDefault()` предотвращает возврат объекта. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - -### Event: 'remote-get-current-web-contents' _Deprecated_ - -Возвращает: - -* Событие типа `event` -* `webContents` [WebContents](web-contents.md) - -Происходит когда функция `remote.getCurrentWebContents()` вызвана в процессе рендеринга `webContents`. Вызов `event.preventDefault()` предотвращает возврат объекта. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - ## Методы Объект `app` имеет следующие методы: @@ -981,7 +933,7 @@ Sets the counter badge for current app. Setting the count to `0` will hide the b На macOS отображается на иконке в Dock. На Linux работает только для лаунчера Unity. -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**Примечание:** для работы Unity лаунчера требуется файл `.desktop`. Дополнительную информациюможно прочесть в [Документации по интеграции Юнити][unity-requirement]. ### `app.getBadgeCount()` _Linux_ _macOS_ @@ -1102,13 +1054,13 @@ stopAccessingSecurityScopedResource() ### `app.enableSandbox()` -Включает полноценный режим песочницы в приложении. This means that all renderers will be launched sandboxed, regardless of the value of the `sandbox` flag in WebPreferences. +Включает полноценный режим песочницы в приложении. Это означает, что все рендереры будут запускаться изолированно, независимо от значения параметра `sandbox` флаг в WebPreferences. Этот метод может быть вызван только до того, как приложение будет готово. ### `app.isInApplicationsFolder()` _macOS_ -Returns `Boolean` - Whether the application is currently running from the systems Application folder. Use in combination with `app.moveToApplicationsFolder()` +Возвращает `Boolean` - выполняется ли приложение в данный момент из системной папки Приложения. Используйте в сочетании с `app.moveToApplicationsFolder()` ### `app.moveToApplicationsFolder([options])` _macOS_ @@ -1116,13 +1068,13 @@ Returns `Boolean` - Whether the application is currently running from the system * `conflictHandler` Function\ (опционально) - обработчик потенциальных конфликтов при неудачных попытках. * `conflictType` String - Тип конфликта перемещения, с которым столкнулся обработчик; может быть `exists` или `existsAndRunning`, где `exists` означает, что приложение с тем же именем присутствует в каталоге приложений, а `existsAndRunning` означает, что он существует и работает в данный момент. -Returns `Boolean` - Whether the move was successful. Please note that if the move is successful, your application will quit and relaunch. +Возвращает `Boolean` - если перемещение было успешным. Обратите внимание, что если перемещение выполнено успешно, ваше приложение закроется и перезапустится. -No confirmation dialog will be presented by default. Если нужно подтверждение операции пользователем, используйте [`dialog`](dialog.md) API. +По умолчанию диалоговое окно подтверждения не отображается. Если нужно подтверждение операции пользователем, используйте [`dialog`](dialog.md) API. -**NOTE:** This method throws errors if anything other than the user causes the move to fail. Например, если пользователь отменяет диалоговое окно авторизации, этот метод возвращает false. Если нам не удастся выполнить копирование, этот метод вызовет ошибку. The message in the error should be informative and tell you exactly what went wrong. +**ПРИМЕЧАНИЕ:** Этот метод выдает ошибки, если что-то, кроме пользователя, вызывает переход к неудачи. Например, если пользователь отменяет диалоговое окно авторизации, этот метод возвращает false. Если нам не удастся выполнить копирование, этот метод вызовет ошибку. Сообщение об ошибке должно быть информативным и сообщать вам именно то, что пошло не так. -By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. Если оно _работает_, на уже существующее запущенное приложение переместится фокус, а ранее активное приложение само завершит работу. Это поведение можно изменить, предоставив необязательный обработчик конфликтов, где логическое значение, возвращаемое обработчиком, определяет, будет ли конфликт перемещения разрешен с поведением по умолчанию. то есть возврат `false` гарантирует, что дальнейшие действия не будут приняты, возврат `true` приведет к поведению по умолчанию и продолжению метода. +По умолчанию, если приложение с тем же именем, что и перемещаемое, существует в каталоге Applications и _not_ запущено, существующее приложение будет удалено, а активное приложение перемещено на свое место. Если оно _работает_, на уже существующее запущенное приложение переместится фокус, а ранее активное приложение само завершит работу. Это поведение можно изменить, предоставив необязательный обработчик конфликтов, где логическое значение, возвращаемое обработчиком, определяет, будет ли конфликт перемещения разрешен с поведением по умолчанию. то есть возврат `false` гарантирует, что дальнейшие действия не будут приняты, возврат `true` приведет к поведению по умолчанию и продолжению метода. Например: @@ -1145,21 +1097,21 @@ app.moveToApplicationsFolder({ ### `app.isSecureKeyboardEntryEnabled()` _macOS_ -Returns `Boolean` - whether `Secure Keyboard Entry` is enabled. +Возвращает `Boolean` - если включен `Secure Keyboard Entry`. -By default this API will return `false`. +По умолчанию этот API вернет `false`. ### `app.setSecureKeyboardEntryEnabled(enabled)` _macOS_ -* `enabled` Boolean - Enable or disable `Secure Keyboard Entry` +* `enabled` Boolean - Включить или отключить `Secure Keyboard Entry` -Set the `Secure Keyboard Entry` is enabled in your application. +Установка `Secure Keyboard Entry` включена в вашем приложении. -By using this API, important information such as password and other sensitive information can be prevented from being intercepted by other processes. +Используя этот API, можно предотвратить перехват важной информации, такой как пароль и другую конфиденциальную информацию, другими процессами. -See [Apple's documentation](https://developer.apple.com/library/archive/technotes/tn2150/_index.html) for more details. +См. [Apple's documentation](https://developer.apple.com/library/archive/technotes/tn2150/_index.html) для получения дополнительной информации подробности. -**Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it when it is no longer needed. +**Примечание:** Включайте `Secure Keyboard Entry` только тогда, когда он нужен, и отключайте, когда он больше не нужен. ## Свойства @@ -1167,7 +1119,7 @@ See [Apple's documentation](https://developer.apple.com/library/archive/technote `Boolean` свойство, которое `true`, если поддержка специальных возможностей Chrome включена, иначе `false`. Это свойство будет `true`, если использование вспомогательных технологий, таких как средства чтения с экрана, были обнаружены. Устанавливая это свойство на `true`, вручную включает поддержку специальных возможностей Chrome, позволяя разработчикам показать пользователю переключатели специальных возможностей в настройках приложения. -See [Chromium's accessibility docs](https://www.chromium.org/developers/design-documents/accessibility) for more details. Отключено по умолчанию. +См. [Chromium's accessibility docs](https://www.chromium.org/developers/design-documents/accessibility) для получения более подробной информации. Отключено по умолчанию. Этот API должен вызываться после того, как произошло событие `ready`. @@ -1179,11 +1131,11 @@ A `Menu | null`свойство, которое возвращает [`Menu`](me ### `app.badgeCount` _Linux_ _macOS_ -An `Integer` property that returns the badge count for current app. Setting the count to `0` will hide the badge. +Свойство `Integer`, которое возвращает количество значков для текущего приложения. Установка счетчика на `0` скроет значок. -On macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher. +В macOS установка любого ненулевого целого числа отображается на значке док-станции. В Linux это свойство работает только для модуля запуска Unity. -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**Примечание:** для работы Unity лаунчера требуется файл `.desktop`. Дополнительную информациюможно прочесть в [Документации по интеграции Юнити][unity-requirement]. **Примечание:** На macOS, вы должны убедиться, что ваше приложение имеет разрешение на отображение уведомлений. @@ -1193,7 +1145,7 @@ On macOS, setting this with any nonzero integer shows on the dock icon. On Linux ### `app.dock` _macOS_ _Readonly_ -A [`Dock`](./dock.md) `| undefined` object that allows you to perform actions on your app icon in the user's dock on macOS. +Это [`Dock`](./dock.md) `| undefined` объект, который позволяет вам выполнять действия со значком вашего приложения в пользовательском док на macOS. ### `app.isPackaged` _Readonly_ @@ -1211,17 +1163,11 @@ A [`Dock`](./dock.md) `| undefined` object that allows you to perform actions on Это агент пользователя, который будет использоваться, если ни один агент пользователя не установлен на уровнях `webContents` или `session`. Это полезно для того, чтобы все ваше приложение имело один и тот же пользовательский агент. Установите пользовательское значение как можно раньше в инициализации Ваших приложений, чтобы убедиться, что используется переопределенное значение. -### `app.allowRendererProcessReuse` - -`Boolean`, которое, когда `true`, отключает переопределения, которые Electron имеет на месте, чтобы убедиться, что графические процессы перезапускаются при каждой навигации. Текущее значение по умолчанию для этого свойства - `true`. - -Цель заключается в том, чтобы эти переопределения были отключены по умолчанию, а затем, в некоторой точке в будущем, это свойство будет удалено. Это свойство влияет на то, какие нативные модули можно использовать в графическом процессе. Для большей информации о том, как Electron перезапускает графический процесс и использует нативные модули в графическом процессе, пожалуйста, проверьте этот [отслеживаемый вопрос](https://github.com/electron/electron/issues/18397). - ### `app.runningUnderRosettaTranslation` _macOS_ _Readonly_ A `Boolean` which when `true` indicates that the app is currently running under the [Rosetta Translator Environment](https://en.wikipedia.org/wiki/Rosetta_(software)). -You can use this property to prompt users to download the arm64 version of your application when they are running the x64 version under Rosetta incorrectly. +Вы можете использовать это свойство, чтобы предложить пользователям загрузить версию для arm64 вашего приложения, когда они запускают версию x64 под Rosetta неправильно. [tasks]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks [app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx @@ -1231,7 +1177,7 @@ You can use this property to prompt users to download the arm64 version of your [LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType -[unity-requirement]: ../tutorial/desktop-environment-integration.md#unity-launcher +[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher [mas-builds]: ../tutorial/mac-app-store-submission-guide.md [Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows [JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx diff --git a/content/ru-RU/docs/api/auto-updater.md b/content/ru-RU/docs/api/auto-updater.md index 036a96cd02b94..31209fea7c0e6 100644 --- a/content/ru-RU/docs/api/auto-updater.md +++ b/content/ru-RU/docs/api/auto-updater.md @@ -97,6 +97,8 @@ Спрашивает сервер, есть ли обновление. Вы должны вызвать `setFeedURL` перед использованием API. +**Note:** If an update is available it will be downloaded automatically. Calling `autoUpdater.checkForUpdates()` twice will download the update two times. + ### `autoUpdater.quitAndInstall()` Перезапускает приложение и устанавливает обновление после его загрузки. Следует вызывать только после произошедшего `update-downloaded`. diff --git a/content/ru-RU/docs/api/browser-window.md b/content/ru-RU/docs/api/browser-window.md index e03228d9fe6cc..8888276c613cf 100644 --- a/content/ru-RU/docs/api/browser-window.md +++ b/content/ru-RU/docs/api/browser-window.md @@ -10,11 +10,11 @@ const { BrowserWindow } = require('electron') const win = new BrowserWindow({ width: 800, height: 600 }) -// Load a remote URL +// Загрузка удаленного URL win.loadURL('https://github.com') -// Or load a local HTML file -win.loadURL(`file://${__dirname}/app/index.html`) +// Или загрузка локального HTML файла +win.loadFile('index.html') ``` ## Окно без рамки @@ -143,7 +143,7 @@ child.once('ready-to-show', () => { * `frame` Boolean (optional) - Specify `false` to create a [Frameless Window](frameless-window.md). По умолчанию - `true`. * `parent` BrowserWindow (optional) - Specify parent window. По умолчанию - `null`. * `modal` Boolean (optional) - Whether this is a modal window. This only works when the window is a child window. По умолчанию - `false`. - * `acceptFirstMouse` Boolean (optional) - Whether the web view accepts a single mouse-down event that simultaneously activates the window. По умолчанию - `false`. + * `acceptFirstMouse` Boolean (optional) - Whether clicking an inactive window will also click through to the web contents. Default is `false` on macOS. This option is not configurable on other platforms. * `disableAutoHideCursor` Boolean (optional) - Whether to hide cursor when typing. По умолчанию - `false`. * `autoHideMenuBar` Boolean (optional) - Auto hide the menu bar unless the `Alt` key is pressed. По умолчанию - `false`. * `enableLargerThanScreen` Boolean (опционально) - позволяет окну изменять размер больше, чем экран. Относится только к macOS, так как другие ОС по умолчанию разрешают окна больше экрана. По умолчанию - `false`. @@ -157,11 +157,11 @@ child.once('ready-to-show', () => { * `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default. * `active` - The backdrop should always appear active. * `inactive` - The backdrop should always appear inactive. - * `titleBarStyle` String (optional) - The style of window title bar. По умолчанию - `default`. Возможные значения: - * `default` - В результате стандартный, серый, непрозрачный Mac заголовок. - * `hidden` - В результате скрытый заголовок и содержимое во все окно, но заголовок по-прежнему имеет стандартное окно контроля ("светофоры") сверху слева. - * `hiddenInset` - в результате скрытый заголовок с альтернативным видом, где кнопки контролирования немного больше отступает от края окна. - * `customButtonsOnHover` - Results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. **Примечание:** Эта опция в настоящее время экспериментальная. + * `titleBarStyle` Строка (необязательно) _macOS_ _Windows_ - Стиль строки заголовка окна. По умолчанию - `default`. Возможные значения: + * `по умолчанию` - результаты в стандартной строке заголовка для macOS или Windows, соответственно. + * `скрытые` - результаты в скрытой строке заголовка и окно полного размера. На macOS в левом верхнем углу окна все еще есть стандартное управление окном ("светофоры"). На Windows, когда в сочетании с заголовком `titleBarOverlay: true` он активирует Overlay Window Controls Overlay (см. `titleBarOverlay` для получения дополнительной информации), иначе панель управления окном не будет показана. + * `hiddenInset` - Только в macOS приводит к скрытой строке заголовка с альтернативным видом где кнопки светофора немного дальше от края окна. + * `customButtonsOnHover` - Только в macOS приводит к скрытой строке заголовка и полному размеру окно содержимого, кнопки светофора будут отображаться при наведении курсора в верхнем левом углу окна. **Примечание:** Эта опция в настоящее время экспериментальная. * `trafficLightPosition` [Point](structures/point.md) (optional) - Set a custom position for the traffic light buttons in frameless windows. * `roundedCorners` Boolean (optional) - Whether frameless window should have rounded corners on macOS. По умолчанию - `true`. * `fullscreenWindowTitle` Boolean (optional) _Deprecated_ - Shows the title in the title bar in full screen mode on macOS for `hiddenInset` titleBarStyle. По умолчанию - `false`. @@ -176,10 +176,8 @@ child.once('ready-to-show', () => { * `nodeIntegrationInSubFrames` Boolean (опционально) - экспериментальная опция для включения поддержки NodeJS в подфреймах, таких как iframes и дочерних окнах. Все Ваши предварительные загрузки будут загружены для каждого iframe, Вы можете использовать `process.isMainFrame`, чтобы определить в главном фрейме Вы или нет. * `preload` String (опционально) - Определяет скрипт, который будет загружен до других скриптов загружаемых в странице. Этот скрипт будет всегда иметь доступ к узлам API в не зависимости включено или выключено объединение узлов. Значение должно быть абсолютным файловым путем к скрипту. Когда интеграция узлов отключена, сценарий предварительной загрузки может повторно вводить глобальные символы узла обратно в глобальную область. Посмотреть пример [здесь](context-bridge.md#exposing-node-global-symbols). * `sandbox` Boolean (опционально) - если установлено в true, то в окне будет запущена песочница рендеринга, что делает ее совместимой с Chromium на уровне операционной системы и отключает Node.js. Это не тоже самое, что параметр `nodeIntegration`, доступные АПИ для предзагрузки более ограничены. Узнать больше об этой опции можно [здесь](../tutorial/sandbox.md). - * `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module. По умолчанию - `false`. * `session` [Сессия](session.md#class-session) (опционально) - отсылает сессию используемую на странице. Вместо передачи объекта Session напрямую, вы можете также выбрать использование `partition` опции вместо которой принимает строку раздела. Когда оба `session` и `partition` определены, `session` будет приоритентней. По умолчанию используется session по умолчанию. * `partition` String (опционально) - Устанавливает сеанс, используемый страницей в соответствии со строкой раздела сессии. Если `partition` начинается с `persist:`, страница будет использовать постоянную сессию доступная всем страницам в приложении с некоторыми `partition`. Если нет `persist:` префикса, страница будет использовать сеанс в памяти. При присваивании одинаковой `partition`, разные страницы могут иметь одинаковую сессию. По умолчанию используется session по умолчанию. - * `affinity` String (опционально) - Когда определено, веб страницы с одинаковыми `affinity` будут работать в том же процессе рендеринга. Обратите внимание, что из-за повторного использования процесса рендеринга, некоторые параметры `webPreferences` также будут доступны между веб-страницами, даже если вы указали для них разные значения, включая, но не ограничиваясь, `preload`, `sandbox` и `nodeIntegration`. Поэтому рекомендуется использовать те же `webPreferences` для веб-страниц с таким же `affinity`. _Deprecated_ * `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents `300%`. По умолчанию - `1.0`. * `javascript` Boolean (optional) - Enables JavaScript support. По умолчанию - `true`. * `webSecurity` Boolean (опционально) - Когда `false`, отключается политика same-origin (обычно используется при тестировании вебсайтов людьми), и устанавливается `allowRunningInsecureContent` в `true`, если параметр не был установлен пользователем. По умолчанию - `true`. @@ -206,8 +204,7 @@ child.once('ready-to-show', () => { * `backgroundThrottling` Boolean (optional) - Whether to throttle animations and timers when the page becomes background. This also affects the [Page Visibility API](#page-visibility). Defaults to `true`. * `offscreen` Boolean (optional) - Whether to enable offscreen rendering for the browser window. Defaults to `false`. See the [offscreen rendering tutorial](../tutorial/offscreen-rendering.md) for more details. * `contextIsolation` Boolean (optional) - Whether to run Electron APIs and the specified `preload` script in a separate JavaScript context. Defaults to `true`. The context that the `preload` script runs in will only have access to its own dedicated `document` and `window` 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 the `preload` 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 the `preload` script and any Electron APIs being used. This option uses the same technique used by [Chrome Content Scripts][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. - * `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values can't unsafely cross between worlds when using `contextIsolation`. Defaults to `true`. _Deprecated_ - * `nativeWindowOpen` Boolean (optional) - Whether to use native `window.open()`. Defaults to `false`. Дочерние окна всегда будут отключены для интеграции узлов, если `nodeIntegrationInSubFrames` будет true. **Примечание:** Эта опция в настоящее время экспериментальная. + * `nativeWindowOpen` Boolean (optional) - Whether to use native `window.open()`. Defaults to `false`. Дочерние окна всегда будут отключены для интеграции узлов, если `nodeIntegrationInSubFrames` будет true. **Примечание:** Значение по умолчанию будет изменено на `true` в Electron 15. * `webviewTag` Boolean (опционально) - включает [``-тег](webview-tag.md). Defaults to `false`. **Примечание:** Cкрипт `предварительной загрузки`, настроенный для ``, будет иметь интеграцию NodeJS, когда будет запущен, так что Вы должны убедиться, что удаленный/непроверенный контент не может создавать тег `` с возможно вредоносным скриптом `предварительной загрузки`. Вы можете использовать событие `will-attach-webview` на [webContents](web-contents.md), чтобы снять скрипт `предварительной загрузки` и проверить или изменить начальные настройки ``. * `additionalArguments` String[] (optional) - A list of strings that will be appended to `process.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. По умолчанию - `false`. @@ -225,6 +222,7 @@ child.once('ready-to-show', () => { * `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation * `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager. Default policy is `code`. * `enablePreferredSizeMode` Boolean (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 the `preferred-size-changed` event to be emitted on the `WebContents` when the preferred size changes. По умолчанию - `false`. + * `titleBarOverlay` [OverlayOptions](structures/overlay-options.md) | Boolean (optional) - When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. По умолчанию - `false`. On Windows, the [OverlayOptions](structures/overlay-options.md) can be used instead of a boolean to specify colors for the overlay. Когда установлен минимальный или максимальный размер окна, при помощи `minWidth`/`maxWidth`/`minHeight`/`maxHeight`, это ограничивает только пользователей. Это не позволит Вам установить размер, который не будет следовать ограничениям размера, в `setBounds`/`setSize` или в конструкторе `BrowserWindow`. @@ -278,7 +276,7 @@ _**Примечание**: Существует тонкая разница ме #### Событие: 'closed' -Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more. +происходит когда окно приложения закрыто. After you have received this event you should remove the reference to the window and avoid using it any more. #### Событие: 'session-end' _Windows_ @@ -544,6 +542,10 @@ A `Boolean` property that determines whether the window is in simple (pre-Lion) A `Boolean` property that determines whether the window is in fullscreen mode. +#### `win.focusable` _Windows_ _macOS_ + +A `Boolean` property that determines whether the window is focusable. + #### `win.visibleOnAllWorkspaces` A `Boolean` property that determines whether the window is visible on all workspaces. @@ -755,19 +757,19 @@ Sets the background color of the window. See [Setting `backgroundColor`](#settin #### `win.previewFile(path[, displayName])` _macOS_ -* `path` String - The absolute path to the file to preview with QuickLook. This is important as Quick Look uses the file name and file extension on the path to determine the content type of the file to open. -* `displayName` String (optional) - The name of the file to display on the Quick Look modal view. This is purely visual and does not affect the content type of the file. Defaults to `path`. +* `path` String - абсолютный путь до файла, для предпросмотра в QuickLook. Это важно, так как QuickLook использует имя файла и расширение файла из пути, чтобы определить тип содержимого файла для открытия. +* `displayName` String (опционально) - имя файла, для отображения в модальном виде QuickLook. Это чисто визуально и не влияет на тип содержимого файла. По умолчанию `path`. -Uses [Quick Look][quick-look] to preview a file at a given path. +Использует [QuickLook][quick-look] для предпросмотра файла, по данному пути. #### `win.closeFilePreview()` _macOS_ -Closes the currently open [Quick Look][quick-look] panel. +Закрывает текущую открытую панель [QuickLook][quick-look]. #### `win.setBounds(bounds[, animate])` * `bounds` Partial<[Rectangle](structures/rectangle.md)> -* `animate` Boolean (optional) _macOS_ +* `animate` Boolean (необязательно) _macOS_ Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values. @@ -775,10 +777,10 @@ Resizes and moves the window to the supplied bounds. Any properties that are not const { BrowserWindow } = require('electron') const win = new BrowserWindow() -// set all bounds properties +// Установить все свойства границы win.setBounds({ x: 440, y: 225, width: 800, height: 600 }) -// set a single bounds property +// Установить одно свойство границы win.setBounds({ width: 100 }) // { x: 440, y: 225, width: 100, height: 600 } @@ -787,7 +789,7 @@ console.log(win.getBounds()) #### `win.getBounds()` -Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `Object`. +Возвращает [`Rectangle`](structures/rectangle.md) - `границы` окна как `объект`. #### `win.getBackgroundColor()` @@ -796,25 +798,25 @@ Returns `String` - Gets the background color of the window. See [Setting `backgr #### `win.setContentBounds(bounds[, animate])` * `bounds` [Rectangle](structures/rectangle.md) -* `animate` Boolean (optional) _macOS_ +* `animate` Boolean (необязательно) _macOS_ -Resizes and moves the window's client area (e.g. the web page) to the supplied bounds. +Меняет размеры и перемещает клиентскую область окна (например, веб-страницу) на заданные границы. #### `win.getContentBounds()` -Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window's client area as `Object`. +Возвращает [`Rectangle`](structures/rectangle.md) - `границы` области клиентского окна как `объект`. #### `win.getNormalBounds()` -Returns [`Rectangle`](structures/rectangle.md) - Contains the window bounds of the normal state +Возвращает [`Rectangle`](structures/rectangle.md) - содержит границы окна в нормальном состоянии -**Note:** whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same [`Rectangle`](structures/rectangle.md). +**Примечание:** Независимо от текущего состояния окна: увеличено до предела, свернуто или в полноэкранном режиме, эта функция всегда возвратит позицию и размер окна в нормальном состоянии. В нормальном состоянии, getBounds и getNormalBounds возвращают тот же [`Rectangle`](structures/rectangle.md). #### `win.setEnabled(enable)` * `enable` Boolean -Disable or enable the window. +Включает или выключает окно. #### `win.isEnabled()` @@ -824,47 +826,47 @@ Returns `Boolean` - whether the window is enabled. * `width` Integer * `height` Integer -* `animate` Boolean (optional) _macOS_ +* `animate` Boolean (необязательно) _macOS_ Resizes the window to `width` and `height`. If `width` or `height` are below any set minimum size constraints the window will snap to its minimum size. #### `win.getSize()` -Returns `Integer[]` - Contains the window's width and height. +Возвращает `Integer[]` - Содержит высоту и ширину окна. #### `win.setContentSize(width, height[, animate])` * `width` Integer * `height` Integer -* `animate` Boolean (optional) _macOS_ +* `animate` Boolean (необязательно) _macOS_ -Resizes the window's client area (e.g. the web page) to `width` and `height`. +Меняет размер клиентской области окна (например, веб-страница) на `width` и `height`. #### `win.getContentSize()` -Returns `Integer[]` - Contains the window's client area's width and height. +Возвращает `Integer[]` - содержит ширину и высоту клиентской области окна. #### `win.setMinimumSize(width, height)` * `width` Integer * `height` Integer -Sets the minimum size of window to `width` and `height`. +Устанавливает минимальный размер окна на `width` и `height`. #### `win.getMinimumSize()` -Returns `Integer[]` - Contains the window's minimum width and height. +Возвращает `Integer[]` - содержит минимальную ширину и высоту окна. #### `win.setMaximumSize(width, height)` * `width` Integer * `height` Integer -Sets the maximum size of window to `width` and `height`. +Устанавливает максимальный размер окна на `width` и `height`. #### `win.getMaximumSize()` -Returns `Integer[]` - Contains the window's maximum width and height. +Возвращает `Integer[]` - содержит максимальную ширину и высоту окна. #### `win.setResizable(resizable)` @@ -884,9 +886,9 @@ Sets whether the window can be moved by user. On Linux does nothing. #### `win.isMovable()` _macOS_ _Windows_ -Returns `Boolean` - Whether the window can be moved by user. +Возвращает `Boolean` - может пользователь перемещать окно или нет. -On Linux always returns `true`. +На Linux всегда возвращает `true`. #### `win.setMinimizable(minimizable)` _macOS_ _Windows_ @@ -898,7 +900,7 @@ Sets whether the window can be manually minimized by user. On Linux does nothing Returns `Boolean` - Whether the window can be manually minimized by the user. -On Linux always returns `true`. +На Linux всегда возвращает `true`. #### `win.setMaximizable(maximizable)` _macOS_ _Windows_ @@ -908,9 +910,9 @@ Sets whether the window can be manually maximized by user. On Linux does nothing #### `win.isMaximizable()` _macOS_ _Windows_ -Returns `Boolean` - Whether the window can be manually maximized by user. +Возвращает `Boolean` - может пользователь вручную увеличивать до предела окно или нет. -On Linux always returns `true`. +На Linux всегда возвращает `true`. #### `win.setFullScreenable(fullscreenable)` @@ -930,21 +932,21 @@ Sets whether the window can be manually closed by user. On Linux does nothing. #### `win.isClosable()` _macOS_ _Windows_ -Returns `Boolean` - Whether the window can be manually closed by user. +Возвращает `Boolean` - может пользователь вручную закрывать окно или нет. -On Linux always returns `true`. +На Linux всегда возвращает `true`. #### `win.setAlwaysOnTop(flag[, level][, relativeLevel])` * `flag` Boolean -* `level` String (optional) _macOS_ _Windows_ - Values include `normal`, `floating`, `torn-off-menu`, `modal-panel`, `main-menu`, `status`, `pop-up-menu`, `screen-saver`, and ~~`dock`~~ (Deprecated). The default is `floating` when `flag` is true. The `level` is reset to `normal` when the flag is false. Note that from `floating` to `status` included, the window is placed below the Dock on macOS and below the taskbar on Windows. From `pop-up-menu` to a higher it is shown above the Dock on macOS and above the taskbar on Windows. See the [macOS docs][window-levels] for more details. -* `relativeLevel` Integer (optional) _macOS_ - The number of layers higher to set this window relative to the given `level`. The default is `0`. Note that Apple discourages setting levels higher than 1 above `screen-saver`. +* `level` String (опционально) _macOS_ _Windows_ - Значения включают `normal`, `floating`, `torn-off-menu`, `modal-panel`, `main-menu`, `status`, `pop-up-menu`, `screen-saver` и ~~`dock`~~ (Устарело). По умолчанию `floating`, когда `flag` установлен true. `level` сбрасывается на `normal`, когда флаг устанавливается false. Обратите внимание, что от `floating` до `status` включительно, окно находится под Dock в macOS и под панелью задач в Windows. От `pop-up-menu` и выше отображается над Dock на macOS и выше панели задач на Windows. Смотрите [документацию macOS][window-levels] для подробностей. +* `relativeLevel` Integer (опционально) _macOS_ - количество слоев выше, чтобы установить окно относительно заданного `level`. По умолчанию - `0`. Обратите внимание, что Apple не рекомендует устанавливать уровни выше, чем 1 верхнего `screen-saver`. Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on. #### `win.isAlwaysOnTop()` -Returns `Boolean` - Whether the window is always on top of other windows. +Возвращает `Boolean` - всегда ли окно поверх остальных окон. #### `win.moveAbove(mediaSourceId)` @@ -954,40 +956,40 @@ Moves window above the source window in the sense of z-order. If the `mediaSourc #### `win.moveTop()` -Moves window to top(z-order) regardless of focus +Перемещает окно на верх(z-order) независимо от фокуса #### `win.center()` -Moves window to the center of the screen. +Перемещает окно в центр экрана. #### `win.setPosition(x, y[, animate])` * `x` Integer * `y` Integer -* `animate` Boolean (optional) _macOS_ +* `animate` Boolean (необязательно) _macOS_ -Moves window to `x` and `y`. +Перемещает окно на `x` и `y`. #### `win.getPosition()` -Returns `Integer[]` - Contains the window's current position. +Возвращает `Integer[]` - содержит текущую позицию окна. #### `win.setTitle(title)` * `title` String -Changes the title of native window to `title`. +Изменяет название нативного окна на `title`. #### `win.getTitle()` -Returns `String` - The title of the native window. +Возвращает `String` - название нативного окна. -**Note:** The title of the web page can be different from the title of the native window. +**Примечание:** Название веб-страницы может отличаться от названия нативного окна. #### `win.setSheetOffset(offsetY[, offsetX])` _macOS_ * `offsetY` Float -* `offsetX` Float (optional) +* `offsetX` Float (опционально) Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. Например: @@ -1094,23 +1096,23 @@ Returns `Boolean` - Whether the window's document has been edited. * `rect` [Rectangle](structures/rectangle.md) (optional) - The bounds to capture -Returns `Promise` - Resolves with a [NativeImage](native-image.md) +Возвращает `Promise` - разрешается с [NativeImage](native-image.md) -Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty. +Захватывает снимок страницы в границах `rect`. Пропустив `rect`, будет сделан захват всей видимой страницы. If the page is not visible, `rect` may be empty. #### `win.loadURL(url[, options])` * `url` String * `options` Object (опционально) - * `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL. + * `httpReferrer` (String | [Referrer](structures/referrer.md)) (опционально) - HTTP Referrer. * `userAgent` String (optional) - A user agent originating the request. * `extraHeaders` String (optional) - Extra headers separated by "\n" * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional) - * `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files. + * `baseURLForDataURL` String (опционально) - Базовый URL (с разделителем пути), для файлов, которые будут загружены по URL данных. Это необходимо, только если указанный `url` это URL данных и необходимо загрузить другие файлы. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Возвращает `Promise` - промис будет разрешен, когда страница завершит загрузку (см. [`did-finish-load`](web-contents.md#event-did-finish-load)), и отклоняет, если страница не удачно загрузилась (см. [`did-fail-load`](web-contents.md#event-did-fail-load)). -Same as [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options). +Тоже, что и [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options). The `url` can be a remote address (e.g. `http://`) or a path to a local HTML file using the `file://` protocol. @@ -1142,11 +1144,11 @@ win.loadURL('http://localhost:8000/post', { * `filePath` String * `options` Object (опционально) - * `query` Record (optional) - Passed to `url.format()`. + * `query` Record (опционально) - переданная в `url.format()`. * `search` String (optional) - Passed to `url.format()`. * `hash` String (optional) - Passed to `url.format()`. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +Возвращает `Promise` - промис будет разрешен, когда страница завершит загрузку (см. [`did-finish-load`](web-contents.md#event-did-finish-load)), и отклоняет, если страница не удачно загрузилась (см. [`did-fail-load`](web-contents.md#event-did-fail-load)). Same as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information. @@ -1158,11 +1160,11 @@ Same as `webContents.reload`. * `menu` Menu | null -Sets the `menu` as the window's menu bar. +Устанавливает `menu` в меню окна. #### `win.removeMenu()` _Linux_ _Windows_ -Remove the window's menu bar. +Удаляет меню окна. #### `win.setProgressBar(progress[, options])` @@ -1170,114 +1172,114 @@ Remove the window's menu bar. * `options` Object (опционально) * `mode` String _Windows_ - Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or `paused`. -Sets progress value in progress bar. Valid range is [0, 1.0]. +Устанавливает значение прогресса на шкале прогресса. Valid range is [0, 1.0]. -Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1. +Удаляет индикатор прогресса, когда прогресс меньше 0; Изменяет в режим indeterminate, когда прогресс больше 1. -On Linux platform, only supports Unity desktop environment, you need to specify the `*.desktop` file name to `desktopName` field in `package.json`. By default, it will assume `{app.name}.desktop`. +На платформе Linux поддерживается только рабочая среда Unity, Вам необходимо указать имя файла `*.desktop` в поле `desktopName` в `package.json`. По умолчанию будет предполагаться `{app.name}.desktop`. -On Windows, a mode can be passed. Accepted values are `none`, `normal`, `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a mode set (but with a value within the valid range), `normal` will be assumed. +На Windows режим может быть передан. Принимаемые значения: `none`, `normal`, `indeterminate`, `error` и `paused`. Если Вы вызовете `setProgressBar` без установленного режима (но со значением в пределах допустимого диапозона), будет предполагаться `normal`. #### `win.setOverlayIcon(overlay, description)` _Windows_ -* `overlay` [NativeImage](native-image.md) | null - the icon to display on the bottom right corner of the taskbar icon. If this parameter is `null`, the overlay is cleared -* `description` String - a description that will be provided to Accessibility screen readers +* `overlay` [NativeImage](native-image.md) | null - иконка, которая будет отображаться в правом краю иконки на панели задач. Если параметр `null`, оверлей будет очищен +* `description` String - описание, которое будет представлено для доступности чтения с экрана -Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user. +Устанавливает 16x16 пиксельный оверлей поверх текущей иконки в панели задач, обычно используется для передачи какого-либо статуса приложения или пассивного уведомления пользователя. #### `win.setHasShadow(hasShadow)` * `hasShadow` Boolean -Sets whether the window should have a shadow. +Устанавливает, будет ли окно иметь тень. #### `win.hasShadow()` -Returns `Boolean` - Whether the window has a shadow. +Возвращает `Boolean` - есть ли у окна тень. #### `win.setOpacity(opacity)` _Windows_ _macOS_ -* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque) +* `opacity` Number - между 0.0 (полная прозрачность) и 1.0 (полная видимость) Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the [0, 1] range. #### `win.getOpacity()` -Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1. +Возвращает `Number` - между 0.0 (полная прозрачность) и 1.0 (полная видимость). On Linux, always returns 1. -#### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_ +#### `win.setShape(rects)` _Windows_ _Linux_ _Экспериментально_ * `rects` [Rectangle[]](structures/rectangle.md) - Sets a shape on the window. Passing an empty list reverts the window to being rectangular. -Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window. +Установка формы окна, которая определяет область в окне, где система разрешает отрисовку и взаимодействие пользователя. Вне данного региона ни один пиксель не отрисуется и ни одно событие мыши не будет зарегистрировано. Вне региона события мыши не будут получены этим окном, но будет передаваться чему-либо позади окна. #### `win.setThumbarButtons(buttons)` _Windows_ * `buttons` [ThumbarButton[]](structures/thumbar-button.md) -Returns `Boolean` - Whether the buttons were added successfully +Возвращает `Boolean` - успешно ли добавлены кнопки -Add a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a `Boolean` object indicates whether the thumbnail has been added successfully. +Добавляет панель миниатюр, с определенным набором кнопок, на слой кнопок в изображении эскиза окна в панели задач. Возвращает объект `Boolean`, который указывает успешно ли добавлена панель миниатюр. -The number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform's limitation. But you can call the API with an empty array to clean the buttons. +Количество кнопок в панели миниатюр не должно быть больше, чем 7, из-за ограничений. После установки панели миниатюр, панель не может быть удалена, из-за ограничений платформы. Но Вы можете вызвать метод с пустым массивом, чтобы убрать кнопки. -The `buttons` is an array of `Button` objects: +`buttons` является массивом объектов `Button`: * `Button` Object - * `icon` [NativeImage](native-image.md) - The icon showing in thumbnail toolbar. + * `icon` [NativeImage](native-image.md) - иконка, отображаемая на панели миниатюр. * `click` Function - * `tooltip` String (optional) - The text of the button's tooltip. - * `flags` String[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`. + * `tooltip` String (опционально) - текст всплывающей подсказки на кнопке. + * `flags` String[] (опционально) - Управление конкретными состояниями и поведением кнопки. По умолчанию, является `['enabled']`. -The `flags` is an array that can include following `String`s: +`flags` — это массив, который может включать следующие `строки`: -* `enabled` - The button is active and available to the user. -* `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action. -* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately. -* `nobackground` - Do not draw a button border, use only the image. -* `hidden` - The button is not shown to the user. -* `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification. +* `enabled` - кнопка активна и доступна пользователю. +* `disabled` - Кнопка отключена. Она присутствует, но имеет неактивное визуальное состояние и не будет реагировать на действия пользователя. +* `dismissonclick` - когда кнопка нажата, окно панели миниатюр закрывается немедленно. +* `nobackground` - не рисует границы кнопок, использует только изображение. +* `hidden` - кнопка не отображается пользователю. +* `noninteractive` - Кнопка включена, но не интерактивна; ни одно состояние кнопки не отображается. Это значение предназначено для случаев, когда кнопка используется в уведомлении. #### `win.setThumbnailClip(region)` _Windows_ -* `region` [Rectangle](structures/rectangle.md) - Region of the window +* `region` [Rectangle](structures/rectangle.md) - область окна -Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0 }`. +Устанавливает область окна, которая будет показана в панели миниатюр, при наведении мыши на окно в панели задач. Вы можете сбросить панель миниатюры, чтобы показывалось окно полностью, указав пустую область: `{ x: 0, y: 0, width: 0, height: 0 }`. #### `win.setThumbnailToolTip(toolTip)` _Windows_ * `toolTip` String -Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar. +Устанавливает всплывающую подсказку, которая будет отображена, при наведении мыши на панель миниатюры окна в панели задач. #### `win.setAppDetails(options)` _Windows_ * `options` Object - * `appId` String (optional) - Window's [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx). It has to be set, otherwise the other options will have no effect. - * `appIconPath` String (optional) - Window's [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx). + * `appId` String (опционально) - [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx) окна. Это должно быть установлено, иначе остальные параметры не будут иметь никакого эффекта. + * `appIconPath` String (опционально) - [иконка перезапуска](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx) окна. * `appIconIndex` Integer (optional) - Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set. По умолчанию `0`. - * `relaunchCommand` String (optional) - Window's [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx). - * `relaunchDisplayName` String (optional) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx). + * `relaunchCommand` String (опционально) - [команда перезапуска](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx) окна. + * `relaunchDisplayName` String (опционально) - [отображаемое имя перезапуска](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx) окна. -Sets the properties for the window's taskbar button. +Устанавливает свойства для кнопки окна на панели задач. **Note:** `relaunchCommand` and `relaunchDisplayName` must always be set together. If one of those properties is not set, then neither will be used. #### `win.showDefinitionForSelection()` _macOS_ -Same as `webContents.showDefinitionForSelection()`. +Тоже, что и `webContents.showDefinitionForSelection()`. #### `win.setIcon(icon)` _Windows_ _Linux_ * `icon` [NativeImage](native-image.md) | String -Changes window icon. +Меняет иконку окна. #### `win.setWindowButtonVisibility(visible)` _macOS_ * `visible` Boolean -Sets whether the window traffic light buttons should be visible. +Устанавливает, должны ли быть видны кнопки контроля окна. #### `win.setAutoHideMenuBar(hide)` @@ -1308,31 +1310,31 @@ Returns `Boolean` - Whether the menu bar is visible. * `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether the window should be visible above fullscreen windows. * `skipTransformProcessType` Boolean (optional) _macOS_ - Calling setVisibleOnAllWorkspaces will by default transform the process type between UIElementApplication and ForegroundApplication to ensure the correct behavior. However, this will hide the window and dock for a short time every time it is called. If your window is already of type UIElementApplication, you can bypass this transformation by passing true to skipTransformProcessType. -Sets whether the window should be visible on all workspaces. +Устанавливает видимость окна на всех рабочих местах. -**Note:** This API does nothing on Windows. +**Примечание:** Этот API ничего не делает в Windows. #### `win.isVisibleOnAllWorkspaces()` -Returns `Boolean` - Whether the window is visible on all workspaces. +Возвращает `Boolean` - видно ли окно на всех рабочих местах. -**Note:** This API always returns false on Windows. +**Примечание:** Данный API всегда возвращает false в Windows. #### `win.setIgnoreMouseEvents(ignore[, options])` -* `ignore` Boolean +* `ignore` Логическое значение * `options` Object (опционально) * `forward` Boolean (optional) _macOS_ _Windows_ - If true, forwards mouse move messages to Chromium, enabling mouse related events such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false, forwarding is always disabled regardless of this value. -Makes the window ignore all mouse events. +Включает для окна игнорирование событий от мыши. -All mouse events happened in this window will be passed to the window below this window, but if this window has focus, it will still receive keyboard events. +Все события мыши, произошедшие в этом окне, будут переданы окну позади этого окна, но, если это окно сфокусировано, оно все еще будет получать события клавиатуры. #### `win.setContentProtection(enable)` _macOS_ _Windows_ * `enable` Boolean -Prevents the window contents from being captured by other apps. +Предотвращает захват содержимого окна другими приложениями. On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10 version 2004 and up the window will be removed from capture entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window. @@ -1340,63 +1342,67 @@ On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows i * `focusable` Boolean -Changes whether the window can be focused. +Меняет, может ли окно быть сфокусировано. + +На macOS он не снимает фокус с окна. + +#### `win.isFocusable()` _macOS_ _Windows_ -On macOS it does not remove the focus from the window. +Returns whether the window can be focused. #### `win.setParentWindow(parent)` * `parent` BrowserWindow | null -Sets `parent` as current window's parent window, passing `null` will turn current window into a top-level window. +Устанавливает `parent` как родителя текущего окна, передав `null` превратит текущее окно в окно верхнего уровня. #### `win.getParentWindow()` -Returns `BrowserWindow` - The parent window. +Возвращает `BrowserWindow` - родительское окно. #### `win.getChildWindows()` -Returns `BrowserWindow[]` - All child windows. +Возвращает `BrowserWindow[]` - все дочерние окна. #### `win.setAutoHideCursor(autoHide)` _macOS_ * `autoHide` Boolean -Controls whether to hide cursor when typing. +Контролирует скрытие курсора при вводе текста. #### `win.selectPreviousTab()` _macOS_ -Selects the previous tab when native tabs are enabled and there are other tabs in the window. +Выбирает предыдущую вкладку, когда нативные вкладки включены и в окне присутствуют другие вкладки. #### `win.selectNextTab()` _macOS_ -Selects the next tab when native tabs are enabled and there are other tabs in the window. +Выбирает следующую вкладку, когда нативные вкладки включены и в окне присутствуют другие вкладки. #### `win.mergeAllWindows()` _macOS_ -Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window. +Объединяет все окна в одно окно с множественными вкладками, когда нативные вкладки включены и в присутствуют открытые окна больше, чем 1. #### `win.moveTabToNewWindow()` _macOS_ -Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window. +Перемещает текущую вкладку в новое окно, если нативные вкладки включены и присутствует больше, чем одна вкладка, в текущем окне. #### `win.toggleTabBar()` _macOS_ -Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window. +Переключает видимость вкладки, если включены нативные вкладки и присутствует только одна вкладка в текущем окне. #### `win.addTabbedWindow(browserWindow)` _macOS_ * `browserWindow` BrowserWindow -Adds a window as a tab on this window, after the tab for the window instance. +Добавляет окно, как вкладку, в это окно, после вкладки экземпляра окна. #### `win.setVibrancy(type)` _macOS_ -* `type` String | null - Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See the [macOS documentation][vibrancy-docs] for more details. +* `type` String | null - Может быть `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window` и `under-page`. See the [macOS documentation][vibrancy-docs] for more details. Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window. -Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS. +Обратите внимание, что `appearance-based`, `light`, `dark`, `medium-light` и `ultra-dark` устарела и будет удалена в следующей версии macOS. #### `win.setTrafficLightPosition(position)` _macOS_ @@ -1414,37 +1420,37 @@ Returns `Point` - The custom position for the traffic light buttons in frameless Sets the touchBar layout for the current window. Specifying `null` or `undefined` clears the touch bar. This method only has an effect if the machine has a touch bar and is running on macOS 10.12.1+. -**Note:** The TouchBar API is currently experimental and may change or be removed in future Electron releases. +**Примечание:** TouchBar API в настоящее время является экспериментальным и может быть изменен или удален в будущих версиях Electron. -#### `win.setBrowserView(browserView)` _Experimental_ +#### `win.setBrowserView(browserView)` _Экспериментально_ * `browserView` [BrowserView](browser-view.md) | null - Attach `browserView` to `win`. If there are other `BrowserView`s attached, they will be removed from this window. -#### `win.getBrowserView()` _Experimental_ +#### `win.getBrowserView()` _Экспериментально_ Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null` if one is not attached. Throws an error if multiple `BrowserView`s are attached. -#### `win.addBrowserView(browserView)` _Experimental_ +#### `win.addBrowserView(browserView)` _Экспериментально_ * `browserView` [BrowserView](browser-view.md) -Replacement API for setBrowserView supporting work with multi browser views. +Заменяет метод setBrowserView, для поддержки работы с множественными видами браузера. -#### `win.removeBrowserView(browserView)` _Experimental_ +#### `win.removeBrowserView(browserView)` _Экспериментально_ * `browserView` [BrowserView](browser-view.md) -#### `win.setTopBrowserView(browserView)` _Experimental_ +#### `win.setTopBrowserView(browserView)` _Экспериментально_ * `browserView` [BrowserView](browser-view.md) Raises `browserView` above other `BrowserView`s attached to `win`. Throws an error if `browserView` is not attached to `win`. -#### `win.getBrowserViews()` _Experimental_ +#### `win.getBrowserViews()` _Экспериментально_ -Returns `BrowserView[]` - an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. +Возвращает `BrowserView[]` - массив всех BrowserViews которые были присоединены с `addBrowserView` или `setBrowserView`. -**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases. +**Примечание:** BrowserView API в настоящее время экспериментально и может измениться или быть удалено в будущих релизах Electron. [runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 [page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API @@ -1453,3 +1459,5 @@ Returns `BrowserView[]` - an array of all BrowserViews that have been attached w [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/ru-RU/docs/api/clipboard.md b/content/ru-RU/docs/api/clipboard.md index 5db984d6d2cb8..9d596d4b3913b 100644 --- a/content/ru-RU/docs/api/clipboard.md +++ b/content/ru-RU/docs/api/clipboard.md @@ -1,29 +1,29 @@ # clipboard -> Perform copy and paste operations on the system clipboard. +> Выполняет копирование и вставку в буфер обмена системы. -Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process) +Процессы: [Основной](../glossary.md#main-process), [Графический](../glossary.md#renderer-process) -On Linux, there is also a `selection` clipboard. To manipulate it you need to pass `selection` to each method: +В Linux также есть `selection` буфер обмена. Для работы с ним необходимо передать `selection` каждому методу: ```javascript const { clipboard } = require('electron') -clipboard.writeText('Example String', 'selection') +clipboard.writeText('Пример строки', 'selection) console.log(clipboard.readText('selection')) ``` ## Методы -The `clipboard` module has the following methods: +Модуль `clipboard` имеет следующие методы: -**Note:** Experimental APIs are marked as such and could be removed in future. +**Примечание:** Экспериментальные API помечены и могут быть удалены в будущем. ### `clipboard.readText([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (опционально) - Может быть `selection` или `clipboard`; по умолчанию 'clipboard'. `selection` доступен только в Linux. -Returns `String` - The content in the clipboard as plain text. +Возвращает `String` — содержимое буфера обмена в виде обычного текста. ```js const { clipboard } = require('electron') @@ -38,9 +38,9 @@ console.log(text) ### `clipboard.writeText(text[, type])` * `text` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (опционально) - Может быть `selection` или `clipboard`; по умолчанию 'clipboard'. `selection` доступен только в Linux. -Writes the `text` into the clipboard as plain text. +Записывает `text` в буфер обмена, как обычный текст. ```js const { clipboard } = require('electron') @@ -51,9 +51,9 @@ clipboard.writeText(text) ### `clipboard.readHTML([type])` -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (опционально) - Может быть `selection` или `clipboard`; по умолчанию 'clipboard'. `selection` доступен только в Linux. -Returns `String` - The content in the clipboard as markup. +Возвращает `String` - содержимое буфера обмена в виде разметки. ```js const { clipboard } = require('electron') @@ -68,9 +68,9 @@ console.log(html) ### `clipboard.writeHTML(markup[, type])` * `markup` String -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (опционально) - Может быть `selection` или `clipboard`; по умолчанию 'clipboard'. `selection` доступен только в Linux. -Writes `markup` to the clipboard. +Записывает `markup` в буфер обмена. ```js const { clipboard } = require('electron') @@ -80,22 +80,22 @@ clipboard.writeHTML('Hiselection

    ') console.log(hasFormat) -// 'true' or 'false +// 'true' or 'false' ``` -### `clipboard.read(format)` _Experimental_ +### `clipboard.read(format)` _Экспериментально_ * `format` String -Returns `String` - Reads `format` type from the clipboard. +Возвращает `String` - читает тип `format` из буфера обмена. -### `clipboard.readBuffer(format)` _Experimental_ +`format` should contain valid ASCII characters and have `/` separator. `a/c`, `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid. + +### `clipboard.readBuffer(format)` _Экспериментально_ * `format` String -Returns `Buffer` - Reads `format` type from the clipboard. +Возвращает `Buffer` - читает тип `format` из буфера обмена. ```js const { clipboard } = require('electron') const buffer = Buffer.from('this is binary', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) -const ret = clipboard.readBuffer('public.utf8-plain-text') +const ret = clipboard.readBuffer('public/utf8-plain-text') console.log(buffer.equals(out)) // true ``` -### `clipboard.writeBuffer(format, buffer[, type])` _Experimental_ +### `clipboard.writeBuffer(format, buffer[, type])` _Экспериментально_ * `format` String * `buffer` Buffer -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. +* `type` String (опционально) - Может быть `selection` или `clipboard`; по умолчанию 'clipboard'. `selection` доступен только в Linux. -Writes the `buffer` into the clipboard as `format`. +Записывает `buffer` в буфер обмена, как `format`. ```js const { clipboard } = require('electron') const buffer = Buffer.from('writeBuffer', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) ``` ### `clipboard.write(data[, type])` * `data` Object - * `text` String (optional) - * `html` String (optional) - * `image` [NativeImage](native-image.md) (optional) - * `rtf` String (optional) - * `bookmark` String (optional) - The title of the URL at `text`. -* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux. - -Writes `data` to the clipboard. + * `text` String (опционально) + * `html` String (опционально) + * `image` [NativeImage](native-image.md) (опционально) + * `rtf` String (опционально) + * `bookmark` String (опционально) - заголовок ссылки на `text`. +* `type` String (опционально) - Может быть `selection` или `clipboard`; по умолчанию 'clipboard'. `selection` доступен только в Linux. + +Записывает `data` в буфер обмена. ```js const { clipboard } = require('electron') diff --git a/content/ru-RU/docs/api/command-line-switches.md b/content/ru-RU/docs/api/command-line-switches.md index 9ed43f55c8c83..aa512ef3e61ce 100644 --- a/content/ru-RU/docs/api/command-line-switches.md +++ b/content/ru-RU/docs/api/command-line-switches.md @@ -59,17 +59,18 @@ Disables NTLM v2 for posix platforms, no effect elsewhere. Enables caller stack logging for the following APIs (filtering events): * `desktopCapturer.getSources()` / `desktop-capturer-get-sources` -* `remote.require()` / `remote-require` -* `remote.getGlobal()` / `remote-get-builtin` -* `remote.getBuiltin()` / `remote-get-global` -* `remote.getCurrentWindow()` / `remote-get-current-window` -* `remote.getCurrentWebContents()` / `remote-get-current-web-contents` -### --enable-logging +### --enable-logging[=file] -Выводит логи Chromium в консоль. +Prints Chromium's logging to stderr (or a log file). -Этот параметр не может быть использован в `app.commandLine.appendSwitch`, с тех пор как он парсится раньше, чем приложение пользователя загружается, но Вы можете установить переменную окружения `ELECTRON_ENABLE_LOGGING`, чтобы достичь того же эффекта. +The `ELECTRON_ENABLE_LOGGING` environment variable has the same effect as passing `--enable-logging`. + +Passing `--enable-logging` will result in logs being printed on stderr. Passing `--enable-logging=file` will result in logs being saved to the file specified by `--log-file=...`, or to `electron_debug.log` in the user-data directory if `--log-file` is not specified. + +> **Note:** On Windows, logs from child processes cannot be sent to stderr. Logging to a file is the most reliable way to collect logs on Windows. + +See also `--log-file`, `--log-level`, `--v`, and `--vmodule`. ### --force-fieldtrials=`trials` @@ -116,10 +117,26 @@ $ electron --js-flags="--harmony_proxies --harmony_collections" your-app Установить пользовательский язык. +### --log-file=`path` + +If `--enable-logging` is specified, logs will be written to the given path. The parent directory must exist. + +Setting the `ELECTRON_LOG_FILE` environment variable is equivalent to passing this flag. If both are present, the command-line switch takes precedence. + ### --log-net-log=`путь` Включает логи сетевых событий для сохранения и записывает их в `путь`. +### --log-level=`N` + +Sets the verbosity of logging when used together with `--enable-logging`. `N` should be one of [Chrome's LogSeverities][severities]. + +Note that two complimentary logging mechanisms in Chromium -- `LOG()` and `VLOG()` -- are controlled by different switches. `--log-level` controls `LOG()` messages, while `--v` and `--vmodule` control `VLOG()` messages. So you may want to use a combination of these three switches depending on the granularity you want and what logging calls are made by the code you're trying to watch. + +See [Chromium Logging source][logging] for more information on how `LOG()` and `VLOG()` interact. Loosely speaking, `VLOG()` can be thought of as sub-levels / per-module levels inside `LOG(INFO)` to control the firehose of `LOG(INFO)` data. + +See also `--enable-logging`, `--log-level`, `--v`, and `--vmodule`. + ### --no-proxy-server Не использовать прокси сервер и всегда делать прямые соединения. Переопределяет все остальные флаги прокси-сервера, которые были указаны. @@ -159,6 +176,8 @@ Gives the default maximal active V-logging level; 0 is the default. Normally pos Этот параметр работает только когда `--enable-logging` также указан. +See also `--enable-logging`, `--log-level`, and `--vmodule`. + ### --vmodule=`шаблон` Дает на каждый модуль максимальный уровень V-логирования, чтобы переопределить значения, заданное `--v`. Например, `my_module=2,foo*=3` would change the logging level for all code in source files `my_module.*` and `foo*.*`. @@ -167,6 +186,8 @@ Gives the default maximal active V-logging level; 0 is the default. Normally pos Этот параметр работает только когда `--enable-logging` также указан. +See also `--enable-logging`, `--log-level`, and `--v`. + ### --force_high_performance_gpu Force using discrete GPU when there are multiple GPUs available. @@ -214,5 +235,7 @@ By default inspector websocket url is available in stderr and under /json/list e [ready]: app.md#event-ready [play-silent-audio]: https://github.com/atom/atom/pull/9485/files [debugging-main-process]: ../tutorial/debugging-main-process.md +[logging]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h [node-cli]: https://nodejs.org/api/cli.html [node-cli]: https://nodejs.org/api/cli.html +[severities]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h?q=logging::LogSeverity&ss=chromium diff --git a/content/ru-RU/docs/api/dialog.md b/content/ru-RU/docs/api/dialog.md index fa62357f11a41..925ce619a3b06 100644 --- a/content/ru-RU/docs/api/dialog.md +++ b/content/ru-RU/docs/api/dialog.md @@ -186,8 +186,6 @@ dialog.showOpenDialog(mainWindow, { * `defaultId` Integer (опционально) - Индекс кнопки в массиве кнопок, который будет выбран по умолчанию при открытии окна сообщения. * `title` String (необязательно) - Заголовок окна сообщения, некоторые платформы не смогут его отобразить. * `detail` String (опционально) - Дополнительные сведения о сообщении. - * `checkboxLabel` String (опционально) - Если это предусмотрено, в окне сообщения будет установлен флажок с данной меткой. - * `checkboxChecked` Boolean (optional) - Initial checked state of the checkbox. По умолчанию `false`. * `icon` ([NativeImage](native-image.md) | String) (опционально) * `cancelId` Integer (опционально) - Индекс кнопки, которая будет использоваться для отмены диалога, через клавишу `Esc`. По умолчанию это назначается первой кнопке с меткой "Отмена" или "Нет". Если этот параметр не установлен и нет таких отмеченных кнопок, как возвращаемое значение будет использоваться `0`. * `noLink` Boolean (опционально) - В Windows Electron попытается выяснить, какие из `buttons` являются общими кнопками (например, «Отмена» или «Да»), и отобразить остальные как ссылки команд в диалоговом окне. Это может сделать диалог в стиле современных приложений Windows. Если вам не нравится такое поведение, вы можете установить `noLink` на `true`. diff --git a/content/ru-RU/docs/api/environment-variables.md b/content/ru-RU/docs/api/environment-variables.md index 36c2a12afb2ae..36d3dd5954c0b 100644 --- a/content/ru-RU/docs/api/environment-variables.md +++ b/content/ru-RU/docs/api/environment-variables.md @@ -104,7 +104,15 @@ Set the trash implementation on Linux. По умолчанию - `gio`. ### `ELECTRON_ENABLE_LOGGING` -Выводит логи Chrome в консоль. +Prints Chromium's internal logging to the console. + +Setting this variable is the same as passing `--enable-logging` on the command line. For more info, see `--enable-logging` in [command-line switches](./command-line-switches.md#enable-loggingfile). + +### `ELECTRON_LOG_FILE` + +Sets the file destination for Chromium's internal logging. + +Setting this variable is the same as passing `--log-file` on the command line. For more info, see `--log-file` in [command-line switches](./command-line-switches.md#log-filepath). ### `ELECTRON_DEBUG_DRAG_REGIONS` @@ -112,7 +120,7 @@ Adds coloration to draggable regions on [`BrowserView`](./browser-view.md)s on m ### `ELECTRON_DEBUG_NOTIFICATIONS` -Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common actions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. +Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common a tions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. Sample output: diff --git a/content/ru-RU/docs/api/extensions.md b/content/ru-RU/docs/api/extensions.md index 315ce8e054285..7799298012770 100644 --- a/content/ru-RU/docs/api/extensions.md +++ b/content/ru-RU/docs/api/extensions.md @@ -64,6 +64,7 @@ session.loadExtension('path/to/unpacked/extension').then(({ id }) => { - `chrome.runtime.getURL` - `chrome.runtime.connect` - `chrome.runtime.sendMessage` +- `chrome.runtime.reload` Поддерживаются только следующие события `chrome.runtime`: diff --git a/content/ru-RU/docs/api/frameless-window.md b/content/ru-RU/docs/api/frameless-window.md index 4222ca915fe84..aabb28f765601 100644 --- a/content/ru-RU/docs/api/frameless-window.md +++ b/content/ru-RU/docs/api/frameless-window.md @@ -14,13 +14,13 @@ const win = new BrowserWindow({ width: 800, height: 600, frame: false }) win.show() ``` -### Альтернативы на macOS +### Alternatives -Существует альтернативный способ указать окно chromeless. Вместо установки `frame` в `false`, которая отключает элементы заголовка и окна, вы можете скрыть строку заголовка, и ваш контент будет расширен до полного размера окна, при этом по-прежнему сохранятся элементы управления окном («светофор») для стандартных действий окна. Вы можете сделать это, указав параметр `titleBarStyle`: +There's an alternative way to specify a chromeless window on macOS and Windows. Instead of setting `frame` to `false` which disables both the titlebar and window controls, you may want to have the title bar hidden and your content extend to the full window size, yet still preserve the window controls ("traffic lights" on macOS) for standard window actions. Вы можете сделать это, указав параметр `titleBarStyle`: #### `hidden` -В результате скроется заголовок и содержимое станет во все окно, но заголовок по-прежнему будет иметь стандартное окно контроля ("светофоры") сверху слева. +Results in a hidden title bar and a full size content window. On macOS, the title bar still has the standard window controls (“traffic lights”) in the top left. ```javascript const { BrowserWindow } = require('electron') @@ -28,6 +28,8 @@ const win = new BrowserWindow({ titleBarStyle: 'hidden' }) win.show() ``` +### Альтернативы на macOS + #### `hiddenInset` В результате скрытый заголовок с альтернативным видом, где кнопки контролирования немного больше вставки от края окна. @@ -48,9 +50,36 @@ const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: fa win.show() ``` +## Windows Control Overlay + +When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS, using one of the `titleBarStyle`s as described above so that the traffic lights are visible, or using `titleBarStyle: hidden` on Windows, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true. Specifying `true` will result in an overlay with default system colors. + +On Windows, you can also specify the color of the overlay and its symbols by setting `titleBarOverlay` to an object with the options `color` and `symbolColor`. If an option is not specified, the color will default to its system color for the window control buttons: + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: true +}) +win.show() +``` + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: { + color: '#2f3241', + symbolColor: '#74b1be' + } +}) +win.show() +``` + ## Прозрачное окно -Установите параметр `transparent` в значение `true`.
    Примечание: вы можете сделать это только для безрамного окна.
    Пример: +Установив для параметра `transparent` значение `true`, можно также сделать безрамочный окно прозрачным: ```javascript const { BrowserWindow } = require('electron') @@ -72,7 +101,7 @@ win.show() ## Невзаимодействующее окно -Чтобы создать невзаимодействующее окно, те. которое не будет реагировать на событии мыши, необходимо вызвать функцию API:[win.setIgnoreMouseEvents(ignore)][ignore-mouse-events]
    Пример: +Чтобы создать окно клика, т.е. сделать так, чтобы окно игнорировало все события мыши, можно вызвать [win.setIgnoreMouseEvents(ignore)][ignore-mouse-events] API: ```javascript const { BrowserWindow } = require('electron') @@ -142,3 +171,5 @@ In a frameless window the dragging behavior may conflict with selecting text. Н На некоторых платформах перетаскиваемая область будет рассматриваться как неклиентский фрейм, поэтому при щелчке правой кнопкой мыши на ней появится системное меню. Чтобы контекстное меню работало правильно на всех платформах, вы никогда не должны использовать настраиваемое контекстное меню в перетаскиваемых областях. [ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/ru-RU/docs/api/ipc-main.md b/content/ru-RU/docs/api/ipc-main.md index f59635e6f7587..80884e4401f7a 100644 --- a/content/ru-RU/docs/api/ipc-main.md +++ b/content/ru-RU/docs/api/ipc-main.md @@ -32,6 +32,8 @@ ipcMain.on('synchronous-message', (event, arg) => { ```javascript // В renderer процессе (web страница). +// NB. Electron APIs are only accessible from preload, unless contextIsolation is disabled. +// See https://www.electronjs.org/docs/tutorial/process-model#preload-scripts for more details. const { ipcRenderer } = require('electron') console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints "pong" diff --git a/content/ru-RU/docs/api/menu-item.md b/content/ru-RU/docs/api/menu-item.md index fc85374be0743..113e0f929028e 100644 --- a/content/ru-RU/docs/api/menu-item.md +++ b/content/ru-RU/docs/api/menu-item.md @@ -13,7 +13,7 @@ * `menuItem` MenuItem * `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open. * `event` [KeyboardEvent](structures/keyboard-event.md) - * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. Смотрите [роли](#roles). + * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. Смотрите [роли](#roles). * `type` String (опционально) - Может быть `normal`, `separator`, `submenu`, `checkbox` или `radio`. * `label` String (опционально) * `sublabel` String (опционально) @@ -128,7 +128,7 @@ A `Function` that is fired when the MenuItem receives a click event. It can be c #### `menuItem.role` -`String` (опционально) с указанием роли элемента, если установлено. Может быть `отменено`, `redo`, `сократить`, `копировать`, `вставить`, `pasteAndMatchStyle`, `удалить`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `минимизируйте`, `близко`, `справки`, `о`, `сервисах`, `скрыть`, `скрыть`, `показов`, `выход`, `startSpeaking`, `stopSpeaking`, `масштаба`, `передней`, `меню приложения`, `меню файлов`, `меню редактирования`, `меню просмотра`, `последних документов`, `переключателей панели`, `selectNextTab`, `selectПредыдущая вкладка`, `Объединение Всех Windows`, `clearRecentDocuments`, `moveTabToNewWindow` или `windowMenu` +`String` (опционально) с указанием роли элемента, если установлено. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` #### `menuItem.accelerator` diff --git a/content/ru-RU/docs/api/menu.md b/content/ru-RU/docs/api/menu.md index 96a8cbfc52e81..5e6c03c286080 100644 --- a/content/ru-RU/docs/api/menu.md +++ b/content/ru-RU/docs/api/menu.md @@ -143,7 +143,7 @@ const template = [ { role: 'services' }, { type: 'separator' }, { role: 'hide' }, - { role: 'hideothers' }, + { role: 'hideOthers' }, { role: 'unhide' }, { type: 'separator' }, { role: 'quit' } diff --git a/content/ru-RU/docs/api/power-monitor.md b/content/ru-RU/docs/api/power-monitor.md index effb3b58420c5..76bfaf1e9c1e1 100644 --- a/content/ru-RU/docs/api/power-monitor.md +++ b/content/ru-RU/docs/api/power-monitor.md @@ -8,11 +8,11 @@ Модуль `powerMonitor` выдает следующие события: -### Event: 'suspend' _macOS_ _Windows_ +### Событие: 'suspend' Возникает, когда система приостановлена. -### Event: 'resume' _macOS_ _Windows_ +### Событие: 'resume' Возникает при возобновлении работы системы. diff --git a/content/ru-RU/docs/api/session.md b/content/ru-RU/docs/api/session.md index bb01c4e4a80bd..d9fa8224fe84e 100644 --- a/content/ru-RU/docs/api/session.md +++ b/content/ru-RU/docs/api/session.md @@ -160,7 +160,7 @@ Emitted when a hunspell dictionary file has been successfully downloaded Emitted when a hunspell dictionary file download fails. For details on the failure you should collect a netlog and inspect the download request. -#### Event: 'select-serial-port' _Experimental_ +#### Event: 'select-serial-port' Возвращает: @@ -172,21 +172,15 @@ Emitted when a hunspell dictionary file download fails. For details on the fail Emitted when a serial port needs to be selected when a call to `navigator.serial.requestPort` is made. `callback` should be called with `portId` to be selected, passing an empty string to `callback` will cancel the request. Additionally, permissioning on `navigator.serial` can be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler) with the `serial` permission. -Because this is an experimental feature it is disabled by default. To enable this feature, you will need to use the `--enable-features=ElectronSerialChooser` command line switch. Additionally because this is an experimental Chromium feature you will need to set `enableBlinkFeatures: 'Serial'` on the `webPreferences` property when opening a BrowserWindow. - ```javascript const { app, BrowserWindow } = require('electron') let win = null -app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser') app.whenReady().then(() => { win = new BrowserWindow({ width: 800, - height: 600, - webPreferences: { - enableBlinkFeatures: 'Serial' - } + height: 600 }) win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => { event.preventDefault() @@ -202,7 +196,7 @@ app.whenReady().then(() => { }) ``` -#### Event: 'serial-port-added' _Experimental_ +#### Event: 'serial-port-added' Возвращает: @@ -212,7 +206,7 @@ app.whenReady().then(() => { Emitted after `navigator.serial.requestPort` has been called and `select-serial-port` has fired if a new serial port becomes available. For example, this event will fire when a new USB device is plugged in. -#### Event: 'serial-port-removed' _Experimental_ +#### Event: 'serial-port-removed' Возвращает: @@ -452,7 +446,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents #### `ses.setPermissionCheckHandler(handler)` * `handler` Function\ | null - * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. Cross origin sub frames making permission checks will pass a `null` webContents to this handler. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. + * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. Все перекрёстные подкадры, делающие проверку прав доступа, передадут этому обработчику `null` webContents, в то время как другие проверку прав доступа, такие как `notifications`, после проверки всегда будут передавать `null`. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. * `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, or `serial`. * `requestingOrigin` String - The origin URL of the permission check * `details` Object - Some properties are only available on certain permission types. diff --git a/content/ru-RU/docs/api/structures/overlay-options.md b/content/ru-RU/docs/api/structures/overlay-options.md new file mode 100644 index 0000000000000..9e0e4815ea59c --- /dev/null +++ b/content/ru-RU/docs/api/structures/overlay-options.md @@ -0,0 +1,4 @@ +# OverlayOptions Object + +* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color. +* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color. diff --git a/content/ru-RU/docs/api/structures/user-default-types.md b/content/ru-RU/docs/api/structures/user-default-types.md new file mode 100644 index 0000000000000..f7009415375ad --- /dev/null +++ b/content/ru-RU/docs/api/structures/user-default-types.md @@ -0,0 +1,12 @@ +# UserDefaultTypes Object + +* Строка `string` +* `boolean` Boolean +* `integer` Number +* `float` Number +* `double` Number +* `url` String +* `array` Array\ +* `dictionary` Record\ + +This type is a helper alias, no object will never exist of this type. diff --git a/content/ru-RU/docs/api/system-preferences.md b/content/ru-RU/docs/api/system-preferences.md index cd1010835a542..76232c28e938e 100644 --- a/content/ru-RU/docs/api/system-preferences.md +++ b/content/ru-RU/docs/api/system-preferences.md @@ -147,12 +147,12 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace. Add the specified defaults to your application's `NSUserDefaults`. -### `systemPreferences.getUserDefault(key, type)` _macOS_ +### `systemPreferences.getUserDefault(key, type)` _macOS_ * `key` String -* `type` String - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. +* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. -Возвращает `any` - Значение `key` в `NSUserDefaults`. +Returns [`UserDefaultTypes[Type]`](structures/user-default-types.md) - The value of `key` in `NSUserDefaults`. Самые популярные `key` и `type`: diff --git a/content/ru-RU/docs/api/touch-bar-scrubber.md b/content/ru-RU/docs/api/touch-bar-scrubber.md index d22a996f00b7c..946f47389babe 100644 --- a/content/ru-RU/docs/api/touch-bar-scrubber.md +++ b/content/ru-RU/docs/api/touch-bar-scrubber.md @@ -14,7 +14,7 @@ * `highlightedIndex` Integer - The index of the item the user touched. * `selectedStyle` String (optional) - Selected item style. Can be `background`, `outline` or `none`. Defaults to `none`. * `overlayStyle` String (optional) - Selected overlay item style. Can be `background`, `outline` or `none`. Defaults to `none`. - * `showArrowButtons` Boolean (опиционально) - по умолчанию `false`. + * `showArrowButtons` Boolean (опционально) - если нужно показать кнопки со стрелками. По умолчанию `false` и показывается только если `элемент` присутствует. * `mode` String (опционально) - Может быть `fixed` или `free`. The default is `free`. * `continuous` Boolean (опиционально) - по умолчанию `true`. diff --git a/content/ru-RU/docs/api/web-contents.md b/content/ru-RU/docs/api/web-contents.md index caf107877df14..7ce6a88f321ca 100644 --- a/content/ru-RU/docs/api/web-contents.md +++ b/content/ru-RU/docs/api/web-contents.md @@ -39,6 +39,24 @@ console.log(webContents) Returns `WebContents` | undefined - A WebContents instance with the given ID, or `undefined` if there is no WebContents associated with the given ID. +### `webContents.fromDevToolsTargetId(targetId)` + +* `targetId` String - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance. + +Returns `WebContents` | undefined - A WebContents instance with the given TargetID, or `undefined` if there is no WebContents associated with the given TargetID. + +When communicating with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), it can be useful to lookup a WebContents instance based on its assigned TargetID. + +```js +async function lookupTargetId (browserWindow) { + const wc = browserWindow.webContents + await wc.debugger.attach('1.3') + const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo') + const { targetId } = targetInfo + const targetWebContents = await webContents.fromDevToolsTargetId(targetId) +} +``` + ## Класс: WebContents > Рендерит и управляет контент экземпляра BrowserWindow. @@ -134,7 +152,7 @@ Emitted when page receives favicon urls. * `frameName` String * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. * `options` BrowserWindowConstructorOptions - The options which will be used for creating the new [`BrowserWindow`](browser-window.md). -* `additionalFeatures` String[] - The non-standard features (features not handled by Chromium or Electron) given to `window.open()`. +* `additionalFeatures` String[] - The non-standard features (features not handled by Chromium or Electron) given to `window.open()`. Deprecated, and will now always be the empty array `[]`. * `referrer` [Referrer](structures/referrer.md) - The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. @@ -178,8 +196,7 @@ myBrowserWindow.webContents.on('new-window', (event, url, frameName, disposition * Объект `details` * `url` String - URL for the created window. * `frameName` String - Name given to the created window in the `window.open()` call. - * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: options inherited from the parent, parsed options from the `features` string from `window.open()`, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. - * `additionalFeatures` String[] - The non-standard features (features not handled Chromium or Electron) _Deprecated_ + * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. * `referrer` [Referrer](structures/referrer.md) - The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. @@ -320,6 +337,8 @@ win.webContents.on('will-prevent-unload', (event) => { }) ``` +**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the [specification](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). + #### Event: 'crashed' _Deprecated_ Возвращает: @@ -726,49 +745,6 @@ Emitted when the renderer process sends a synchronous message via `ipcRenderer.s Emitted when `desktopCapturer.getSources()` is called in the renderer process. Вызов `event.preventDefault()` вернет пустые источники. -#### Event: 'remote-require' _Deprecated_ - -Возвращает: - -* `event` IpcMainEvent -* `moduleName` String - -Emitted when `remote.require()` is called in the renderer process. Вызов `event.preventDefault()` предотвращает возврат модуля. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - -#### Event: 'remote-get-global' _Deprecated_ - -Возвращает: - -* `event` IpcMainEvent -* `globalName` String - -Emitted when `remote.getGlobal()` is called in the renderer process. Вызов `event.preventDefault()` предотвращает возврат глобального значения. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - -#### Event: 'remote-get-builtin' _Deprecated_ - -Возвращает: - -* `event` IpcMainEvent -* `moduleName` String - -Emitted when `remote.getBuiltin()` is called in the renderer process. Вызов `event.preventDefault()` предотвращает возврат модуля. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - -#### Event: 'remote-get-current-window' _Deprecated_ - -Возвращает: - -* `event` IpcMainEvent - -Emitted when `remote.getCurrentWindow()` is called in the renderer process. Вызов `event.preventDefault()` предотвращает возврат объекта. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - -#### Event: 'remote-get-current-web-contents' _Deprecated_ - -Возвращает: - -* `event` IpcMainEvent - -Emitted when `remote.getCurrentWebContents()` is called in the renderer process. Вызов `event.preventDefault()` предотвращает возврат объекта. Пользовательское значение может быть возвращено, если установить его в `event.returnValue`. - #### Event: 'preferred-size-changed' Возвращает: @@ -1040,7 +1016,7 @@ Ignore application menu shortcuts while this web contents is focused. Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window. Returning an unrecognized value such as a null, undefined, or an object without a recognized 'action' value will result in a console error and have the same effect as returning `{action: 'deny'}`. -Called before creating a window when `window.open()` is called from the renderer. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. +Called before creating a window a new window is requested by the renderer, e.g. by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or submitting a form with ``. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. #### `contents.setAudioMuted(muted)` diff --git a/content/ru-RU/docs/api/web-frame-main.md b/content/ru-RU/docs/api/web-frame-main.md index 8dcc3ee7991eb..cb9464414f370 100644 --- a/content/ru-RU/docs/api/web-frame-main.md +++ b/content/ru-RU/docs/api/web-frame-main.md @@ -154,3 +154,9 @@ An `Integer` representing the Chromium internal `pid` of the process which owns #### `frame.routingId` _Readonly_ An `Integer` representing the unique frame id in the current renderer process. Distinct `WebFrameMain` instances that refer to the same underlying frame will have the same `routingId`. + +#### `frame.visibilityState` _Только чтение_ + +A `string` representing the [visibility state](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) of the frame. + +See also how the [Page Visibility API](browser-window.md#page-visibility) is affected by other Electron APIs. diff --git a/content/ru-RU/docs/api/web-request.md b/content/ru-RU/docs/api/web-request.md index e17072671ad49..33d209b9d132c 100644 --- a/content/ru-RU/docs/api/web-request.md +++ b/content/ru-RU/docs/api/web-request.md @@ -46,7 +46,7 @@ session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback * `webContentsId` Integer (опционально) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `uploadData` [UploadData[]](structures/upload-data.md)
    @@ -88,7 +88,7 @@ Some examples of valid `urls`: * `webContentsId` Integer (опционально) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `requestHeaders` Record @@ -113,7 +113,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (опционально) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `requestHeaders` Record @@ -132,7 +132,7 @@ The `listener` will be called with `listener(details)` just before a request is * `webContentsId` Integer (опционально) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * Строка `statusLine` @@ -160,7 +160,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (опционально) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -182,7 +182,7 @@ The `listener` will be called with `listener(details)` when first byte of the re * `webContentsId` Integer (опционально) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `redirectURL` String @@ -206,7 +206,7 @@ The `listener` will be called with `listener(details)` when a server initiated r * `webContentsId` Integer (опционально) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -229,7 +229,7 @@ The `listener` will be called with `listener(details)` when a request is complet * `webContentsId` Integer (опционально) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `fromCache` Boolean diff --git a/content/ru-RU/docs/api/webview-tag.md b/content/ru-RU/docs/api/webview-tag.md index 7d9aa21028225..0efd8121d7966 100644 --- a/content/ru-RU/docs/api/webview-tag.md +++ b/content/ru-RU/docs/api/webview-tag.md @@ -94,14 +94,6 @@ A `Boolean`. When this attribute is present the guest page in `webview` will hav A `Boolean` for the experimental option for enabling NodeJS support in sub-frames such as iframes inside the `webview`. All your preloads will load for every iframe, you can use `process.isMainFrame` to determine if you are in the main frame or not. This option is disabled by default in the guest page. -### `enableremotemodule` - -```html - -``` - -A `Boolean`. When this attribute is `false` the guest page in `webview` will not have access to the [`remote`](remote.md) module. The remote module is unavailable by default. - ### `plugins` ```html @@ -737,6 +729,18 @@ It is also not emitted during in-page navigation, such as clicking anchor links Calling `event.preventDefault()` does __NOT__ have any effect. +### Event: 'did-start-navigation' + +Возвращает: + +* `url` String +* `isInPlace` Boolean +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitted when any frame (including main) starts navigating. `isInPlace` will be `true` for in-page navigations. + ### Событие: 'did-navigate' Возвращает: @@ -747,6 +751,21 @@ Emitted when a navigation is done. This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. +### Event: 'did-frame-navigate' + +Возвращает: + +* `url` String +* `httpResponseCode` Integer - -1 for non HTTP navigations +* `httpStatusText` String - empty for non HTTP navigations, +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitted when any frame navigation is done. + +This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. + ### Event: 'did-navigate-in-page' Возвращает: diff --git a/content/ru-RU/docs/api/window-open.md b/content/ru-RU/docs/api/window-open.md index d786751084cd8..d77a3775d7161 100644 --- a/content/ru-RU/docs/api/window-open.md +++ b/content/ru-RU/docs/api/window-open.md @@ -11,7 +11,7 @@ However, when the `sandbox` (or directly, `nativeWindowOpen`) option is set, a ` Electron pairs this native Chrome `Window` with a BrowserWindow under the hood. You can take advantage of all the customization available when creating a BrowserWindow in the main process by using `webContents.setWindowOpenHandler()` for renderer-created windows. -BrowserWindow constructor options are set by, in increasing precedence order: options inherited from the parent, parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. +BrowserWindow constructor options are set by, in increasing precedence order: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. ### `window.open(url[, frameName][, features])` @@ -36,7 +36,8 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn * Интеграция с Node будет всегда выключена в открытых `window` если она была выключена в родительском окне. * Изоляция контекста будет всегда включена в открытых `window` если она была включена в родительском окне. * JavaScript будет всегда включен в открытых `window` если он был включен в родительском окне. -* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `additionalFeatures` argument. +* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `options` argument. +* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters). To customize or cancel the creation of the window, you can optionally set an override handler with `webContents.setWindowOpenHandler()` from the main process. Returning `false` cancels the window, while returning an object sets the `BrowserWindowConstructorOptions` used when creating the window. Note that this is more powerful than passing options through the feature string, as the renderer has more limited privileges in deciding security preferences than the main process. @@ -56,7 +57,7 @@ mainWindow.webContents.setWindowOpenHandler(({ url }) => { mainWindow.webContents.on('did-create-window', (childWindow) => { // For example... - childWindow.webContents('will-navigate', (e) => { + childWindow.webContents.on('will-navigate', (e) => { e.preventDefault() }) }) diff --git a/content/ru-RU/docs/breaking-changes.md b/content/ru-RU/docs/breaking-changes.md index 287fadcc4f50d..75cee311fb56b 100644 --- a/content/ru-RU/docs/breaking-changes.md +++ b/content/ru-RU/docs/breaking-changes.md @@ -12,9 +12,29 @@ * **Устарело:** API был помечен как устаревший. API продолжит функционировать, но будет появляться предупреждающее сообщение о том, что API будет удален в будущем релизе. * **Удалено:** API или функция была удалена и больше не поддерживается Electron. +## Запланированные критические изменения API (15.0) + +### Default Changed: `nativeWindowOpen` defaults to `true` + +Prior to Electron 15, `window.open` was by default shimmed to use `BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work to open synchronously scriptable child windows, among other incompatibilities. `nativeWindowOpen: true` is no longer experimental, and is now the default. + +See the documentation for [window.open in Electron](api/window-open.md) for more details. + ## Запланированные критические изменения API (14.0) -### Изменения в API: `window.(open)` +### Удален: `app.allowRendererProcessReuse` + +The `app.allowRendererProcessReuse` property will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. + +Для подробностей см. [#18397](https://github.com/electron/electron/issues/18397). + +### Removed: Browser Window Affinity + +Параметр `affinity` при создании нового `BrowserWindow` будет удален в рамках нашего плана для более тесной связи с моделью процесса Chrome в целях безопасности, производительность и лучшей поддержки. + +Для подробностей см. [#18397](https://github.com/electron/electron/issues/18397). + +### Изменения в API: `window.open()` Необязательный параметр `frameName` больше не устанавливает название окна. Теперь это следует спецификации, описанной в [документации](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) в соответствии с параметром `windowName`. @@ -27,6 +47,44 @@ You will be affected by this change if you use either `webFrame.executeJavaScript` or `webFrame.executeJavaScriptInIsolatedWorld`. You will need to ensure that values returned by either of those methods are supported by the [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) as these methods use the same value passing semantics. +### Removed: BrowserWindowConstructorOptions inheriting from parent windows + +Prior to Electron 14, windows opened with `window.open` would inherit BrowserWindow constructor options such as `transparent` and `resizable` from their parent window. Beginning with Electron 14, this behavior is removed, and windows will not inherit any BrowserWindow constructor options from their parents. + +Instead, explicitly set options for the new window with `setWindowOpenHandler`: + +```js +webContents.setWindowOpenHandler((details) => { + return { + action: 'allow', + overrideBrowserWindowOptions: { + // ... + } + } +}) +``` + +### Удален: `additionalFeatures` + +The deprecated `additionalFeatures` property in the `new-window` and `did-create-window` events of WebContents has been removed. Since `new-window` uses positional arguments, the argument is still present, but will always be the empty array `[]`. (Though note, the `new-window` event itself is deprecated, and is replaced by `setWindowOpenHandler`.) Bare keys in window features will now present as keys with the value `true` in the options object. + +```js +// Removed in Electron 14 +// Triggered by window.open('...', '', 'my-key') +webContents.on('did-create-window', (window, details) => { + if (details.additionalFeatures.includes('my-key')) { + // ... + } +}) + +// Replace with +webContents.on('did-create-window', (window, details) => { + if (details.options['my-key']) { + // ... + } +}) +``` + ## Запланированные критические изменения API (13.0) ### Изменения в API: `session.setPermissionCheckHandler(handler)` @@ -285,12 +343,6 @@ See [#23265](https://github.com/electron/electron/pull/23265) for more details. Setting `{ compress: false }` in `crashReporter.start` is deprecated. Nearly all crash ingestion servers support gzip compression. This option will be removed in a future version of Electron. -### Removed: Browser Window Affinity - -Параметр `affinity` при создании нового `BrowserWindow` будет удален в рамках нашего плана для более тесной связи с моделью процесса Chrome в целях безопасности, производительность и лучшей поддержки. - -Для подробностей см. [#18397](https://github.com/electron/electron/issues/18397). - ### Изменение значения по-умолчанию: `enableRemoteModule` изменено на `false` In Electron 9, using the remote module without explicitly enabling it via the `enableRemoteModule` WebPreferences option began emitting a warning. In Electron 10, the remote module is now disabled by default. To use the remote module, `enableRemoteModule: true` must be specified in WebPreferences: diff --git a/content/ru-RU/docs/development/pull-requests.md b/content/ru-RU/docs/development/pull-requests.md index c83a772b3039d..9409cee531f2b 100644 --- a/content/ru-RU/docs/development/pull-requests.md +++ b/content/ru-RU/docs/development/pull-requests.md @@ -92,7 +92,6 @@ Common prefixes: * perf: A code change that improves performance * refactor: A code change that neither fixes a bug nor adds a feature * style: Changes that do not affect the meaning of the code (linting) -* vendor: Bumping a dependency like libchromiumcontent or node Other things to keep in mind when writing a commit message: diff --git a/content/ru-RU/docs/development/source-code-directory-structure.md b/content/ru-RU/docs/development/source-code-directory-structure.md index bc86cd9cd0d2a..dc4335e530cfe 100644 --- a/content/ru-RU/docs/development/source-code-directory-structure.md +++ b/content/ru-RU/docs/development/source-code-directory-structure.md @@ -79,7 +79,6 @@ Electron * **.circleci** - Config file for CI with CircleCI. * **.github** - GitHub-specific config files including issues templates and CODEOWNERS. * **dist** - Temporary directory created by `script/create-dist.py` script when creating a distribution. -* **external_binaries** - Downloaded binaries of third-party frameworks which do not support building with `gn`. * **node_modules** - Third party node modules used for building. * **npm** - Logic for installation of Electron via npm. * **out** - Temporary output directory of `ninja`. @@ -95,4 +94,3 @@ script/ - The set of all scripts Electron runs for a variety of purposes. ``` * **typings** - TypeScript typings for Electron's internal code. -* **vendor** - Source code for some third party dependencies. diff --git a/content/ru-RU/docs/tutorial/application-debugging.md b/content/ru-RU/docs/tutorial/application-debugging.md index 66a6cf23db012..eb683c601e44a 100644 --- a/content/ru-RU/docs/tutorial/application-debugging.md +++ b/content/ru-RU/docs/tutorial/application-debugging.md @@ -29,7 +29,7 @@ If the V8 context crashes, the DevTools will display this message. Chromium logs can be enabled via the `ELECTRON_ENABLE_LOGGING` environment variable. Для получения дополнительной информации обратитесь к [документации по переменным окружения](../api/environment-variables.md#electron_enable_logging). -Alternatively, the command line argument `--enable-logging` can be passed. Дополнительная информация доступна в [switches документации командной строки](../api/command-line-switches.md#--enable-logging). +Alternatively, the command line argument `--enable-logging` can be passed. Дополнительная информация доступна в [switches документации командной строки](../api/command-line-switches.md#--enable-loggingfile). [node-inspect]: https://nodejs.org/en/docs/inspector/ [devtools]: https://developer.chrome.com/devtools diff --git a/content/ru-RU/docs/tutorial/code-signing.md b/content/ru-RU/docs/tutorial/code-signing.md index 9a5b57e696388..23f78959822a0 100644 --- a/content/ru-RU/docs/tutorial/code-signing.md +++ b/content/ru-RU/docs/tutorial/code-signing.md @@ -8,8 +8,8 @@ On Windows, the system assigns a trust level to your code signing certificate wh Можно распространять неподписанные приложения, но не рекомендуется. Both Windows and macOS will, by default, prevent either the download or the execution of unsigned applications. Starting with macOS Catalina (version 10.15), users have to go through multiple manual steps to open unsigned applications. -![macOS Catalina Gatekeeper warning: The app cannot be opened because the -developer cannot be verified](../images/gatekeeper.png) +![предупреждение macOS Catalina Gatekeeper: Не удается открыть приложение, так как +разработчик не может быть проверен](../images/gatekeeper.png) As you can see, users get two options: Move the app straight to the trash or cancel running it. You don't want your users to see that dialog. @@ -103,7 +103,7 @@ Electron Builder comes with a custom solution for signing your application. You If you're not using an integrated build pipeline like Forge or Builder, you are likely using [`electron-packager`][], which includes [`electron-osx-sign`][] and [`electron-notarize`][]. -If you're using Packager's API, you can pass [in configuration that both signs and notarizes your application](https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html). +If you're using Packager's API, you can pass [in configuration that both signs and notarizes your application](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html). ```js const packager = require('electron-packager') @@ -149,14 +149,13 @@ See the [Mac App Store Guide][]. Перед подписью, следует: -1. Get a Windows Authenticode code signing certificate (requires an annual fee) -2. Install Visual Studio to get the signing utility (the free [Community Edition](https://visualstudio.microsoft.com/vs/community/) is enough) +1. Получить сертификат для подписания кода аутентификации Windows (требуется ежегодная плата) +2. Установите Visual Studio для получения утилиты подписи (бесплатной версия [ Community Edition](https://visualstudio.microsoft.com/vs/community/) достаточно) -You can get a code signing certificate from a lot of resellers. Prices vary, so it may be worth your time to shop around. Popular resellers include: +Вы можете получить сертификат от множества продавцов, включая самых популярных. Цены варьируются, поэтому это может стоить вашего времени, чтобы ходить по магазинам. Популярные реселлеры включают: * [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm) * [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing) -* [GoDaddy](https://au.godaddy.com/web-security/code-signing-certificate) * Amongst others, please shop around to find one that suits your needs, Google is your friend 😄 Существует ряд инструментов для подписывания приложений: @@ -167,7 +166,7 @@ You can get a code signing certificate from a lot of resellers. Prices vary, so ## Windows Store -See the [Windows Store Guide][]. +Смотри страницу [Windows Store Guide][]. [Apple Developer Program]: https://developer.apple.com/programs/ [`electron-builder`]: https://github.com/electron-userland/electron-builder diff --git a/content/ru-RU/docs/tutorial/dark-mode.md b/content/ru-RU/docs/tutorial/dark-mode.md index a2be9bc502ee4..f5830712db025 100644 --- a/content/ru-RU/docs/tutorial/dark-mode.md +++ b/content/ru-RU/docs/tutorial/dark-mode.md @@ -56,9 +56,9 @@ Starting with the `index.html` file: ``` -And the `style.css` file: +И файл `styles.css`: -```css title='style.css' +```css title='styles.css' @media (prefers-color-scheme: dark) { body { background: #333; color: white; } } @@ -160,6 +160,6 @@ Run the example using Electron Fiddle and then click the "Toggle Dark Mode" butt [system-wide-dark-mode]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/ [electron-forge]: https://www.electronforge.io/ [electron-packager]: https://github.com/electron/electron-packager -[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport +[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#darwindarkmodesupport [prefers-color-scheme]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme [event-listeners]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener diff --git a/content/ru-RU/docs/tutorial/in-app-purchases.md b/content/ru-RU/docs/tutorial/in-app-purchases.md index ced03de89ba09..38a8ddd8e8f4a 100644 --- a/content/ru-RU/docs/tutorial/in-app-purchases.md +++ b/content/ru-RU/docs/tutorial/in-app-purchases.md @@ -1,4 +1,4 @@ -# Встроенные покупки (macOS) +# In-App Purchases (macOS) ## Подготовка diff --git a/content/ru-RU/docs/tutorial/installation.md b/content/ru-RU/docs/tutorial/installation.md index 7fb7bbf44b317..a97b93b972b22 100644 --- a/content/ru-RU/docs/tutorial/installation.md +++ b/content/ru-RU/docs/tutorial/installation.md @@ -1,4 +1,4 @@ -# Установка +# Advanced Installation Instructions To install prebuilt Electron binaries, use [`npm`][npm]. The preferred method is to install Electron as a development dependency in your app: diff --git a/content/ru-RU/docs/tutorial/launch-app-from-url-in-another-app.md b/content/ru-RU/docs/tutorial/launch-app-from-url-in-another-app.md index 1eb1bd3a8cfe1..2ac8edfe2fc1a 100644 --- a/content/ru-RU/docs/tutorial/launch-app-from-url-in-another-app.md +++ b/content/ru-RU/docs/tutorial/launch-app-from-url-in-another-app.md @@ -1,5 +1,5 @@ --- -title: launch-app-from-URL-in-another-app +title: Launching Your Electron App From A URL In Another App description: This guide will take you through the process of setting your electron app as the default handler for a specific protocol. slug: launch-app-from-url-in-another-app hide_title: true @@ -123,31 +123,25 @@ This feature will only work on macOS when your app is packaged. It will not work ### Plist ```XML -

    -

    macOS plist
    -
    
    -    
    -        
    -            
    -                
    -                    CFBundleURLTypes
    -                    
    -                        
    -                            CFBundleURLSchemes
    -                            
    -                                electron-api-demos
    -                            
    -                            CFBundleURLName
    -                            Electron API Demos Protocol
    -                        
    -                    
    -                    ElectronTeamID
    -                    VEKTX9H2N7
    -                
    -            
    -        
    -    
    -

    + + + + + CFBundleURLTypes + + + CFBundleURLSchemes + + electron-api-demos + + CFBundleURLName + Electron API Demos Protocol + + + ElectronTeamID + VEKTX9H2N7 + + ``` ## Conclusion diff --git a/content/ru-RU/docs/tutorial/linux-desktop-actions.md b/content/ru-RU/docs/tutorial/linux-desktop-actions.md index 1d256176307f3..1144f0c038896 100644 --- a/content/ru-RU/docs/tutorial/linux-desktop-actions.md +++ b/content/ru-RU/docs/tutorial/linux-desktop-actions.md @@ -1,4 +1,4 @@ -# Custom Linux Desktop Launcher Actions +# Desktop Launcher Actions (Linux) ## Обзор diff --git a/content/ru-RU/docs/tutorial/macos-dock.md b/content/ru-RU/docs/tutorial/macos-dock.md index 585c89cc4d2f2..a498baec0a251 100644 --- a/content/ru-RU/docs/tutorial/macos-dock.md +++ b/content/ru-RU/docs/tutorial/macos-dock.md @@ -1,4 +1,4 @@ -# Configuring the macOS Dock +# Dock (macOS) Electron has APIs to configure the app's icon in the macOS Dock. A macOS-only API exists to create a custom dock menu, but Electron also uses the app dock icon as the entry point for cross-platform features like [recent documents][recent-documents] and [application progress][progress-bar]. diff --git a/content/ru-RU/docs/tutorial/notifications.md b/content/ru-RU/docs/tutorial/notifications.md index efee974746888..937ce739ebaf5 100644 --- a/content/ru-RU/docs/tutorial/notifications.md +++ b/content/ru-RU/docs/tutorial/notifications.md @@ -1,4 +1,4 @@ -# Уведомления (Window, Linux, macOS) +# Notification (Оповещения) ## Обзор diff --git a/content/ru-RU/docs/tutorial/progress-bar.md b/content/ru-RU/docs/tutorial/progress-bar.md index c630b082d4b8b..babd38219db99 100644 --- a/content/ru-RU/docs/tutorial/progress-bar.md +++ b/content/ru-RU/docs/tutorial/progress-bar.md @@ -1,4 +1,4 @@ -# Индикатор прогресса в меню задач (Windows, macOS, Unity) +# Taskbar Progress Bar (Windows & macOS) ## Обзор diff --git a/content/ru-RU/docs/tutorial/represented-file.md b/content/ru-RU/docs/tutorial/represented-file.md index 13d32ecfd781d..6d362b1823f06 100644 --- a/content/ru-RU/docs/tutorial/represented-file.md +++ b/content/ru-RU/docs/tutorial/represented-file.md @@ -1,4 +1,4 @@ -# Представленный файл для macOS BrowserWindows +# Representing Files in a BrowserWindow (macOS) ## Обзор diff --git a/content/ru-RU/docs/tutorial/security.md b/content/ru-RU/docs/tutorial/security.md index c57ea4d1b8755..b15d5d1b3c192 100644 --- a/content/ru-RU/docs/tutorial/security.md +++ b/content/ru-RU/docs/tutorial/security.md @@ -18,7 +18,7 @@ Electron keeps up to date with alternating Chromium releases. For more informati Важно помнить, что безопасность вашего Electron приложения является результатом общей безопасности основы платформы (*Chromium*, *Node.js*), самого Electron, всех NPM-зависимостей и вашего кода. Поэтому вы обязаны следовать нескольким важным рекомендациям: -* **Keep your application up-to-date with the latest Electron framework release.** When releasing your product, you’re also shipping a bundle composed of Electron, Chromium shared library and Node.js. Vulnerabilities affecting these components may impact the security of your application. By updating Electron to the latest version, you ensure that critical vulnerabilities (such as *nodeIntegration bypasses*) are already patched and cannot be exploited in your application. For more information, see "[Use a current version of Electron](#15-use-a-current-version-of-electron)". +* **Keep your application up-to-date with the latest Electron framework release.** When releasing your product, you’re also shipping a bundle composed of Electron, Chromium shared library and Node.js. Vulnerabilities affecting these components may impact the security of your application. By updating Electron to the latest version, you ensure that critical vulnerabilities (such as *nodeIntegration bypasses*) are already patched and cannot be exploited in your application. For more information, see "[Use a current version of Electron](#16-use-a-current-version-of-electron)". * **Оцените свои зависимости.** В то время как NPM предоставляет полмиллиона многоразовых пакетов, вы несете ответственность за выбор надежных библиотек третьей стороны. If you use outdated libraries affected by known vulnerabilities or rely on poorly maintained code, your application security could be in jeopardy. @@ -43,18 +43,19 @@ You should at least follow these steps to improve the security of your applicati 1. [Загружайте только безопасный контент](#1-only-load-secure-content) 2. [Выключите Node.js интеграцию во всех видах (renderers) показывающих удаленный контент](#2-do-not-enable-nodejs-integration-for-remote-content) 3. [Включите контекстную изоляцию для всех видов (renders) с удаленным контентом](#3-enable-context-isolation-for-remote-content) -4. [Используйте `ses.setPermissionRequestHandler()` в сессиях с загрузкой удаленного контента](#4-handle-session-permission-requests-from-remote-content) -5. [Не выключайте `webSecurity`](#5-do-not-disable-websecurity) -6. [Определите `Content-Security-Policy`](#6-define-a-content-security-policy) и используйте ограничительные правила (i.e. `script-src 'self'`) -7. [Не устанавливайте `allowRunningInsecureContent` в `true`](#7-do-not-set-allowrunninginsecurecontent-to-true) -8. [Не включайте экспериментальные функции](#8-do-not-enable-experimental-features) -9. [Не испольхуйте `enableBlinkFeatures`](#9-do-not-use-enableblinkfeatures) -10. [``: Do not use `allowpopups`](#10-do-not-use-allowpopups) -11. [``: Verify options and params](#11-verify-webview-options-before-creation) -12. [Disable or limit navigation](#12-disable-or-limit-navigation) -13. [Disable or limit creation of new windows](#13-disable-or-limit-creation-of-new-windows) -14. [Do not use `openExternal` with untrusted content](#14-do-not-use-openexternal-with-untrusted-content) -15. [Use a current version of Electron](#15-use-a-current-version-of-electron) +4. [Enable sandboxing](#4-enable-sandboxing) +5. [Используйте `ses.setPermissionRequestHandler()` в сессиях с загрузкой удаленного контента](#5-handle-session-permission-requests-from-remote-content) +6. [Не выключайте `webSecurity`](#6-do-not-disable-websecurity) +7. [Определите `Content-Security-Policy`](#7-define-a-content-security-policy) и используйте ограничительные правила (i.e. `script-src 'self'`) +8. [Не устанавливайте `allowRunningInsecureContent` в `true`](#8-do-not-set-allowrunninginsecurecontent-to-true) +9. [Не включайте экспериментальные функции](#9-do-not-enable-experimental-features) +10. [Не испольхуйте `enableBlinkFeatures`](#10-do-not-use-enableblinkfeatures) +11. [``: Do not use `allowpopups`](#11-do-not-use-allowpopups) +12. [``: Verify options and params](#12-verify-webview-options-before-creation) +13. [Disable or limit navigation](#13-disable-or-limit-navigation) +14. [Disable or limit creation of new windows](#14-disable-or-limit-creation-of-new-windows) +15. [Do not use `openExternal` with untrusted content](#15-do-not-use-openexternal-with-untrusted-content) +16. [Use a current version of Electron](#16-use-a-current-version-of-electron) To automate the detection of misconfigurations and insecure patterns, it is possible to use [electronegativity](https://github.com/doyensec/electronegativity). For additional details on potential weaknesses and implementation bugs when developing applications using Electron, please refer to this [guide for developers and auditors](https://doyensec.com/resources/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf) @@ -158,7 +159,23 @@ Even when `nodeIntegration: false` is used, to truly enforce strong isolation an For more information on what `contextIsolation` is and how to enable it please see our dedicated [Context Isolation](context-isolation.md) document. -## 4) Handle Session Permission Requests From Remote Content +## 4) Enable Sandboxing + +[Sandboxing](sandbox.md) is a Chromium feature that uses the operating system to significantly limit what renderer processes have access to. You should enable the sandbox in all renderers. Loading, reading or processing any untrusted content in an unsandboxed process, including the main process, is not advised. + +### Как? + +When creating a window, pass the `sandbox: true` option in `webPreferences`: + +```js +const win = new BrowserWindow({ + webPreferences: { + sandbox: true + } +}) +``` + +## 5) Handle Session Permission Requests From Remote Content You may have seen permission requests while using Chrome: They pop up whenever the website attempts to use a feature that the user has to manually approve ( like notifications). @@ -191,7 +208,7 @@ session }) ``` -## 5) Do Not Disable WebSecurity +## 6) Do Not Disable WebSecurity _Recommendation is Electron's default_ @@ -227,7 +244,7 @@ const mainWindow = new BrowserWindow() ``` -## 6) Define a Content Security Policy +## 7) Define a Content Security Policy A Content Security Policy (CSP) is an additional layer of protection against cross-site-scripting attacks and data injection attacks. We recommend that they be enabled by any website you load inside Electron. @@ -270,7 +287,7 @@ CSP's preferred delivery mechanism is an HTTP header, however it is not possible ``` -## 7) Do Not Set `allowRunningInsecureContent` to `true` +## 8) Do Not Set `allowRunningInsecureContent` to `true` _Recommendation is Electron's default_ @@ -298,7 +315,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 8) Do Not Enable Experimental Features +## 9) Do Not Enable Experimental Features _Recommendation is Electron's default_ @@ -326,7 +343,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({}) ``` -## 9) Do Not Use `enableBlinkFeatures` +## 10) Do Not Use `enableBlinkFeatures` _Recommendation is Electron's default_ @@ -352,7 +369,7 @@ const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow() ``` -## 10) Do Not Use `allowpopups` +## 11) Do Not Use `allowpopups` _Recommendation is Electron's default_ @@ -372,7 +389,7 @@ If you do not need popups, you are better off not allowing the creation of new [ ``` -## 11) Verify WebView Options Before Creation +## 12) Verify WebView Options Before Creation A WebView created in a renderer process that does not have Node.js integration enabled will not be able to enable integration itself. However, a WebView will always create an independent renderer process with its own `webPreferences`. @@ -408,7 +425,7 @@ app.on('web-contents-created', (event, contents) => { Again, this list merely minimizes the risk, it does not remove it. If your goal is to display a website, a browser will be a more secure option. -## 12) Disable or limit navigation +## 13) Disable or limit navigation If your app has no need to navigate or only needs to navigate to known pages, it is a good idea to limit navigation outright to that known scope, disallowing any other kinds of navigation. @@ -438,7 +455,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 13) Disable or limit creation of new windows +## 14) Disable or limit creation of new windows If you have a known set of windows, it's a good idea to limit the creation of additional windows in your app. @@ -473,7 +490,7 @@ app.on('web-contents-created', (event, contents) => { }) ``` -## 14) Do not use `openExternal` with untrusted content +## 15) Do not use `openExternal` with untrusted content Shell's [`openExternal`][open-external] allows opening a given protocol URI with the desktop's native utilities. On macOS, for instance, this function is similar to the `open` terminal command utility and will open the specific application based on the URI and filetype association. @@ -495,7 +512,7 @@ const { shell } = require('electron') shell.openExternal('https://example.com/index.html') ``` -## 15) Use a current version of Electron +## 16) Use a current version of Electron You should strive for always using the latest available version of Electron. Whenever a new major version is released, you should attempt to update your app as quickly as possible. diff --git a/content/ru-RU/docs/tutorial/snapcraft.md b/content/ru-RU/docs/tutorial/snapcraft.md index 1119f250d1b54..1cf12282c1e22 100644 --- a/content/ru-RU/docs/tutorial/snapcraft.md +++ b/content/ru-RU/docs/tutorial/snapcraft.md @@ -1,4 +1,4 @@ -# Snapcraft Guide (Ubuntu Software Center & More) +# Snapcraft Guide (Linux) This guide provides information on how to package your Electron application for any Snapcraft environment, including the Ubuntu Software Center. diff --git a/content/ru-RU/docs/tutorial/support.md b/content/ru-RU/docs/tutorial/support.md index 48c2f0dd817db..56dbad50524d7 100644 --- a/content/ru-RU/docs/tutorial/support.md +++ b/content/ru-RU/docs/tutorial/support.md @@ -41,9 +41,9 @@ When an API is changed or removed in a way that breaks existing functionality, t ### Currently supported versions +* 14.x.y * 13.x.y * 12.x.y -* 11.x.y ### End-of-life diff --git a/content/ru-RU/docs/tutorial/updates.md b/content/ru-RU/docs/tutorial/updates.md index 5ee622c7f4b5d..ccfa665dd9384 100644 --- a/content/ru-RU/docs/tutorial/updates.md +++ b/content/ru-RU/docs/tutorial/updates.md @@ -35,14 +35,14 @@ If you're developing a private Electron application, or if you're not publishing Depending on your needs, you can choose from one of these: -- [Hazel][hazel] – Update server for private or open-source apps which can be deployed for free on [Now][now]. It pulls from [GitHub Releases][gh-releases] and leverages the power of GitHub's CDN. +- [Hazel][hazel] – сервер обновлений для частных приложений или приложений с открытым исходным кодом, которые можно бесплатно развернуть на [Vercel][vercel]. It pulls from [GitHub Releases][gh-releases] and leverages the power of GitHub's CDN. - [Nuts][nuts] – Also uses [GitHub Releases][gh-releases], but caches app updates on disk and supports private repositories. - [electron-release-server][electron-release-server] – Provides a dashboard for handling releases and does not require releases to originate on GitHub. - [Nucleus][nucleus] – A complete update server for Electron apps maintained by Atlassian. Supports multiple applications and channels; uses a static file store to minify server cost. ## Внедрение обновлений в Ваше приложение -Once you've deployed your update server, continue with importing the required modules in your code. The following code might vary for different server software, but it works like described when using [Hazel](https://github.com/zeit/hazel). +Once you've deployed your update server, continue with importing the required modules in your code. The following code might vary for different server software, but it works like described when using [Hazel][hazel]. **Important:** Please ensure that the code below will only be executed in your packaged app, and not in development. You can use [electron-is-dev](https://github.com/sindresorhus/electron-is-dev) to check for the environment. @@ -102,8 +102,8 @@ autoUpdater.on('error', message => { Because the requests made by Auto Update aren't under your direct control, you may find situations that are difficult to handle (such as if the update server is behind authentication). The `url` field does support files, which means that with some effort, you can sidestep the server-communication aspect of the process. [Here's an example of how this could work](https://github.com/electron/electron/issues/5020#issuecomment-477636990). -[now]: https://zeit.co/now -[hazel]: https://github.com/zeit/hazel +[vercel]: https://vercel.com +[hazel]: https://github.com/vercel/hazel [nuts]: https://github.com/GitbookIO/nuts [gh-releases]: https://help.github.com/articles/creating-releases/ [electron-release-server]: https://github.com/ArekSredzki/electron-release-server diff --git a/content/ru-RU/docs/tutorial/using-native-node-modules.md b/content/ru-RU/docs/tutorial/using-native-node-modules.md index f72c84fc9875d..0a546ae84f8a6 100644 --- a/content/ru-RU/docs/tutorial/using-native-node-modules.md +++ b/content/ru-RU/docs/tutorial/using-native-node-modules.md @@ -1,4 +1,4 @@ -# Использование модулей узлов +# Native Node Modules Native Node.js modules are supported by Electron, but since Electron has a different [application binary interface (ABI)][abi] from a given Node.js binary (due to differences such as using Chromium's BoringSSL instead of OpenSSL), the native modules you use will need to be recompiled for Electron. Иначе, при запуске приложения вы получите следующий класс ошибок: @@ -74,7 +74,7 @@ HOME=~/.electron-gyp node-gyp rebuild --target=1.2.3 --arch=x64 --dist-url=https To compile native Node modules against a custom build of Electron that doesn't match a public release, instruct `npm` to use the version of Node you have bundled with your custom build. ```sh -npm rebuild --nodedir=/path/to/electron/vendor/node +npm rebuild --nodedir=/path/to/src/out/Default/gen/node_headers ``` ## Устранение проблем diff --git a/content/ru-RU/docs/tutorial/using-pepper-flash-plugin.md b/content/ru-RU/docs/tutorial/using-pepper-flash-plugin.md index 488913ab4b263..f09a9f2d2fdaa 100644 --- a/content/ru-RU/docs/tutorial/using-pepper-flash-plugin.md +++ b/content/ru-RU/docs/tutorial/using-pepper-flash-plugin.md @@ -1,4 +1,4 @@ -# Использование плагина Pepper Flash +# Pepper Flash Plugin Electron no longer supports the Pepper Flash plugin, as Chrome has removed support. diff --git a/content/ru-RU/docs/tutorial/using-selenium-and-webdriver.md b/content/ru-RU/docs/tutorial/using-selenium-and-webdriver.md index f1cf852fe6bdf..d23d2bc848447 100644 --- a/content/ru-RU/docs/tutorial/using-selenium-and-webdriver.md +++ b/content/ru-RU/docs/tutorial/using-selenium-and-webdriver.md @@ -1,4 +1,4 @@ -# Использование Selenium и WebDriver +# Selenium and WebDriver От [ChromeDriver - WebDriver для Chrome][chrome-driver]: diff --git a/content/ru-RU/docs/tutorial/web-embeds.md b/content/ru-RU/docs/tutorial/web-embeds.md index c812b629c1d03..0da7e1fb3bb76 100644 --- a/content/ru-RU/docs/tutorial/web-embeds.md +++ b/content/ru-RU/docs/tutorial/web-embeds.md @@ -1,4 +1,4 @@ -# Web embeds +# Web Embeds ## Обзор diff --git a/content/ru-RU/docs/tutorial/windows-arm.md b/content/ru-RU/docs/tutorial/windows-arm.md index eb16cd4fd7b02..7269e99e99df0 100644 --- a/content/ru-RU/docs/tutorial/windows-arm.md +++ b/content/ru-RU/docs/tutorial/windows-arm.md @@ -1,4 +1,4 @@ -# Windows 10 on Arm +# Windows on ARM If your app runs with Electron 6.0.8 or later, you can now build it for Windows 10 on Arm. This considerably improves performance, but requires recompilation of any native modules used in your app. It may also require small fixups to your build and packaging scripts. diff --git a/content/ru-RU/docs/tutorial/windows-taskbar.md b/content/ru-RU/docs/tutorial/windows-taskbar.md index 7be0ce5bfb0ce..9627d42a58d13 100644 --- a/content/ru-RU/docs/tutorial/windows-taskbar.md +++ b/content/ru-RU/docs/tutorial/windows-taskbar.md @@ -1,4 +1,4 @@ -# Панель задач Windows +# Taskbar Customization (Windows) ## Обзор diff --git a/content/ru-RU/website/blog/webview2.md b/content/ru-RU/website/blog/webview2.md new file mode 100644 index 0000000000000..be4ffc67fbe25 --- /dev/null +++ b/content/ru-RU/website/blog/webview2.md @@ -0,0 +1,81 @@ +--- +title: WebView2 и Electron +author: + - electron +date: '2021-07-22' +--- + +За последние недели мы получили несколько вопросов о различиях между новыми [WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) и Electron. + +Обе команды поставили перед собой цель сделать веб-технологии максимально эффективными для настольных компьютеров, и обсуждается совместное всеобъемлющее сравнение. + +Electron и WebView2это динамичные и постоянно развивающиеся проекты. Мы собрали краткий снимок сходства и различий между Electron и WebView2 в том виде, в каком они существуют сегодня. + +--- + +## Обзор архитектуры + +Electron, и WebView2 основаны на исходном коде Chromium для рендеринга веб-контента. Строго говоря, WebView2 построен из исходного кода Edge, но Edge построен с использованием ветки исходного кода Chromium. Electron не использует библиотеки DLL совместно с Chrome. Двоичные файлы WebView2 жестко связаны с Edge (стабильный канал с Edge 90), поэтому они совместно используют диск и некоторый рабочий набор. См. [Evergreen distribution mode](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#evergreen-distribution-mode) для получения дополнительной информации. + +Приложения Electron всегда комплектуют и распространяют точную версию Electron, с которой они были разработаны. WebView2 имеет два варианта распространения. Можно объединить именно ту библиотеку WebView2, с которой было разработано приложение, или использовать версию общей среды выполнения, которая уже может присутствовать в системе. WebView2 предоставляет инструменты для каждого подхода, включая установщик начальной загрузки на случай, если общая среда выполнения отсутствует. WebView2 поставляется _папке «Входящие»_ начиная с Windows 11. + +Applications that bundle their frameworks are responsible for updating those frameworks, including minor security releases. For apps using the shared WebView2 runtime, WebView2 has its own updater, similar to Chrome or Edge, that runs independent of your application. Updating the application's code or any of its other dependencies is still a responsibility for the developer, same as with Electron. Neither Electron nor WebView2 is managed by Windows Update. + +Both Electron and WebView2 inherit Chromium’s multi-process architecture - namely, a single main process that communicates with one-or-more renderer processes. These processes are entirely separate from other applications running on the system. Every Electron application is a separate process tree, containing a root browser-process, some utility processes, and zero or more render processes. WebView2 apps that use the same [user data folder](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder) (like a suite of apps would do), share non-renderer processes. WebView2 apps using different data folders do not share processes. + +* ElectronJS Process Model: + + ![ElectronJS Process Model Diagram](/images/Electron-Architecture.png) +* WebView2 Based Application Process Model: + + ![WebView2 Process Model Diagram](/images/WebView2-Architecture.png) + +Read more about [WebView2’s process model](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/process-model) and [Electron’s process model](https://www.electronjs.org/docs/tutorial/process-model) here. + +Electron provides APIs for common desktop application needs such as menus, file system access, notifications, and more. WebView2 is a component meant to be integrated into an application framework such as WinForms, WPF, WinUI, or Win32. WebView2 does not provide operating system APIs outside the web standard via JavaScript. + +Node.js is integrated into Electron. Electron applications may use any Node.js API, module, or node-native-addon from the renderer and main processes. A WebView2 application does not assume which language or framework the rest of your application is written in. Your JavaScript code must proxy any operating system access through the application-host process. + +Electron strives to maintain compatibility with the web API, including APIs developed from the [Fugu Project](https://fugu-tracker.web.app/). We have a [snapshot of Electron’s Fugu API compatibility](https://docs.google.com/spreadsheets/d/1APQalp8HCa-lXVOqyul369G-wjM2RcojMujgi67YaoE/edit?usp=sharing). WebView2 maintains a similar list of [API differences from Edge](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/browser-features). + +Electron has a configurable security model for web content, from full-access to full-sandbox. WebView2 content is always sandboxed. Electron has [comprehensive security documentation](https://www.electronjs.org/docs/tutorial/security) on choosing your security model. WebView2 also has [security best practices](https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/security). + +The Electron source is maintained and available on GitHub. Applications can modify can build their own _brands_ of Electron. The WebView2 source is not available on GitHub. + +Quick Summary: + +| | Electron | WebView2 | +| ----------------------------------- | ---------------:| -----------------------:| +| Build Dependency | Chromium | Edge | +| Source Available on GitHub | Yes | No | +| Shares Edge/Chrome DLLs | No | Yes (as of Edge 90) | +| Shared Runtime Between Applications | No | Optional | +| Application APIs | Yes | No | +| Node.js | Yes | No | +| Песочница | Optional | Always | +| Requires an Application Framework | No | Yes | +| Поддерживаемые платформы | Mac, Win, Linux | Win (Mac/Linux planned) | +| Process Sharing Between Apps | Never | Optional | +| Framework Updates Managed By | Application | WebView2 | + +## Performance Discussion + +When it comes to rendering your web content, we expect little performance difference between Electron, WebView2, and any other Chromium-based renderer. We created [scaffolding for apps built using Electron, C++ + WebView2, and C# + WebView2](https://github.com/crossplatform-dev/xplat-challenges) for those interested to investigate potential performance differences. + +There are a few differences that come into play _outside_ of rendering web content, and folks from Electron, WebView2, Edge, and others have expressed interest in working on a detailed comparison including PWAs. + +### Inter-Process Communication (IPC) + +_There is one difference we want to highlight immediately, as we believe it is often a performance consideration in Electron apps._ + +In Chromium, the browser process acts as an IPC broker between sandboxed renderers and the rest of the system. While Electron allows unsandboxed render processes, many apps choose to enable the sandbox for added security. WebView2 always has the sandbox enabled, so for most Electron and WebView2 apps IPC can impact overall performance. + +Even though Electron and WebView2 have a similar process models, the underlying IPC differs. Communicating between JavaScript and C++ or C# requires [marshalling](https://en.wikipedia.org/wiki/Marshalling_(computer_science)), most commonly to a JSON string. JSON serialization/parsing is an expensive operation, and IPC-bottlenecks can negatively impact performance. Starting with Edge 93, WV2 will use [CBOR](https://en.wikipedia.org/wiki/CBOR) for network events. + +Electron supports direct IPC between any two processes via the [MessagePorts](https://www.electronjs.org/docs/latest/tutorial/message-ports) API, which utilize [the structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). Applications which leverage this can avoid paying the JSON-serialization tax when sending objects between processes. + +## Summary + +Electron and WebView2 have a number of differences, but don't expect much difference with respect to how they perform rendering web content. Ultimately, an app’s architecture and JavaScript libraries/frameworks have a larger impact on memory and performance than anything else because _Chromium is Chromium_ regardless of where it is running. + +Special thanks to the WebView2 team for reviewing this post, and ensuring we have an up-to-date view of the WebView2 architecture. They welcome any [feedback on the project](https://github.com/MicrosoftEdge/WebView2Feedback). diff --git a/content/ru-RU/website/i18n/code.json b/content/ru-RU/website/i18n/code.json index 8291b10512852..6cb97aafe337b 100644 --- a/content/ru-RU/website/i18n/code.json +++ b/content/ru-RU/website/i18n/code.json @@ -51,14 +51,14 @@ "message": "Older Post", "description": "The blog post button label to navigate to the older/next post" }, - "theme.blog.sidebar.navAriaLabel": { - "message": "Blog recent posts navigation", - "description": "The ARIA label for recent posts in the blog sidebar" - }, "theme.tags.tagsPageTitle": { "message": "Tags", "description": "The title of the tag list page" }, + "theme.blog.sidebar.navAriaLabel": { + "message": "Blog recent posts navigation", + "description": "The ARIA label for recent posts in the blog sidebar" + }, "theme.blog.post.plurals": { "message": "One post|{count} posts", "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" @@ -76,11 +76,11 @@ "description": "The ARIA label for copy code blocks button" }, "theme.CodeBlock.copied": { - "message": "Copied", + "message": "Скопировано", "description": "The copied button label on code blocks" }, "theme.CodeBlock.copy": { - "message": "Copy", + "message": "Копировать", "description": "The copy button label on code blocks" }, "theme.docs.sidebar.expandButtonTitle": { @@ -96,11 +96,11 @@ "description": "The ARIA label for the docs pagination" }, "theme.docs.paginator.previous": { - "message": "Previous", + "message": "Назад", "description": "The label used to navigate to the previous doc" }, "theme.docs.paginator.next": { - "message": "Next", + "message": "Далее", "description": "The label used to navigate to the next doc" }, "theme.docs.sidebar.collapseButtonTitle": { @@ -111,18 +111,6 @@ "message": "Collapse sidebar", "description": "The title attribute for collapse button of doc sidebar" }, - "theme.docs.sidebar.responsiveCloseButtonLabel": { - "message": "Close menu", - "description": "The ARIA label for close button of mobile doc sidebar" - }, - "theme.docs.sidebar.responsiveOpenButtonLabel": { - "message": "Open menu", - "description": "The ARIA label for open button of mobile doc sidebar" - }, - "theme.docs.sidebar.navAriaLabel": { - "message": "Sidebar navigation", - "description": "The ARIA label for documentation menu" - }, "theme.docs.versions.unreleasedVersionLabel": { "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.", "description": "The label used to tell the user that he's browsing an unreleased doc version" @@ -133,7 +121,7 @@ }, "theme.docs.versions.latestVersionSuggestionLabel": { "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).", - "description": "The label userd to tell the user that he's browsing an unmaintained doc version" + "description": "The label used to tell the user to check the latest version" }, "theme.docs.versions.latestVersionLinkLabel": { "message": "latest version", @@ -159,10 +147,18 @@ "message": "Last updated{atDate}{byUser}", "description": "The sentence used to display when a page has been last updated, and by who" }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← Back to main menu", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, "theme.common.skipToMainContent": { "message": "Skip to main content", "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "On this page", + "description": "The label used by the button on the collapsible TOC component" + }, "theme.SearchPage.documentsFound.plurals": { "message": "One document found|{count} documents found", "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" @@ -180,7 +176,7 @@ "description": "The placeholder for search page input" }, "theme.SearchPage.inputLabel": { - "message": "Search", + "message": "Поиск", "description": "The ARIA label for search page input" }, "theme.SearchPage.algoliaLabel": { @@ -196,7 +192,7 @@ "description": "The paragraph for fetching new search results" }, "theme.SearchBar.label": { - "message": "Search", + "message": "Поиск", "description": "The ARIA label and placeholder for search button" } } \ No newline at end of file diff --git a/content/ru-RU/website/i18n/docusaurus-plugin-content-blog/options.json b/content/ru-RU/website/i18n/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000000..94a4ebed2d7a2 --- /dev/null +++ b/content/ru-RU/website/i18n/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Electron's blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Keep up to date with what's going on with the Electron project", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Latest posts", + "description": "The label for the left sidebar" + } +} \ No newline at end of file diff --git a/content/ru-RU/website/i18n/docusaurus-theme-classic/footer.json b/content/ru-RU/website/i18n/docusaurus-theme-classic/footer.json index 8b26237397c6f..824406bd5e743 100644 --- a/content/ru-RU/website/i18n/docusaurus-theme-classic/footer.json +++ b/content/ru-RU/website/i18n/docusaurus-theme-classic/footer.json @@ -1,10 +1,14 @@ { "link.title.Docs": { - "message": "Docs", + "message": "Документация", "description": "The title of the footer links column with title=Docs in the footer" }, + "link.title.Checklists": { + "message": "Checklists", + "description": "The title of the footer links column with title=Checklists in the footer" + }, "link.title.Community": { - "message": "Community", + "message": "Сообщество", "description": "The title of the footer links column with title=Community in the footer" }, "link.title.More": { @@ -13,11 +17,19 @@ }, "link.item.label.Getting Started": { "message": "Getting Started", - "description": "The label of footer link with label=Getting Started linking to /" + "description": "The label of footer link with label=Getting Started linking to /docs/latest/" }, - "link.item.label.Stack Overflow": { - "message": "Stack Overflow", - "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + "link.item.label.API Reference": { + "message": "Справка по API", + "description": "The label of footer link with label=API Reference linking to /docs/latest/api/app" + }, + "link.item.label.Performance": { + "message": "Характеристика", + "description": "The label of footer link with label=Performance linking to /docs/latest/tutorial/performance" + }, + "link.item.label.Security": { + "message": "Безопасность", + "description": "The label of footer link with label=Security linking to /docs/latest/tutorial/security" }, "link.item.label.Discord": { "message": "Discord", @@ -27,12 +39,20 @@ "message": "Twitter", "description": "The label of footer link with label=Twitter linking to https://twitter.com/electronjs" }, + "link.item.label.Stack Overflow": { + "message": "Stack Overflow", + "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/electron" + }, "link.item.label.GitHub": { "message": "GitHub", "description": "The label of footer link with label=GitHub linking to https://github.com/electron/electron" }, + "link.item.label.Open Collective": { + "message": "Open Collective", + "description": "The label of footer link with label=Open Collective linking to https://opencollective.com/electron" + }, "copyright": { - "message": "Copyright © 2021 My Project, Inc. Built with Docusaurus.", + "message": "Copyright © 2021 OpenJS Foundation and Electron contributors.", "description": "The footer copyright" } } \ No newline at end of file diff --git a/content/ru-RU/website/i18n/docusaurus-theme-classic/navbar.json b/content/ru-RU/website/i18n/docusaurus-theme-classic/navbar.json index f1c4b1011e519..6d5ede2552a9f 100644 --- a/content/ru-RU/website/i18n/docusaurus-theme-classic/navbar.json +++ b/content/ru-RU/website/i18n/docusaurus-theme-classic/navbar.json @@ -4,7 +4,7 @@ "description": "The title in the navbar" }, "item.label.Docs": { - "message": "Docs", + "message": "Документация", "description": "Navbar item with label Docs" }, "item.label.API": { @@ -15,6 +15,10 @@ "message": "Примеры", "description": "Navbar item with label Examples" }, + "item.label.Blog": { + "message": "Блог", + "description": "Navbar item with label Blog" + }, "item.label.GitHub": { "message": "GitHub", "description": "Navbar item with label GitHub" diff --git a/content/ru-RU/website/locale.yml b/content/ru-RU/website/locale.yml index 0d5d9ca22c203..f3c606f866ec2 100644 --- a/content/ru-RU/website/locale.yml +++ b/content/ru-RU/website/locale.yml @@ -1,279 +1,281 @@ -tagline: Build cross-platform desktop apps with JavaScript, HTML, and CSS +tagline: Создавайте кросс-платформенные приложения при помощи JavaScript, HTML и CSS nav: - apps: Apps + apps: Приложения blog: Блог code_of_conduct: Кодекс поведения - security: Security + security: Безопасность community: Сообщество - contact: Contact - docs: Docs - donors: Donors - languages: Languages - license: License - releases: Releases - search: Search - userland: Userland - governance: Governance + contact: Контакт + docs: Документация + donors: Спонсоры + languages: Языки + license: Лицензия + releases: Релизы + search: Поиск + userland: Пользовательское пространство + governance: Управление keyboard_modal: title: Горячие клавиши - key: Key - action: Action - focus_search: Focus the search bar - focus_and_clear: Focus the search bar and cleans it - scroll_down: Select the next search result - scroll_up: Select the previous search result - open: Open the selected search result - open_new_tab: Open the selected search result in a new tab + key: Клавиша + action: Действие + focus_search: Сфокусировать панель поиска + focus_and_clear: Фокусирует поисковую строку и очищает ее + scroll_down: Выберите следующий результат поиска + scroll_up: Выберите предыдущий результат поиска + open: Открыть выбранный результат поиска + open_new_tab: Открыть выбранные результат поиска в новой вкладке docs: - title: Electron Documentation - guides: "Guides: Getting Started with Electron" - api_reference: API Reference - api_structures: API Structures - advanced: Advanced - detailed: In Detail - custom_dom: Custom DOM Elements - main_proc_modules: Main Process Modules - renderer_proc_modules: Renderer Process Modules - both_proc_modules: Modules for Both Process Types - propose_change: Improve this doc - version_history: Version history - translate: Translate this doc + title: Документация Electron + guides: "Руководства: Начало работы с Electron" + api_reference: Справка по API + api_structures: Структуры API + advanced: Расширенный + detailed: В деталях + custom_dom: Пользовательские DOM-элементы + main_proc_modules: Модули основного процесса + renderer_proc_modules: Модули графического процесса + both_proc_modules: Модули для обоих процессов + propose_change: Улучшить этот документ + version_history: История версий + translate: Перевести этот документ languages: - choose_language: Choose Your Site Language - view_more_details: View More Language Details - translation_progress: Translation Progress - current: current selection + choose_language: Выберите язык сайта + view_more_details: Узнать больше о языке + translation_progress: Прогресс перевода + current: текущий выбор community: - title: Electron Community - description: Resources for connecting with people working on Electron. + title: Сообщество Electron + description: Средства для связи с людьми, работающими над Electron. channels: - get_started: "Get started building an app by reading the quick-start guide." - updates: "Stay up to date by following @electronjs on Twitter and subscribing to the blog feed." - localized_docs: "Read docs in your native language by visiting the languages page." - help: "Get help and feedback by joining the Discord server, or visiting Stack Overflow." - security: "Report security issues by emailing security@electronjs.org." - bugs: "Report bugs by opening issues on the electron/electron repository." - feature_requests: "Request features by opening issues on the electron/electron repository." - code_of_conduct: "Report Code of Conduct violations by emailing coc@electronjs.org." - donations: "Donate on our OpenCollective page." - other: "For all other inquiries, email info@electronjs.org." + get_started: "Начните создание приложения с прочтения инструкции по началу работы." + updates: "Будьте в курсе, отслеживая @electronjs на Twitter и подписавшись на блог." + localized_docs: "Читайте документацию на родном языке посетив языковую страницу." + help: "Получите помощь и обратную связь, присоединившись к серверу Discord или посетив Stack Overflow." + security: "Сообщите о проблемах безопасности по электронной почте security@electronjs.org." + bugs: "Сообщайте об ошибках, открывая вопросы в electron/electron репозитории." + feature_requests: "Предлагайте идеи, открывая вопросы в репозитории electron/electron." + code_of_conduct: "Сообщите о нарушении правил поведения, написав нам на почту coc@electronjs.org." + donations: "Поддержите нас на нашей странице OpenCollective." + other: "По всем другим вопросам, пишите на info@electronjs.org." language_communities: - title: Language Communities - description: "The Electron community spans the globe, and English is not everyone's first language. Find documentation in your language, or join one of the language communities below:" - tools: Tools - boilerplates: Boilerplates - components: Components - videos: Videos - meetups: Meetups - awesome_notice: This list is generated from @sindresorhus's Awesome Electron repository.
    Something missing? Make a pull request. - meetup_notice: To add a meetup, edit data/meetups.json and make a pull request. + title: Языковые сообщества + description: "Сообщество Electron охватывает весь земной шар, и английский язык не является первым. Ищите документацию на Вашем языке, или присоединяйтесь к одному из языковых сообществ ниже:" + tools: Инструменты + boilerplates: Шаблоны + components: Компоненты + videos: Видео + meetups: Встречи + awesome_notice: Этот список генерируется из репозитория Awesome Electron от @sindresorhus.
    Что-то пропустили? Сделайте pull request. + meetup_notice: Чтобы добавить встречу, отредактируйте data/meetups.json и сделайте pull request. releases: - show_releases: "Show Releases:" - show_only_releases_from: "Show Only Releases From:" - all_versions: All Versions - stable_releases: Stable Releases - stable_desc: Regular, supported releases - beta_releases: Beta Releases - beta_desc: Test your app with upcoming changes - nightly_releases: Nightly Releases - nightly_desc: Experiment with the latest features - next: Next - next_page: Next Page - previous: Previous - previous_page: Previous Page - page: Page - all_releases: All Releases - back_to_index: Back to index + show_releases: "Выбор релизов:" + show_only_releases_from: "Отображать релизы от:" + all_versions: Все версии + stable_releases: Стабильные релизы + stable_desc: Регулярные релизы с поддержкой + beta_releases: Бета-релизы + beta_desc: Проверьте Ваше приложение с учетом будущих изменений + alpha_releases: Alpha Releases + alpha_desc: Test features slightly more on the edge + nightly_releases: Ночные релизы + nightly_desc: Экспериментируйте с последними нововведениями + next: Далее + next_page: Следующая страница + previous: Назад + previous_page: Предыдущая страница + page: Страница + all_releases: Все релизы + back_to_index: Вернуться к содержанию electron_is_good: - title: Apps users love, built with Electron - description: Thousands of organizations spanning all industries use Electron to build cross-platform software. + title: Приложения, которые любят пользователи, созданные с помощью Electron + description: Тысячи организаций, охватывающих все отрасли промышленности, используют Electron для создания кросс-платформенного программного обеспечения. electron_is_easy: - title: It's easier than you think - description: If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application. + title: Это проще, чем вы думаете + description: 'Если Вы можете сделать сайт, то Вы сможете сделать настольное приложение. Electron это фреймворк для создания нативных приложений с веб-технологиями, такими как: JavaScript, HTML и CSS. Он заботится о трудных частях, так что Вы можете сосредоточиться на главных элементах Вашего приложения.' web_technologies: - title: Web Technologies - description: Electron uses Chromium and Node.js so you can build your app with HTML, CSS, and JavaScript. + title: Веб-технологии + description: Electron использует Chromium и Node.js, так что Вы можете создавать свои приложения на HTML, CSS и JavaScript. open_source: title: Open Source - description: Electron is an open source project maintained by the OpenJS Foundation and an active community of contributors. + description: Electron это проект с открытым исходным кодом, который поддерживается OpenJS Foundation и активным сообществом авторов. cross_platform: - title: Cross Platform - description: Compatible with Mac, Windows, and Linux, Electron apps build and run on three platforms. + title: Кросс-платформенный + description: Совместимые с Mac, Windows и Linux приложения Electron создаются и запускаются на трех платформах. benefits: - hard_parts_made_easy: The hard parts made easy - automatic_updates: Automatic updates - native_menus_and_notifications: Native menus & notifications - crash_reporting: Crash reporting - debugging_and_profiling: Debugging & profiling - windows_installers: Windows installers + hard_parts_made_easy: Сложные вещи стали проще + automatic_updates: Автоматическое обновление + native_menus_and_notifications: Собственные меню и уведомления + crash_reporting: Отчеты об ошибках + debugging_and_profiling: Отладка и профилирование + windows_installers: Установщики для Windows get_started: - title: Get started - description: To get started with Electron, check out the resources below. Learn how to wrap your web app with Electron, access all the APIs, and generate installers. + title: Начать работу + description: Для начала работы с Electron посмотрите на указанные ниже ресурсы. Узнайте как обернуть Ваше веб-приложение с Electron, получить доступ ко всем API и научиться создавать установщики. explore: fiddle_title: Try powerful experiments with Electron Fiddle - see_more_info: See more info -download: Download -download_from_github: Download from GitHub + see_more_info: Подробнее +download: Скачать +download_from_github: Скачать с GitHub quick_start: - title: "Spin up the Quick Start app to see Electron in action:" - description: A minimal Electron app with helpful notations. - clone: Clone the Quick Start repository - go_into_repo: Go into the repository - install_deps: Install the dependencies and run - dive_deeper: Or dive deeper and read the documentation. + title: "Подготовьте приложение быстрого старта для просмотра Electron в действии:" + description: Небольшое приложение Electron с полезными нотациями. + clone: Клонируйте репозиторий быстрого старта + go_into_repo: Перейдите в репозиторий + install_deps: Установите зависимости и выполните + dive_deeper: Или окунитесь глубже и ознакомьтесь с документацией. need_help: - title: Need Help? - description: Ask questions in the Discord server. Follow @electronjs on Twitter for important announcements. Need to privately reach out? Email info@electronjs.org. + title: Нужна помощь? + description: Задавайте вопросы вDiscord server. Следите за важными объявлениями @electronjs в Twitter. Если Вам нужно решить персональный вопрос, отправьте e-mail на info@electronjs.org. headings: - languages: Languages + languages: Языки taglines: - languages: Localized content from our awesome global developer community. + languages: Локализованное содержимое от нашего удивительного сообщества разработчиков по всему миру. announcement: 'Black Lives Matter. Support the Equal Justice Initiative and read our statement here.' -help_translate: "Help translate" +help_translate: "Помочь перевести" footer: - see_the_faq: See the frequently asked questions + see_the_faq: Просмотреть часто задаваемые вопросы apps: - something_missing: Something missing? - edit_this_app: Edit this app. - search_app: Filter apps by name, description, etc… - categories: Categories - add_app_link: 'Make a Pull Request to add your application.' + something_missing: Что-то отсутствует? + edit_this_app: Измените это приложение. + search_app: Отфильтровать приложения по имени, описанию и так далее… + categories: Категории + add_app_link: 'Создайте Pull Request, чтобы добавить свое приложение.' #App show page specific localization strings - website: Website - repository: Repository - category: Category - downloads: Downloads - keywords: Keywords - license: License - latest_release: Latest Release + website: Веб-сайт + repository: Репозиторий + category: Категория + downloads: Загрузки + keywords: Ключевые слова + license: Лицензия + latest_release: Последний релиз blog: - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Блог Electron + description: Все последние новости от команды Electron и сообщества. #Post show page specific localization strings - feedback: Have feedback on this post? Let @electronjs know on Twitter. - help: Need help or found a bug? Contact us. + feedback: Есть мысли по поводу этой публикации? Дайте @electronjs об этом знать на Twitter. + help: Нужна помощь или Вы нашли баг? Свяжитесь с нами. clipboard: - copy: Copy - copy_to_clipboard: Copy to Clipboard - copied: Copied + copy: Копировать + copy_to_clipboard: Копировать в буфер обмена + copied: Скопировано fiddle_launch_button: - launch: Launch - launch_in_fiddle: Launch in Fiddle + launch: Запустить + launch_in_fiddle: Запустить в Fiddle pages: '/': - title: Electron | Build cross-platform desktop apps with JavaScript, HTML, and CSS. - description: 'Build cross-platform desktop apps with JavaScript, HTML, and CSS.' + title: Electron | Создавайте кросс-платформенные приложения при помощи JavaScript, HTML и CSS. + description: 'Создавайте кросс-платформенные приложения при помощи JavaScript, HTML и CSS.' '/apps': - title: Electron Apps - description: Apps Built on Electron + title: Приложения Electron + description: Приложения, созданные на Electron '/docs': title: Документация - description: Guides and API reference documentation for the latest Electron release + description: Руководства и API справочной документации для последнего релиза Electron '/docs/api': title: API - description: API reference documentation for the latest Electron release + description: Руководства и API справочной документации для последнего релиза Electron '/docs/development': title: Разработка - description: Developing with Electron + description: Разрабатывание при помощи Electron '/docs/tutorial': - title: Tutorial - description: Guides and tutorials for the latest Electron release + title: Руководство + description: Справочники и руководства для последнего релиза Electron '/blog': - title: Electron Blog - description: All the latest news from the Electron team and community. + title: Блог Electron + description: Все последние новости от команды Electron и сообщества. '/community': title: Сообщество '/releases': - title: Releases + title: Релизы '/contact': - title: Contact - description: Get in touch with the Electron team on Twitter, Slack, GitHub, or via email. + title: Контакт + description: Свяжитесь с командой Electron через Twitter, Slack, GitHub или по электронной почте. '/languages': - title: Languages + title: Языки '/userland': - title: Userland + title: Пользовательское пространство '/devtron': title: Devtron - description: Devtron is an open source tool to help you inspect, monitor, and debug your Electron app. Built on top of the amazing Chrome Developer Tools. + description: Devtron является инструментом с открытым исходным кодом, чтобы помочь Вам проверять, контролировать и отлаживать Ваши приложения Electron. Построен на базе удивительных инструментов разработчика Chrome. '/spectron': title: Spectron - description: Spectron is an open source framework for easily writing integrations tests for your Electron app. Built on top of ChromeDriver and WebDriverIO. + description: Spectron является фреймворком с открытым исходным кодом для легкого написания тестов интеграции для Вашего приложения Electron. Построен на базе ChromeDriver и WebDriverIO. '/fiddle': title: Electron Fiddle - description: The easiest way to get started with Electron + description: Самый лёгкий способ начать работу с Electron '/governance': - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. + title: Управление Electron + description: Система управления Electron состоит из рабочих групп, которые осуществляют контроль за различными аспектами экосистемы Electron, и административной рабочей группы, которая отвечает за урегулирование конфликтов между ними. '/donors': - title: Donors + title: Спонсоры '/blacklivesmatter': title: Black Lives Matter landing: - get_started: Get started + get_started: Начать работу fiddle: - lead_desc: The easiest way to get started with Electron - different_os: "Not the right operating system? See:" - create_app: Create your app - description: Electron Fiddle lets you create and play with small Electron experiments. It greets you with a quick-start template after opening – change a few things, choose the version of Electron you want to run it with, and play around. Then, save your Fiddle either as a GitHub Gist or to a local folder. Once pushed to GitHub, anyone can quickly try your Fiddle out by just entering it in the address bar. - explore: Explore Electron - explore_desc: "Try Electron without installing any dependencies: Fiddle includes everything you'll need to explore the platform. It also includes examples for every API available in Electron, so if you want to quickly see what a BrowserView is or how the desktopCapturer works, Fiddle has got you covered." - code_with_types: Code with Types - code_with_types_desc: Fiddle includes Microsoft's excellent Monaco Editor, the same editor powering Visual Studio Code. It also installs the type definitions for the currently selected version of Electron automatically, ensuring that you always have all Electron APIs only a few keystrokes away. - compile_and_package: Compile and Package - compile_and_package_desc: Fiddle can automatically turn your experiment into binaries you can share with your friends, coworkers, or grandparents. It does so thanks to electron-forge, allowing you to package your fiddle as an app for Windows, macOS, or Linux. - easy_start: Start with Fiddle, Continue Wherever - easy_start_desc: Fiddle is not an IDE – it is however an excellent starting point. Once your fiddle has grown up, export it as a project with or without electron-forge. Then, use your favorite editor and take on the world! + lead_desc: Самый лёгкий способ начать работу с Electron + different_os: "Не та операционная система? Посмотрите:" + create_app: Создание Вашего приложения + description: Electron Fiddle позволяет Вам создавать и пробовать небольшие эксперименты с Electron. По открытию, Вас приветствуют шаблоном ускоренного запуска - Вы можете изменить несколько установок, выбрать желаемую версию Electron и поиграть с разными вариантами. После, сохраните Ваш Fiddle как GitHub Gist или в локальную папку. При опубликовании в GitHub, Ваш Fiddle доступен любому и всё, что нужно сделать, чтобы попробовать Ваш Fiddle это ввести его в адресную строку браузера. + explore: Исследуйте Electron + explore_desc: "Попробуйте Electron без установки зависимостей: Fiddle включает всё, что Вам нужно для изучения платформы. Он также включает в себя примеры для каждого доступного API в Electron, так что если Вы хотите посмотреть, что из себя представляет BrowserView и как работает desktopCapturer, Fiddle готов прийти к Вам на помощь." + code_with_types: Программируйте с типами + code_with_types_desc: Fiddle включает превосходный редактор Монако от компании Microsoft, с такой же мощностью как и Visual Studio Code. Он также устанавливает определения типа для выбранной версии Electron автоматически, гарантируя, что у Вас всегда есть все API Electron всего за несколько нажатий клавиш. + compile_and_package: Компилируйте и упаковывайте + compile_and_package_desc: Fiddle может автоматически превратить Ваш эксперимент в бинарные файлы, которыми Вы можете поделиться с друзьями, коллегами или бабушками с дедушками. Это благодаря electron-forge, который позволяет Вам упаковать Ваш fiddle в приложение для Windows, macOS или Linux. + easy_start: Начните с Fiddle, продолжите где угодно + easy_start_desc: Fiddle - это не IDE - это отличная отправная точка. Как только Ваш Fiddle подрастет, экспортируйте его как проект с помощью electron-forge или без него. Затем, используйте свой любимый редактор и покоряйте мир! governance: - title: Electron Governance - description: The Electron governance system is comprised of Working Groups that oversee different aspects of the Electron ecosystem, and an Administrative working group that functions to resolve conflicts between them. - wgs: Working Groups + title: Управление Electron + description: Система управления Electron состоит из рабочих групп, которые осуществляют контроль за различными аспектами экосистемы Electron, и административной рабочей группы, которая отвечает за урегулирование конфликтов между ними. + wgs: Рабочие группы ecosystem: - title: Ecosystem - description: Oversees the projects that make Electron app development easier. + title: Экосистема + description: Наблюдает за проектами, которые упрощают разработку приложений Electron. outreach: - title: Outreach - description: Grows the Electron community + title: Охват + description: Увеличивает сообщество Electron releases: - title: Releases - description: Oversees all release branches, and tooling to support releases. + title: Релизы + description: Курирует все ветви релизов и инструменты, которые поддерживают релизы. upgrades: - title: Upgrades - description: Oversees upgrades of upstream dependencies; specifically Chromium and Node. + title: Улучшения + description: Курирует обновления исходящих зависимостей; в частности Chromium и Node. cmsf: - title: Community & Safety - description: Oversees removal/bans from community. + title: Сообщество и безопасность + description: Курирует удаление/баны в сообществе. security: - title: Security - description: Proactively ensures the Security of Electron as a project, responds to incoming incidents, and oversees rollout of fixes. + title: Безопасность + description: Заранее обеспечивает безопасность Electron, как проект, отвечает входящим инцидентам и контролирует развертывание исправлений. admins: - title: Administrative - description: The Administrative Working Group oversees the entire governance and project. + title: Администрирование + description: Административная рабочая группа осуществляет надзор за всем процессом управления и проектом. api: title: API - description: Oversees public API design based on project principles. + description: Курирует разработку общедоступного API, основанного на принципах проекта. global: overview: Обзор - associated_repos: Associated Repositories - notes: Meeting Notes + associated_repos: Связанные репозитории + notes: Примечания к заседанию definitions: - title: Definitions + title: Определения list: - - A maintainer is anyone who plays an active role in governance. - - A collaborator is active in the community, but not in governance. - - A participant is anyone who is a maintainer or collaborator. - - A working group is a group of maintainers that is formed to take responsibility for certain aspects of the Electron project. Normally these groups will meet regularly but in some cases will only meet as required to fulfill their responsibilities. - - 'A chair leads a working group.' + - Сопровождающий - любой, кто активно участвует в управление. + - Соавтор активно работает в сообществе, но не в управлении. + - Участник - любой, кто является сопровождающим или соавтором. + - Рабочая группа является группой сопровождающих, которая формируется для того, чтобы взять на себя ответственность за определенные аспекты проекта Electron. Обычно эти группы будут регулярно встречаться, но в некоторых случаях будут встречаться только по мере необходимости выполнения своих обязанностей. + - 'Председатель возглавляет рабочую группу.' responsibilities: - title: Responsibilities - listdescription: "All Working Groups have these core responsibilities:" + title: Ответственности + listdescription: "Все рабочие группы несут эти основные обязанности:" list: - - They shall decide for themselves, and publicly post, their rules, e.g. how decisions are made, when meetings are held, and who may attend. - - 'They shall select a chair to represent the group.' - - They shall keep meeting notes, including agenda items, discussion points, and outcomes for everyone to review. - - 'They shall be collaborative and work in good faith with other Working Groups.' - see_charter: See charter for more information. - code_of_conduct: The Electron organization and all repos therein adhere to the following Code of Conduct. - license: Electron is licensed with the MIT License. - repository: Check out the Governance Repository to find more information about the governance structure. + - Они должны решать за себя и публично размещать свои правила, например, как принимаются решения, когда проводятся заседания и кто может присутствовать. + - 'Они должны выбрать председателя, представляющий группу.' + - Они должны вести записи совещаний, включая вопросы на повестке дня, вопросы для обсуждения и итоги, чтобы каждый мог их просмотреть. + - 'Они должны сотрудничать и работать добросовестно с другими рабочими группами.' + see_charter: Смотрите председательство для дополнительной информации. + code_of_conduct: Организация Electron и все репозитории в ней придерживаются следующего Кодекса поведения. + license: Electron лицензирован с помощью лицензии MIT. + repository: Посмотрите на репозиторий управления, чтобы найти больше информации о структуре управления. _404: - page_not_found: Page not found. + page_not_found: Страница не найдена. diff --git a/content/zh-CN/docs/api/app.md b/content/zh-CN/docs/api/app.md index 4bfb1d5d6ccfe..326f95c9d757f 100644 --- a/content/zh-CN/docs/api/app.md +++ b/content/zh-CN/docs/api/app.md @@ -420,54 +420,6 @@ app.on('session-created', (session) => { 在 `webContents` 的渲染器进程中调用 `desktopCapturer.getSources()` 时触发。 调用 `event.preventDefault()` 将使它返回空的sources。 -### 事件: "remote-require" _弃用_ - -返回: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -在 `webContents` 的渲染器进程中调用 `remote.require()` 时发出。 调用 `event.preventDefault()` 将阻止模块返回。 可以通过设置 `event.returnValue` 返回自定义值。 - -### 事件: "remote-get-global" _弃用_ - -返回: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `globalName` String - -在 `webContents` 的渲染器进程中调用 `remote.getGlobal()` 时发出。 调用 `event.preventDefault()` 将阻止全局返回。 可以通过设置 `event.returnValue` 返回自定义值。 - -### 事件: "remote-get-builtin" _弃用_ - -返回: - -* `event` Event -* `webContents` [WebContents](web-contents.md) -* `moduleName` String - -在 `webContents` 的渲染器进程中调用 `remote.getBuiltin()` 时发出。 调用 `event.preventDefault()` 将阻止模块返回。 可以通过设置 `event.returnValue` 返回自定义值。 - -### 事件: "remote-get-current-window" _弃用_ - -返回: - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -在 `webContents` 的渲染器进程中调用 `remote.getCurrentWindow()` 时发出。 调用 `event.preventDefault()` 将阻止对象返回 可以通过设置 `event.returnValue` 返回自定义值。 - -### 事件: "remote-get-current-web-contents" _弃用_ - -返回: - -* `event` Event -* `webContents` [WebContents](web-contents.md) - -在 `webContents` 的渲染器进程中调用 `remote.getCurrentWebContents()` 时发出。 调用 `event.preventDefault()` 将阻止对象返回 可以通过设置 `event.returnValue` 返回自定义值。 - ## 方法 ` app ` 对象具有以下方法: @@ -981,7 +933,7 @@ if (!gotTheLock) { 在 macOS 上,它会在dock 图标上显示。 在 Linux 上,它只适用于 Unity 启动器。 -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**注意:** Unity 启动器需要一个 `.desktop` 文件才能工作。 欲了解更多信息, 请阅读 [Unity integration 文档][unity-requirement]。 ### `app.getBadgeCount()` _Linux_ _macOS_ @@ -1024,7 +976,7 @@ Returns `Boolean` - 当前桌面环境是否为 Unity 启动器 * `enabled` Boolean (可选) _Windows_ - `true` 将更改已启用的启动注册表项,并在任务管理器和 Windows 设置中 `启用 / 禁用` 应用程序。 默认值为 `true`。 * `name` String (可选) _Windows_ - 要写入注册表的值名称。 默认为应用的 AppUserModelId()。 设置应用程序的登录项设置。 -To work with Electron's `autoUpdater` on Windows, which uses [Squirrel][Squirrel-Windows], you'll want to set the launch path to Update.exe, and pass arguments that specify your application name. 例如: +如果需要在 Windows 上使用[Squirrel][Squirrel-Windows]的 `autoUpdater` ,你需要将启动路径设置为 Update.exe,并传递指定应用程序名称的参数。 例如: ``` javascript const appFolder = path.dirname(process.execPath) @@ -1072,7 +1024,7 @@ https://www.chromium.org/developers/design-documents/accessibility

    * `website` String (可选) _Linux_ - 应用程序的网站。 * `iconPath` String (可选) _Linux_ _Windows_ - 以JPEG 或 PNG 文件格式为应用程序图标路径。 在 Linux 上,将显示为 64x64 像素,同时保留纵横比。 -设置 "关于" 面板选项。 这将覆盖应用程序在 macOS 上的 `.plist` 文件中定义的值。 See the [Apple docs][about-panel-options] for more details. 在 Linux 上,没有默认值,所以必须设置值才能显示。 +设置 "关于" 面板选项。 这将覆盖应用程序在 macOS 上的 `.plist` 文件中定义的值。 详细信息请查阅 [ Apple 文档 ][about-panel-options]。 在 Linux 上,没有默认值,所以必须设置值才能显示。 如果您没有设置 `credits` 但仍希望在应用中显示它们,AppKit 将在 NSBundle 类的main方法返回的捆绑包中按顺序查找名为"Credits.html", "Credits.rtf"和"Credits.rtfd"的文件。 先找到的文件将被使用,如果未找到,则信息区域将留空。 有关更多信息,请参阅 Apple [文档](https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc) 。 @@ -1088,14 +1040,14 @@ https://www.chromium.org/developers/design-documents/accessibility

    * `bookmarkData` String - base64 编码的安全作用域的书签数据(bookmark data) ,通过 `dialog.showOpenDialog` 或者 `dialog.showSaveDialog` 方法获取。 -Returns `Function` - This function **must** be called once you have finished accessing the security scoped file. 如果你忘记停止访问书签,[内核资源将会泄漏](https://developer.apple.com/reference/foundation/nsurl/1417051-startaccessingsecurityscopedreso?language=objc),并且你的应用将失去完全到达沙盒之外的能力,直到应用重启。 +返回 `Function` - 该函数 **必须** 在你完成访问安全作用域文件后调用一次。 如果你忘记停止访问书签,[内核资源将会泄漏](https://developer.apple.com/reference/foundation/nsurl/1417051-startaccessingsecurityscopedreso?language=objc),并且你的应用将失去完全到达沙盒之外的能力,直到应用重启。 ```js //开始读取文件 -const stopAccessingSecurityScopedResource = app.startAccessingSecurityScopedResource(data) -// You can now access the file outside of the sandbox 🎉 +const stopAcessingSecurityScopedResource = app。 tartAccessingSecurityScopedResource(数据) +// 您现在可以在 sandbox:party_popper 之外访问文件🎉 -// Remember to stop accessing the file once you've finished with it. +// 记住在文件完成后停止访问 stopAccessingSecurityScopedResource() ``` @@ -1121,7 +1073,7 @@ stopAccessingSecurityScopedResource() 默认情况下不会显示确认对话框。 如果您希望允许用户确认操作,您可以使用[`dialog`](dialog.md) API 进行确认。 -**NOTE:** This method throws errors if anything other than the user causes the move to fail. 例如,如果用户取消了授权会话,这个方法将返回false。 如果无法执行复制操作, 则此方法将抛出错误。 错误中的信息应该是翔实的,并告诉你到底是哪里出了问题。 +**注意:**如果并非是用户造成操作失败,这个方法会抛出错误。 例如,如果用户取消了授权会话,这个方法将返回false。 如果无法执行复制操作, 则此方法将抛出错误。 错误中的信息应该是翔实的,并告诉你到底是哪里出了问题。 默认情况下,如果应用程序目录中存在与被移动的应用同名的应用,并且 _未_ 运行,则已有应用将被丢弃,被移动的应用将顶替其位置。 如果它 _正在_ 运行,预先存在的运行应用程序将承担焦点,以前活动的应用程序将退出自己。 此行为可以通过提供可选的冲突处理器来更改,处理器返回的 boolean 将决定移动冲突是否通过默认行为得到解决。 即:返回 `false` 将确保不采取进一步行动,返回 `true` 将导致默认行为同时方法继续执行。 @@ -1184,7 +1136,7 @@ app.moveToApplicationsFolder({ 在 macOS 上,为该属性设置任何非零整数,会显示在dock 图标上。 在 Linux 上,这个属性只适用于 Unity 启动器。 -**Note:** Unity launcher requires the existence of a `.desktop` file to work, for more information please read [Desktop Environment Integration][unity-requirement]. +**注意:** Unity 启动器需要一个 `.desktop` 文件才能工作。 欲了解更多信息, 请阅读 [Unity integration 文档][unity-requirement]。 **注意:** 在 macOS 上,为了使该属性生效,您需要确保您的应用程序具有显示通知的权限。 @@ -1212,12 +1164,6 @@ app.moveToApplicationsFolder({ 当用户代理在`webContents` 或 `session` 级别没有被设置时,将使用此用户代理。 有助于确保您的整个应用程序具有相同的用户代理。 在应用初始化中尽早设置为自定义值,以确保使用的是您覆盖的值。 -### `app.allowRendererProcessReuse` - -`Boolean` 为`true`时禁止Electron每次导航时都重新启动渲染器进程。 此属性的默认值为 `true`。 - -目的是让这些覆盖在默认情况下不可用,此属性未来将被删除。 此属性会影响您可以在渲染进程中使用哪些本地模块。 有关 Electron 重新启动渲染进程以及在渲染进程中使用本地模块的未来设计,请查看此[跟踪问题](https://github.com/electron/electron/issues/18397)。 - ### `app.runningUnderRosettaTranslation` _macOS_ _只读_ `Boolean` ,为 `true` 表明该应用程序目前正在运行在[转译环境](https://en.wikipedia.org/wiki/Rosetta_(software))下。 @@ -1232,7 +1178,7 @@ app.moveToApplicationsFolder({ [LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType -[unity-requirement]: ../tutorial/desktop-environment-integration.md#unity-launcher +[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher [mas-builds]: ../tutorial/mac-app-store-submission-guide.md [Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows [JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx diff --git a/content/zh-CN/docs/api/auto-updater.md b/content/zh-CN/docs/api/auto-updater.md index 2f87aecb12404..43de0da1c53af 100644 --- a/content/zh-CN/docs/api/auto-updater.md +++ b/content/zh-CN/docs/api/auto-updater.md @@ -97,6 +97,8 @@ 询问服务器是否有更新。 在使用此 API 之前,您必须调用`setFeedURL` 。 +**Note:** If an update is available it will be downloaded automatically. Calling `autoUpdater.checkForUpdates()` twice will download the update two times. + ### `autoUpdater.quitAndInstall()` 重启应用并在下载后安装更新。 它只应在发出 `update-downloaded` 后方可被调用。 diff --git a/content/zh-CN/docs/api/browser-window.md b/content/zh-CN/docs/api/browser-window.md index 1672f33a0f696..9afdf14382705 100644 --- a/content/zh-CN/docs/api/browser-window.md +++ b/content/zh-CN/docs/api/browser-window.md @@ -14,7 +14,7 @@ const win = new BrowserWindow({ width: 800, height: 600 }) win.loadURL('https://github.com') // Or load a local HTML file -win.loadURL(`file://${__dirname}/app/index.html`) +win.loadFile('index.html') ``` ## Frameless window @@ -143,7 +143,7 @@ child.once('ready-to-show', () => { * `frame` Boolean (可选) - 设置为 `false` 时可以创建一个[无边框窗口](frameless-window.md)。 默认值为 `true`。 * `parent` BrowserWindow (可选) - 指定父窗口 默认值为 `null`. * `momodalable` Boolean (可选) - 当前是否为模态窗口。 只有当窗口是子窗口时才起作用。 默认值为 `false`. - * `acceptFirstMouse` Boolean (可选) - 是否允许单击页面来激活窗口。 默认值为 `false`。 + * `acceptFirstMouse` Boolean (optional) - Whether clicking an inactive window will also click through to the web contents. Default is `false` on macOS. This option is not configurable on other platforms. * `disableAutoHideCursor` Boolean (可选) - 是否在打字时隐藏光标。 默认值为 `false`. * `autoHideMenuBar` Boolean (可选) - 自动隐藏菜单栏,除非按了`Alt`键。 默认值为 `false`. * `enableLargerThanScreen` Boolean (可选) - 是否允许改变窗口的大小使之大于屏幕的尺寸. 仅适用于 macOS,因为其它操作系统默认允许 大于屏幕的窗口。 默认值为 `false`. @@ -157,11 +157,11 @@ child.once('ready-to-show', () => { * `followWindow` - 当窗口处于激活状态时,后台应自动显示为激活状态,当窗口处于非激活状态时,后台应自动显示为非激活状态。 默认为该值。 * `active` - 后台应一直显示为激活状态。 * `inactive` - 后台应一直显示为非激活状态。 - * `titleBarStyle` String (可选) - 窗口标题栏样式。 默认值为 `default`. 可能的值有 - * `default` - 标准灰色不透明的Mac标题栏 - * `hidden` - 隐藏标题栏, 内容充满整个窗口, 但它依然在左上角, 仍然受标准窗口控制. - * `hiddenInset` - 隐藏标题栏, 显示小的控制按钮在窗口边缘 - * `customButtonsOnHover` - Results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. ** 注意: **此选项目前是实验性的。 + * `titleBarStyle` String (optional) _macOS_ _Windows_ - The style of window title bar. 默认值为 `default`. 可能的值有 + * `default` - Results in the standard title bar for macOS or Windows respectively. + * `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown. + * `hiddenInset` - Only on macOS, results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge. + * `customButtonsOnHover` - Only on macOS, results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. ** 注意: **此选项目前是实验性的。 * `trafficLightPosition` [Point](structures/point.md) (optional) - Set a custom position for the traffic light buttons in frameless windows. * `roundedCorners` Boolean (optional) - Whether frameless window should have rounded corners on macOS. 默认值为 `true`。 * `fullscreenWindowTitle` Boolean (optional) _Deprecated_ - Shows the title in the title bar in full screen mode on macOS for `hiddenInset` titleBarStyle. 默认值为 `false`. @@ -176,10 +176,8 @@ child.once('ready-to-show', () => { * `nodeIntegrationInSubFrames` Boolean (可选项)(实验性),是否允许在子页面(iframe)或子窗口(child window)中集成Node.js; 预先加载的脚本会被注入到每一个iframe,你可以用 `process.isMainFrame` 来判断当前是否处于主框架(main frame)中。 * `preload` String (可选) -在页面运行其他脚本之前预先加载指定的脚本 无论页面是否集成Node, 此脚本都可以访问所有Node API 脚本路径为文件的绝对路径。 当 node integration 关闭时, 预加载的脚本将从全局范围重新引入node的全局引用标志 [参考示例](context-bridge.md#exposing-node-global-symbols). * `sandbox` Boolean (可选)-如果设置该参数, 沙箱的渲染器将与窗口关联, 使它与Chromium OS-level 的沙箱兼容, 并禁用 Node. js 引擎。 它与 `nodeIntegration` 的选项不同,且预加载脚本的 API 也有限制. [更多详情](../tutorial/sandbox.md). - * `enableRemoteModule` Boolean (可选) - 是否启用 [`remote`](remote.md) 模块。 默认值为 `false`. * `session` [Session](session.md#class-session) (可选) - 设置页面的 session 而不是直接忽略 Session 对象, 也可用 `partition` 选项来代替,它接受一个 partition 字符串. 同时设置了`session` 和 `partition`时, `session` 的优先级更高. 默认使用默认的 session. * `partition` String (optional) - 通过 session 的 partition 字符串来设置界面session. 如果 `partition` 以 `persist:`开头, 该页面将使用持续的 session,并在所有页面生效,且使用同一个`partition`. 如果没有 `persist:` 前缀, 页面将使用 in-memory session. 通过分配相同的 ` partition `, 多个页可以共享同一会话。 默认使用默认的 session. - * `affinity` String (可选) - 当指定,具有相同`affinity` 的 web页面将在相同的渲染进程运行。 需要注意的是,由于渲染过程中会有代码重用,如 `webPreferences`的`preload`, `sandbox` 和 `nodeIntegration`等选项会在不同页面之间共用,即使你已经在不同页面中为同一选项设置过不同的值,它们仍会被共用。 因此,建议为`affinity`相同的页面,使用相同的 `webPreferences` _已废弃_ * `zoomFactor` Number (可选) - 页面的默认缩放系数, `3.0` 表示 `300%`。 默认值为 `1.0`. * `javascript` Boolean (可选) - 是否启用 JavaScript 支持。 默认值为 `true`。 * `webSecurity` Boolean (可选) - 当设置为 `false`, 它将禁用同源策略 (通常用来测试网站), 如果此选项不是由开发者设置的,还会把 `allowRunningInsecureContent`设置为 `true`. 默认值为 `true`。 @@ -206,8 +204,7 @@ child.once('ready-to-show', () => { * ` backgroundThrottling `Boolean (可选)-是否在页面成为背景时限制动画和计时器。 这也会影响到 [Page Visibility API](#page-visibility). 默认值为 `true`。 * `offscreen` Boolean (optional) - 是否绘制和渲染可视区域外的窗口. 默认值为 `false`. 更多详情, 请参见 [ offscreen rendering tutorial ](../tutorial/offscreen-rendering.md)。 * `contextIsolation` Boolean (可选) - 是否在独立 JavaScript 环境中运行 Electron API和指定的`preload` 脚本. 默认为 `true`。 `预加载`脚本所运行的上下文环境只能访问其自身专用的`文档`和全局`窗口`,其自身一系列内置的JavaScript (`Array`, `Object`, `JSON`, 等等) 也是如此,这些对于已加载的内容都是不可见的。 Electron API 将只在`预加载`脚本中可用,在已加载页面中不可用。 这个选项应被用于加载可能不被信任的远程内容时来确保加载的内容无法篡改`预加载`脚本和任何正在使用的Electron api。 该选项使用的是与[Chrome内容脚本][chrome-content-scripts]相同的技术。 你可以在开发者工具Console选项卡内顶部组合框中选择 'Electron Isolated Context'条目来访问这个上下文。 - * `worldSafeExecuteJavaScript` Boolean (可选) - 如果为true,从`webFrame.executeJavaScript` 返回的值将被特殊处理,以确保使用 `contextIsolation` 时,JS中的值安全地在两个世界之间传递。 默认值为 `true`。 _已废弃_ - * `nativeWindowOpen` Boolean (可选) - 是否使用原生的`window.open()`. 默认值为 `false`. 除了 `nodeIntegrationInSubFrames` 为true时,其它情况下node integration将永远禁用。 ** 注意: **此选项目前是实验性的。 + * `nativeWindowOpen` Boolean (可选) - 是否使用原生的`window.open()`. 默认值为 `false`. 除了 `nodeIntegrationInSubFrames` 为true时,其它情况下node integration将永远禁用。 **Note:** The default value will be changing to `true` in Electron 15. * `webviewTag` Boolean (可选) - 是否启用 [`` tag](webview-tag.md)标签. 默认值为 `false`. ** 注意: **为 `< webview>` 配置的 ` preload ` 脚本在执行时将启用节点集成, 因此应确保远程或不受信任的内容无法创建恶意的 ` preload ` 脚本 。 可以使用 [ webContents ](web-contents.md) 上的 ` will-attach-webview ` 事件对 ` preload ` 脚本进行剥离, 并验证或更改 `` 的初始设置。 * `additionalArguments` String[] (可选) - 一个将被附加到当前应用程序的渲染器进程中`process.argv`的字符串列表 。 可用于将少量的数据传递到渲染器进程预加载脚本中。 * `safeDialogs` Boolean (可选) - 是否启用浏览器样式的持续对话框保护。 默认值为 `false`. @@ -225,6 +222,7 @@ child.once('ready-to-show', () => { * `bypassHeatCheck` - 绕过启发式代码缓存,但使用懒编译。 * `bypassHeatCheckAndEagerCompile` - 与上面相同,除了编译是及时的。 默认策略是 `code`。 * `enablePreferredSizeMode` Boolean (可选) - 是否启用首选大小模式。 首选大小是包含文档布局所需的最小大小--无需滚动。 启用该属性将导致在首选大小发生变化时,在`WebContents` 上触发 `preferred-size-changed` 事件。 默认值为 `false`. + * `titleBarOverlay` [OverlayOptions](structures/overlay-options.md) | Boolean (optional) - When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS or using a `titleBarStyle` so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars]. Specifying `true` will result in an overlay with default system colors. 默认值为 `false`. On Windows, the [OverlayOptions](structures/overlay-options.md) can be used instead of a boolean to specify colors for the overlay. 当使用 ` minWidth `/` maxWidth `/` minHeight `/` maxHeight ` 设置最小或最大窗口大小时, 它只限制用户。 它不会阻止您将不符合大小限制的值传递给 ` setBounds `/` setSize ` 或 ` BrowserWindow ` 的构造函数。 @@ -543,6 +541,10 @@ win.loadURL('https://github.com') 一个 `Boolean` 属性,用于决定窗口是否处于全屏模式。 +#### `win.focusable` _Windows_ _macOS_ + +A `Boolean` property that determines whether the window is focusable. + #### `win.visibleOnAllWorkspaces` 一个 `Boolean` 属性,用于决定窗口是否在所有工作区中可见。 @@ -956,7 +958,7 @@ console.log(win.getBounds()) #### `win.center()` -Moves window to the center of the screen. +将窗口移动到屏幕中央。 #### `win.setPosition(x, y[, animate])` @@ -964,30 +966,30 @@ Moves window to the center of the screen. * `y` Integer * `animate` Boolean (可选) _macOS_ -Moves window to `x` and `y`. +将窗口移动到 ` x ` 和 ` y `。 #### `win.getPosition()` -Returns `Integer[]` - Contains the window's current position. +返回 `Integer[]` - 返回一个包含当前窗口位置的数组. #### `win.setTitle(title)` * `title` String -Changes the title of native window to `title`. +将原生窗口的标题更改为 ` title `。 #### `win.getTitle()` -Returns `String` - The title of the native window. +返回 ` String `-原生窗口的标题。 -**Note:** The title of the web page can be different from the title of the native window. +**注意:** 网页的标题可以与原生窗口的标题不同。 #### `win.setSheetOffset(offsetY[, offsetX])` _macOS_ * `offsetY` Float -* `offsetX` Float (optional) +* `offsetX` Float (可选) -Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. 例如: +改变macOS上sheet组件的附着点。 默认情况下,sheet贴在窗口边框正下方,但你可能需要在 HTML 渲染工具栏下方显示它们。 例如: ```javascript const { BrowserWindow } = require('electron') @@ -1001,88 +1003,88 @@ win.setSheetOffset(toolbarRect.height) * `flag` Boolean -Starts or stops flashing the window to attract user's attention. +启动或停止闪烁窗口, 以吸引用户的注意。 #### `win.setSkipTaskbar(skip)` * `skip` Boolean -Makes the window not show in the taskbar. +使窗口不显示在任务栏中。 #### `win.setKiosk(flag)` * `flag` Boolean -Enters or leaves kiosk mode. +进入或离开 kiosk 模式。 #### `win.isKiosk()` -Returns `Boolean` - Whether the window is in kiosk mode. +返回 `Boolean` - 判断窗口是否处于kiosk模式. #### `win.isTabletMode()` _Windows_ -Returns `Boolean` - Whether the window is in Windows 10 tablet mode. +返回 `Boolean` - 无论当前窗口是否处在 Windows 10 平板模式 -Since Windows 10 users can [use their PC as tablet](https://support.microsoft.com/en-us/help/17210/windows-10-use-your-pc-like-a-tablet), under this mode apps can choose to optimize their UI for tablets, such as enlarging the titlebar and hiding titlebar buttons. +因为 Windows 10 用户可以 [将他们的 PC 作为平板电脑来使用](https://support.microsoft.com/en-us/help/17210/windows-10-use-your-pc-like-a-tablet),在此模式下,应用可以选择为平板电脑的界面做出优化,如扩展标题栏和隐藏标题栏按钮。 -This API returns whether the window is in tablet mode, and the `resize` event can be be used to listen to changes to tablet mode. +此 API 返回 窗口是否在平板电脑模式下,并且 `调整大小` 事件可以用于监听对平板模式的更改。 #### `win.getMediaSourceId()` -Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1324:0". +返回 `String` - DesktopCapturerSource的id格式的窗口 id 。 例如 "window:1324:0"。 -More precisely the format is `window:id:other_id` where `id` is `HWND` on Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on Linux. `other_id` is used to identify web contents (tabs) so within the same top level window. +更确切地说,格式是 `window:id:other_id`。在Windows上 `id` 是 `HWND` 类型;在macOS上是 `CGWindowID` (`uint64_t`);在Linux上是 `Window` (`unsigned long`)。 `other_id` 用于识别同一顶层窗口内的Web 内容 (选项卡)。 #### `win.getNativeWindowHandle()` -Returns `Buffer` - The platform-specific handle of the window. +返回 `Buffer` - 窗口的平台特定句柄 -The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and `Window` (`unsigned long`) on Linux. +Windows上句柄类型为 `HWND`,macOS 上为 `NSView*`,Linux 上为`Window` (`unsigned long`) #### `win.hookWindowMessage(message, callback)` _Windows_ * `message` Integer * `callback` Function - * `wParam` any - The `wParam` provided to the WndProc - * `lParam` any - The `lParam` provided to the WndProc + * `wParam` any - 提供给 WndProc的 `wParam` 值。 + * `lParam` any - 提供给 WndProc的 `lParam` 值。 -Hooks a windows message. The `callback` is called when the message is received in the WndProc. +钩住窗口消息。 当消息到达 WndProc 时调用`callback` 。 #### `win.isWindowMessageHooked(message)` _Windows_ * `message` Integer -Returns `Boolean` - `true` or `false` depending on whether the message is hooked. +返回 `Boolean` - `true` 或`false` ,具体取决于是否钩挂了消息. #### `win.unhookWindowMessage(message)` _Windows_ * `message` Integer -Unhook the window message. +取消窗口信息的钩子。 #### `win.unhookAllWindowMessages()` _Windows_ -Unhooks all of the window messages. +取消所有窗口信息的钩子。 #### `win.setRepresentedFilename(filename)` _macOS_ * `filename` String -Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar. +设置窗口所代表的文件的路径名,并且将这个文件的图标放在窗口标题栏上。 #### `win.getRepresentedFilename()` _macOS_ -Returns `String` - The pathname of the file the window represents. +返回 `String` - 获取窗口当前文件路径. #### `win.setDocumentEdited(edited)` _macOS_ * `edited` Boolean -Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to `true`. +明确指出窗口文档是否可以编辑, 如果设置为`true`则将标题栏的图标变成灰色. #### `win.isDocumentEdited()` _macOS_ -Returns `Boolean` - Whether the window's document has been edited. +返回 `Boolean` - 判断当前窗口文档是否可编辑. #### `win.focusOnWebView()` @@ -1090,29 +1092,29 @@ Returns `Boolean` - Whether the window's document has been edited. #### `win.capturePage([rect])` -* `rect` [Rectangle](structures/rectangle.md) (optional) - The bounds to capture +* `rect` [Rectangle](structures/rectangle.md) (可选) - 捕获的区域 -Returns `Promise` - Resolves with a [NativeImage](native-image.md) +返回 `Promise` - 完成后返回一个[NativeImage](native-image.md) -Captures a snapshot of the page within `rect`. Omitting `rect` will capture the whole visible page. If the page is not visible, `rect` may be empty. +在 `rect`内捕获页面的快照。 省略 `rect` 将捕获整个可见页面。 如果页面不可见, `rect` 可能是空的。 #### `win.loadURL(url[, options])` * `url` String * `options` Object (可选) - * `httpReferrer` (String | [Referrer](structures/referrer.md)) (optional) - An HTTP Referrer URL. - * `userAgent` String (optional) - A user agent originating the request. - * `extraHeaders` String (optional) - Extra headers separated by "\n" + * `httpReferrer` (String | [Referrer](structures/referrer.md)) (可选) - HTTP 引用 url。 + * `userAgent` String (可选) - 发起请求的 userAgent. + * `extraHeaders` String (可选) - 用 "\n" 分割的额外标题 * `postData` ([UploadRawData](structures/upload-raw-data.md) | [UploadFile](structures/upload-file.md))[] (optional) - * `baseURLForDataURL` String (optional) - Base URL (with trailing path separator) for files to be loaded by the data URL. This is needed only if the specified `url` is a data URL and needs to load other files. + * `baseURLForDataURL` String (可选) - 要由数据URL加载的文件基本URL(末尾带有路径分隔符)。 仅当指定的`url`是数据url并且需要加载其他文件时,才需要此选项。 -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +返回 `Promise` - 当页面完成加载后 promise 将会resolve (见 [`did-finish-load`](web-contents.md#event-did-finish-load)),如果页面加载失败,则 reject (见 [`did-fail-load`](web-contents.md#event-did-fail-load))。 -Same as [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options). +与 [`webContents.loadURL(url[, options])`](web-contents.md#contentsloadurlurl-options) 相同。 -The `url` can be a remote address (e.g. `http://`) or a path to a local HTML file using the `file://` protocol. +`url` 可以是远程地址 (例如 `http://`),也可以是 `file://` 协议的本地HTML文件的路径. -To ensure that file URLs are properly formatted, it is recommended to use Node's [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject) method: +为了确保文件网址格式正确, 建议使用Node的 [` url.format `](https://nodejs.org/api/url.html#url_url_format_urlobject) 方法: ```javascript const url = require('url').format({ @@ -1124,7 +1126,7 @@ const url = require('url').format({ win.loadURL(url) ``` -You can load a URL using a `POST` request with URL-encoded data by doing the following: +您可以通过执行以下操作, 使用带有网址编码数据的 `POST`请求​​加载网址: ```javascript win.loadURL('http://localhost:8000/post', { @@ -1140,164 +1142,164 @@ win.loadURL('http://localhost:8000/post', { * `filePath` String * `options` Object (可选) - * `query` Record (optional) - Passed to `url.format()`. - * `search` String (optional) - Passed to `url.format()`. - * `hash` String (optional) - Passed to `url.format()`. + * `query` Record (可选) - 传递给 `url.format()`. + * `search` String (可选) - 传递给 `url.format()`. + * `hash` String (可选) - 传递给 `url.format()`. -Returns `Promise` - the promise will resolve when the page has finished loading (see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects if the page fails to load (see [`did-fail-load`](web-contents.md#event-did-fail-load)). +返回 `Promise` - 当页面完成加载后 promise 将会resolve (见 [`did-finish-load`](web-contents.md#event-did-finish-load)),如果页面加载失败,则 reject (见 [`did-fail-load`](web-contents.md#event-did-fail-load))。 -Same as `webContents.loadFile`, `filePath` should be a path to an HTML file relative to the root of your application. See the `webContents` docs for more information. +与 `webContents.loadFile`相同, `filePath` 应该是一个与你的应用程序的根路径相关的HTML文件路径。 有关更多信息,请参阅`webContents` 文档。 #### `win.reload()` -Same as `webContents.reload`. +与 `webContents.reload` 相同. #### `win.setMenu(menu)` _Linux_ _Windows_ * `menu` Menu | null -Sets the `menu` as the window's menu bar. +将 `menu` 设置为窗口的菜单栏。 #### `win.removeMenu()` _Linux_ _Windows_ -Remove the window's menu bar. +删除窗口的菜单栏。 #### `win.setProgressBar(progress[, options])` * `progress` Double * `options` Object (可选) - * `mode` String _Windows_ - Mode for the progress bar. Can be `none`, `normal`, `indeterminate`, `error` or `paused`. + * `mode` String _Windows_ - 进度条的状态。 可以是 `none`, `normal`, `indeterminate`, `error` 或 `paused`。 -Sets progress value in progress bar. Valid range is [0, 1.0]. +设置进度条的进度值。 有效范围为 [0, 1.0]。 -Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1. +当进度小于0时不显示进度; 当进度大于0时显示结果不确定. -On Linux platform, only supports Unity desktop environment, you need to specify the `*.desktop` file name to `desktopName` field in `package.json`. By default, it will assume `{app.name}.desktop`. +在 Linux 平台上,只支持 Unity 桌面模式, 你需要在 `package.json` 中为 `desktopName` 指定 `*.desktop` 的文件名. 默认情况下,将取 `{app.name}.desktop`。 -On Windows, a mode can be passed. Accepted values are `none`, `normal`, `indeterminate`, `error`, and `paused`. If you call `setProgressBar` without a mode set (but with a value within the valid range), `normal` will be assumed. +在 Windows 上, 可以传递模式。 可以接受的值为`none`, `normal`, `indeterminate`, `error`和 `paused`. 如果没有设置模式 (但值在有效范围内) 的情况下调用 ` setProgressBar `, 默认值为` normal `。 #### `win.setOverlayIcon(overlay, description)` _Windows_ -* `overlay` [NativeImage](native-image.md) | null - the icon to display on the bottom right corner of the taskbar icon. If this parameter is `null`, the overlay is cleared -* `description` String - a description that will be provided to Accessibility screen readers +* `overlay` [NativeImage](native-image.md) | null - 右下角任务栏的显示图标。 如果此参数是 `null`,覆盖层层会被清除。 +* `description` String -提供给屏幕阅读器的描述文字 -Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user. +在当前任务栏图标上设置一个 16 x 16 像素的图标, 通常用于传达某种应用程序状态或被动地通知用户。 #### `win.setHasShadow(hasShadow)` * `hasShadow` Boolean -Sets whether the window should have a shadow. +设置窗口是否有阴影。 #### `win.hasShadow()` -Returns `Boolean` - Whether the window has a shadow. +返回 `Boolean` - 判断窗口是否有阴影. #### `win.setOpacity(opacity)` _Windows_ _macOS_ -* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque) +* `opacity` Number - 介于0.0 ( 完全透明 ) 和1.0 ( 完全不透明 ) 之间 -Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the [0, 1] range. +设置窗口的不透明度。 在Linux上不起作用。 超出界限的数值被限制在[0, 1] 范围内。 #### `win.getOpacity()` -Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1. +返回 `Number` - 介于0.0 (完全透明) 和1.0 (完全不透明) 之间。 在Linux上,始终返回1。 -#### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_ +#### `win.setShape(rects)` _Windows_ _Linux_ _实验性_ -* `rects` [Rectangle[]](structures/rectangle.md) - Sets a shape on the window. Passing an empty list reverts the window to being rectangular. +* `rects` [Rectangle[]](structures/rectangle.md) - 在窗口上设置形状。 通过传入空列表将窗口恢复为矩形。 -Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window. +对窗口形状的设置决定了窗口内系统允许绘制与用户交互的区域. 在给定的区域外, 没有像素会被绘制, 且没有鼠标事件会被登记. 在该区域外的鼠标事件将不会被该窗口接收, 而是落至该窗口后方的任意窗口. #### `win.setThumbarButtons(buttons)` _Windows_ * `buttons` [ThumbarButton[]](structures/thumbar-button.md) -Returns `Boolean` - Whether the buttons were added successfully +返回 `Boolean` - 按钮是否成功添加 -Add a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout. Returns a `Boolean` object indicates whether the thumbnail has been added successfully. +将指定的一组按钮添加到菜单栏的缩图工具栏上。 返回一个 `Boolean` 对象表示是否成功地添加了缩略图. -The number of buttons in thumbnail toolbar should be no greater than 7 due to the limited room. Once you setup the thumbnail toolbar, the toolbar cannot be removed due to the platform's limitation. But you can call the API with an empty array to clean the buttons. +由于空间有限, 缩图工具栏中的按钮数量不要超过7个。 一旦设置了缩略图工具栏,则无法删除。 但你可以通过调用 API 传递一个空数组来清除按钮. -The `buttons` is an array of `Button` objects: +`buttons` 是一个 `Button` 对象的数组: * `Button` Object - * `icon` [NativeImage](native-image.md) - The icon showing in thumbnail toolbar. + * `icon` [NativeImage](native-image.md) - 在缩图工具栏上显示的图标. * `click` Function - * `tooltip` String (optional) - The text of the button's tooltip. - * `flags` String[] (optional) - Control specific states and behaviors of the button. By default, it is `['enabled']`. + * `tooltip` String (可选) - 按钮的提示文本. + * `flags` String[] (可选) - 控制按钮的特定状态和行为。 默认情况下,值为 `['enabled']`。 -The `flags` is an array that can include following `String`s: +`flags` 属性是一个数组,包含以下`String`类型的值: -* `enabled` - The button is active and available to the user. -* `disabled` - The button is disabled. It is present, but has a visual state indicating it will not respond to user action. -* `dismissonclick` - When the button is clicked, the thumbnail window closes immediately. -* `nobackground` - Do not draw a button border, use only the image. -* `hidden` - The button is not shown to the user. -* `noninteractive` - The button is enabled but not interactive; no pressed button state is drawn. This value is intended for instances where the button is used in a notification. +* `enabled` - 该按钮处于活动状态并可供用户使用. +* `disabled` - 按钮已禁用。 会以一种视觉状态表示它不会响应用户操作的形式显示。 +* `dismissonclick` - 当按钮被点击时,缩略图窗口立即关闭。 +* `nobackground` - 仅仅使用图像而不绘制边框。 +* `hidden` - 该按钮对用户不可见。 +* `noninteractive` - 按钮已启用,但不交互;不绘制按钮按下的状态。 此值用于在通知中使用按钮的实例。 #### `win.setThumbnailClip(region)` _Windows_ -* `region` [Rectangle](structures/rectangle.md) - Region of the window +* `region` [Rectangle](structures/rectangle.md) 窗口的区域 -Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: `{ x: 0, y: 0, width: 0, height: 0 }`. +将窗口的区域设置为在任务栏中悬停在窗口上方时显示的缩略图图像。 通过指定空区域:`{ x: 0, y: 0, width: 0, height: 0 }`,可以重置整个窗口的缩略图。 #### `win.setThumbnailToolTip(toolTip)` _Windows_ * `toolTip` String -Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar. +设置在任务栏中悬停在窗口缩略图上时显示的工具提示。 #### `win.setAppDetails(options)` _Windows_ * `选项` 对象 - * `appId` String (optional) - Window's [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx). It has to be set, otherwise the other options will have no effect. - * `appIconPath` String (optional) - Window's [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx). - * `appIconIndex` Integer (optional) - Index of the icon in `appIconPath`. Ignored when `appIconPath` is not set. 默认值为 `0`. - * `relaunchCommand` String (optional) - Window's [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx). - * `relaunchDisplayName` String (optional) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx). + * `appId` String (可选) - 窗口的 [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx). 该项必须设置, 否则其他选项将没有效果. + * `appIconPath` String (可选) -窗口的 [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx). + * `appIconIndex` Integer (可选) - `appIconPath`中的图标索引。 未设置 `appIconPath` 时忽略。 默认值为 `0`. + * `relaunchCommand` String (可选) - 窗口的 [重新启动命令](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx). + * `relaunchDisplayName` String (可选) - 窗口的[重新启动显示名称](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx). -Sets the properties for the window's taskbar button. +设置窗口任务栏按钮的属性。 -**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set together. If one of those properties is not set, then neither will be used. +**注意:**必须始终同时设置 `relaunchCommand` 和 `relaunchDisplayName`。 如果其中一个属性没有设置,那么这两个属性都不会使用。 #### `win.showDefinitionForSelection()` _macOS_ -Same as `webContents.showDefinitionForSelection()`. +和 `webContents.showDefinitionForSelection()` 相同. #### `win.setIcon(icon)` _Windows_ _Linux_ * `icon` [NativeImage](native-image.md) | String -Changes window icon. +设置窗口图标 #### `win.setWindowButtonVisibility(visible)` _macOS_ * `visible` Boolean -Sets whether the window traffic light buttons should be visible. +设置是否窗口交通灯需要显示。 #### `win.setAutoHideMenuBar(hide)` * `hide` Boolean -Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single `Alt` key. +设置窗口菜单栏是否自动隐藏。 一旦设置,菜单栏将只在用户单击 `Alt` 键时显示。 -If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately. +如果菜单栏已经可见, 调用 `setAutoHideMenuBar(true)`时不会立刻隐藏。 #### `win.isMenuBarAutoHide()` -Returns `Boolean` - Whether menu bar automatically hides itself. +返回 `Boolean` - 判断窗口的菜单栏是否自动隐藏. #### `win.setMenuBarVisibility(visible)` _Windows_ _Linux_ * `visible` Boolean -Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key. +设置菜单栏是否可见。 如果菜单栏自动隐藏,用户仍然可以通过单击 `Alt` 键来唤出菜单栏。 #### `win.isMenuBarVisible()` -Returns `Boolean` - Whether the menu bar is visible. +返回 `Boolean` - 判断窗口的菜单栏是否可见. #### `win.setVisibleOnAllWorkspaces(visible[, options])` @@ -1306,95 +1308,99 @@ Returns `Boolean` - Whether the menu bar is visible. * `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether the window should be visible above fullscreen windows. * `skipTransformProcessType` Boolean (optional) _macOS_ - Calling setVisibleOnAllWorkspaces will by default transform the process type between UIElementApplication and ForegroundApplication to ensure the correct behavior. However, this will hide the window and dock for a short time every time it is called. If your window is already of type UIElementApplication, you can bypass this transformation by passing true to skipTransformProcessType. -Sets whether the window should be visible on all workspaces. +设置窗口是否在所有工作空间上可见 -**Note:** This API does nothing on Windows. +**注意:** 该 API 在 Windows 上无效. #### `win.isVisibleOnAllWorkspaces()` -Returns `Boolean` - Whether the window is visible on all workspaces. +返回 `Boolean` - 判断窗口是否在所有工作空间上可见. -**Note:** This API always returns false on Windows. +**注意:** 该 API 在 Windows 上始终返回 false. #### `win.setIgnoreMouseEvents(ignore[, options])` * `ignore` Boolean * `options` Object (可选) - * `forward` Boolean (optional) _macOS_ _Windows_ - If true, forwards mouse move messages to Chromium, enabling mouse related events such as `mouseleave`. Only used when `ignore` is true. If `ignore` is false, forwarding is always disabled regardless of this value. + * `forward` Boolean (可选) _macOS_ _Windows_ - 如果为 true, 传递鼠标移动消息给 Chromium,鼠标相关事件将可用,如 `mouseleave`。 仅当` ignore 为 true 时才被使用。 如果 ignore` 为 false, 转发始终是禁用的,不管这个值是什么。 -Makes the window ignore all mouse events. +忽略窗口内的所有鼠标事件 -All mouse events happened in this window will be passed to the window below this window, but if this window has focus, it will still receive keyboard events. +在此窗口中发生的所有鼠标事件将被传递到此窗口下面的窗口, 但如果此窗口具有焦点, 它仍然会接收键盘事件 #### `win.setContentProtection(enable)` _macOS_ _Windows_ * `enable` Boolean -Prevents the window contents from being captured by other apps. +防止窗口内容被其他应用捕获 -On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. For Windows 10 version 2004 and up the window will be removed from capture entirely, older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window. +在 macOS 上,它将 NSWindow 的 sharingType 设置为 NSWindowSharingNone。 在 Windows 上,它以参数为 `WDA_EXCLUDEFROMCAPTURE` 调用 SetWindowDisplayAffinity 。 对于 Windows 10 2004以上版,本窗口将完全从抓取中移除,在低版本 Windows 上其行为就像是 `WDA_MONITOR` 捕捉了黑色窗口。 #### `win.setFocusable(focusable)` _macOS_ _Windows_ * `focusable` Boolean -Changes whether the window can be focused. +设置窗口是否可聚焦 + +在 macOS 上,该方法不会从窗口中移除焦点。 + +#### `win.isFocusable()` _macOS_ _Windows_ -On macOS it does not remove the focus from the window. +Returns whether the window can be focused. #### `win.setParentWindow(parent)` * `parent` BrowserWindow | null -Sets `parent` as current window's parent window, passing `null` will turn current window into a top-level window. +设置 `parent` 为当前窗口的父窗口. 为`null`时表示将当前窗口转为顶级窗口 #### `win.getParentWindow()` -Returns `BrowserWindow` - The parent window. +返回 `BrowserWindow` - 父窗口. #### `win.getChildWindows()` -Returns `BrowserWindow[]` - All child windows. +返回 `BrowserWindow[]` - 首页的子窗口. #### `win.setAutoHideCursor(autoHide)` _macOS_ * `autoHide` Boolean -Controls whether to hide cursor when typing. +设置输入时是否隐藏光标 #### `win.selectPreviousTab()` _macOS_ -Selects the previous tab when native tabs are enabled and there are other tabs in the window. +当启用本地选项卡,并且窗口中有另一个标签时,选择上一个选项卡。 #### `win.selectNextTab()` _macOS_ -Selects the next tab when native tabs are enabled and there are other tabs in the window. +当启用本地选项卡,并且窗口中有另一个标签时,选择下一个选项卡。 #### `win.mergeAllWindows()` _macOS_ -Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window. +当启用本地选项卡并且存在多个打开窗口时,将所有窗口合并到一个带有多个选项卡的窗口中。 #### `win.moveTabToNewWindow()` _macOS_ -Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window. +如果启用了本机选项卡并且当前窗口中有多个选项卡,则将当前选项卡移动到新窗口中。 #### `win.toggleTabBar()` _macOS_ -Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window. +如果启用了本机选项卡并且当前窗口中只有一个选项卡,则切换选项卡栏是否可见。 #### `win.addTabbedWindow(browserWindow)` _macOS_ * `browserWindow` BrowserWindow -Adds a window as a tab on this window, after the tab for the window instance. +在该窗口中添加一个窗口作为选项卡,位于窗口实例的选项卡之后。 #### `win.setVibrancy(type)` _macOS_ -* `type` String | null - Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. See the [macOS documentation][vibrancy-docs] for more details. +* `type` String | null - 可以是 `appearance-based`,`light`,`dark`,`titlebar`,`selection`,`menu`,`popover`,`sidebar`,`medium-light`,`ultra-dark`,`header`,`sheet`,`window`,`hud`,`fullscreen-ui`,`tooltip`,`content`,`under-window` 或 `under-page`。 更多详细信息,请查阅 [macOS documentation][vibrancy-docs] -Adds a vibrancy effect to the browser window. Passing `null` or an empty string will remove the vibrancy effect on the window. +在浏览器窗口中添加一个动态特效。 传递 `null` 或空字符串将会移除窗口上的动态效果。 -Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS. +请注意, `appearance-based`,`light`,`dark`,`medium-light` 和 `ultra-dark` 已被弃用,并将在即将推出的 macOS 版本中被移除。 #### `win.setTrafficLightPosition(position)` _macOS_ @@ -1410,39 +1416,39 @@ Returns `Point` - The custom position for the traffic light buttons in frameless * `touchBar` TouchBar | null -Sets the touchBar layout for the current window. Specifying `null` or `undefined` clears the touch bar. This method only has an effect if the machine has a touch bar and is running on macOS 10.12.1+. +设置窗口的触摸条布局 设置为 `null` 或`undefined`将清除触摸条. 此方法只有在macOS 10.12.1+且设备支持触摸条TouchBar时可用. -**Note:** The TouchBar API is currently experimental and may change or be removed in future Electron releases. +**注意:** TouchBar API目前为实验性质,可能会更改或删除。 -#### `win.setBrowserView(browserView)` _Experimental_ +#### `win.setBrowserView(browserView)` _实验_ -* `browserView` [BrowserView](browser-view.md) | null - Attach `browserView` to `win`. If there are other `BrowserView`s attached, they will be removed from this window. +* `browserView` [BrowserView](browser-view.md) | null - 将 `browserView` 附加到 `win`。 如果已经附加了其他 `BrowserView`,那么它们将会被从此窗口中移除。 -#### `win.getBrowserView()` _Experimental_ +#### `win.getBrowserView()` _实验功能_ -Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null` if one is not attached. Throws an error if multiple `BrowserView`s are attached. +返回 `BrowserView | null` - 附加到 `win` 的 `BrowserView` 。 如果未附加,则返回 `null`。 如果附加了多个 `BrowserView`,则抛出错误。 -#### `win.addBrowserView(browserView)` _Experimental_ +#### `win.addBrowserView(browserView)` _实验功能_ * `browserView` [BrowserView](browser-view.md) -Replacement API for setBrowserView supporting work with multi browser views. +替代 setBrowserView 的API,支持多个browserView一起使用。 -#### `win.removeBrowserView(browserView)` _Experimental_ +#### `win.removeBrowserView(browserView)` _实验功能_ * `browserView` [BrowserView](browser-view.md) -#### `win.setTopBrowserView(browserView)` _Experimental_ +#### `win.setTopBrowserView(browserView)` _实验功能_ * `browserView` [BrowserView](browser-view.md) -Raises `browserView` above other `BrowserView`s attached to `win`. Throws an error if `browserView` is not attached to `win`. +提高 `browserView` 于其它附加到 `win` 的 `BrowserView` 之上 。 如果 `browserView` 未附加到 `win`,则抛出错误。 -#### `win.getBrowserViews()` _Experimental_ +#### `win.getBrowserViews()` _实验功能_ -Returns `BrowserView[]` - an array of all BrowserViews that have been attached with `addBrowserView` or `setBrowserView`. +返回 `BrowserView[]` - 所有通过 `addBrowserView` 或 `setBrowserView` 附加的BrowserView数组。 -**Note:** The BrowserView API is currently experimental and may change or be removed in future Electron releases. +**注意:** BrowserView 的 API目前为实验性质,可能会更改或删除。 [runtime-enabled-features]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/runtime_enabled_features.json5?l=70 [page-visibility-api]: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API @@ -1451,3 +1457,5 @@ Returns `BrowserView[]` - an array of all BrowserViews that have been attached w [window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level [chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/zh-CN/docs/api/clipboard.md b/content/zh-CN/docs/api/clipboard.md index 2d047c6b00ae2..995736de5951a 100644 --- a/content/zh-CN/docs/api/clipboard.md +++ b/content/zh-CN/docs/api/clipboard.md @@ -193,7 +193,7 @@ const { clipboard } = require('electron') const hasFormat = clipboard.has('

    selection

    ') console.log(hasFormat) -// 'true' or 'false +// 'true' or 'false' ``` ### `clipboard.read(format)` _实验功能_ @@ -202,6 +202,8 @@ console.log(hasFormat) 返回 ` String `- 从剪贴板中读取 ` format ` 类型的内容。 +`format` should contain valid ASCII characters and have `/` separator. `a/c`, `a/bc` are valid formats while `/abc`, `abc/`, `a/`, `/a`, `a` are not valid. + ### `clipboard.readBuffer(format)` _实验功能_ * `format` String @@ -212,9 +214,9 @@ console.log(hasFormat) const { clipboard } = require('electron') const buffer = Buffer.from('this is binary', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) -const ret = clipboard.readBuffer('public.utf8-plain-text') +const ret = clipboard.readBuffer('public/utf8-plain-text') console.log(buffer.equals(out)) // true @@ -232,7 +234,7 @@ console.log(buffer.equals(out)) const { clipboard } = require('electron') const buffer = Buffer.from('writeBuffer', 'utf8') -clipboard.writeBuffer('public.utf8-plain-text', buffer) +clipboard.writeBuffer('public/utf8-plain-text', buffer) ``` ### `clipboard.write(data[, type])` diff --git a/content/zh-CN/docs/api/command-line-switches.md b/content/zh-CN/docs/api/command-line-switches.md index 11b37441591e0..669973ce293fa 100644 --- a/content/zh-CN/docs/api/command-line-switches.md +++ b/content/zh-CN/docs/api/command-line-switches.md @@ -59,17 +59,18 @@ app.whenReady().then(() => { 开启以下API 的调用堆栈日志记录(过滤事件): * `desktopCapturer.getSources()` / `desktop-capturer-get-sources` -* `remote.require()` / `remote-require` -* `remote.getGlobal()` / `remote-get-builtin` -* `remote.getBuiltin()` / `remote-get-global` -* `remote.getCurrentWindow()` / `remote-get-current-window` -* `remote.getCurrentWebContents()` / `remote-get-current-web-contents` -### --enable-logging +### --enable-logging[=file] -在控制台打印Chromium日志. +Prints Chromium's logging to stderr (or a log file). -这个开关不能用于`app.commandLine.appendSwitch`, 因为它在用户应用程序加载之前就被解析了, 但是你可以设置`ELECTRON_ENABLE_LOGGING`环境变量来达到同样的效果. +The `ELECTRON_ENABLE_LOGGING` environment variable has the same effect as passing `--enable-logging`. + +Passing `--enable-logging` will result in logs being printed on stderr. Passing `--enable-logging=file` will result in logs being saved to the file specified by `--log-file=...`, or to `electron_debug.log` in the user-data directory if `--log-file` is not specified. + +> **Note:** On Windows, logs from child processes cannot be sent to stderr. Logging to a file is the most reliable way to collect logs on Windows. + +See also `--log-file`, `--log-level`, `--v`, and `--vmodule`. ### --force-fieldtrials=`trials` @@ -116,10 +117,26 @@ $ electron --js-flags="--harmony_proxies --harmony_collections" your-app 设置系统语言环境 +### --log-file=`path` + +If `--enable-logging` is specified, logs will be written to the given path. The parent directory must exist. + +Setting the `ELECTRON_LOG_FILE` environment variable is equivalent to passing this flag. If both are present, the command-line switch takes precedence. + ### --log-net-log=`path` 启用需要保存的网络日志事件并将其写入`path`路径下. +### --log-level=`N` + +Sets the verbosity of logging when used together with `--enable-logging`. `N` should be one of [Chrome's LogSeverities][severities]. + +Note that two complimentary logging mechanisms in Chromium -- `LOG()` and `VLOG()` -- are controlled by different switches. `--log-level` controls `LOG()` messages, while `--v` and `--vmodule` control `VLOG()` messages. So you may want to use a combination of these three switches depending on the granularity you want and what logging calls are made by the code you're trying to watch. + +See [Chromium Logging source][logging] for more information on how `LOG()` and `VLOG()` interact. Loosely speaking, `VLOG()` can be thought of as sub-levels / per-module levels inside `LOG(INFO)` to control the firehose of `LOG(INFO)` data. + +See also `--enable-logging`, `--log-level`, `--v`, and `--vmodule`. + ### --no-proxy-server 不使用代理服务器,并始终保持直连。 会覆盖其他代理服务器标记。 @@ -159,6 +176,8 @@ app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com 这个开关只有在`--enable-logging`也被传递时才起效. +See also `--enable-logging`, `--log-level`, and `--vmodule`. + ### --vmodule=`pattern` 给定每个模块最大的V-logging等级, 覆盖`--v`设定的值. 如下: `my_module=2,foo*=3` 会更改所有代码在源文件 `my_module.*` 和 `foo*.*` 中的日志级别。 @@ -167,6 +186,8 @@ app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com 这个开关只有在`--enable-logging`也被传递时才起效. +See also `--enable-logging`, `--log-level`, and `--v`. + ### --force_high_performance_gpu 当有多个GPU可用时,强制使用独立显卡。 @@ -214,5 +235,7 @@ Electron 支持一些 Node.js 支持的 [CLI flags][node-cli]。 [ready]: app.md#event-ready [play-silent-audio]: https://github.com/atom/atom/pull/9485/files [debugging-main-process]: ../tutorial/debugging-main-process.md +[logging]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h [node-cli]: https://nodejs.org/api/cli.html [node-cli]: https://nodejs.org/api/cli.html +[severities]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h?q=logging::LogSeverity&ss=chromium diff --git a/content/zh-CN/docs/api/dialog.md b/content/zh-CN/docs/api/dialog.md index 45146ca39de8f..f02cfe03e2d94 100644 --- a/content/zh-CN/docs/api/dialog.md +++ b/content/zh-CN/docs/api/dialog.md @@ -186,8 +186,6 @@ dialog.showOpenDialog(mainWindow, { * `defaultId` Integer (可选) - 在 message box 对话框打开的时候,设置默认选中的按钮,值为在 buttons 数组中的索引. * `title` String (可选) - message box 的标题,一些平台不显示. * `detail` String (可选) - 额外信息. - * `checkboxLabel` String (可选) - 如果使用了,消息框将包含带有给定标签的复选框。 - * `checkboxChecked` Boolean (可选) - checkbox 的初始值。 默认值为 `false` * `icon` ([NativeImage](native-image.md) | String) (可选) * `cancelId` Integer (可选) - 用于取消对话框的按钮的索引,例如 `Esc` 键. 默认情况下,它被分配给第一个按钮,文字为 “cancel” 或 “no”。 如果不存在这个标签的按钮,同时该选项又未设置,返回值为`0`。 * `noLink` Boolean (可选) - 在Windows上,应用将尝试找出哪个 `buttons` 是常用按钮(例如 "Cancel" 或 "Yes"),然后在对话框中以链接命令的方式展现其它的按钮。 这可以使对话框以现代Windows应用程序的风格显示。 如果你不喜欢这个行为, 你可以设置 `noLink` 为 `true`. diff --git a/content/zh-CN/docs/api/environment-variables.md b/content/zh-CN/docs/api/environment-variables.md index d3baeca7f68df..f69b190262b6e 100644 --- a/content/zh-CN/docs/api/environment-variables.md +++ b/content/zh-CN/docs/api/environment-variables.md @@ -104,7 +104,15 @@ Set the trash implementation on Linux. 默认值为 `gio`. ### `ELECTRON_ENABLE_LOGGING` -将 Chrome 的内部日志打印到控制台。 +Prints Chromium's internal logging to the console. + +Setting this variable is the same as passing `--enable-logging` on the command line. For more info, see `--enable-logging` in [command-line switches](./command-line-switches.md#enable-loggingfile). + +### `ELECTRON_LOG_FILE` + +Sets the file destination for Chromium's internal logging. + +Setting this variable is the same as passing `--log-file` on the command line. For more info, see `--log-file` in [command-line switches](./command-line-switches.md#log-filepath). ### `ELECTRON_DEBUG_DRAG_REGIONS` @@ -112,7 +120,7 @@ Adds coloration to draggable regions on [`BrowserView`](./browser-view.md)s on m ### `ELECTRON_DEBUG_NOTIFICATIONS` -Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common actions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. +Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common a tions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to. Sample output: diff --git a/content/zh-CN/docs/api/extensions.md b/content/zh-CN/docs/api/extensions.md index ba4848bd07abe..cc18bd9859073 100644 --- a/content/zh-CN/docs/api/extensions.md +++ b/content/zh-CN/docs/api/extensions.md @@ -64,6 +64,7 @@ session.loadExtension('path/to/unpacked/extension').then(({ id }) => { - `chrome.runtime.getURL` - `chrome.runtime.connect` - `chrome.runtime.sendMessage` +- `chrome.runtime.reload` 支持 `chrome.runtime` 的以下事件: diff --git a/content/zh-CN/docs/api/frameless-window.md b/content/zh-CN/docs/api/frameless-window.md index 68efe98640ca7..ae3eb204c0e4b 100644 --- a/content/zh-CN/docs/api/frameless-window.md +++ b/content/zh-CN/docs/api/frameless-window.md @@ -14,13 +14,13 @@ const win = new BrowserWindow({ width: 800, height: 600, frame: false }) win.show() ``` -### macOS 上的其他方案 +### Alternatives -要实现无边框窗口还有其他的方案。 将`frame`设置为`false`会将标题栏和窗口控制按钮全部隐藏,但实际上,你可能希望隐藏标题栏并将内容区域全屏的同时,依旧保留窗口控制按钮("红绿灯")来进行标准窗口操作。 你可以通过指定 ` titleBarStyle ` 选项来完成此操作: +There's an alternative way to specify a chromeless window on macOS and Windows. Instead of setting `frame` to `false` which disables both the titlebar and window controls, you may want to have the title bar hidden and your content extend to the full window size, yet still preserve the window controls ("traffic lights" on macOS) for standard window actions. 你可以通过指定 ` titleBarStyle ` 选项来完成此操作: #### `hidden` -返回一个隐藏标题栏的全尺寸内容窗口,在左上角仍然有标准的窗口控制按钮(俗称“红绿灯”)。 +Results in a hidden title bar and a full size content window. On macOS, the title bar still has the standard window controls (“traffic lights”) in the top left. ```javascript const { BrowserWindow } = require('electron') @@ -28,6 +28,8 @@ const win = new BrowserWindow({ titleBarStyle: 'hidden' }) win.show() ``` +### macOS 上的其他方案 + #### `hiddenInset` 返回一个另一种隐藏了标题栏的窗口,其中控制按钮到窗口边框的距离更大。 @@ -48,6 +50,33 @@ const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: fa win.show() ``` +## Windows Control Overlay + +When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS, using one of the `titleBarStyle`s as described above so that the traffic lights are visible, or using `titleBarStyle: hidden` on Windows, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true. Specifying `true` will result in an overlay with default system colors. + +On Windows, you can also specify the color of the overlay and its symbols by setting `titleBarOverlay` to an object with the options `color` and `symbolColor`. If an option is not specified, the color will default to its system color for the window control buttons: + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: true +}) +win.show() +``` + +```javascript +const { BrowserWindow } = require('electron') +const win = new BrowserWindow({ + titleBarStyle: 'hidden', + titleBarOverlay: { + color: '#2f3241', + symbolColor: '#74b1be' + } +}) +win.show() +``` + ## 透明窗口 通过将 ` transparent ` 选项设置为 ` true `, 还可以使无框窗口透明: @@ -142,3 +171,5 @@ button { 在某些平台上,可拖拽区域不被视为窗口的实际内容,而是作为窗口边框处理,因此在右键单击时会弹出系统菜单。 要使上下文菜单在所有平台上都正确运行, 您永远也不要在可拖拽区域上使用自定义上下文菜单。 [ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options +[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis +[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables diff --git a/content/zh-CN/docs/api/ipc-main.md b/content/zh-CN/docs/api/ipc-main.md index b4f5949ebc16f..690a7e94c4c78 100644 --- a/content/zh-CN/docs/api/ipc-main.md +++ b/content/zh-CN/docs/api/ipc-main.md @@ -32,6 +32,8 @@ ipcMain.on('synchronous-message', (event, arg) => { ```javascript //在渲染器进程 (网页) 中。 +// NB. Electron APIs are only accessible from preload, unless contextIsolation is disabled. +// See https://www.electronjs.org/docs/tutorial/process-model#preload-scripts for more details. const { ipcRenderer } = require('electron') console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints "pong" diff --git a/content/zh-CN/docs/api/menu-item.md b/content/zh-CN/docs/api/menu-item.md index aabbd13c285b1..ed92817e89bdc 100644 --- a/content/zh-CN/docs/api/menu-item.md +++ b/content/zh-CN/docs/api/menu-item.md @@ -13,7 +13,7 @@ * `menuItem` MenuItem * `browserWindow` [BrowserWindow](browser-window.md) |未定义 - 如果没有打开窗口,则无法定义此定义。 * `event` [KeyboardEvent](structures/keyboard-event.md) - * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. 参见 [roles](#roles) + * `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the `click` property will be ignored. 参见 [roles](#roles) * ` type `String (可选)-可以是 ` normal `、` separator `、` submenu `、` checkbox ` 或 ` radio `。 * `label` String (可选) * `sublabel` String (可选) @@ -128,7 +128,7 @@ A `Menu` (optional) containing the menu item's submenu, if present. #### `menuItem.role` -`String`(可选) 指出菜单项的角色 可为 `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` 或 `windowMenu` +`String`(可选) 指出菜单项的角色 Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` #### `menuItem.accelerator` diff --git a/content/zh-CN/docs/api/menu.md b/content/zh-CN/docs/api/menu.md index 36d35308fcc60..ca40a863c94af 100644 --- a/content/zh-CN/docs/api/menu.md +++ b/content/zh-CN/docs/api/menu.md @@ -236,7 +236,7 @@ const template = [ { role: 'services' }, { type: 'separator' }, { role: 'hide' }, - { role: 'hideothers' }, + { role: 'hideOthers' }, { role: 'unhide' }, { type: 'separator' }, { role: 'quit' } diff --git a/content/zh-CN/docs/api/power-monitor.md b/content/zh-CN/docs/api/power-monitor.md index bbb6c18a4b0c8..f464ade2eb469 100644 --- a/content/zh-CN/docs/api/power-monitor.md +++ b/content/zh-CN/docs/api/power-monitor.md @@ -8,11 +8,11 @@ ` powerMonitor ` 模块触发以下事件: -### Event: 'suspend' _macOS_ _Windows_ +### Event: 'suspend' 在系统挂起时触发。 -### Event: 'resume' _macOS_ _Windows_ +### Event: 'resume' 在系统恢复时触发。 diff --git a/content/zh-CN/docs/api/session.md b/content/zh-CN/docs/api/session.md index 50a9451cf9687..d2354e8872bab 100644 --- a/content/zh-CN/docs/api/session.md +++ b/content/zh-CN/docs/api/session.md @@ -160,7 +160,7 @@ Emitted when a hunspell dictionary file has been successfully downloaded 当hunspell字典下载失败时触发。 如果需要详细信息,你应当查看网络日志并且检查下载请求。 -#### Event: 'select-serial-port' _Experimental_ +#### Event: 'select-serial-port' 返回: @@ -172,21 +172,15 @@ Emitted when a hunspell dictionary file has been successfully downloaded Emitted when a serial port needs to be selected when a call to `navigator.serial.requestPort` is made. `callback` should be called with `portId` to be selected, passing an empty string to `callback` will cancel the request. Additionally, permissioning on `navigator.serial` can be managed by using [ses.setPermissionCheckHandler(handler)](#sessetpermissioncheckhandlerhandler) with the `serial` permission. -Because this is an experimental feature it is disabled by default. To enable this feature, you will need to use the `--enable-features=ElectronSerialChooser` command line switch. Additionally because this is an experimental Chromium feature you will need to set `enableBlinkFeatures: 'Serial'` on the `webPreferences` property when opening a BrowserWindow. - ```javascript const { app, BrowserWindow } = require('electron') let win = null -app.commandLine.appendSwitch('enable-features', 'ElectronSerialChooser') app.whenReady().then(() => { win = new BrowserWindow({ width: 800, - height: 600, - webPreferences: { - enableBlinkFeatures: 'Serial' - } + height: 600 }) win.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => { event.preventDefault() @@ -202,7 +196,7 @@ app.whenReady().then(() => { }) ``` -#### Event: 'serial-port-added' _Experimental_ +#### Event: 'serial-port-added' 返回: @@ -212,7 +206,7 @@ app.whenReady().then(() => { Emitted after `navigator.serial.requestPort` has been called and `select-serial-port` has fired if a new serial port becomes available. For example, this event will fire when a new USB device is plugged in. -#### Event: 'serial-port-removed' _Experimental_ +#### Event: 'serial-port-removed' 返回: @@ -452,7 +446,7 @@ session.fromPartition('some-partition').setPermissionRequestHandler((webContents #### `ses.setPermissionCheckHandler(handler)` * `handler` 函数\ | null - * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. Cross origin sub frames making permission checks will pass a `null` webContents to this handler. You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. + * `webContents` ([WebContents](web-contents.md) | null) - WebContents checking the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin. 所有进行权限检查的跨源子帧将传递一个 `null` 的 webContents 对象给此处理程序,而某些其他权限检查(如 `notifications` 检查)将始终传递一个 `null`。 You should use `embeddingOrigin` and `requestingOrigin` to determine what origin the owning frame and the requesting frame are on respectively. * `permission` String - Type of permission check. Valid values are `midiSysex`, `notifications`, `geolocation`, `media`,`mediaKeySystem`,`midi`, `pointerLock`, `fullscreen`, `openExternal`, or `serial`. * `requestingOrigin` String - The origin URL of the permission check * `details` Object - Some properties are only available on certain permission types. diff --git a/content/zh-CN/docs/api/structures/overlay-options.md b/content/zh-CN/docs/api/structures/overlay-options.md new file mode 100644 index 0000000000000..9e0e4815ea59c --- /dev/null +++ b/content/zh-CN/docs/api/structures/overlay-options.md @@ -0,0 +1,4 @@ +# OverlayOptions Object + +* `color` String (optional) _Windows_ - The CSS color of the Window Controls Overlay when enabled. Default is the system color. +* `symbolColor` String (optional) _Windows_ - The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color. diff --git a/content/zh-CN/docs/api/structures/user-default-types.md b/content/zh-CN/docs/api/structures/user-default-types.md new file mode 100644 index 0000000000000..e3ce82b666dfe --- /dev/null +++ b/content/zh-CN/docs/api/structures/user-default-types.md @@ -0,0 +1,12 @@ +# UserDefaultTypes Object + +* `string` String +* `boolean` Boolean +* `integer` Number +* `float` Number +* `double` Number +* `url` String +* `array` Array\ +* `dictionary` Record\ + +This type is a helper alias, no object will never exist of this type. diff --git a/content/zh-CN/docs/api/system-preferences.md b/content/zh-CN/docs/api/system-preferences.md index b1805462ba94b..c77687917d3a9 100644 --- a/content/zh-CN/docs/api/system-preferences.md +++ b/content/zh-CN/docs/api/system-preferences.md @@ -147,12 +147,12 @@ Same as `subscribeNotification`, but uses `NSNotificationCenter` for local defau 在应用的`NSUserDefaults`配置项中添加其它默认设置。 -### `systemPreferences.getUserDefault(key, type)` _macOS_ +### `systemPreferences.getUserDefault(key, type)` _macOS_ * `key` String -* `type` String - 可以为 `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` 或 `dictionary`. +* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`. -返回 `any` - `NSUserDefaults` 中 `key` 的值. +Returns [`UserDefaultTypes[Type]`](structures/user-default-types.md) - The value of `key` in `NSUserDefaults`. 常用的 `key` 和 `type` 的类型为: diff --git a/content/zh-CN/docs/api/touch-bar-scrubber.md b/content/zh-CN/docs/api/touch-bar-scrubber.md index 1505367feabd4..2180e60cfdfde 100644 --- a/content/zh-CN/docs/api/touch-bar-scrubber.md +++ b/content/zh-CN/docs/api/touch-bar-scrubber.md @@ -14,7 +14,7 @@ * highlightedIndex Integer - 用户选中项排序. * `selectedStyle` String (optional) - Selected item style. Can be `background`, `outline` or `none`. 默认值为:`none`。 * `overlayStyle` String (optional) - Selected overlay item style. Can be `background`, `outline` or `none`. 默认值为:`none`。 - * `showArrowButtons` Boolean (optional) - Defaults to `false`. + * `showArrowButtons` Boolean (可选) - 是否在任务栏中显示窗口。 默认为 `false` 并且只在 `items` 是非空的情况下才显示。 * `mode` String (可选) - 可以是 `fixed` 或 `free`。 默认值为`free`. * `continuous` Boolean (optional) - Defaults to `true`. diff --git a/content/zh-CN/docs/api/web-contents.md b/content/zh-CN/docs/api/web-contents.md index a46e834c478ce..b5e3e1b815e6b 100644 --- a/content/zh-CN/docs/api/web-contents.md +++ b/content/zh-CN/docs/api/web-contents.md @@ -39,6 +39,24 @@ Returns `WebContents` - 此 app 中焦点的 web 内容,否则返回 `null`。 Returns `WebContents` | undefined - A WebContents instance with the given ID, or `undefined` if there is no WebContents associated with the given ID. +### `webContents.fromDevToolsTargetId(targetId)` + +* `targetId` String - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance. + +Returns `WebContents` | undefined - A WebContents instance with the given TargetID, or `undefined` if there is no WebContents associated with the given TargetID. + +When communicating with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), it can be useful to lookup a WebContents instance based on its assigned TargetID. + +```js +async function lookupTargetId (browserWindow) { + const wc = browserWindow.webContents + await wc.debugger.attach('1.3') + const { targetInfo } = await wc.debugger.sendCommand('Target.getTargetInfo') + const { targetId } = targetInfo + const targetWebContents = await webContents.fromDevToolsTargetId(targetId) +} +``` + ## 类: WebContents > 渲染和控制 BrowserWindow 实例的内容。 @@ -134,7 +152,7 @@ Fired when page title is set during navigation. `explicitSet` is false when titl * `frameName` String * `disposition` String - 可以被设置为 `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` 及 `other`. * `options` BrowserWindowConstructorOptions - 用于创建新的 [`BrowserWindow`](browser-window.md). -* `additionalFeatures` String[] - 非标准功能(非标准功能是指这些功能不是由Chromium或Electron处理的功能),这些功能默认指向`window.open()`. +* `additionalFeatures` String[] - 非标准功能(非标准功能是指这些功能不是由Chromium或Electron处理的功能),这些功能默认指向`window.open()`. Deprecated, and will now always be the empty array `[]`. * `referrer` [Referrer](structures/referrer.md) - The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. @@ -178,8 +196,7 @@ myBrowserWindow.webContents.on('new-window', (event, url, frameName, disposition * `details` Object * `url` String - URL for the created window. * `frameName` String - Name given to the created window in the `window.open()` call. - * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: options inherited from the parent, parsed options from the `features` string from `window.open()`, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. - * `additionalFeatures` String[] - The non-standard features (features not handled Chromium or Electron) _Deprecated_ + * `options` BrowserWindowConstructorOptions - The options used to create the BrowserWindow. They are merged in increasing precedence: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Unrecognized options are not filtered out. * `referrer` [Referrer](structures/referrer.md) - The referrer that will be passed to the new window. May or may not result in the `Referer` header being sent, depending on the referrer policy. * `postBody` [PostBody](structures/post-body.md) (optional) - The post data that will be sent to the new window, along with the appropriate headers that will be set. If no post data is to be sent, the value will be `null`. Only defined when the window is being created by a form that set `target=_blank`. * `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, `new-window`, `save-to-disk` and `other`. @@ -320,6 +337,8 @@ win.webContents.on('will-prevent-unload', (event) => { }) ``` +**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the [specification](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). + #### Event: 'crashed' _Deprecated_ 返回: @@ -726,49 +745,6 @@ Emitted when the renderer process sends a synchronous message via `ipcRenderer.s Emitted when `desktopCapturer.getSources()` is called in the renderer process. 调用 `event.preventDefault()` 将使它返回空的sources。 -#### 事件: "remote-require" _弃用_ - -返回: - -* `event` IpcMainEvent -* `moduleName` String - -Emitted when `remote.require()` is called in the renderer process. 调用 `event.preventDefault()` 将阻止模块返回。 可以通过设置 `event.returnValue` 返回自定义值。 - -#### 事件: "remote-get-global" _弃用_ - -返回: - -* `event` IpcMainEvent -* `globalName` String - -Emitted when `remote.getGlobal()` is called in the renderer process. 调用 `event.preventDefault()` 将阻止全局返回。 可以通过设置 `event.returnValue` 返回自定义值。 - -#### 事件: "remote-get-builtin" _弃用_ - -返回: - -* `event` IpcMainEvent -* `moduleName` String - -Emitted when `remote.getBuiltin()` is called in the renderer process. 调用 `event.preventDefault()` 将阻止模块返回。 可以通过设置 `event.returnValue` 返回自定义值。 - -#### 事件: "remote-get-current-window" _弃用_ - -返回: - -* `event` IpcMainEvent - -Emitted when `remote.getCurrentWindow()` is called in the renderer process. 调用 `event.preventDefault()` 将阻止对象返回 可以通过设置 `event.returnValue` 返回自定义值。 - -#### 事件: "remote-get-current-web-contents" _弃用_ - -返回: - -* `event` IpcMainEvent - -Emitted when `remote.getCurrentWebContents()` is called in the renderer process. 调用 `event.preventDefault()` 将阻止对象返回 可以通过设置 `event.returnValue` 返回自定义值。 - #### Event: 'preferred-size-changed' 返回: @@ -1040,7 +1016,7 @@ Ignore application menu shortcuts while this web contents is focused. Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window. Returning an unrecognized value such as a null, undefined, or an object without a recognized 'action' value will result in a console error and have the same effect as returning `{action: 'deny'}`. -Called before creating a window when `window.open()` is called from the renderer. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. +Called before creating a window a new window is requested by the renderer, e.g. by `window.open()`, a link with `target="_blank"`, shift+clicking on a link, or submitting a form with ``. See [`window.open()`](window-open.md) for more details and how to use this in conjunction with `did-create-window`. #### `contents.setAudioMuted(muted)` diff --git a/content/zh-CN/docs/api/web-frame-main.md b/content/zh-CN/docs/api/web-frame-main.md index 63f45436bd6ba..5d44a801b57d6 100644 --- a/content/zh-CN/docs/api/web-frame-main.md +++ b/content/zh-CN/docs/api/web-frame-main.md @@ -1,10 +1,10 @@ # webFrameMain -> Control web pages and iframes. +> 控制页面和内联框架(iframes)。 进程:[主进程](../glossary.md#main-process) -The `webFrameMain` module can be used to lookup frames across existing [`WebContents`](web-contents.md) instances. Navigation events are the common use case. +`webFramework` 模块可以用来查找现有的 [`WebContents`](web-contents.md) 实例。 通常在导航事件中使用。 ```javascript const { BrowserWindow, webFrameMain } = require('electron') @@ -24,7 +24,7 @@ win.webContents.on( ) ``` -You can also access frames of existing pages by using the `mainFrame` property of [`WebContents`](web-contents.md). +您还可以通过使用 [`WebContents`](web-contents.md)的 `mainFrame` 属性 访问现有页面的框架。 ```javascript const { BrowserWindow } = require('electron') @@ -50,12 +50,12 @@ main() ## 方法 -These methods can be accessed from the `webFrameMain` module: +通过`webFrameMain`模块可以访问以下方法: ### `webFrameMain.fromId(processId, routingId)` -* `processId` Integer - An `Integer` representing the internal ID of the process which owns the frame. -* `routingId` Integer - An `Integer` representing the unique frame ID in the current renderer process. Routing IDs can be retrieved from `WebFrameMain` instances (`frame.routingId`) and are also passed by frame specific `WebContents` navigation events (e.g. `did-frame-navigate`). +* `processId` Integer - 表示拥有此框架的进程的内部 ID。 +* `routingId` Integer - 表示当前渲染器进程中唯一框架的 ID 。 Routing IDs can be retrieved from `WebFrameMain` instances (`frame.routingId`) and are also passed by frame specific `WebContents` navigation events (e.g. `did-frame-navigate`). Returns `WebFrameMain | undefined` - A frame with the given process and routing IDs, or `undefined` if there is no WebFrameMain associated with the given IDs. @@ -154,3 +154,9 @@ An `Integer` representing the Chromium internal `pid` of the process which owns #### `frame.routingId` _Readonly_ An `Integer` representing the unique frame id in the current renderer process. Distinct `WebFrameMain` instances that refer to the same underlying frame will have the same `routingId`. + +#### `frame.visibilityState` _只读_ + +A `string` representing the [visibility state](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) of the frame. + +See also how the [Page Visibility API](browser-window.md#page-visibility) is affected by other Electron APIs. diff --git a/content/zh-CN/docs/api/web-request.md b/content/zh-CN/docs/api/web-request.md index 3496c0ce5d2c6..b5b03170e2970 100644 --- a/content/zh-CN/docs/api/web-request.md +++ b/content/zh-CN/docs/api/web-request.md @@ -46,7 +46,7 @@ session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback * `webContentsId` Integer (可选) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `uploadData` [UploadData[]](structures/upload-data.md) @@ -88,7 +88,7 @@ Some examples of valid `urls`: * `webContentsId` Integer (可选) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `requestHeaders` Record @@ -113,7 +113,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (可选) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `requestHeaders` Record @@ -132,7 +132,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (可选) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `statusLine` String @@ -160,7 +160,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (可选) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -182,7 +182,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (可选) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `redirectURL` String @@ -206,7 +206,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (可选) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `responseHeaders` Record (optional) @@ -229,7 +229,7 @@ The `callback` has to be called with a `response` object. * `webContentsId` Integer (可选) * `webContents` WebContents (optional) * `frame` WebFrameMain (optional) - * `resourceType` String + * `resourceType` String - Can be `mainFrame`, `subFrame`, `stylesheet`, `script`, `image`, `font`, `object`, `xhr`, `ping`, `cspReport`, `media`, `webSocket` or `other`. * `referrer` String * `timestamp` Double * `fromCache` Boolean diff --git a/content/zh-CN/docs/api/webview-tag.md b/content/zh-CN/docs/api/webview-tag.md index e2f6a8b458f55..495478f4f06ed 100644 --- a/content/zh-CN/docs/api/webview-tag.md +++ b/content/zh-CN/docs/api/webview-tag.md @@ -94,14 +94,6 @@ Electron的 `webview` 标签基于 [Chromium
    webview ][chrome-webvi A `Boolean` for the experimental option for enabling NodeJS support in sub-frames such as iframes inside the `webview`. All your preloads will load for every iframe, you can use `process.isMainFrame` to determine if you are in the main frame or not. Node 集成在访客页中默认是禁用的。 -### `enableremotemodule` - -```html - -``` - -一个 `Boolean`。 When this attribute is `false` the guest page in `webview` will not have access to the [`remote`](remote.md) module. The remote module is unavailable by default. - ### `plugins` ```html @@ -737,6 +729,18 @@ It is also not emitted during in-page navigation, such as clicking anchor links Calling `event.preventDefault()` does __NOT__ have any effect. +### Event: 'did-start-navigation' + +返回: + +* `url` String +* `isInPlace` Boolean +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitted when any frame (including main) starts navigating. `isInPlace` will be `true` for in-page navigations. + ### Event: 'did-navigate' 返回: @@ -747,6 +751,21 @@ Emitted when a navigation is done. This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. +### Event: 'did-frame-navigate' + +返回: + +* `url` String +* `httpResponseCode` Integer - -1 for non HTTP navigations +* `httpStatusText` String - empty for non HTTP navigations, +* `isMainFrame` Boolean +* `frameProcessId` Integer +* `frameRoutingId` Integer + +Emitted when any frame navigation is done. + +This event is not emitted for in-page navigations, such as clicking anchor links or updating the `window.location.hash`. Use `did-navigate-in-page` event for this purpose. + ### Event: 'did-navigate-in-page' 返回: diff --git a/content/zh-CN/docs/api/window-open.md b/content/zh-CN/docs/api/window-open.md index 37f390d48ba23..5cbee7ef642bf 100644 --- a/content/zh-CN/docs/api/window-open.md +++ b/content/zh-CN/docs/api/window-open.md @@ -1,17 +1,17 @@ # 从渲染进程打开窗口 -There are several ways to control how windows are created from trusted or untrusted content within a renderer. 可以通过两种方式从渲染进程创建窗口: +有几种方法可以控制从信任或在渲染器内创建窗口的方式。 可以通过两种方式从渲染进程创建窗口: -* clicking on links or submitting forms adorned with `target=_blank` -* JavaScript calling `window.open()` +* 如果属性中包含 `target=_blank`,单击链接或提交表格即可创建 +* 在 JavaScript 中调用 `window.open()` -In non-sandboxed renderers, or when `nativeWindowOpen` is false (the default), this results in the creation of a [`BrowserWindowProxy`](browser-window-proxy.md), a light wrapper around `BrowserWindow`. +在非沙盒渲染器中,或当 `nativeWindowOpen` 为false (默认值) 时, 将导致创建一个[`BrowserWindowProxy`](browser-window-proxy.md), 这是一个轻量级的 <2>BrowserWindow However, when the `sandbox` (or directly, `nativeWindowOpen`) option is set, a `Window` instance is created, as you'd expect in the browser. For same-origin content, the new window is created within the same process, enabling the parent to access the child window directly. This can be very useful for app sub-windows that act as preference panels, or similar, as the parent can render to the sub-window directly, as if it were a `div` in the parent. Electron pairs this native Chrome `Window` with a BrowserWindow under the hood. You can take advantage of all the customization available when creating a BrowserWindow in the main process by using `webContents.setWindowOpenHandler()` for renderer-created windows. -BrowserWindow constructor options are set by, in increasing precedence order: options inherited from the parent, parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. +BrowserWindow constructor options are set by, in increasing precedence order: parsed options from the `features` string from `window.open()`, security-related webPreferences inherited from the parent, and options given by [`webContents.setWindowOpenHandler`](web-contents.md#contentssetwindowopenhandlerhandler). Note that `webContents.setWindowOpenHandler` has final say and full privilege because it is invoked in the main process. ### `window.open(url[, frameName][, features])` @@ -36,7 +36,8 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn * 如果在父窗口中禁用了 Node integration, 则在打开的 `window ` 中将始终被禁用。 * 如果在父窗口中启用了上下文隔离, 则在打开的 ` window ` 中将始终被启用。 * 父窗口禁用 Javascript,打开的 `window` 中将被始终禁用 -* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `additionalFeatures` argument. +* Non-standard features (that are not handled by Chromium or Electron) given in `features` will be passed to any registered `webContents`'s `did-create-window` event handler in the `options` argument. +* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters). To customize or cancel the creation of the window, you can optionally set an override handler with `webContents.setWindowOpenHandler()` from the main process. Returning `false` cancels the window, while returning an object sets the `BrowserWindowConstructorOptions` used when creating the window. Note that this is more powerful than passing options through the feature string, as the renderer has more limited privileges in deciding security preferences than the main process. @@ -56,7 +57,7 @@ mainWindow.webContents.setWindowOpenHandler(({ url }) => { mainWindow.webContents.on('did-create-window', (childWindow) => { // For example... - childWindow.webContents('will-navigate', (e) => { + childWindow.webContents.on('will-navigate', (e) => { e.preventDefault() }) }) diff --git a/content/zh-CN/docs/breaking-changes.md b/content/zh-CN/docs/breaking-changes.md index 18bde49d4459c..5c444cb520d68 100644 --- a/content/zh-CN/docs/breaking-changes.md +++ b/content/zh-CN/docs/breaking-changes.md @@ -6,35 +6,93 @@ 本文档使用以下约定对重大更改进行分类: -* **API Changed:** An API was changed in such a way that code that has not been updated is guaranteed to throw an exception. -* **Behavior Changed:** The behavior of Electron has changed, but not in such a way that an exception will necessarily be thrown. -* **Default Changed:** Code depending on the old default may break, not necessarily throwing an exception. The old behavior can be restored by explicitly specifying the value. -* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release. -* **Removed:** An API or feature was removed, and is no longer supported by Electron. +* **API 更改:**已更改的 API 会以某种方式使未更新的代码必定抛出异常。 +* **行为改变:**Electron 的行为已经改变,但并不一定抛出相应的异常。 +* **默认值更改:**依赖于默认值的代码的行为可能被破坏,但不保证会抛出相应的异常。 您可以通过显式指定该值的方式恢复旧的默认行为。 +* **已废弃:**该 API 已标记为废弃。 该 API 依旧可正常运作,但会抛出已废弃警告,并在将来会移除。 +* **已移除:**该 API 或功能已移除,Electron团队不再对此提供支持。 + +## 计划重写的 API (15.0) + +### 默认更改: `nativeWindowOpen` 默认为 `true` + +Prior to Electron 15, `window.open` was by default shimmed to use `BrowserWindowProxy`. This meant that `window.open('about:blank')` did not work to open synchronously scriptable child windows, among other incompatibilities. `nativeWindowOpen: true` is no longer experimental, and is now the default. + +See the documentation for [window.open in Electron](api/window-open.md) for more details. ## 计划重写的 API (14.0) -### API Changed: `window.(open)` +### 已移除: `app.allowRendererProcessReuse` + +The `app.allowRendererProcessReuse` property will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. + +For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). + +### Removed: Browser Window Affinity + +The `affinity` option when constructing a new `BrowserWindow` will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. + +For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). + +### API 更改: `window.open()` -可选参数 `frameName` 将不再设置窗口的标题。 This now follows the specification described by the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) under the corresponding parameter `windowName`. +可选参数 `frameName` 将不再设置窗口的标题。 该功能现在遵循 [原生文档](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters) 中的约束,由名为 `windowName` 的参数控制。 -If you were using this parameter to set the title of a window, you can instead use [win.setTitle(title)](https://www.electronjs.org/docs/api/browser-window#winsettitletitle). +若您之前使用了该参数用于设置窗口标题,您可以转而使用 [win.setTitle(title)](https://www.electronjs.org/docs/api/browser-window#winsettitletitle)。 ### 已移除: `worldSafeExecuteJavaScript` -在 Electron 14, `worldSafeExecuteJavaScript` 将被移除。 There is no alternative, please ensure your code works with this property enabled. It has been enabled by default since Electron +在 Electron 14, `worldSafeExecuteJavaScript` 将被移除。 除此之外没有其他方式,请保证您的代码中包含该属性。 Electron 12中默认启用该属性。 12. -You will be affected by this change if you use either `webFrame.executeJavaScript` or `webFrame.executeJavaScriptInIsolatedWorld`. You will need to ensure that values returned by either of those methods are supported by the [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) as these methods use the same value passing semantics. +若您使用了 `webFrame.executeJavaScript` 或 `webFrame.executeJavaScriptInIsolatedWorld`,这个改动会对您造成影响。 您需要保证 [Context Bridge API](api/context-bridge.md#parameter--error--return-type-support) 支持这些方法的返回值,因为这些方法使用相同的值传递语义。 + +### Removed: BrowserWindowConstructorOptions inheriting from parent windows + +Prior to Electron 14, windows opened with `window.open` would inherit BrowserWindow constructor options such as `transparent` and `resizable` from their parent window. Beginning with Electron 14, this behavior is removed, and windows will not inherit any BrowserWindow constructor options from their parents. + +Instead, explicitly set options for the new window with `setWindowOpenHandler`: + +```js +webContents.setWindowOpenHandler((details) => { + return { + action: 'allow', + overrideBrowserWindowOptions: { + // ... + } + } +}) +``` + +### 已移除: `additionalFeatures` + +The deprecated `additionalFeatures` property in the `new-window` and `did-create-window` events of WebContents has been removed. Since `new-window` uses positional arguments, the argument is still present, but will always be the empty array `[]`. (Though note, the `new-window` event itself is deprecated, and is replaced by `setWindowOpenHandler`.) Bare keys in window features will now present as keys with the value `true` in the options object. + +```js +// Removed in Electron 14 +// Triggered by window.open('...', '', 'my-key') +webContents.on('did-create-window', (window, details) => { + if (details.additionalFeatures.includes('my-key')) { + // ... + } +}) + +// Replace with +webContents.on('did-create-window', (window, details) => { + if (details.options['my-key']) { + // ... + } +}) +``` ## 计划重写的 API (13.0) ### API 更改: `session.setPermissionCheckHandler(handler)` -The `handler` methods first parameter was previously always a `webContents`, it can now sometimes be `null`. You should use the `requestingOrigin`, `embeddingOrigin` and `securityOrigin` properties to respond to the permission check correctly. As the `webContents` can be `null` it can no longer be relied on. +`handler` 方法的第一个参数曾是 `webContents`,但现在可以为 `null`。 为正确响应权限检查,您需要使用`requestingOrigin`、`embeddingOrigin` 和 `securityOrigin` 这些属性。 因为 `webContents` 现在可能为 `null`,您不应当依赖此参数。 ```js -// Old code +// 旧代码 session.setPermissionCheckHandler((webContents, permission) => { if (webContents.getURL().startsWith('https://google.com/') && permission === 'notification') { return true @@ -42,7 +100,7 @@ session.setPermissionCheckHandler((webContents, permission) => { return false }) -// Replace with +// 变更为 session.setPermissionCheckHandler((webContents, permission, requestingOrigin) => { if (new URL(requestingOrigin).hostname === 'google.com' && permission === 'notification') { return true @@ -53,12 +111,12 @@ session.setPermissionCheckHandler((webContents, permission, requestingOrigin) => ### 已移除: `shell.moveItemToTrash()` -The deprecated synchronous `shell.moveItemToTrash()` API has been removed. Use the asynchronous `shell.trashItem()` instead. +已废弃的同步方法 `shell.moveItemToTrash()` 已移除。 作为替代,您应当使用异步的 `shell.trashItem()`。 ```js -// Removed in Electron 13 +// 在 Electron 13 移除 shell.moveItemToTrash(path) -// Replace with +// 替换为 shell.trashItem(path).then(/* ... */) ``` @@ -73,78 +131,78 @@ shell.trashItem(path).then(/* ... */) * `BrowserWindow.getExtensions()` * `BrowserWindow.getDevToolsExtensions()` -Use the session APIs instead: +改为使用 session API: * `ses.loadExtension(path)` * `ses.removeExtension(extension_id)` * `ses.getAllExtensions()` ```js -// Removed in Electron 13 +// 在 Electron 13 移除 BrowserWindow.addExtension(path) BrowserWindow.addDevToolsExtension(path) -// Replace with +// 替换为 session.defaultSession.loadExtension(path) ``` ```js -// Removed in Electron 13 +// 在 Electron 13 移除 BrowserWindow.removeExtension(name) BrowserWindow.removeDevToolsExtension(name) -// Replace with +// 替换为 session.defaultSession.removeExtension(extension_id) ``` ```js -// Removed in Electron 13 +// 在 Electron 13 移除 BrowserWindow.getExtensions() BrowserWindow.getDevToolsExtensions() -// Replace with +// 替换为 session.defaultSession.getAllExtensions() ``` ### 已移除: `systemPreferences` 中的方法 -The following `systemPreferences` methods have been deprecated: +`systemPreferences` 方法已经被废弃: * `systemPreferences.isDarkMode()` * `systemPreferences.isInvertedColorScheme()` * `systemPreferences.isHighContrastColorScheme()` -Use the following `nativeTheme` properties instead: +使用 `nativeTheme` 属性作为替代: * `nativeTheme.shouldUseDarkColors` * `nativeTheme.shouldUseInvertedColorScheme` * `nativeTheme.shouldUseHighContrastColors` ```js -// Removed in Electron 13 +// 在 Electron 13 移除 systemPreferences.isDarkMode() -// Replace with +// 替换为 nativeTheme.shouldUseDarkColors -// Removed in Electron 13 +// 在 Electron 13 移除 systemPreferences.isInvertedColorScheme() -// Replace with +// 替换为 nativeTheme.shouldUseInvertedColorScheme -// Removed in Electron 13 +// 在 Electron 13 移除 systemPreferences.isHighContrastColorScheme() -// Replace with +// 替换为 nativeTheme.shouldUseHighContrastColors ``` -### Deprecated: WebContents `new-window` event +### 已废弃: WebContents `new-window` 事件 -The `new-window` event of WebContents has been deprecated. It is replaced by [`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler). +WebContents 中的 `new-window` 事件已经被废弃。 已弃用:[`webContents.setWindowOpenHandler()`](api/web-contents.md#contentssetwindowopenhandlerhandler)。 ```js -// Deprecated in Electron 13 +// 在 Electron 13 废弃 webContents.on('new-window', (event) => { event.preventDefault() }) -// Replace with +// 替换为 webContents.setWindowOpenHandler((details) => { return { action: 'deny' } }) @@ -152,9 +210,9 @@ webContents.setWindowOpenHandler((details) => { ## 计划重写的 API (12.0) -### Removed: Pepper Flash support +### 已移除:Pepper Flash 支持 -Chromium has removed support for Flash, and so we must follow suit. See Chromium's [Flash Roadmap](https://www.chromium.org/flash-roadmap) for more details. +Chromium 已经取消了对Flash的支持,因此我们必须效仿。 更多详细信息,请参阅 Chromium 的 [ Flash Roadmap](https://www.chromium.org/flash-roadmap) ### 默认更改: `worldSafeExecuteJavaScript` 默认为 `true` @@ -170,22 +228,22 @@ We [recommend having contextIsolation enabled](https://github.com/electron/elect Another implication is that `require()` cannot be used in the renderer process unless `nodeIntegration` is `true` and `contextIsolation` is `false`. -For more details see: https://github.com/electron/electron/issues/23506 +更多信息请参阅:https://github.com/electron/electron/issues/23506 ### 已移除: `crashReporter.getCrashesDirectory()` -The `crashReporter.getCrashesDirectory` method has been removed. Usage should be replaced by `app.getPath('crashDumps')`. +`crashReporter.getCrashesDirectory` 方法已被删除。 Usage should be replaced by `app.getPath('crashDumps')`. ```js -// Removed in Electron 12 +// 在 Electron 12 移除 crashReporter.getCrashesDirectory() -// Replace with +// 替换为 app.getPath('crashDumps') ``` ### Removed: `crashReporter` methods in the renderer process -The following `crashReporter` methods are no longer available in the renderer process: +`crashReporter` 方法在渲染进程中不再能使用: * `crashReporter.start` * `crashReporter.getLastCrashReport` @@ -196,7 +254,7 @@ The following `crashReporter` methods are no longer available in the renderer pr They should be called only from the main process. -See [#23265](https://github.com/electron/electron/pull/23265) for more details. +更多详细信息请访问 [#23265](https://github.com/electron/electron/pull/23265) ### Default Changed: `crashReporter.start({ compress: true })` @@ -204,9 +262,9 @@ The default value of the `compress` option to `crashReporter.start` has changed If your crash ingestion server does not support compressed payloads, you can turn off compression by specifying `{ compress: false }` in the crash reporter options. -### Deprecated: `remote` module +### 已废弃: `remote` 模块 -The `remote` module is deprecated in Electron 12, and will be removed in Electron 14. It is replaced by the [`@electron/remote`](https://github.com/electron/remote) module. +`remote` 模块在 Electron 12 废弃,并将在 Electron 14 被移除 由[`@electronic/remote`](https://github.com/electron/remote) 模块替代。 ```js // Deprecated in Electron 12: @@ -214,21 +272,21 @@ const { BrowserWindow } = require('electron').remote ``` ```js -// Replace with: +// 替换为: const { BrowserWindow } = require('@electron/remote') -// In the main process: +// 在主进程中: require('@electron/remote/main').initialize() ``` -### Deprecated: `shell.moveItemToTrash()` +### 已废弃:`shell.moveItemToTrash()` The synchronous `shell.moveItemToTrash()` has been replaced by the new, asynchronous `shell.trashItem()`. ```js -// Deprecated in Electron 12 +// 在 Electron 12 废弃 shell.moveItemToTrash(path) -// Replace with +// 替换为 shell.trashItem(path).then(/* ... */) ``` @@ -253,7 +311,7 @@ crashReporter.start({ companyName: 'Umbrella Corporation' }) crashReporter.start({ globalExtra: { _companyName: 'Umbrella Corporation' } }) ``` -### Deprecated: `crashReporter.getCrashesDirectory()` +### 已废弃:`crashReporter.getCrashesDirectory()` The `crashReporter.getCrashesDirectory` method has been deprecated. Usage should be replaced by `app.getPath('crashDumps')`. @@ -264,7 +322,7 @@ crashReporter.getCrashesDirectory() app.getPath('crashDumps') ``` -### Deprecated: `crashReporter` methods in the renderer process +### 已废弃:渲染进程中的 `crashReporter` 方法 Calling the following `crashReporter` methods from the renderer process is deprecated: @@ -279,17 +337,11 @@ The only non-deprecated methods remaining in the `crashReporter` module in the r All above methods remain non-deprecated when called from the main process. -See [#23265](https://github.com/electron/electron/pull/23265) for more details. - -### Deprecated: `crashReporter.start({ compress: false })` +更多详细信息请访问 [#23265](https://github.com/electron/electron/pull/23265) -Setting `{ compress: false }` in `crashReporter.start` is deprecated. Nearly all crash ingestion servers support gzip compression. This option will be removed in a future version of Electron. +### 已废弃:`crashReporter.start({ compress: false })` -### Removed: Browser Window Affinity - -The `affinity` option when constructing a new `BrowserWindow` will be removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability. - -For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). +Setting `{ compress: false }` in `crashReporter.start` is deprecated. Nearly all crash ingestion servers support gzip compression. 此选项将在未来版本的 Electron 中删除。 ### 默认更改: `enableRemoteModule` 默认为 `false` @@ -309,7 +361,7 @@ We [recommend moving away from the remote module](https://medium.com/@nornagon/e ### `protocol.uninterceptProtocol` -The APIs are now synchronous and the optional callback is no longer needed. +这些 APIs 现在是同步的,不再需要可选的回调。 ```javascript // Deprecated @@ -338,12 +390,12 @@ protocol.unregisterProtocol(scheme) ### `protocol.interceptStreamProtocol` -The APIs are now synchronous and the optional callback is no longer needed. +这些 APIs 现在是同步的,不再需要可选的回调。 ```javascript -// Deprecated +// 已废弃 protocol.registerFileProtocol(scheme, handler, () => { /* ... */ }) -// Replace with +// 替换为 protocol.registerFileProtocol(scheme, handler) ``` @@ -371,7 +423,7 @@ If this impacts you, you can temporarily set `app.allowRendererProcessReuse` to For more detailed information see [#18397](https://github.com/electron/electron/issues/18397). -### Deprecated: `BrowserWindow` extension APIs +### 已废弃: `BrowserWindow` 扩展 API The following extension APIs have been deprecated: @@ -382,51 +434,51 @@ The following extension APIs have been deprecated: * `BrowserWindow.getExtensions()` * `BrowserWindow.getDevToolsExtensions()` -Use the session APIs instead: +改为使用 session API: * `ses.loadExtension(path)` * `ses.removeExtension(extension_id)` * `ses.getAllExtensions()` ```js -// Deprecated in Electron 9 +// 在 Electron 9 废弃 BrowserWindow.addExtension(path) BrowserWindow.addDevToolsExtension(path) -// Replace with +// 替换为 session.defaultSession.loadExtension(path) ``` ```js -// Deprecated in Electron 9 +// 在 Electron 9 废弃 BrowserWindow.removeExtension(name) BrowserWindow.removeDevToolsExtension(name) -// Replace with +// 替换为 session.defaultSession.removeExtension(extension_id) ``` ```js -// Deprecated in Electron 9 +// 在 Electron 9 废弃 BrowserWindow.getExtensions() BrowserWindow.getDevToolsExtensions() -// Replace with +// 替换为 session.defaultSession.getAllExtensions() ``` -### Removed: `.getWebContents()` +### 已移除: `.getWebContents()` This API, which was deprecated in Electron 8.0, is now removed. ```js -// Removed in Electron 9.0 +// 在 Electron 9.0 移除 webview.getWebContents() -// Replace with +// 替换为 const { remote } = require('electron') remote.webContents.fromId(webview.getWebContentsId()) ``` ### 已移除: `webFrame.setLayoutZoomLevelLimits()` -Chromium has removed support for changing the layout zoom level limits, and it is beyond Electron's capacity to maintain it. The function was deprecated in Electron 8.x, and has been removed in Electron 9.x. The layout zoom level limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined [here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11). +Chromium has removed support for changing the layout zoom level limits, and it is beyond Electron's capacity to maintain it. 函数在 Electron 8.x 废弃,并将在 Electron 9.x 被移除。 The layout zoom level limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined [here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11). ### Behavior Changed: Sending non-JS objects over IPC now throws an exception @@ -471,7 +523,7 @@ Buffer.from(value.buffer, value.byteOffset, value.byteLength) Sending any objects that aren't native JS types, such as DOM objects (e.g. `Element`, `Location`, `DOMMatrix`), Node.js objects (e.g. `process.env`, `Stream`), or Electron objects (e.g. `WebContents`, `BrowserWindow`, `WebFrame`) is deprecated. In Electron 8, these objects will be serialized as before with a DeprecationWarning message, but starting in Electron 9, sending these kinds of objects will throw a 'could not be cloned' error. -### Deprecated: `.getWebContents()` +### 已废弃: `.getWebContents()` This API is implemented using the `remote` module, which has both performance and security implications. Therefore its usage should be explicit. @@ -533,34 +585,34 @@ systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ }) nativeTheme.on('updated', () => { /* ... */ }) ``` -### Deprecated: methods in `systemPreferences` +### 已废弃:`systemPreferences` 中的方法 -The following `systemPreferences` methods have been deprecated: +`systemPreferences` 方法已经被废弃: * `systemPreferences.isDarkMode()` * `systemPreferences.isInvertedColorScheme()` * `systemPreferences.isHighContrastColorScheme()` -Use the following `nativeTheme` properties instead: +使用 `nativeTheme` 属性作为替代: * `nativeTheme.shouldUseDarkColors` * `nativeTheme.shouldUseInvertedColorScheme` * `nativeTheme.shouldUseHighContrastColors` ```js -// Deprecated +// 已废弃 systemPreferences.isDarkMode() -// Replace with +// 替换为 nativeTheme.shouldUseDarkColors -// Deprecated +// 已废弃 systemPreferences.isInvertedColorScheme() -// Replace with +// 替换为 nativeTheme.shouldUseInvertedColorScheme -// Deprecated +// 已废弃 systemPreferences.isHighContrastColorScheme() -// Replace with +// 替换为 nativeTheme.shouldUseHighContrastColors ``` @@ -664,7 +716,7 @@ These functions now only return Promises: * `app.getFileIcon()` [#15742](https://github.com/electron/electron/pull/15742) * `app.dock.show()` [#16904](https://github.com/electron/electron/pull/16904) * `contentTracing.getCategories()` [#16583](https://github.com/electron/electron/pull/16583) -* `contentTracing.getTraceBufferUsage()` [#16600](https://github.com/electron/electron/pull/16600) +* `contentTracking.getTraceBufferUs()` [#16600](https://github.com/electron/electron/pull/16600) * `contentTracing.startRecording()` [#16584](https://github.com/electron/electron/pull/16584) * `contentTracing.stopRecording()` [#16584](https://github.com/electron/electron/pull/16584) * `contents.executeJavaScript()` [#17312](https://github.com/electron/electron/pull/17312) @@ -683,7 +735,7 @@ These functions now only return Promises: * `session.clearStorageData()` [#17249](https://github.com/electron/electron/pull/17249) * `session.getBlobData()` [#17303](https://github.com/electron/electron/pull/17303) * `session.getCacheSize()` [#17185](https://github.com/electron/electron/pull/17185) -* `session.resolveProxy()` [#17222](https://github.com/electron/electron/pull/17222) +* `session.getCacheSize()` [#17185](https://github.com/electron/electron/pull/17222) * `session.setProxy()` [#17222](https://github.com/electron/electron/pull/17222) * `shell.openExternal()` [#16176](https://github.com/electron/electron/pull/16176) * `webContents.loadFile()` [#15855](https://github.com/electron/electron/pull/15855) @@ -880,11 +932,11 @@ The following list includes the breaking API changes made in Electron 4.0. ### `app.makeSingleInstance` ```js -// Deprecated +// 已废弃 app.makeSingleInstance((argv, cwd) => { /* ... */ }) -// Replace with +// 替换为 app.requestSingleInstanceLock() app.on('second-instance', (event, argv, cwd) => { /* ... */ @@ -932,20 +984,20 @@ const { memory } = metrics[0] // 弃用的属性 ### `BrowserWindow` ```js -// Deprecated +// 已废弃 const optionsA = { webPreferences: { blinkFeatures: '' } } const windowA = new BrowserWindow(optionsA) -// Replace with +// 替换为 const optionsB = { webPreferences: { enableBlinkFeatures: '' } } const windowB = new BrowserWindow(optionsB) -// Deprecated +// 已废弃 window.on('app-command', (e, cmd) => { if (cmd === 'media-play_pause') { // do something } }) -// Replace with +// 替换为 window.on('app-command', (e, cmd) => { if (cmd === 'media-play-pause') { // do something @@ -1106,10 +1158,10 @@ webview.onkeyup = () => { /* handler */ } ### `BrowserWindow` ```js -// Deprecated +// 已废弃 const optionsA = { titleBarStyle: 'hidden-inset' } const windowA = new BrowserWindow(optionsA) -// Replace with +// 替换为 const optionsB = { titleBarStyle: 'hiddenInset' } const windowB = new BrowserWindow(optionsB) ``` diff --git a/content/zh-CN/docs/development/pull-requests.md b/content/zh-CN/docs/development/pull-requests.md index 5cc5544580fc8..9b3930bd505db 100644 --- a/content/zh-CN/docs/development/pull-requests.md +++ b/content/zh-CN/docs/development/pull-requests.md @@ -34,7 +34,7 @@ $ git fetch upstream 根据您的操作系统, 项目构建步骤和依赖项稍有不同。 请参阅这些关于构建 Electron 项目的详细指南: -* [Building on macOS](build-instructions-macos.md) +* [在 macOS 上构建](build-instructions-macos.md) * [在 Linux 上构建](build-instructions-linux.md) * [在 Windows 上构建](build-instructions-windows.md) @@ -86,13 +86,12 @@ Before a pull request can be merged, it **must** have a pull request title with * fix: A bug fix * feat: A new feature * docs: Documentation changes -* test: Adding missing tests or correcting existing tests +* 测试:添加缺失测试或纠正现有测试 * build: Changes that affect the build system * ci: Changes to our CI configuration files and scripts * perf: A code change that improves performance * refactor: A code change that neither fixes a bug nor adds a feature * style: Changes that do not affect the meaning of the code (linting) -* vendor: Bumping a dependency like libchromiumcontent or node 其他在写提交信息时需要留意的事情: diff --git a/content/zh-CN/docs/development/source-code-directory-structure.md b/content/zh-CN/docs/development/source-code-directory-structure.md index 932ff87e3efa7..1baa348af5dde 100644 --- a/content/zh-CN/docs/development/source-code-directory-structure.md +++ b/content/zh-CN/docs/development/source-code-directory-structure.md @@ -78,7 +78,6 @@ Electron * **.cloeci** - CircleCI 的 CI 配置文件。 * **.github** - GitHub专用配置文件,包括 issue 模板和 CODEOWNERS。 * **dist** - 由脚本 `script/create-dist.py` 创建的临时发布目录. -* **external_binaries** - 下载了不支持用 `gn` 构建的第三方框架的二进制文件. * **node_modules** - 在构建中用到的第三方 node 模块. * **npm** - 通过 npm 安装 Electron 的逻辑。 * **out** - `ninja` 的临时输出目录. @@ -94,4 +93,3 @@ script/ - The set of all scripts Electron runs for a variety of purposes. ``` * **typings** - Electron的内部代码的 TypeScript typings。 -* **vendor** - 一些第三方依赖的源代码。 diff --git a/content/zh-CN/docs/tutorial/application-debugging.md b/content/zh-CN/docs/tutorial/application-debugging.md index 94a4c7cf256d9..4fbc1584e2dc4 100644 --- a/content/zh-CN/docs/tutorial/application-debugging.md +++ b/content/zh-CN/docs/tutorial/application-debugging.md @@ -29,7 +29,7 @@ win.webContents.openDevTools() Chromium日志可以通过`ELECTRON_ENABLE_LOGGING`环境变量启用。 有关更多信息,请参见[环境变量文档](../api/environment-variables.md#electron_enable_logging)。 -或者,可以传递命令行参数`--enable-logging`。 更多信息请查看[命令行开关文档](../api/command-line-switches.md#--enable-logging) +或者,可以传递命令行参数`--enable-logging`。 更多信息请查看[命令行开关文档](../api/command-line-switches.md#--enable-loggingfile) [node-inspect]: https://nodejs.org/en/docs/inspector/ [devtools]: https://developer.chrome.com/devtools diff --git a/content/zh-CN/docs/tutorial/code-signing.md b/content/zh-CN/docs/tutorial/code-signing.md index a6a0cd45fa75b..969d4a62f876c 100644 --- a/content/zh-CN/docs/tutorial/code-signing.md +++ b/content/zh-CN/docs/tutorial/code-signing.md @@ -102,7 +102,7 @@ Electron Builder comes with a custom solution for signing your application. 你 If you're not using an integrated build pipeline like Forge or Builder, you are likely using [`electron-packager`][], which includes [`electron-osx-sign`][] and [`electron-notarize`][]. -如果您正在使用Packager的 API,您可以通过配置 [来签名并对您的应用程序进行公证](https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html) +如果您正在使用Packager的 API,您可以通过配置 [来签名并对您的应用程序进行公证](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html) ```js const packager = require('electron-packager') @@ -155,7 +155,6 @@ You can get a code signing certificate from a lot of resellers. 价格各异, * [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm) * [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing) -* [GoDaddy](https://au.godaddy.com/web-security/code-signing-certificate) * 除其他外,请货比三家后选择适合你的那一款,Google 是您的朋友😄: 你可以运用许多方式来签署你的应用: diff --git a/content/zh-CN/docs/tutorial/dark-mode.md b/content/zh-CN/docs/tutorial/dark-mode.md index 649697f820b97..0ce21c965424c 100644 --- a/content/zh-CN/docs/tutorial/dark-mode.md +++ b/content/zh-CN/docs/tutorial/dark-mode.md @@ -56,9 +56,9 @@ If you wish to opt-out while using Electron > 8.0.0, you must set the `NSRequ ``` -以及 `style.css` 文件: +以及 `styles.css` 文件: -```css title='style.css' +```css title='styles.css' @media (prefers-color-scheme: dark) { body { background: #333; color: white; } } @@ -160,6 +160,6 @@ app.on('window-all-closed', () => { [system-wide-dark-mode]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/ [electron-forge]: https://www.electronforge.io/ [electron-packager]: https://github.com/electron/electron-packager -[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport +[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#darwindarkmodesupport [prefers-color-scheme]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme [event-listeners]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener diff --git a/content/zh-CN/docs/tutorial/in-app-purchases.md b/content/zh-CN/docs/tutorial/in-app-purchases.md index 88d03155303ab..061b273ef00d3 100644 --- a/content/zh-CN/docs/tutorial/in-app-purchases.md +++ b/content/zh-CN/docs/tutorial/in-app-purchases.md @@ -1,4 +1,4 @@ -# 应用内购买 (macOS) +# In-App Purchases (macOS) ## 准备工作 diff --git a/content/zh-CN/docs/tutorial/installation.md b/content/zh-CN/docs/tutorial/installation.md index ff9fef71ac36a..d72f4dbc31c75 100644 --- a/content/zh-CN/docs/tutorial/installation.md +++ b/content/zh-CN/docs/tutorial/installation.md @@ -1,4 +1,4 @@ -# 安装 +# Advanced Installation Instructions 要安装预编译的 Electron 二进制文件,请使用 [`npm`][npm]。 首选方法是在你的应用程序中安装 Electron 作为开发依赖: diff --git a/content/zh-CN/docs/tutorial/launch-app-from-url-in-another-app.md b/content/zh-CN/docs/tutorial/launch-app-from-url-in-another-app.md index 527a7f7dd58fb..aa5f7f70bb539 100644 --- a/content/zh-CN/docs/tutorial/launch-app-from-url-in-another-app.md +++ b/content/zh-CN/docs/tutorial/launch-app-from-url-in-another-app.md @@ -1,32 +1,32 @@ --- -title: launch-app-from-URL-in-another-app -description: This guide will take you through the process of setting your electron app as the default handler for a specific protocol. -slug: launch-app-from-url-in-another-app +title: 从其他应用中的 URL 启动您的应用 +description: 本指南将会指导您配置 Electron 应用为特定协议的默认处理器。 +slug: 从其他应用中的URL启动应用 hide_title: true --- -# Launching Your Electron App From A URL In Another App +# 从其他应用中的 URL 启动您的应用 ## 概览 -This guide will take you through the process of setting your electron app as the default handler for a specific [protocol](https://www.electronjs.org/docs/api/protocol). +本指南将会指导您配置 Electron 应用为[特定协议](https://www.electronjs.org/docs/api/protocol)的默认处理器。 -By the end of this tutorial, we will have set our app to intercept and handle any clicked URLs that start with a specific protocol. In this guide, the protocol we will use will be "`electron-fiddle://`". +通过此教程,您会掌握如何设置您的应用以拦截并处理任意特定协议的URL的点击事件。 在本指南中,我们假定这个协议名为“`electron-fiddle://`”。 ## 示例 -### Main Process (main.js) +### 主进程(main.js) -First we will import the required modules from `electron`. These modules help control our application life and create a native browser window. +首先,我们需要从`electron`导入所需的模块。 这些模块有助于控制应用的生命周期,或创建原生的浏览器窗口。 ```js const { app, BrowserWindow, shell } = require('electron') const path = require('path') ``` -Next, we will proceed to register our application to handle all "`electron-fiddle://`" protocols. +其次,我们将应用注册为“`electron-fiddle://`”协议的处理器。 ```js if (process.defaultApp) { @@ -38,11 +38,11 @@ if (process.defaultApp) { } ``` -We will now define the function in charge of creating our browser window and load our application's `index.html` file. +现在我们定义负责创建浏览器窗口的函数,并加载应用的 `index.html` 文件。 ```js function createWindow () { - // Create the browser window. + // 创建浏览器窗口 mainWindow = new BrowserWindow({ width: 800, height: 600, @@ -55,11 +55,11 @@ function createWindow () { } ``` -In this next step, we will create our `BrowserWindow` and tell our application how to handle an event in which an external protocol is clicked. +紧接着,我们将创建 `BrowserWindow` 并在应用中定义如何处理此外部协议被点击的事件。 -This code will be different in WindowsOS compared to MacOS and Linux. This is due to Windows requiring additional code in order to open the contents of the protocol link within the same electron instance. Read more about this [here](https://www.electronjs.org/docs/api/app#apprequestsingleinstancelock). +与 MacOS 或 Linux 不同,在 Windows 下需要其他的代码。 这是因为在 Windows 中需要特别处理在同一个 Electron 实例中打开的协议的内容。 请点击 [此处](https://www.electronjs.org/docs/api/app#apprequestsingleinstancelock) 了解更多 -### Windows code: +### Windows 下代码: ```js const gotTheLock = app.requestSingleInstanceLock() @@ -68,91 +68,85 @@ if (!gotTheLock) { app.quit() } else { app.on('second-instance', (event, commandLine, workingDirectory) => { - // Someone tried to run a second instance, we should focus our window. + // 用户正在尝试运行第二个实例,我们需要让焦点指向我们的窗口 if (mainWindow) { if (mainWindow.isMinimized()) mainWindow.restore() mainWindow.focus() } }) - // Create mainWindow, load the rest of the app, etc... + // 创建 mainWindow,加载其他资源,等等…… app.whenReady().then(() => { createWindow() }) - // handling the protocol. In this case, we choose to show an Error Box. + // 处理协议。 在本例中,我们选择显示一个错误提示对话框。 app.on('open-url', (event, url) => { - dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`) + dialog.showErrorBox('欢迎回来', `导向自: ${url}`) }) } ``` -### MacOS and Linux code: +### MacOS 与 Linux 下代码: ```js -// This method will be called when Electron has finished -// initialization and is ready to create browser windows. +// Electron 在完成初始化,并准备创建浏览器窗口时, +// 会调用这个方法。 // 部分 API 在 ready 事件触发后才能使用。 app.whenReady().then(() => { createWindow() }) -// handling the protocol. In this case, we choose to show an Error Box. +// 处理协议。 在本例中,我们选择显示一个错误提示对话框。 app.on('open-url', (event, url) => { - dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`) + dialog.showErrorBox('欢迎回来', `导向自: ${url}`) }) ``` -Finally, we will add some additional code to handle when someone closes our application +最后,我们还需要处理应用的关闭事件。 ```js -// Quit when all windows are closed, except on macOS. There, it's common -// for applications and their menu bar to stay active until the user quits -// explicitly with Cmd + Q. +// 在除 MacOS 的其他平台上,当所有窗口关闭后,退出当前应用。 在 MacOS 上, +// 应用及其菜单栏通常会保持活跃状态, +// 直到用户明确按下 Cmd + Q 退出应用。 app.on('window-all-closed', function () { if (process.platform !== 'darwin') app.quit() }) ``` -## Important Note: +## 重要说明: ### 打包 -This feature will only work on macOS when your app is packaged. It will not work when you're launching it in development from the command-line. When you package your app you'll need to make sure the macOS `plist` for the app is updated to include the new protocol handler. If you're using [`electron-packager`](https://github.com/electron/electron-packager) then you can add the flag `--extend-info` with a path to the `plist` you've created. The one for this app is below: +在 MacOS 上的这个功能仅在应用打包后有效。 在命令行启动的开发版中无效。 打包 MacOS 应用时,您需要确保 `plist` 文件中包含了处理该协议的声明。 若您使用 [`electron-packager`](https://github.com/electron/electron-packager) 打包应用,您可以添加 `--extend-info` 标记,并附上 `plist` 文件的路径。 在本文的例子中如下所示: ### Plist ```XML -

    -

    macOS plist
    -
    
    -    
    -        
    -            
    -                
    -                    CFBundleURLTypes
    -                    
    -                        
    -                            CFBundleURLSchemes
    -                            
    -                                electron-api-demos
    -                            
    -                            CFBundleURLName
    -                            Electron API Demos Protocol
    -                        
    -                    
    -                    ElectronTeamID
    -                    VEKTX9H2N7
    -                
    -            
    -        
    -    
    -

    + + + + + CFBundleURLTypes + + + CFBundleURLSchemes + + electron-api-demos + + CFBundleURLName + Electron API Demos Protocol + + + ElectronTeamID + VEKTX9H2N7 + + ``` ## 结论 -After you start your electron app, you can now enter in a URL in your browser that contains the custom protocol, for example `"electron-fiddle://open"` and observe that the application will respond and show an error dialog box. +启动 Electron 应用后,在浏览器内键入包含该自定义协议的 URL,如`“electron-fiddle://open”`,观察应用是否正确响应并显示一个错误提示对话框。