mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
62 Commits
v9.0.0-bet
...
v9.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cf55a674e | ||
|
|
4542e2eef9 | ||
|
|
5009538045 | ||
|
|
2f8150891b | ||
|
|
4b9df8c248 | ||
|
|
0920d01c9c | ||
|
|
520e0bcc43 | ||
|
|
6be41c2f8e | ||
|
|
b997c562f7 | ||
|
|
2c9fe0b951 | ||
|
|
4445182739 | ||
|
|
e549aec5fc | ||
|
|
c1311480c0 | ||
|
|
6c78c9274a | ||
|
|
d50fb2938b | ||
|
|
5414c8dd7e | ||
|
|
ee68e1a787 | ||
|
|
e3d4f999ca | ||
|
|
b62df312f2 | ||
|
|
9ba491116c | ||
|
|
c74dd6eee7 | ||
|
|
2d888dc7b5 | ||
|
|
1024544573 | ||
|
|
ebbd3081b9 | ||
|
|
dc3dc81beb | ||
|
|
6babb8a9fe | ||
|
|
088e23d604 | ||
|
|
d0a764bd16 | ||
|
|
d47b788e03 | ||
|
|
a985865f65 | ||
|
|
729019b974 | ||
|
|
e83d6be20c | ||
|
|
69eddfb2f9 | ||
|
|
71c3c2b65e | ||
|
|
cf230bc709 | ||
|
|
6d3a6ce307 | ||
|
|
3d8b2af151 | ||
|
|
45174dfc19 | ||
|
|
5bdb5b821b | ||
|
|
0cce079c8f | ||
|
|
0c67a1de8c | ||
|
|
963ef4dbe7 | ||
|
|
e559af3616 | ||
|
|
ed2bc5a4aa | ||
|
|
edb22be8d4 | ||
|
|
74d391baae | ||
|
|
b35a98ce2a | ||
|
|
9bc01adbd5 | ||
|
|
af43d065d2 | ||
|
|
6f4412a317 | ||
|
|
f0a34a2f91 | ||
|
|
30e68263ed | ||
|
|
73a6d507a7 | ||
|
|
ff6e411973 | ||
|
|
fe5af34acc | ||
|
|
cd359127c9 | ||
|
|
248beeb7a5 | ||
|
|
bb2773bf66 | ||
|
|
914a8d02b4 | ||
|
|
27367fb553 | ||
|
|
f193d9a34f | ||
|
|
bcb7fbd9c5 |
72
BUILD.gn
72
BUILD.gn
@@ -3,6 +3,7 @@ import("//build/config/ui.gni")
|
||||
import("//build/config/win/manifest.gni")
|
||||
import("//components/spellcheck/spellcheck_build_features.gni")
|
||||
import("//content/public/app/mac_helpers.gni")
|
||||
import("//extensions/buildflags/buildflags.gni")
|
||||
import("//pdf/features.gni")
|
||||
import("//ppapi/buildflags/buildflags.gni")
|
||||
import("//printing/buildflags/buildflags.gni")
|
||||
@@ -58,6 +59,17 @@ if (is_mas_build) {
|
||||
"It doesn't make sense to build a MAS build on a non-mac platform")
|
||||
}
|
||||
|
||||
if (enable_pdf_viewer) {
|
||||
assert(enable_pdf, "PDF viewer support requires enable_pdf=true")
|
||||
assert(enable_electron_extensions,
|
||||
"PDF viewer support requires enable_electron_extensions=true")
|
||||
}
|
||||
|
||||
if (enable_electron_extensions) {
|
||||
assert(enable_extensions,
|
||||
"Chrome extension support requires enable_extensions=true")
|
||||
}
|
||||
|
||||
config("branding") {
|
||||
defines = [
|
||||
"ELECTRON_PRODUCT_NAME=\"$electron_product_name\"",
|
||||
@@ -324,13 +336,17 @@ source_set("electron_lib") {
|
||||
"//chrome/app/resources:platform_locale_settings",
|
||||
"//chrome/services/printing/public/mojom",
|
||||
"//components/certificate_transparency",
|
||||
"//components/crash/core/app",
|
||||
"//components/language/core/browser",
|
||||
"//components/net_log",
|
||||
"//components/network_hints/browser",
|
||||
"//components/network_hints/common:mojo_bindings",
|
||||
"//components/network_hints/renderer",
|
||||
"//components/network_session_configurator/common",
|
||||
"//components/pref_registry",
|
||||
"//components/prefs",
|
||||
"//components/upload_list",
|
||||
"//components/user_prefs",
|
||||
"//components/viz/host",
|
||||
"//components/viz/service",
|
||||
"//content/public/browser",
|
||||
@@ -443,10 +459,15 @@ source_set("electron_lib") {
|
||||
]
|
||||
}
|
||||
|
||||
if (is_linux) {
|
||||
deps += [ "//components/crash/content/browser" ]
|
||||
}
|
||||
|
||||
if (is_mac) {
|
||||
deps += [
|
||||
"//components/remote_cocoa/app_shim",
|
||||
"//content/common:mac_helpers",
|
||||
"//third_party/crashpad/crashpad/client",
|
||||
"//ui/accelerated_widget_mac",
|
||||
]
|
||||
|
||||
@@ -468,11 +489,7 @@ source_set("electron_lib") {
|
||||
]
|
||||
if (is_mas_build) {
|
||||
sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
|
||||
sources -= [
|
||||
"shell/browser/auto_updater_mac.mm",
|
||||
"shell/common/crash_reporter/crash_reporter_mac.h",
|
||||
"shell/common/crash_reporter/crash_reporter_mac.mm",
|
||||
]
|
||||
sources -= [ "shell/browser/auto_updater_mac.mm" ]
|
||||
defines += [ "MAS_BUILD" ]
|
||||
} else {
|
||||
libs += [
|
||||
@@ -493,10 +510,8 @@ source_set("electron_lib") {
|
||||
deps += [
|
||||
":libnotify_loader",
|
||||
"//build/config/linux/gtk",
|
||||
"//chrome/browser/ui/gtk",
|
||||
"//dbus",
|
||||
"//device/bluetooth",
|
||||
"//third_party/breakpad:client",
|
||||
"//ui/events/devices/x11",
|
||||
"//ui/events/platform/x11",
|
||||
"//ui/gtk",
|
||||
@@ -510,7 +525,6 @@ source_set("electron_lib") {
|
||||
]
|
||||
}
|
||||
configs += [ ":gio_unix" ]
|
||||
include_dirs += [ "//third_party/breakpad" ]
|
||||
configs += [ "//build/config/linux:x11" ]
|
||||
defines += [
|
||||
# Disable warnings for g_settings_list_schemas.
|
||||
@@ -526,6 +540,7 @@ source_set("electron_lib") {
|
||||
if (is_win) {
|
||||
libs += [ "dwmapi.lib" ]
|
||||
deps += [
|
||||
"//components/crash/core/app:crash_export_thunks",
|
||||
"//ui/native_theme:native_theme_browser",
|
||||
"//ui/views/controls/webview",
|
||||
"//ui/wm",
|
||||
@@ -537,14 +552,6 @@ source_set("electron_lib") {
|
||||
]
|
||||
}
|
||||
|
||||
if ((is_mac && !is_mas_build) || is_win) {
|
||||
sources += [
|
||||
"shell/common/crash_reporter/crash_reporter_crashpad.cc",
|
||||
"shell/common/crash_reporter/crash_reporter_crashpad.h",
|
||||
]
|
||||
deps += [ "//third_party/crashpad/crashpad/client" ]
|
||||
}
|
||||
|
||||
if (enable_plugins) {
|
||||
deps += [ "chromium_src:plugins" ]
|
||||
sources += [
|
||||
@@ -635,15 +642,6 @@ source_set("electron_lib") {
|
||||
deps += [ "//components/printing/common:mojo_interfaces" ]
|
||||
}
|
||||
|
||||
deps += [
|
||||
"//components/pref_registry",
|
||||
"//components/user_prefs",
|
||||
"//extensions/browser",
|
||||
"//extensions/browser:core_api_provider",
|
||||
"//extensions/common",
|
||||
"//extensions/common:core_api_provider",
|
||||
"//extensions/renderer",
|
||||
]
|
||||
if (enable_electron_extensions) {
|
||||
sources += filenames.lib_sources_extensions
|
||||
deps += [
|
||||
@@ -652,6 +650,11 @@ source_set("electron_lib") {
|
||||
"shell/common/extensions/api:extensions_features",
|
||||
"//chrome/browser/resources:component_extension_resources",
|
||||
"//components/zoom",
|
||||
"//extensions/browser",
|
||||
"//extensions/browser:core_api_provider",
|
||||
"//extensions/common",
|
||||
"//extensions/common:core_api_provider",
|
||||
"//extensions/renderer",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -765,11 +768,17 @@ if (is_mac) {
|
||||
}
|
||||
|
||||
bundle_data("electron_crashpad_helper") {
|
||||
sources = [ "$root_out_dir/crashpad_handler" ]
|
||||
sources = [ "$root_out_dir/chrome_crashpad_handler" ]
|
||||
|
||||
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
|
||||
outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
|
||||
|
||||
public_deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
|
||||
public_deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
|
||||
|
||||
if (is_asan) {
|
||||
# crashpad_handler requires the ASan runtime at its @executable_path.
|
||||
sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
|
||||
public_deps += [ "//build/config/sanitizers:copy_asan_runtime" ]
|
||||
}
|
||||
}
|
||||
|
||||
mac_framework_bundle("electron_framework") {
|
||||
@@ -778,6 +787,7 @@ if (is_mac) {
|
||||
framework_contents = [
|
||||
"Resources",
|
||||
"Libraries",
|
||||
"Helpers",
|
||||
]
|
||||
public_deps = [
|
||||
":electron_framework_libraries",
|
||||
@@ -1045,6 +1055,7 @@ if (is_mac) {
|
||||
":electron_app_manifest",
|
||||
":electron_lib",
|
||||
":packed_resources",
|
||||
"//components/crash/core/app",
|
||||
"//content:sandbox_helper_win",
|
||||
"//electron/buildflags",
|
||||
"//ui/strings",
|
||||
@@ -1074,6 +1085,11 @@ if (is_mac) {
|
||||
"shell/browser/resources/win/resource.h",
|
||||
]
|
||||
|
||||
deps += [
|
||||
"//components/browser_watcher:browser_watcher_client",
|
||||
"//components/crash/core/app:run_as_crashpad_handler",
|
||||
]
|
||||
|
||||
libs = [
|
||||
"comctl32.lib",
|
||||
"uiautomationcore.lib",
|
||||
|
||||
2
DEPS
2
DEPS
@@ -12,7 +12,7 @@ gclient_gn_args = [
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'83.0.4102.3',
|
||||
'83.0.4103.45',
|
||||
'node_version':
|
||||
'v12.14.1',
|
||||
'nan_version':
|
||||
|
||||
@@ -1 +1 @@
|
||||
9.0.0-beta.16
|
||||
9.0.0-beta.24
|
||||
@@ -88,5 +88,6 @@ steps:
|
||||
- powershell: |
|
||||
Get-Process | Where Name –Like "electron*" | Stop-Process
|
||||
Get-Process | Where Name –Like "MicrosoftEdge*" | Stop-Process
|
||||
Get-Process | Where Name –Like "msedge*" | Stop-Process
|
||||
displayName: 'Kill processes left running from last test run'
|
||||
condition: always()
|
||||
|
||||
@@ -20,7 +20,3 @@ angle_enable_vulkan_validation_layers = false
|
||||
dawn_enable_vulkan_validation_layers = false
|
||||
|
||||
is_cfi = false
|
||||
|
||||
enable_osr = true
|
||||
|
||||
enable_electron_extensions = true
|
||||
|
||||
@@ -32,7 +32,7 @@ declare_args() {
|
||||
enable_pepper_flash = true
|
||||
|
||||
# Enable Chrome extensions support.
|
||||
enable_electron_extensions = false
|
||||
enable_electron_extensions = true
|
||||
|
||||
# Enable Spellchecker support
|
||||
enable_builtin_spellchecker = true
|
||||
|
||||
@@ -14,6 +14,8 @@ static_library("chrome") {
|
||||
sources = [
|
||||
"//chrome/browser/browser_process.cc",
|
||||
"//chrome/browser/browser_process.h",
|
||||
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc",
|
||||
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.h",
|
||||
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
|
||||
"//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
|
||||
"//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
|
||||
@@ -51,10 +53,12 @@ static_library("chrome") {
|
||||
"//chrome/browser/ssl/security_state_tab_helper.cc",
|
||||
"//chrome/browser/ssl/security_state_tab_helper.h",
|
||||
"//chrome/browser/ssl/tls_deprecation_config.cc",
|
||||
"//chrome/browser/ui/autofill/popup_view_common.cc",
|
||||
"//chrome/browser/ui/autofill/popup_view_common.h",
|
||||
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
|
||||
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
|
||||
"//chrome/browser/win/chrome_process_finder.cc",
|
||||
"//chrome/browser/win/chrome_process_finder.h",
|
||||
"//chrome/child/v8_crashpad_support_win.cc",
|
||||
"//chrome/child/v8_crashpad_support_win.h",
|
||||
"//extensions/browser/app_window/size_constraints.cc",
|
||||
"//extensions/browser/app_window/size_constraints.h",
|
||||
]
|
||||
@@ -69,6 +73,7 @@ static_library("chrome") {
|
||||
deps = [
|
||||
"//chrome/browser:resource_prefetch_predictor_proto",
|
||||
"//components/feature_engagement:buildflags",
|
||||
"//components/optimization_guide/proto:optimization_guide_proto",
|
||||
]
|
||||
|
||||
if (is_linux) {
|
||||
@@ -238,8 +243,6 @@ static_library("chrome") {
|
||||
sources += [
|
||||
"//chrome/browser/extensions/chrome_url_request_util.cc",
|
||||
"//chrome/browser/extensions/chrome_url_request_util.h",
|
||||
"//chrome/browser/pdf/pdf_extension_util.cc",
|
||||
"//chrome/browser/pdf/pdf_extension_util.h",
|
||||
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc",
|
||||
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h",
|
||||
"//chrome/renderer/extensions/extension_hooks_delegate.cc",
|
||||
@@ -247,6 +250,15 @@ static_library("chrome") {
|
||||
"//chrome/renderer/extensions/tabs_hooks_delegate.cc",
|
||||
"//chrome/renderer/extensions/tabs_hooks_delegate.h",
|
||||
]
|
||||
|
||||
if (enable_pdf_viewer) {
|
||||
sources += [
|
||||
"//chrome/browser/pdf/pdf_extension_util.cc",
|
||||
"//chrome/browser/pdf/pdf_extension_util.h",
|
||||
"//chrome/renderer/pepper/chrome_pdf_print_client.cc",
|
||||
"//chrome/renderer/pepper/chrome_pdf_print_client.h",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,12 +277,14 @@ source_set("plugins") {
|
||||
"//chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h",
|
||||
]
|
||||
deps += [
|
||||
"//components/pdf/browser",
|
||||
"//media:media_buildflags",
|
||||
"//ppapi/buildflags",
|
||||
"//ppapi/proxy:ipc",
|
||||
"//services/device/public/mojom",
|
||||
]
|
||||
if (enable_pdf_viewer) {
|
||||
deps += [ "//components/pdf/browser" ]
|
||||
}
|
||||
if (enable_pepper_flash) {
|
||||
sources += [
|
||||
"//chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc",
|
||||
@@ -316,9 +330,11 @@ source_set("plugins") {
|
||||
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
|
||||
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
|
||||
]
|
||||
if (enable_pdf_viewer) {
|
||||
deps += [ "//components/pdf/renderer" ]
|
||||
}
|
||||
}
|
||||
deps += [
|
||||
"//components/pdf/renderer",
|
||||
"//components/strings",
|
||||
"//media:media_buildflags",
|
||||
"//ppapi/host",
|
||||
|
||||
@@ -112,6 +112,7 @@ These individual tutorials expand on topics discussed in the guide above.
|
||||
* [Process Object](api/process.md)
|
||||
* [Supported Command Line Switches](api/command-line-switches.md)
|
||||
* [Environment Variables](api/environment-variables.md)
|
||||
* [Chrome Extensions Support](api/extensions.md)
|
||||
* [Breaking API Changes](breaking-changes.md)
|
||||
|
||||
### Custom DOM Elements:
|
||||
|
||||
@@ -54,7 +54,7 @@ The `Super` key is mapped to the `Windows` key on Windows and Linux and
|
||||
* `0` to `9`
|
||||
* `A` to `Z`
|
||||
* `F1` to `F24`
|
||||
* Punctuations like `~`, `!`, `@`, `#`, `$`, etc.
|
||||
* Punctuation like `~`, `!`, `@`, `#`, `$`, etc.
|
||||
* `Plus`
|
||||
* `Space`
|
||||
* `Tab`
|
||||
|
||||
@@ -75,7 +75,7 @@ Returns:
|
||||
* `event` Event
|
||||
|
||||
Emitted when all windows have been closed and the application will quit.
|
||||
Calling `event.preventDefault()` will prevent the default behaviour, which is
|
||||
Calling `event.preventDefault()` will prevent the default behavior, which is
|
||||
terminating the application.
|
||||
|
||||
See the description of the `window-all-closed` event for the differences between
|
||||
@@ -204,7 +204,7 @@ Returns:
|
||||
[`NSUserActivity.activityType`][activity-type].
|
||||
* `userInfo` unknown - Contains app-specific state stored by the activity.
|
||||
|
||||
Emitted when [Handoff][handoff] is about to be resumed on another device. If you need to update the state to be transferred, you should call `event.preventDefault()` immediately, construct a new `userInfo` dictionary and call `app.updateCurrentActiviy()` in a timely manner. Otherwise, the operation will fail and `continue-activity-error` will be called.
|
||||
Emitted when [Handoff][handoff] is about to be resumed on another device. If you need to update the state to be transferred, you should call `event.preventDefault()` immediately, construct a new `userInfo` dictionary and call `app.updateCurrentActivity()` in a timely manner. Otherwise, the operation will fail and `continue-activity-error` will be called.
|
||||
|
||||
### Event: 'new-window-for-tab' _macOS_
|
||||
|
||||
@@ -554,11 +554,17 @@ Returns `Promise<void>` - fulfilled when Electron is initialized.
|
||||
May be used as a convenient alternative to checking `app.isReady()`
|
||||
and subscribing to the `ready` event if the app is not ready yet.
|
||||
|
||||
### `app.focus()`
|
||||
### `app.focus([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `steal` Boolean _macOS_ - Make the receiver the active app even if another app is
|
||||
currently active.
|
||||
|
||||
On Linux, focuses on the first visible window. On macOS, makes the application
|
||||
the active app. On Windows, focuses on the application's first window.
|
||||
|
||||
You should seek to use the `steal` option as sparingly as possible.
|
||||
|
||||
### `app.hide()` _macOS_
|
||||
|
||||
Hides all application windows without minimizing them.
|
||||
@@ -602,6 +608,7 @@ Returns `String` - The current application directory.
|
||||
* `videos` Directory for a user's videos.
|
||||
* `logs` Directory for your app's log folder.
|
||||
* `pepperFlashSystemPlugin` Full path to the system version of the Pepper Flash plugin.
|
||||
* `crashDumps` Directory where crash dumps are stored.
|
||||
|
||||
Returns `String` - A path to a special directory or file associated with `name`. On
|
||||
failure, an `Error` is thrown.
|
||||
@@ -1021,7 +1028,7 @@ This method can only be called before app is ready.
|
||||
|
||||
By default, Chromium disables 3D APIs (e.g. WebGL) until restart on a per
|
||||
domain basis if the GPU processes crashes too frequently. This function
|
||||
disables that behaviour.
|
||||
disables that behavior.
|
||||
|
||||
This method can only be called before app is ready.
|
||||
|
||||
@@ -1190,7 +1197,7 @@ Show the app's about panel options. These options can be overridden with `app.se
|
||||
* `website` String (optional) _Linux_ - The app's website.
|
||||
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
|
||||
|
||||
Set the about panel options. This will override the values defined in the app's `.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
|
||||
Set the about panel options. This will override the values defined in the app's `.plist` file on macOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
|
||||
|
||||
If you do not set `credits` but still wish to surface them in your app, AppKit will look for a file named "Credits.html", "Credits.rtf", and "Credits.rtfd", in that order, in the bundle returned by the NSBundle class method main. The first file found is used, and if none is found, the info area is left blank. See Apple [documentation](https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc) for more information.
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
* `simpleFullscreen` Boolean (optional) - Use pre-Lion fullscreen on macOS. Default is `false`.
|
||||
* `skipTaskbar` Boolean (optional) - Whether to show the window in taskbar. Default is
|
||||
`false`.
|
||||
* `kiosk` Boolean (optional) - The kiosk mode. Default is `false`.
|
||||
* `kiosk` Boolean (optional) - Whether the window is in kiosk mode. Default is `false`.
|
||||
* `title` String (optional) - Default window title. Default is `"Electron"`. If the HTML tag `<title>` is defined in the HTML file loaded by `loadURL()`, this property will be ignored.
|
||||
* `icon` ([NativeImage](native-image.md) | String) (optional) - The window icon. On Windows it is
|
||||
recommended to use `ICO` icons to get best visual effects, you can also
|
||||
@@ -207,7 +207,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
* `opacity` Number (optional) - Set the initial opacity of the window, between 0.0 (fully
|
||||
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
|
||||
* `darkTheme` Boolean (optional) - Forces using dark theme for the window, only works on
|
||||
some GTK+3 desktop environments. Default is `false`.
|
||||
some GTK desktop environments. Default is `false`.
|
||||
* `transparent` Boolean (optional) - Makes the window [transparent](frameless-window.md#transparent-window).
|
||||
Default is `false`. On Windows, does not work unless the window is frameless.
|
||||
* `type` String (optional) - The type of window, default is normal window. See more about
|
||||
@@ -623,6 +623,12 @@ Returns:
|
||||
|
||||
Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`, `left`.
|
||||
|
||||
The method underlying this event is built to handle older macOS-style trackpad swiping,
|
||||
where the content on the screen doesn't move with the swipe. Most macOS trackpads are not
|
||||
configured to allow this kind of swiping anymore, so in order for it to emit properly the
|
||||
'Swipe between pages' preference in `System Preferences > Trackpad > More Gestures` must be
|
||||
set to 'Swipe with two or three fingers'.
|
||||
|
||||
#### Event: 'rotate-gesture' _macOS_
|
||||
|
||||
Returns:
|
||||
@@ -797,6 +803,51 @@ A `Boolean` property that determines whether the window menu bar should hide its
|
||||
If the menu bar is already visible, setting this property to `true` won't
|
||||
hide it immediately.
|
||||
|
||||
#### `win.simpleFullScreen`
|
||||
|
||||
A `Boolean` property that determines whether the window is in simple (pre-Lion) fullscreen mode.
|
||||
|
||||
#### `win.fullScreen`
|
||||
|
||||
A `Boolean` property that determines whether the window is in fullscreen mode.
|
||||
|
||||
#### `win.visibleOnAllWorkspaces`
|
||||
|
||||
A `Boolean` property that determines whether the window is visible on all workspaces.
|
||||
|
||||
**Note:** Always returns false on Windows.
|
||||
|
||||
#### `win.shadow`
|
||||
|
||||
A `Boolean` property that determines whether the window has a shadow.
|
||||
|
||||
#### `win.menuBarVisible` _Windows_ _Linux_
|
||||
|
||||
A `Boolean` property that determines whether the menu bar should be visible.
|
||||
|
||||
**Note:** If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.
|
||||
|
||||
#### `win.kiosk`
|
||||
|
||||
A `Boolean` property that determines whether the window is in kiosk mode.
|
||||
|
||||
#### `win.documentEdited` _macOS_
|
||||
|
||||
A `Boolean` property that specifies whether the window’s document has been edited.
|
||||
|
||||
The icon in title bar will become gray when set to `true`.
|
||||
|
||||
#### `win.representedFilename` _macOS_
|
||||
|
||||
A `String` property that determines the pathname of the file the window represents,
|
||||
and the icon of the file will show in window's title bar.
|
||||
|
||||
#### `win.title`
|
||||
|
||||
A `String` property that determines the title of the native window.
|
||||
|
||||
**Note:** The title of the web page can be different from the title of the native window.
|
||||
|
||||
#### `win.minimizable`
|
||||
|
||||
A `Boolean` property that determines whether the window can be manually minimized by user.
|
||||
@@ -952,7 +1003,7 @@ Returns `Boolean` - Whether the window is in fullscreen mode.
|
||||
|
||||
Enters or leaves simple fullscreen mode.
|
||||
|
||||
Simple fullscreen mode emulates the native fullscreen behavior found in versions of Mac OS X prior to Lion (10.7).
|
||||
Simple fullscreen mode emulates the native fullscreen behavior found in versions of macOS prior to Lion (10.7).
|
||||
|
||||
#### `win.isSimpleFullScreen()` _macOS_
|
||||
|
||||
@@ -1276,7 +1327,7 @@ Makes the window not show in the taskbar.
|
||||
|
||||
* `flag` Boolean
|
||||
|
||||
Enters or leaves the kiosk mode.
|
||||
Enters or leaves kiosk mode.
|
||||
|
||||
#### `win.isKiosk()`
|
||||
|
||||
|
||||
@@ -4,18 +4,13 @@
|
||||
|
||||
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
|
||||
|
||||
The following is an example of automatically submitting a crash report to a
|
||||
remote server:
|
||||
The following is an example of setting up Electron to automatically submit
|
||||
crash reports to a remote server:
|
||||
|
||||
```javascript
|
||||
const { crashReporter } = require('electron')
|
||||
|
||||
crashReporter.start({
|
||||
productName: 'YourName',
|
||||
companyName: 'YourCompany',
|
||||
submitURL: 'https://your-domain.com/url-to-submit',
|
||||
uploadToServer: true
|
||||
})
|
||||
crashReporter.start({ submitURL: 'https://your-domain.com/url-to-submit' })
|
||||
```
|
||||
|
||||
For setting up a server to accept and process crash reports, you can use
|
||||
@@ -30,11 +25,19 @@ Or use a 3rd party hosted solution:
|
||||
* [Sentry](https://docs.sentry.io/clients/electron)
|
||||
* [BugSplat](https://www.bugsplat.com/docs/platforms/electron)
|
||||
|
||||
Crash reports are saved locally in an application-specific temp directory folder.
|
||||
For a `productName` of `YourName`, crash reports will be stored in a folder
|
||||
named `YourName Crashes` inside the temp directory. You can customize this temp
|
||||
directory location for your app by calling the `app.setPath('temp', '/my/custom/temp')`
|
||||
API before starting the crash reporter.
|
||||
Crash reports are stored temporarily before being uploaded in a directory
|
||||
underneath the app's user data directory (called 'Crashpad' on Windows and Mac,
|
||||
or 'Crash Reports' on Linux). You can override this directory by calling
|
||||
`app.setPath('crashDumps', '/path/to/crashes')` before starting the crash
|
||||
reporter.
|
||||
|
||||
On Windows and macOS, Electron uses
|
||||
[crashpad](https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md)
|
||||
to monitor and report crashes. On Linux, Electron uses
|
||||
[breakpad](https://chromium.googlesource.com/breakpad/breakpad/+/master/). This
|
||||
is an implementation detail driven by Chromium, and it may change in future. In
|
||||
particular, crashpad is newer and will likely eventually replace breakpad on
|
||||
all platforms.
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -43,40 +46,68 @@ The `crashReporter` module has the following methods:
|
||||
### `crashReporter.start(options)`
|
||||
|
||||
* `options` Object
|
||||
* `companyName` String
|
||||
* `submitURL` String - URL that crash reports will be sent to as POST.
|
||||
* `productName` String (optional) - Defaults to `app.name`.
|
||||
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent to the server. Default is `true`.
|
||||
* `ignoreSystemCrashHandler` Boolean (optional) - Default is `false`.
|
||||
* `extra` Record<String, String> (optional) - An object you can define that will be sent along with the
|
||||
report. Only string properties are sent correctly. Nested objects are not
|
||||
supported. When using Windows, the property names and values must be fewer than 64 characters.
|
||||
* `crashesDirectory` String (optional) - Directory to store the crash reports temporarily (only used when the crash reporter is started via `process.crashReporter.start`).
|
||||
* `companyName` String (optional) _Deprecated_ - Deprecated alias for
|
||||
`{ globalExtra: { _companyName: ... } }`.
|
||||
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent
|
||||
to the server. If false, crash reports will be collected and stored in the
|
||||
crashes directory, but not uploaded. Default is `true`.
|
||||
* `ignoreSystemCrashHandler` Boolean (optional) - If true, crashes generated
|
||||
in the main process will not be forwarded to the system crash handler.
|
||||
Default is `false`.
|
||||
* `rateLimit` Boolean (optional) _macOS_ _Windows_ - If true, limit the
|
||||
number of crashes uploaded to 1/hour. Default is `false`.
|
||||
* `compress` Boolean (optional) _macOS_ _Windows_ - If true, crash reports
|
||||
will be compressed and uploaded with `Content-Encoding: gzip`. Not all
|
||||
collection servers support compressed payloads. Default is `false`.
|
||||
* `extra` Record<String, String> (optional) - Extra string key/value
|
||||
annotations that will be sent along with crash reports that are generated
|
||||
in the main process. Only string values are supported. Crashes generated in
|
||||
child processes will not contain these extra
|
||||
parameters to crash reports generated from child processes, call
|
||||
[`addExtraParameter`](#crashreporteraddextraparameterkey-value) from the
|
||||
child process.
|
||||
* `globalExtra` Record<String, String> (optional) - Extra string key/value
|
||||
annotations that will be sent along with any crash reports generated in any
|
||||
process. These annotations cannot be changed once the crash reporter has
|
||||
been started. If a key is present in both the global extra parameters and
|
||||
the process-specific extra parameters, then the global one will take
|
||||
precedence. By default, `productName` and the app version are included, as
|
||||
well as the Electron version.
|
||||
|
||||
You are required to call this method before using any other `crashReporter` APIs
|
||||
and in each process (main/renderer) from which you want to collect crash reports.
|
||||
You can pass different options to `crashReporter.start` when calling from different processes.
|
||||
This method must be called before using any other `crashReporter` APIs. Once
|
||||
initialized this way, the crashpad handler collects crashes from all
|
||||
subsequently created processes. The crash reporter cannot be disabled once
|
||||
started.
|
||||
|
||||
**Note** Child processes created via the `child_process` module will not have access to the Electron modules.
|
||||
Therefore, to collect crash reports from them, use `process.crashReporter.start` instead. Pass the same options as above
|
||||
along with an additional one called `crashesDirectory` that should point to a directory to store the crash
|
||||
reports temporarily. You can test this out by calling `process.crash()` to crash the child process.
|
||||
This method should be called as early as possible in app startup, preferably
|
||||
before `app.on('ready')`. If the crash reporter is not initialized at the time
|
||||
a renderer process is created, then that renderer process will not be monitored
|
||||
by the crash reporter.
|
||||
|
||||
**Note:** If you need send additional/updated `extra` parameters after your
|
||||
first call `start` you can call `addExtraParameter` on macOS or call `start`
|
||||
again with the new/updated `extra` parameters on Linux and Windows.
|
||||
**Note:** You can test out the crash reporter by generating a crash using
|
||||
`process.crash()`.
|
||||
|
||||
**Note:** On macOS and windows, Electron uses a new `crashpad` client for crash collection and reporting.
|
||||
If you want to enable crash reporting, initializing `crashpad` from the main process using `crashReporter.start` is required
|
||||
regardless of which process you want to collect crashes from. Once initialized this way, the crashpad handler collects
|
||||
crashes from all processes. You still have to call `crashReporter.start` from the renderer or child process, otherwise crashes from
|
||||
them will get reported without `companyName`, `productName` or any of the `extra` information.
|
||||
**Note:** If you need to send additional/updated `extra` parameters after your
|
||||
first call `start` you can call `addExtraParameter`.
|
||||
|
||||
**Note:** Parameters passed in `extra`, `globalExtra` or set with
|
||||
`addExtraParameter` have limits on the length of the keys and values. Key names
|
||||
must be at most 39 bytes long, and values must be no longer than 127 bytes.
|
||||
Keys with names longer than the maximum will be silently ignored. Key values
|
||||
longer than the maximum length will be truncated.
|
||||
|
||||
**Note:** Calling this method from the renderer process is deprecated.
|
||||
|
||||
### `crashReporter.getLastCrashReport()`
|
||||
|
||||
Returns [`CrashReport`](structures/crash-report.md):
|
||||
Returns [`CrashReport`](structures/crash-report.md) - The date and ID of the
|
||||
last crash report. Only crash reports that have been uploaded will be returned;
|
||||
even if a crash report is present on disk it will not be returned until it is
|
||||
uploaded. In the case that there are no uploaded reports, `null` is returned.
|
||||
|
||||
Returns the date and ID of the last crash report. Only crash reports that have been uploaded will be returned; even if a crash report is present on disk it will not be returned until it is uploaded. In the case that there are no uploaded reports, `null` is returned.
|
||||
**Note:** Calling this method from the renderer process is deprecated.
|
||||
|
||||
### `crashReporter.getUploadedReports()`
|
||||
|
||||
@@ -85,43 +116,61 @@ Returns [`CrashReport[]`](structures/crash-report.md):
|
||||
Returns all uploaded crash reports. Each report contains the date and uploaded
|
||||
ID.
|
||||
|
||||
**Note:** Calling this method from the renderer process is deprecated.
|
||||
|
||||
### `crashReporter.getUploadToServer()`
|
||||
|
||||
Returns `Boolean` - Whether reports should be submitted to the server. Set through
|
||||
the `start` method or `setUploadToServer`.
|
||||
|
||||
**Note:** This API can only be called from the main process.
|
||||
**Note:** Calling this method from the renderer process is deprecated.
|
||||
|
||||
### `crashReporter.setUploadToServer(uploadToServer)`
|
||||
|
||||
* `uploadToServer` Boolean _macOS_ - Whether reports should be submitted to the server.
|
||||
* `uploadToServer` Boolean - Whether reports should be submitted to the server.
|
||||
|
||||
This would normally be controlled by user preferences. This has no effect if
|
||||
called before `start` is called.
|
||||
|
||||
**Note:** This API can only be called from the main process.
|
||||
**Note:** Calling this method from the renderer process is deprecated.
|
||||
|
||||
### `crashReporter.addExtraParameter(key, value)` _macOS_ _Windows_
|
||||
### `crashReporter.getCrashesDirectory()` _Deprecated_
|
||||
|
||||
* `key` String - Parameter key, must be less than 64 characters long.
|
||||
* `value` String - Parameter value, must be less than 64 characters long.
|
||||
Returns `String` - The directory where crashes are temporarily stored before being uploaded.
|
||||
|
||||
Set an extra parameter to be sent with the crash report. The values
|
||||
specified here will be sent in addition to any values set via the `extra` option when `start` was called. This API is only available on macOS and windows, if you need to add/update extra parameters on Linux after your first call to `start` you can call `start` again with the updated `extra` options.
|
||||
**Note:** This method is deprecated, use `app.getPath('crashDumps')` instead.
|
||||
|
||||
### `crashReporter.removeExtraParameter(key)` _macOS_ _Windows_
|
||||
### `crashReporter.addExtraParameter(key, value)`
|
||||
|
||||
* `key` String - Parameter key, must be less than 64 characters long.
|
||||
* `key` String - Parameter key, must be no longer than 39 bytes.
|
||||
* `value` String - Parameter value, must be no longer than 127 bytes.
|
||||
|
||||
Remove a extra parameter from the current set of parameters so that it will not be sent with the crash report.
|
||||
Set an extra parameter to be sent with the crash report. The values specified
|
||||
here will be sent in addition to any values set via the `extra` option when
|
||||
`start` was called.
|
||||
|
||||
Parameters added in this fashion (or via the `extra` parameter to
|
||||
`crashReporter.start`) are specific to the calling process. Adding extra
|
||||
parameters in the main process will not cause those parameters to be sent along
|
||||
with crashes from renderer or other child processes. Similarly, adding extra
|
||||
parameters in a renderer process will not result in those parameters being sent
|
||||
with crashes that occur in other renderer processes or in the main process.
|
||||
|
||||
**Note:** Parameters have limits on the length of the keys and values. Key
|
||||
names must be no longer than 39 bytes, and values must be no longer than 127
|
||||
bytes. Keys with names longer than the maximum will be silently ignored. Key
|
||||
values longer than the maximum length will be truncated.
|
||||
|
||||
### `crashReporter.removeExtraParameter(key)`
|
||||
|
||||
* `key` String - Parameter key, must be no longer than 39 bytes.
|
||||
|
||||
Remove a extra parameter from the current set of parameters. Future crashes
|
||||
will not include this parameter.
|
||||
|
||||
### `crashReporter.getParameters()`
|
||||
|
||||
See all of the current parameters being passed to the crash reporter.
|
||||
|
||||
### `crashReporter.getCrashesDirectory()`
|
||||
|
||||
Returns `String` - The directory where crashes are temporarily stored before being uploaded.
|
||||
Returns `Record<String, String>` - The current 'extra' parameters of the crash reporter.
|
||||
|
||||
## Crash Report Payload
|
||||
|
||||
|
||||
@@ -269,6 +269,7 @@ Shows a message box, it will block the process until the message box is closed.
|
||||
It returns the index of the clicked button.
|
||||
|
||||
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
|
||||
If `browserWindow` is not shown dialog will not be attached to it. In such case It will be displayed as independed window.
|
||||
|
||||
### `dialog.showMessageBox([browserWindow, ]options)`
|
||||
|
||||
|
||||
101
docs/api/extensions.md
Normal file
101
docs/api/extensions.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# Chrome Extension Support
|
||||
|
||||
Electron supports a subset of the [Chrome Extensions
|
||||
API][chrome-extensions-api-index], primarily to support DevTools extensions and
|
||||
Chromium-internal extensions, but it also happens to support some other
|
||||
extension capabilities.
|
||||
|
||||
[chrome-extensions-api-index]: https://developer.chrome.com/extensions/api_index
|
||||
|
||||
> **Note:** Electron does not support arbitrary Chrome extensions from the
|
||||
> store, and it is a **non-goal** of the Electron project to be perfectly
|
||||
> compatible with Chrome's implementation of Extensions.
|
||||
|
||||
## Loading extensions
|
||||
|
||||
Electron only supports loading unpacked extensions (i.e., `.crx` files do not
|
||||
work). Extensions are installed per-`session`. To load an extension, call
|
||||
[`ses.loadExtension`](session.md#sesloadextensionpath):
|
||||
|
||||
```js
|
||||
const { session } = require('electron')
|
||||
|
||||
session.loadExtension('path/to/unpacked/extension').then(({ id }) => {
|
||||
// ...
|
||||
})
|
||||
```
|
||||
|
||||
Loaded extensions will not be automatically remembered across exits; if you do
|
||||
not call `loadExtension` when the app runs, the extension will not be loaded.
|
||||
|
||||
See the [`session`](session.md) documentation for more information about
|
||||
loading, unloading, and querying active extensions.
|
||||
|
||||
## Supported Extensions APIs
|
||||
|
||||
We support the following extensions APIs, with some caveats. Other APIs may
|
||||
additionally be supported, but support for any APIs not listed here is
|
||||
provisional and may be removed.
|
||||
|
||||
### `chrome.devtools.inspectedWindow`
|
||||
|
||||
All features of this API are supported.
|
||||
|
||||
### `chrome.devtools.network`
|
||||
|
||||
All features of this API are supported.
|
||||
|
||||
### `chrome.devtools.panels`
|
||||
|
||||
All features of this API are supported.
|
||||
|
||||
### `chrome.extension`
|
||||
|
||||
The following properties of `chrome.extension` are supported:
|
||||
|
||||
- `chrome.extension.lastError`
|
||||
|
||||
The following methods of `chrome.extension` are supported:
|
||||
|
||||
- `chrome.extension.getURL`
|
||||
- `chrome.extension.getBackgroundPage`
|
||||
|
||||
### `chrome.runtime`
|
||||
|
||||
The following properties of `chrome.runtime` are supported:
|
||||
|
||||
- `chrome.runtime.lastError`
|
||||
- `chrome.runtime.id`
|
||||
|
||||
The following methods of `chrome.runtime` are supported:
|
||||
|
||||
- `chrome.runtime.getBackgroundPage`
|
||||
- `chrome.runtime.getManifest`
|
||||
- `chrome.runtime.getURL`
|
||||
- `chrome.runtime.connect`
|
||||
- `chrome.runtime.sendMessage`
|
||||
|
||||
The following events of `chrome.runtime` are supported:
|
||||
|
||||
- `chrome.runtime.onStartup`
|
||||
- `chrome.runtime.onInstalled`
|
||||
- `chrome.runtime.onSuspend`
|
||||
- `chrome.runtime.onSuspendCanceled`
|
||||
- `chrome.runtime.onConnect`
|
||||
- `chrome.runtime.onMessage`
|
||||
|
||||
### `chrome.storage`
|
||||
|
||||
Only `chrome.storage.local` is supported; `chrome.storage.sync` and
|
||||
`chrome.storage.managed` are not.
|
||||
|
||||
### `chrome.tabs`
|
||||
|
||||
The following methods of `chrome.tabs` are supported:
|
||||
|
||||
- `chrome.tabs.sendMessage`
|
||||
- `chrome.tabs.executeScript`
|
||||
|
||||
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
|
||||
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
|
||||
> supported and will raise an error.
|
||||
@@ -52,7 +52,7 @@ win.show()
|
||||
Uses custom drawn close, and miniaturize buttons that display
|
||||
when hovering in the top left of the window. The fullscreen button
|
||||
is not available due to restrictions of frameless windows as they
|
||||
interface with Apple's MacOS window masks. These custom buttons prevent
|
||||
interface with Apple's macOS window masks. These custom buttons prevent
|
||||
issues with mouse events that occur with the standard window toolbar buttons.
|
||||
This option is only applicable for frameless windows.
|
||||
|
||||
@@ -158,7 +158,7 @@ buttons in titlebar non-draggable.
|
||||
|
||||
## Text selection
|
||||
|
||||
In a frameless window the dragging behaviour may conflict with selecting text.
|
||||
In a frameless window the dragging behavior may conflict with selecting text.
|
||||
For example, when you drag the titlebar you may accidentally select the text on
|
||||
the titlebar. To prevent this, you need to disable text selection within a
|
||||
draggable area like this:
|
||||
|
||||
@@ -14,7 +14,7 @@ See [`Menu`](menu.md) for examples.
|
||||
* `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`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
|
||||
* `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`, `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`.
|
||||
@@ -117,7 +117,7 @@ When specifying a `role` on macOS, `label` and `accelerator` are the only
|
||||
options that will affect the menu item. All other options will be ignored.
|
||||
Lowercase `role`, e.g. `toggledevtools`, is still supported.
|
||||
|
||||
**Nota Bene:** The `enabled` and `visibility` properties are not available for top-level menu items in the tray on MacOS.
|
||||
**Nota Bene:** The `enabled` and `visibility` properties are not available for top-level menu items in the tray on macOS.
|
||||
|
||||
### Instance Properties
|
||||
|
||||
@@ -151,7 +151,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`, `close`, `minimize`, `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`, `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`
|
||||
|
||||
#### `menuItem.accelerator`
|
||||
|
||||
|
||||
@@ -5,14 +5,7 @@ The Electron team is currently undergoing an initiative to convert separate gett
|
||||
## Candidates
|
||||
|
||||
* `BrowserWindow`
|
||||
* `fullscreen`
|
||||
* `simpleFullscreen`
|
||||
* `alwaysOnTop`
|
||||
* `title`
|
||||
* `documentEdited`
|
||||
* `hasShadow`
|
||||
* `menubarVisible`
|
||||
* `visibleOnAllWorkspaces`
|
||||
* `crashReporter` module
|
||||
* `uploadToServer`
|
||||
* `webFrame` modules
|
||||
|
||||
@@ -51,7 +51,7 @@ app.whenReady().then(() => {
|
||||
|
||||
In the above code the [`BrowserWindow`](browser-window.md) that was created has Node.js disabled and can communicate
|
||||
only via IPC. The use of this option stops Electron from creating a Node.js runtime in the renderer. Also,
|
||||
within this new window `window.open` follows the native behaviour (by default Electron creates a [`BrowserWindow`](browser-window.md)
|
||||
within this new window `window.open` follows the native behavior (by default Electron creates a [`BrowserWindow`](browser-window.md)
|
||||
and returns a proxy to this via `window.open`).
|
||||
|
||||
[`app.enableSandbox`](app.md#appenablesandbox-experimental) can be used to force `sandbox: true` for all `BrowserWindow` instances.
|
||||
|
||||
4
docs/api/structures/new-window-event.md
Normal file
4
docs/api/structures/new-window-event.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# NewWindowEvent Object extends `Event`
|
||||
|
||||
* `newGuest` BrowserWindow (optional)
|
||||
|
||||
@@ -326,7 +326,7 @@ This API is only available on macOS 10.14 Mojave or newer.
|
||||
* `window-frame-text` - The text in the window's titlebar area.
|
||||
|
||||
Returns `String` - The system color setting in RGB hexadecimal form (`#ABCDEF`).
|
||||
See the [Windows docs][windows-colors] and the [MacOS docs][macos-colors] for more details.
|
||||
See the [Windows docs][windows-colors] and the [macOS docs][macos-colors] for more details.
|
||||
|
||||
The following colors are only available on macOS 10.14: `find-highlight`, `selected-content-background`, `separator`, `unemphasized-selected-content-background`, `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ Emitted when page receives favicon urls.
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `event` NewWindowEvent
|
||||
* `url` String
|
||||
* `frameName` String
|
||||
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
|
||||
@@ -1804,7 +1804,7 @@ A [`WebContents`](web-contents.md) instance that might own this `WebContents`.
|
||||
|
||||
#### `contents.devToolsWebContents` _Readonly_
|
||||
|
||||
A `WebContents` of DevTools for this `WebContents`.
|
||||
A `WebContents | null` property that represents the of DevTools `WebContents` associated with a given `WebContents`.
|
||||
|
||||
**Note:** Users should never store this object because it may become `null`
|
||||
when the DevTools has been closed.
|
||||
|
||||
@@ -2,13 +2,124 @@
|
||||
|
||||
Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version](tutorial/electron-versioning.md#semver) before the change is made.
|
||||
|
||||
## `FIXME` comments
|
||||
### Types of Breaking Changes
|
||||
|
||||
The `FIXME` string is used in code comments to denote things that should be fixed for future releases. See https://github.com/electron/electron/search?q=fixme
|
||||
This document uses the following convention to categorize breaking changes:
|
||||
|
||||
- **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.
|
||||
|
||||
## Planned Breaking API Changes (12.0)
|
||||
|
||||
### Removed: `crashReporter` methods in the renderer process
|
||||
|
||||
The following `crashReporter` methods are no longer available in the renderer
|
||||
process:
|
||||
|
||||
- `crashReporter.start`
|
||||
- `crashReporter.getLastCrashReport`
|
||||
- `crashReporter.getUploadedReports`
|
||||
- `crashReporter.getUploadToServer`
|
||||
- `crashReporter.setUploadToServer`
|
||||
- `crashReporter.getCrashesDirectory`
|
||||
|
||||
They should be called only from the main process.
|
||||
|
||||
See [#23265](https://github.com/electron/electron/pull/23265) for more details.
|
||||
|
||||
## Planned Breaking API Changes (11.0)
|
||||
|
||||
## Planned Breaking API Changes (10.0)
|
||||
|
||||
### Deprecated: `companyName` argument to `crashReporter.start()`
|
||||
|
||||
The `companyName` argument to `crashReporter.start()`, which was previously
|
||||
required, is now optional, and further, is deprecated. To get the same
|
||||
behavior in a non-deprecated way, you can pass a `companyName` value in
|
||||
`globalExtra`.
|
||||
|
||||
```js
|
||||
// Deprecated in Electron 10
|
||||
crashReporter.start({ companyName: 'Umbrella Corporation' })
|
||||
// Replace with
|
||||
crashReporter.start({ globalExtra: { _companyName: 'Umbrella Corporation' } })
|
||||
```
|
||||
|
||||
### Deprecated: `crashReporter.getCrashesDirectory()`
|
||||
|
||||
The `crashReporter.getCrashesDirectory` method has been deprecated. Usage
|
||||
should be replaced by `app.getPath('crashDumps')`.
|
||||
|
||||
```js
|
||||
// Deprecated in Electron 10
|
||||
crashReporter.getCrashesDirectory()
|
||||
// Replace with
|
||||
app.getPath('crashDumps')
|
||||
```
|
||||
|
||||
### Deprecated: `crashReporter` methods in the renderer process
|
||||
|
||||
Calling the following `crashReporter` methods from the renderer process is
|
||||
deprecated:
|
||||
|
||||
- `crashReporter.start`
|
||||
- `crashReporter.getLastCrashReport`
|
||||
- `crashReporter.getUploadedReports`
|
||||
- `crashReporter.getUploadToServer`
|
||||
- `crashReporter.setUploadToServer`
|
||||
- `crashReporter.getCrashesDirectory`
|
||||
|
||||
The only non-deprecated methods remaining in the `crashReporter` module in the
|
||||
renderer are `addExtraParameter`, `removeExtraParameter` and `getParameters`.
|
||||
|
||||
All above methods remain non-deprecated when called from the main process.
|
||||
|
||||
See [#23265](https://github.com/electron/electron/pull/23265) for more details.
|
||||
|
||||
### 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:
|
||||
|
||||
```js
|
||||
const w = new BrowserWindow({
|
||||
webPreferences: {
|
||||
enableRemoteModule: true
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
We [recommend moving away from the remote
|
||||
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
|
||||
|
||||
## Planned Breaking API Changes (9.0)
|
||||
|
||||
### `<webview>.getWebContents()`
|
||||
### 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.
|
||||
|
||||
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).
|
||||
|
||||
### Removed: `<webview>.getWebContents()`
|
||||
|
||||
This API, which was deprecated in Electron 8.0, is now removed.
|
||||
|
||||
@@ -20,7 +131,7 @@ const { remote } = require('electron')
|
||||
remote.webContents.fromId(webview.getWebContentsId())
|
||||
```
|
||||
|
||||
### `webFrame.setLayoutZoomLevelLimits()`
|
||||
### Removed: `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
|
||||
@@ -28,7 +139,7 @@ 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).
|
||||
|
||||
### Sending non-JS objects over IPC now throws an exception
|
||||
### Behavior Changed: Sending non-JS objects over IPC now throws an exception
|
||||
|
||||
In Electron 8.0, IPC was changed to use the Structured Clone Algorithm,
|
||||
bringing significant performance improvements. To help ease the transition, the
|
||||
@@ -44,9 +155,14 @@ In Electron 9.0, the old serialization algorithm has been removed, and sending
|
||||
such non-serializable objects will now throw an "object could not be cloned"
|
||||
error.
|
||||
|
||||
### API Changed: `shell.openItem` is now `shell.openPath`
|
||||
|
||||
The `shell.openItem` API has been replaced with an asynchronous `shell.openPath` API.
|
||||
You can see the original API proposal and reasoning [here](https://github.com/electron/governance/blob/master/wg-api/spec-documents/shell-openitem.md).
|
||||
|
||||
## Planned Breaking API Changes (8.0)
|
||||
|
||||
### Values sent over IPC are now serialized with Structured Clone Algorithm
|
||||
### Behavior Changed: Values sent over IPC are now serialized with Structured Clone Algorithm
|
||||
|
||||
The algorithm used to serialize objects sent over IPC (through
|
||||
`ipcRenderer.send`, `ipcRenderer.sendSync`, `WebContents.send` and related
|
||||
@@ -97,7 +213,7 @@ these kinds of objects will throw a 'could not be cloned' error.
|
||||
|
||||
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
||||
|
||||
### `<webview>.getWebContents()`
|
||||
### Deprecated: `<webview>.getWebContents()`
|
||||
|
||||
This API is implemented using the `remote` module, which has both performance
|
||||
and security implications. Therefore its usage should be explicit.
|
||||
@@ -138,7 +254,7 @@ const { ipcRenderer } = require('electron')
|
||||
ipcRenderer.invoke('openDevTools', webview.getWebContentsId())
|
||||
```
|
||||
|
||||
### `webFrame.setLayoutZoomLevelLimits()`
|
||||
### Deprecated: `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 will emit a warning
|
||||
@@ -148,7 +264,7 @@ limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
|
||||
|
||||
## Planned Breaking API Changes (7.0)
|
||||
|
||||
### Node Headers URL
|
||||
### Deprecated: Atom.io Node Headers URL
|
||||
|
||||
This is the URL specified as `disturl` in a `.npmrc` file or as the `--dist-url`
|
||||
command line flag when building native Node modules. Both will be supported for
|
||||
@@ -158,7 +274,7 @@ Deprecated: https://atom.io/download/electron
|
||||
|
||||
Replace with: https://electronjs.org/headers
|
||||
|
||||
### `session.clearAuthCache(options)`
|
||||
### API Changed: `session.clearAuthCache()` no longer accepts options
|
||||
|
||||
The `session.clearAuthCache` API no longer accepts options for what to clear, and instead unconditionally clears the whole cache.
|
||||
|
||||
@@ -169,25 +285,25 @@ session.clearAuthCache({ type: 'password' })
|
||||
session.clearAuthCache()
|
||||
```
|
||||
|
||||
### `powerMonitor.querySystemIdleState`
|
||||
### API Changed: `powerMonitor.querySystemIdleState` is now `powerMonitor.getSystemIdleState`
|
||||
|
||||
```js
|
||||
// Removed in Electron 7.0
|
||||
powerMonitor.querySystemIdleState(threshold, callback)
|
||||
// Replace with synchronous API
|
||||
const idleState = getSystemIdleState(threshold)
|
||||
const idleState = powerMonitor.getSystemIdleState(threshold)
|
||||
```
|
||||
|
||||
### `powerMonitor.querySystemIdleTime`
|
||||
### API Changed: `powerMonitor.querySystemIdleTime` is now `powerMonitor.getSystemIdleState`
|
||||
|
||||
```js
|
||||
// Removed in Electron 7.0
|
||||
powerMonitor.querySystemIdleTime(callback)
|
||||
// Replace with synchronous API
|
||||
const idleTime = getSystemIdleTime()
|
||||
const idleTime = powerMonitor.getSystemIdleTime()
|
||||
```
|
||||
|
||||
### webFrame Isolated World APIs
|
||||
### API Changed: `webFrame.setIsolatedWorldInfo` replaces separate methods
|
||||
|
||||
```js
|
||||
// Removed in Electron 7.0
|
||||
@@ -204,11 +320,11 @@ webFrame.setIsolatedWorldInfo(
|
||||
})
|
||||
```
|
||||
|
||||
### Removal of deprecated `marked` property on getBlinkMemoryInfo
|
||||
### Removed: `marked` property on `getBlinkMemoryInfo`
|
||||
|
||||
This property was removed in Chromium 77, and as such is no longer available.
|
||||
|
||||
### `webkitdirectory` attribute for `<input type="file"/>`
|
||||
### Behavior Changed: `webkitdirectory` attribute for `<input type="file"/>` now lists directory contents
|
||||
|
||||
The `webkitdirectory` property on HTML file inputs allows them to select folders.
|
||||
Previous versions of Electron had an incorrect implementation where the `event.target.files`
|
||||
@@ -241,9 +357,10 @@ In Electron 7, this now returns a `FileList` with a `File` object for:
|
||||
Note that `webkitdirectory` no longer exposes the path to the selected folder.
|
||||
If you require the path to the selected folder rather than the folder contents,
|
||||
see the `dialog.showOpenDialog` API ([link](https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options)).
|
||||
|
||||
## Planned Breaking API Changes (6.0)
|
||||
|
||||
### `win.setMenu(null)`
|
||||
### API Changed: `win.setMenu(null)` is now `win.removeMenu()`
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
@@ -252,7 +369,7 @@ win.setMenu(null)
|
||||
win.removeMenu()
|
||||
```
|
||||
|
||||
### `contentTracing.getTraceBufferUsage()`
|
||||
### API Changed: `contentTracing.getTraceBufferUsage()` is now a promise
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
@@ -265,7 +382,7 @@ contentTracing.getTraceBufferUsage().then(infoObject => {
|
||||
})
|
||||
```
|
||||
|
||||
### `electron.screen` in renderer process
|
||||
### API Changed: `electron.screen` in the renderer process should be accessed via `remote`
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
@@ -274,7 +391,7 @@ require('electron').screen
|
||||
require('electron').remote.screen
|
||||
```
|
||||
|
||||
### `require` in sandboxed renderers
|
||||
### API Changed: `require()`ing node builtins in sandboxed renderers no longer implicitly loads the `remote` version
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
@@ -298,25 +415,25 @@ require('path')
|
||||
require('electron').remote.require('path')
|
||||
```
|
||||
|
||||
### `powerMonitor.querySystemIdleState`
|
||||
### Deprecated: `powerMonitor.querySystemIdleState` replaced with `powerMonitor.getSystemIdleState`
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
powerMonitor.querySystemIdleState(threshold, callback)
|
||||
// Replace with synchronous API
|
||||
const idleState = getSystemIdleState(threshold)
|
||||
const idleState = powerMonitor.getSystemIdleState(threshold)
|
||||
```
|
||||
|
||||
### `powerMonitor.querySystemIdleTime`
|
||||
### Deprecated: `powerMonitor.querySystemIdleTime` replaced with `powerMonitor.getSystemIdleTime`
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
powerMonitor.querySystemIdleTime(callback)
|
||||
// Replace with synchronous API
|
||||
const idleTime = getSystemIdleTime()
|
||||
const idleTime = powerMonitor.getSystemIdleTime()
|
||||
```
|
||||
|
||||
### `app.enableMixedSandbox`
|
||||
### Deprecated: `app.enableMixedSandbox()` is no longer needed
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
@@ -325,7 +442,7 @@ app.enableMixedSandbox()
|
||||
|
||||
Mixed-sandbox mode is now enabled by default.
|
||||
|
||||
### `Tray`
|
||||
### Deprecated: `Tray.setHighlightMode`
|
||||
|
||||
Under macOS Catalina our former Tray implementation breaks.
|
||||
Apple's native substitute doesn't support changing the highlighting behavior.
|
||||
@@ -338,7 +455,7 @@ tray.setHighlightMode(mode)
|
||||
|
||||
## Planned Breaking API Changes (5.0)
|
||||
|
||||
### `new BrowserWindow({ webPreferences })`
|
||||
### Default Changed: `nodeIntegration` and `webviewTag` default to false, `contextIsolation` defaults to true
|
||||
|
||||
The following `webPreferences` option default values are deprecated in favor of the new defaults listed below.
|
||||
|
||||
@@ -358,16 +475,16 @@ const w = new BrowserWindow({
|
||||
})
|
||||
```
|
||||
|
||||
### `nativeWindowOpen`
|
||||
### Behavior Changed: `nodeIntegration` in child windows opened via `nativeWindowOpen`
|
||||
|
||||
Child windows opened with the `nativeWindowOpen` option will always have Node.js integration disabled, unless `nodeIntegrationInSubFrames` is `true.
|
||||
Child windows opened with the `nativeWindowOpen` option will always have Node.js integration disabled, unless `nodeIntegrationInSubFrames` is `true`.
|
||||
|
||||
### Privileged Schemes Registration
|
||||
### API Changed: Registering privileged schemes must now be done before app ready
|
||||
|
||||
Renderer process APIs `webFrame.setRegisterURLSchemeAsPrivileged` and `webFrame.registerURLSchemeAsBypassingCSP` as well as browser process API `protocol.registerStandardSchemes` have been removed.
|
||||
Renderer process APIs `webFrame.registerURLSchemeAsPrivileged` and `webFrame.registerURLSchemeAsBypassingCSP` as well as browser process API `protocol.registerStandardSchemes` have been removed.
|
||||
A new API, `protocol.registerSchemesAsPrivileged` has been added and should be used for registering custom schemes with the required privileges. Custom schemes are required to be registered before app ready.
|
||||
|
||||
### webFrame Isolated World APIs
|
||||
### Deprecated: `webFrame.setIsolatedWorld*` replaced with `webFrame.setIsolatedWorldInfo`
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
@@ -384,7 +501,7 @@ webFrame.setIsolatedWorldInfo(
|
||||
})
|
||||
```
|
||||
|
||||
## `webFrame.setSpellCheckProvider`
|
||||
### API Changed: `webFrame.setSpellCheckProvider` now takes an asynchronous callback
|
||||
The `spellCheck` callback is now asynchronous, and `autoCorrectWord` parameter has been removed.
|
||||
```js
|
||||
// Deprecated
|
||||
|
||||
@@ -25,7 +25,7 @@ Follow the guidelines below for building Electron on Linux.
|
||||
Doing so permits installing Node on your own home directory as a standard user.
|
||||
Or try repositories such as [NodeSource](https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories).
|
||||
* [clang](https://clang.llvm.org/get_started.html) 3.4 or later.
|
||||
* Development headers of GTK+ and libnotify.
|
||||
* Development headers of GTK 3 and libnotify.
|
||||
|
||||
On Ubuntu, install the following libraries:
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ $ pip install pyobjc
|
||||
If you're developing Electron and don't plan to redistribute your
|
||||
custom Electron build, you may skip this section.
|
||||
|
||||
Official Electron builds are built with [Xcode 9.4.1](http://adcdownload.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip), and the MacOS 10.13 SDK. Building with a newer SDK works too, but the releases currently use the 10.13 SDK.
|
||||
Official Electron builds are built with [Xcode 9.4.1](http://adcdownload.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip), and the macOS 10.13 SDK. Building with a newer SDK works too, but the releases currently use the 10.13 SDK.
|
||||
|
||||
## Building Electron
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ you prefer a graphical interface.
|
||||
tail calls, and other compiler optimizations.
|
||||
|
||||
* **Xcode**: In addition to Xcode, also install the Xcode command line tools.
|
||||
They include LLDB, the default debugger in Xcode on Mac OS X. It supports
|
||||
They include LLDB, the default debugger in Xcode on macOS. It supports
|
||||
debugging C, Objective-C and C++ on the desktop and iOS devices and simulator.
|
||||
|
||||
* **.lldbinit**: Create or edit `~/.lldbinit` to allow Chromium code to be properly source-mapped.
|
||||
|
||||
@@ -35,7 +35,7 @@ $ git fetch upstream
|
||||
|
||||
Build steps and dependencies differ slightly depending on your operating system.
|
||||
See these detailed guides on building Electron locally:
|
||||
* [Building on MacOS](https://electronjs.org/docs/development/build-instructions-macos)
|
||||
* [Building on macOS](https://electronjs.org/docs/development/build-instructions-macos)
|
||||
* [Building on Linux](https://electronjs.org/docs/development/build-instructions-linux)
|
||||
* [Building on Windows](https://electronjs.org/docs/development/build-instructions-windows)
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ app.whenReady().then(() => {
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
const reopenMenuItem = findReopenMenuItem()
|
||||
if (reopenMenuItem) reopenMenuItem.enabled = true
|
||||
@@ -335,7 +335,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -46,7 +46,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -54,7 +54,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -36,7 +36,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -44,7 +44,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -38,7 +38,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -46,7 +46,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -38,7 +38,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -46,7 +46,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<h2>Create a new window</h2>
|
||||
<h3>Supports: Win, MacOS, Linux <span>|</span> Process: Main</h3>
|
||||
<h3>Supports: Win, macOS, Linux <span>|</span> Process: Main</h3>
|
||||
<button id="new-window">View Demo</button>
|
||||
<p>The <code>BrowserWindow</code> module gives you the ability to create new windows in your app. This main process module can be used from the renderer process with the <code>remote</code> module, as is shown in this demo.</p>
|
||||
<p>There are a lot of options when creating a new window. A few are in this demo, but visit the <a id="browser-window-link" href="">documentation<span>(opens in new window)</span></a>
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -37,7 +37,7 @@ app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On OS X it is common for applications and their menu bar
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
@@ -45,7 +45,7 @@ app.on('window-all-closed', function () {
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
|
||||
@@ -76,7 +76,7 @@ that cache folder to provide custom builds of Electron or to avoid making contac
|
||||
with the network at all.
|
||||
|
||||
* Linux: `$XDG_CACHE_HOME` or `~/.cache/electron/`
|
||||
* MacOS: `~/Library/Caches/electron/`
|
||||
* macOS: `~/Library/Caches/electron/`
|
||||
* Windows: `$LOCALAPPDATA/electron/Cache` or `~/AppData/Local/electron/Cache/`
|
||||
|
||||
On environments that have been using older versions of Electron, you might find the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# MacOS Dock
|
||||
# macOS Dock
|
||||
|
||||
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
|
||||
|
||||
@@ -49,7 +49,7 @@ The library file `widevinecdm.dll` will be under
|
||||
`Program Files(x86)/Google/Chrome/Application/CHROME_VERSION/WidevineCdm/_platform_specific/win_(x86|x64)/`
|
||||
directory.
|
||||
|
||||
### On MacOS
|
||||
### On macOS
|
||||
|
||||
The library file `libwidevinecdm.dylib` will be under
|
||||
`/Applications/Google Chrome.app/Contents/Versions/CHROME_VERSION/Google Chrome Framework.framework/Versions/A/Libraries/WidevineCdm/_platform_specific/mac_(x86|x64)/`
|
||||
|
||||
@@ -21,6 +21,7 @@ auto_filenames = {
|
||||
"docs/api/dock.md",
|
||||
"docs/api/download-item.md",
|
||||
"docs/api/environment-variables.md",
|
||||
"docs/api/extensions.md",
|
||||
"docs/api/file-object.md",
|
||||
"docs/api/frameless-window.md",
|
||||
"docs/api/global-shortcut.md",
|
||||
@@ -96,6 +97,7 @@ auto_filenames = {
|
||||
"docs/api/structures/mime-typed-buffer.md",
|
||||
"docs/api/structures/mouse-input-event.md",
|
||||
"docs/api/structures/mouse-wheel-input-event.md",
|
||||
"docs/api/structures/new-window-event.md",
|
||||
"docs/api/structures/notification-action.md",
|
||||
"docs/api/structures/point.md",
|
||||
"docs/api/structures/printer-info.md",
|
||||
@@ -136,14 +138,13 @@ auto_filenames = {
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/crash-reporter.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/type-utils.ts",
|
||||
"lib/common/web-view-methods.ts",
|
||||
"lib/common/webpack-globals-provider.ts",
|
||||
"lib/renderer/api/context-bridge.ts",
|
||||
"lib/renderer/api/crash-reporter.js",
|
||||
"lib/renderer/api/crash-reporter.ts",
|
||||
"lib/renderer/api/desktop-capturer.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
@@ -178,11 +179,8 @@ auto_filenames = {
|
||||
isolated_bundle_deps = [
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/isolated_renderer/init.js",
|
||||
"lib/renderer/ipc-renderer-internal-utils.ts",
|
||||
"lib/renderer/ipc-renderer-internal.ts",
|
||||
"lib/renderer/web-view/web-view-constants.ts",
|
||||
"lib/renderer/web-view/web-view-element.ts",
|
||||
"lib/renderer/window-setup.ts",
|
||||
"package.json",
|
||||
"tsconfig.electron.json",
|
||||
"tsconfig.json",
|
||||
@@ -192,6 +190,7 @@ auto_filenames = {
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/webpack-globals-provider.ts",
|
||||
"lib/content_script/init.js",
|
||||
"lib/renderer/api/context-bridge.ts",
|
||||
"lib/renderer/chrome-api.ts",
|
||||
"lib/renderer/extensions/event.ts",
|
||||
"lib/renderer/extensions/i18n.ts",
|
||||
@@ -214,7 +213,7 @@ auto_filenames = {
|
||||
"lib/browser/api/browser-view.js",
|
||||
"lib/browser/api/browser-window.js",
|
||||
"lib/browser/api/content-tracing.js",
|
||||
"lib/browser/api/crash-reporter.js",
|
||||
"lib/browser/api/crash-reporter.ts",
|
||||
"lib/browser/api/dialog.js",
|
||||
"lib/browser/api/exports/electron.ts",
|
||||
"lib/browser/api/global-shortcut.js",
|
||||
@@ -250,7 +249,6 @@ auto_filenames = {
|
||||
"lib/browser/api/web-contents.js",
|
||||
"lib/browser/chrome-extension-shim.js",
|
||||
"lib/browser/chrome-extension.js",
|
||||
"lib/browser/crash-reporter-init.js",
|
||||
"lib/browser/default-menu.ts",
|
||||
"lib/browser/desktop-capturer.ts",
|
||||
"lib/browser/devtools.ts",
|
||||
@@ -270,7 +268,6 @@ auto_filenames = {
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/crash-reporter.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/init.ts",
|
||||
@@ -293,7 +290,6 @@ auto_filenames = {
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/crash-reporter.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/init.ts",
|
||||
@@ -302,7 +298,7 @@ auto_filenames = {
|
||||
"lib/common/web-view-methods.ts",
|
||||
"lib/common/webpack-globals-provider.ts",
|
||||
"lib/renderer/api/context-bridge.ts",
|
||||
"lib/renderer/api/crash-reporter.js",
|
||||
"lib/renderer/api/crash-reporter.ts",
|
||||
"lib/renderer/api/desktop-capturer.ts",
|
||||
"lib/renderer/api/exports/electron.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
@@ -342,7 +338,6 @@ auto_filenames = {
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/crash-reporter.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
"lib/common/init.ts",
|
||||
@@ -350,7 +345,7 @@ auto_filenames = {
|
||||
"lib/common/type-utils.ts",
|
||||
"lib/common/webpack-globals-provider.ts",
|
||||
"lib/renderer/api/context-bridge.ts",
|
||||
"lib/renderer/api/crash-reporter.js",
|
||||
"lib/renderer/api/crash-reporter.ts",
|
||||
"lib/renderer/api/desktop-capturer.ts",
|
||||
"lib/renderer/api/exports/electron.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
|
||||
@@ -31,6 +31,8 @@ filenames = {
|
||||
"shell/app/command_line_args.h",
|
||||
"shell/app/electron_content_client.cc",
|
||||
"shell/app/electron_content_client.h",
|
||||
"shell/app/electron_crash_reporter_client.cc",
|
||||
"shell/app/electron_crash_reporter_client.h",
|
||||
"shell/app/electron_main_delegate.cc",
|
||||
"shell/app/electron_main_delegate.h",
|
||||
"shell/app/electron_main_delegate_mac.h",
|
||||
@@ -51,6 +53,8 @@ filenames = {
|
||||
"shell/browser/api/electron_api_content_tracing.cc",
|
||||
"shell/browser/api/electron_api_cookies.cc",
|
||||
"shell/browser/api/electron_api_cookies.h",
|
||||
"shell/browser/api/electron_api_crash_reporter.cc",
|
||||
"shell/browser/api/electron_api_crash_reporter.h",
|
||||
"shell/browser/api/electron_api_data_pipe_holder.cc",
|
||||
"shell/browser/api/electron_api_data_pipe_holder.h",
|
||||
"shell/browser/api/electron_api_debugger.cc",
|
||||
@@ -164,7 +168,6 @@ filenames = {
|
||||
"shell/browser/electron_javascript_dialog_manager.h",
|
||||
"shell/browser/electron_navigation_throttle.cc",
|
||||
"shell/browser/electron_navigation_throttle.h",
|
||||
"shell/browser/electron_paths.h",
|
||||
"shell/browser/electron_permission_manager.cc",
|
||||
"shell/browser/electron_permission_manager.h",
|
||||
"shell/browser/electron_quota_permission_context.cc",
|
||||
@@ -433,7 +436,6 @@ filenames = {
|
||||
"shell/common/api/electron_api_clipboard.h",
|
||||
"shell/common/api/electron_api_clipboard_mac.mm",
|
||||
"shell/common/api/electron_api_command_line.cc",
|
||||
"shell/common/api/electron_api_crash_reporter.cc",
|
||||
"shell/common/api/electron_api_key_weak_map.h",
|
||||
"shell/common/api/electron_api_native_image.cc",
|
||||
"shell/common/api/electron_api_native_image.h",
|
||||
@@ -456,22 +458,13 @@ filenames = {
|
||||
"shell/common/asar/scoped_temporary_file.h",
|
||||
"shell/common/color_util.cc",
|
||||
"shell/common/color_util.h",
|
||||
"shell/common/crash_reporter/crash_reporter.cc",
|
||||
"shell/common/crash_reporter/crash_reporter.h",
|
||||
"shell/common/crash_reporter/crash_reporter_linux.cc",
|
||||
"shell/common/crash_reporter/crash_reporter_linux.h",
|
||||
"shell/common/crash_reporter/crash_reporter_mac.h",
|
||||
"shell/common/crash_reporter/crash_reporter_mac.mm",
|
||||
"shell/common/crash_reporter/crash_reporter_win.cc",
|
||||
"shell/common/crash_reporter/crash_reporter_win.h",
|
||||
"shell/common/crash_reporter/linux/crash_dump_handler.cc",
|
||||
"shell/common/crash_reporter/linux/crash_dump_handler.h",
|
||||
"shell/common/crash_reporter/win/crash_service_main.cc",
|
||||
"shell/common/crash_reporter/win/crash_service_main.h",
|
||||
"shell/common/crash_keys.cc",
|
||||
"shell/common/crash_keys.h",
|
||||
"shell/common/electron_command_line.cc",
|
||||
"shell/common/electron_command_line.h",
|
||||
"shell/common/electron_constants.cc",
|
||||
"shell/common/electron_constants.h",
|
||||
"shell/common/electron_paths.h",
|
||||
"shell/common/gin_converters/accelerator_converter.cc",
|
||||
"shell/common/gin_converters/accelerator_converter.h",
|
||||
"shell/common/gin_converters/blink_converter.cc",
|
||||
@@ -479,8 +472,6 @@ filenames = {
|
||||
"shell/common/gin_converters/callback_converter.h",
|
||||
"shell/common/gin_converters/content_converter.cc",
|
||||
"shell/common/gin_converters/content_converter.h",
|
||||
"shell/common/gin_converters/extension_converter.cc",
|
||||
"shell/common/gin_converters/extension_converter.h",
|
||||
"shell/common/gin_converters/file_dialog_converter.cc",
|
||||
"shell/common/gin_converters/file_dialog_converter.h",
|
||||
"shell/common/gin_converters/file_path_converter.h",
|
||||
@@ -495,6 +486,8 @@ filenames = {
|
||||
"shell/common/gin_converters/net_converter.cc",
|
||||
"shell/common/gin_converters/net_converter.h",
|
||||
"shell/common/gin_converters/std_converter.h",
|
||||
"shell/common/gin_converters/time_converter.cc",
|
||||
"shell/common/gin_converters/time_converter.h",
|
||||
"shell/common/gin_converters/value_converter.cc",
|
||||
"shell/common/gin_converters/value_converter.h",
|
||||
"shell/common/gin_helper/arguments.cc",
|
||||
@@ -531,6 +524,10 @@ filenames = {
|
||||
"shell/common/key_weak_map.h",
|
||||
"shell/common/keyboard_util.cc",
|
||||
"shell/common/keyboard_util.h",
|
||||
"shell/common/language_util.h",
|
||||
"shell/common/language_util_linux.cc",
|
||||
"shell/common/language_util_mac.mm",
|
||||
"shell/common/language_util_win.cc",
|
||||
"shell/common/mac/main_application_bundle.h",
|
||||
"shell/common/mac/main_application_bundle.mm",
|
||||
"shell/common/mouse_util.cc",
|
||||
@@ -565,6 +562,7 @@ filenames = {
|
||||
"shell/renderer/api/context_bridge/render_frame_function_store.h",
|
||||
"shell/renderer/api/electron_api_context_bridge.cc",
|
||||
"shell/renderer/api/electron_api_context_bridge.h",
|
||||
"shell/renderer/api/electron_api_crash_reporter_renderer.cc",
|
||||
"shell/renderer/api/electron_api_renderer_ipc.cc",
|
||||
"shell/renderer/api/electron_api_spell_check_client.cc",
|
||||
"shell/renderer/api/electron_api_spell_check_client.h",
|
||||
@@ -645,6 +643,8 @@ filenames = {
|
||||
"shell/common/extensions/electron_extensions_api_provider.h",
|
||||
"shell/common/extensions/electron_extensions_client.cc",
|
||||
"shell/common/extensions/electron_extensions_client.h",
|
||||
"shell/common/gin_converters/extension_converter.cc",
|
||||
"shell/common/gin_converters/extension_converter.h",
|
||||
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.cc",
|
||||
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.h",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.cc",
|
||||
|
||||
@@ -92,43 +92,6 @@ BrowserWindow.prototype._init = function () {
|
||||
return this.webContents.devToolsWebContents;
|
||||
}
|
||||
});
|
||||
|
||||
// Properties
|
||||
|
||||
Object.defineProperty(this, 'autoHideMenuBar', {
|
||||
get: () => this.isMenuBarAutoHide(),
|
||||
set: (autoHide) => this.setAutoHideMenuBar(autoHide)
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'minimizable', {
|
||||
get: () => this.isMinimizable(),
|
||||
set: (min) => this.setMinimizable(min)
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'maximizable', {
|
||||
get: () => this.isMaximizable(),
|
||||
set: (max) => this.setMaximizable(max)
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'resizable', {
|
||||
get: () => this.isResizable(),
|
||||
set: (res) => this.setResizable(res)
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'fullScreenable', {
|
||||
get: () => this.isFullScreenable(),
|
||||
set: (full) => this.setFullScreenable(full)
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'closable', {
|
||||
get: () => this.isClosable(),
|
||||
set: (close) => this.setClosable(close)
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'movable', {
|
||||
get: () => this.isMovable(),
|
||||
set: (move) => this.setMovable(move)
|
||||
});
|
||||
};
|
||||
|
||||
const isBrowserWindow = (win) => {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const CrashReporter = require('@electron/internal/common/crash-reporter');
|
||||
const { crashReporterInit } = require('@electron/internal/browser/crash-reporter-init');
|
||||
|
||||
class CrashReporterMain extends CrashReporter {
|
||||
init (options) {
|
||||
return crashReporterInit(options);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new CrashReporterMain();
|
||||
83
lib/browser/api/crash-reporter.ts
Normal file
83
lib/browser/api/crash-reporter.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
import { app } from 'electron';
|
||||
|
||||
const binding = process.electronBinding('crash_reporter');
|
||||
|
||||
class CrashReporter {
|
||||
start (options: Electron.CrashReporterStartOptions) {
|
||||
const {
|
||||
productName = app.name,
|
||||
companyName = undefined,
|
||||
extra = {},
|
||||
globalExtra = {},
|
||||
ignoreSystemCrashHandler = false,
|
||||
submitURL = undefined,
|
||||
uploadToServer = true,
|
||||
rateLimit = false,
|
||||
compress = false
|
||||
} = options || {};
|
||||
|
||||
if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start');
|
||||
|
||||
const appVersion = app.getVersion();
|
||||
|
||||
if (companyName && globalExtra._companyName == null) globalExtra._companyName = companyName;
|
||||
|
||||
const globalExtraAmended = {
|
||||
_productName: productName,
|
||||
_version: appVersion,
|
||||
...globalExtra
|
||||
};
|
||||
|
||||
binding.start(submitURL, uploadToServer,
|
||||
ignoreSystemCrashHandler, rateLimit, compress, globalExtraAmended, extra, false);
|
||||
}
|
||||
|
||||
getLastCrashReport () {
|
||||
const reports = this.getUploadedReports()
|
||||
.sort((a, b) => {
|
||||
const ats = (a && a.date) ? new Date(a.date).getTime() : 0;
|
||||
const bts = (b && b.date) ? new Date(b.date).getTime() : 0;
|
||||
return bts - ats;
|
||||
});
|
||||
|
||||
return (reports.length > 0) ? reports[0] : null;
|
||||
}
|
||||
|
||||
getUploadedReports (): Electron.CrashReport[] {
|
||||
return binding.getUploadedReports();
|
||||
}
|
||||
|
||||
getCrashesDirectory () {
|
||||
return app.getPath('crashDumps');
|
||||
}
|
||||
|
||||
getUploadToServer () {
|
||||
if (process.type === 'browser') {
|
||||
return binding.getUploadToServer();
|
||||
} else {
|
||||
throw new Error('getUploadToServer can only be called from the main process');
|
||||
}
|
||||
}
|
||||
|
||||
setUploadToServer (uploadToServer: boolean) {
|
||||
if (process.type === 'browser') {
|
||||
return binding.setUploadToServer(uploadToServer);
|
||||
} else {
|
||||
throw new Error('setUploadToServer can only be called from the main process');
|
||||
}
|
||||
}
|
||||
|
||||
addExtraParameter (key: string, value: string) {
|
||||
binding.addExtraParameter(key, value);
|
||||
}
|
||||
|
||||
removeExtraParameter (key: string) {
|
||||
binding.removeExtraParameter(key);
|
||||
}
|
||||
|
||||
getParameters () {
|
||||
return binding.getParameters();
|
||||
}
|
||||
}
|
||||
|
||||
export default new CrashReporter();
|
||||
@@ -17,6 +17,88 @@ TopLevelWindow.prototype._init = function () {
|
||||
}
|
||||
};
|
||||
|
||||
// Properties
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'autoHideMenuBar', {
|
||||
get: function () { return this.isMenuBarAutoHide(); },
|
||||
set: function (autoHide) { this.setAutoHideMenuBar(autoHide); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'visibleOnAllWorkspaces', {
|
||||
get: function () { return this.isVisibleOnAllWorkspaces(); },
|
||||
set: function (visible) { this.setVisibleOnAllWorkspaces(visible); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'fullScreen', {
|
||||
get: function () { return this.isFullScreen(); },
|
||||
set: function (full) { this.setFullScreen(full); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'simpleFullScreen', {
|
||||
get: function () { return this.isSimpleFullScreen(); },
|
||||
set: function (simple) { this.setSimpleFullScreen(simple); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'kiosk', {
|
||||
get: function () { return this.isKiosk(); },
|
||||
set: function (kiosk) { this.setKiosk(kiosk); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'documentEdited', {
|
||||
get: function () { return this.isFullscreen(); },
|
||||
set: function (edited) { this.setDocumentEdited(edited); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'shadow', {
|
||||
get: function () { return this.hasShadow(); },
|
||||
set: function (shadow) { this.setHasShadow(shadow); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'representedFilename', {
|
||||
get: function () { return this.getRepresentedFilename(); },
|
||||
set: function (filename) { this.setRepresentedFilename(filename); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'minimizable', {
|
||||
get: function () { return this.isMinimizable(); },
|
||||
set: function (min) { this.setMinimizable(min); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'title', {
|
||||
get: function () { return this.getTitle(); },
|
||||
set: function (title) { this.setTitle(title); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'maximizable', {
|
||||
get: function () { return this.isMaximizable(); },
|
||||
set: function (max) { this.setMaximizable(max); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'resizable', {
|
||||
get: function () { return this.isResizable(); },
|
||||
set: function (res) { this.setResizable(res); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'menuBarVisible', {
|
||||
get: function () { return this.isMenuBarVisible(); },
|
||||
set: function (visible) { this.setMenuBarVisibility(visible); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'fullScreenable', {
|
||||
get: function () { return this.isFullScreenable(); },
|
||||
set: function (full) { this.setFullScreenable(full); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'closable', {
|
||||
get: function () { return this.isClosable(); },
|
||||
set: function (close) { this.setClosable(close); }
|
||||
});
|
||||
|
||||
Object.defineProperty(TopLevelWindow.prototype, 'movable', {
|
||||
get: function () { return this.isMovable(); },
|
||||
set: function (move) { this.setMovable(move); }
|
||||
});
|
||||
|
||||
TopLevelWindow.getFocusedWindow = () => {
|
||||
return TopLevelWindow.getAllWindows().find((win) => win.isFocused());
|
||||
};
|
||||
|
||||
@@ -528,6 +528,11 @@ WebContents.prototype._init = function () {
|
||||
const referrer = { url: '', policy: 'default' };
|
||||
internalWindowOpen(event, url, referrer, frameName, disposition, options);
|
||||
});
|
||||
|
||||
const prefs = this.getWebPreferences() || {};
|
||||
if (prefs.webviewTag && prefs.contextIsolation) {
|
||||
electron.deprecate.log('Security Warning: A WebContents was just created with both webviewTag and contextIsolation enabled. This combination is fundamentally less secure and effectively bypasses the protections of contextIsolation. We strongly recommend you move away from webviews to OOPIF or BrowserView in order for your app to be more secure');
|
||||
}
|
||||
}
|
||||
|
||||
this.on('login', (event, ...args) => {
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const { app } = require('electron');
|
||||
const path = require('path');
|
||||
|
||||
const getTempDirectory = function () {
|
||||
try {
|
||||
return app.getPath('temp');
|
||||
} catch {
|
||||
// Delibrately laze-load the os module, this file is on the hot
|
||||
// path when booting Electron and os takes between 5 - 8ms to load and we do not need it yet
|
||||
return require('os').tmpdir();
|
||||
}
|
||||
};
|
||||
|
||||
exports.crashReporterInit = function (options) {
|
||||
const productName = options.productName || app.name;
|
||||
const crashesDirectory = path.join(getTempDirectory(), `${productName} Crashes`);
|
||||
|
||||
return {
|
||||
productName,
|
||||
crashesDirectory,
|
||||
appVersion: app.getVersion()
|
||||
};
|
||||
};
|
||||
@@ -266,6 +266,9 @@ const attachGuest = function (event, embedderFrameId, elementInstanceId, guestIn
|
||||
// Remove an guest-embedder relationship.
|
||||
const detachGuest = function (embedder, guestInstanceId) {
|
||||
const guestInstance = guestInstances[guestInstanceId];
|
||||
|
||||
if (!guestInstance) return;
|
||||
|
||||
if (embedder !== guestInstance.embedder) {
|
||||
return;
|
||||
}
|
||||
@@ -356,6 +359,10 @@ handleMessage('ELECTRON_GUEST_VIEW_MANAGER_ATTACH_GUEST', function (event, embed
|
||||
}
|
||||
});
|
||||
|
||||
handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_DETACH_GUEST', function (event, guestInstanceId) {
|
||||
return detachGuest(event.sender, guestInstanceId);
|
||||
});
|
||||
|
||||
// this message is sent by the actual <webview>
|
||||
ipcMainInternal.on('ELECTRON_GUEST_VIEW_MANAGER_FOCUS_CHANGE', function (event, focus, guestInstanceId) {
|
||||
const guest = getGuest(guestInstanceId);
|
||||
|
||||
@@ -188,6 +188,14 @@ const canAccessWindow = function (sender, target) {
|
||||
|
||||
// Routed window.open messages with raw options
|
||||
ipcMainInternal.on('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', (event, url, frameName, features) => {
|
||||
// This should only be allowed for senders that have nativeWindowOpen: false
|
||||
{
|
||||
const webPreferences = event.sender.getLastWebPreferences();
|
||||
if (webPreferences.nativeWindowOpen || webPreferences.sandbox) {
|
||||
event.returnValue = null;
|
||||
throw new Error('GUEST_WINDOW_MANAGER_WINDOW_OPEN denied: expected native window.open');
|
||||
}
|
||||
}
|
||||
if (url == null || url === '') url = 'about:blank';
|
||||
if (frameName == null) frameName = '';
|
||||
if (features == null) features = '';
|
||||
@@ -195,7 +203,7 @@ ipcMainInternal.on('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', (event, url, fra
|
||||
const options = {};
|
||||
|
||||
const ints = ['x', 'y', 'width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight', 'zoomFactor'];
|
||||
const webPreferences = ['zoomFactor', 'nodeIntegration', 'enableRemoteModule', 'preload', 'javascript', 'contextIsolation', 'webviewTag'];
|
||||
const webPreferences = ['zoomFactor', 'nodeIntegration', 'enableRemoteModule', 'javascript', 'contextIsolation', 'webviewTag'];
|
||||
const disposition = 'new-window';
|
||||
|
||||
// Used to store additional features
|
||||
|
||||
@@ -203,10 +203,9 @@ const { setDefaultApplicationMenu } = require('@electron/internal/browser/defaul
|
||||
|
||||
// Create default menu.
|
||||
//
|
||||
// Note that the task must be added before loading any app, so we can make sure
|
||||
// the call is maded before any user window is created, otherwise the default
|
||||
// menu may show even when user explicitly hides the menu.
|
||||
app.whenReady().then(setDefaultApplicationMenu);
|
||||
// The |will-finish-launching| event is emitted before |ready| event, so default
|
||||
// menu is set before any user window is created.
|
||||
app.once('will-finish-launching', setDefaultApplicationMenu);
|
||||
|
||||
if (packagePath) {
|
||||
// Finally load app's main.js and transfer control to C++.
|
||||
|
||||
@@ -7,7 +7,6 @@ const eventBinding = process.electronBinding('event');
|
||||
const clipboard = process.electronBinding('clipboard');
|
||||
const features = process.electronBinding('features');
|
||||
|
||||
const { crashReporterInit } = require('@electron/internal/browser/crash-reporter-init');
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal');
|
||||
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils');
|
||||
const guestViewManager = require('@electron/internal/browser/guest-view-manager');
|
||||
@@ -37,10 +36,6 @@ ipcMainInternal.on('ELECTRON_BROWSER_WINDOW_CLOSE', function (event) {
|
||||
event.returnValue = null;
|
||||
});
|
||||
|
||||
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_INIT', function (event, options) {
|
||||
return crashReporterInit(options);
|
||||
});
|
||||
|
||||
ipcMainInternal.handle('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES', function (event) {
|
||||
return event.sender.getLastWebPreferences();
|
||||
});
|
||||
@@ -135,3 +130,23 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event)
|
||||
ipcMainInternal.on('ELECTRON_BROWSER_PRELOAD_ERROR', function (event, preloadPath, error) {
|
||||
event.sender.emit('preload-error', event, preloadPath, error);
|
||||
});
|
||||
|
||||
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_LAST_CRASH_REPORT', () => {
|
||||
return electron.crashReporter.getLastCrashReport();
|
||||
});
|
||||
|
||||
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_UPLOADED_REPORTS', () => {
|
||||
return electron.crashReporter.getUploadedReports();
|
||||
});
|
||||
|
||||
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_UPLOAD_TO_SERVER', () => {
|
||||
return electron.crashReporter.getUploadToServer();
|
||||
});
|
||||
|
||||
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_SET_UPLOAD_TO_SERVER', (event, uploadToServer) => {
|
||||
return electron.crashReporter.setUploadToServer(uploadToServer);
|
||||
});
|
||||
|
||||
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_CRASHES_DIRECTORY', () => {
|
||||
return electron.crashReporter.getCrashesDirectory();
|
||||
});
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const binding = process.electronBinding('crash_reporter');
|
||||
|
||||
class CrashReporter {
|
||||
constructor () {
|
||||
this.productName = null;
|
||||
this.crashesDirectory = null;
|
||||
}
|
||||
|
||||
init (options) {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
|
||||
start (options) {
|
||||
if (options == null) options = {};
|
||||
|
||||
const {
|
||||
productName,
|
||||
companyName,
|
||||
extra = {},
|
||||
ignoreSystemCrashHandler = false,
|
||||
submitURL,
|
||||
uploadToServer = true
|
||||
} = options;
|
||||
|
||||
if (companyName == null) throw new Error('companyName is a required option to crashReporter.start');
|
||||
if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start');
|
||||
|
||||
const ret = this.init({
|
||||
submitURL,
|
||||
productName
|
||||
});
|
||||
|
||||
this.productName = ret.productName;
|
||||
this.crashesDirectory = ret.crashesDirectory;
|
||||
|
||||
if (extra._productName == null) extra._productName = ret.productName;
|
||||
if (extra._companyName == null) extra._companyName = companyName;
|
||||
if (extra._version == null) extra._version = ret.appVersion;
|
||||
|
||||
binding.start(ret.productName, companyName, submitURL, ret.crashesDirectory, uploadToServer, ignoreSystemCrashHandler, extra);
|
||||
}
|
||||
|
||||
getLastCrashReport () {
|
||||
const reports = this.getUploadedReports()
|
||||
.sort((a, b) => {
|
||||
const ats = (a && a.date) ? new Date(a.date).getTime() : 0;
|
||||
const bts = (b && b.date) ? new Date(b.date).getTime() : 0;
|
||||
return bts - ats;
|
||||
});
|
||||
|
||||
return (reports.length > 0) ? reports[0] : null;
|
||||
}
|
||||
|
||||
getUploadedReports () {
|
||||
const crashDir = this.getCrashesDirectory();
|
||||
if (!crashDir) {
|
||||
throw new Error('crashReporter has not been started');
|
||||
}
|
||||
|
||||
return binding.getUploadedReports(crashDir);
|
||||
}
|
||||
|
||||
getCrashesDirectory () {
|
||||
return this.crashesDirectory;
|
||||
}
|
||||
|
||||
getUploadToServer () {
|
||||
if (process.type === 'browser') {
|
||||
return binding.getUploadToServer();
|
||||
} else {
|
||||
throw new Error('getUploadToServer can only be called from the main process');
|
||||
}
|
||||
}
|
||||
|
||||
setUploadToServer (uploadToServer) {
|
||||
if (process.type === 'browser') {
|
||||
return binding.setUploadToServer(uploadToServer);
|
||||
} else {
|
||||
throw new Error('setUploadToServer can only be called from the main process');
|
||||
}
|
||||
}
|
||||
|
||||
addExtraParameter (key, value) {
|
||||
binding.addExtraParameter(key, value);
|
||||
}
|
||||
|
||||
removeExtraParameter (key) {
|
||||
binding.removeExtraParameter(key);
|
||||
}
|
||||
|
||||
getParameters () {
|
||||
return binding.getParameters();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CrashReporter;
|
||||
@@ -6,10 +6,6 @@ process.electronBinding = require('@electron/internal/common/electron-binding-se
|
||||
|
||||
const v8Util = process.electronBinding('v8_util');
|
||||
|
||||
// The `lib/renderer/ipc-renderer-internal.js` module looks for the ipc object in the
|
||||
// "ipc-internal" hidden value
|
||||
v8Util.setHiddenValue(global, 'ipc-internal', v8Util.getHiddenValue(isolatedWorld, 'ipc-internal'));
|
||||
|
||||
const webViewImpl = v8Util.getHiddenValue(isolatedWorld, 'web-view-impl');
|
||||
|
||||
if (webViewImpl) {
|
||||
@@ -17,11 +13,3 @@ if (webViewImpl) {
|
||||
const { setupWebView } = require('@electron/internal/renderer/web-view/web-view-element');
|
||||
setupWebView(v8Util, webViewImpl);
|
||||
}
|
||||
|
||||
const isolatedWorldArgs = v8Util.getHiddenValue(isolatedWorld, 'isolated-world-args');
|
||||
|
||||
if (isolatedWorldArgs) {
|
||||
const { guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen } = isolatedWorldArgs;
|
||||
const { windowSetup } = require('@electron/internal/renderer/window-setup');
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen);
|
||||
}
|
||||
|
||||
@@ -18,3 +18,17 @@ const contextBridge = {
|
||||
if (!binding._debugGCMaps) delete contextBridge.debugGC;
|
||||
|
||||
export default contextBridge;
|
||||
|
||||
export const internalContextBridge = {
|
||||
contextIsolationEnabled,
|
||||
overrideGlobalValueFromIsolatedWorld: (keys: string[], value: any) => {
|
||||
return binding._overrideGlobalValueFromIsolatedWorld(keys, value, false);
|
||||
},
|
||||
overrideGlobalValueWithDynamicPropsFromIsolatedWorld: (keys: string[], value: any) => {
|
||||
return binding._overrideGlobalValueFromIsolatedWorld(keys, value, true);
|
||||
},
|
||||
overrideGlobalPropertyFromIsolatedWorld: (keys: string[], getter: Function, setter?: Function) => {
|
||||
return binding._overrideGlobalPropertyFromIsolatedWorld(keys, getter, setter || null);
|
||||
},
|
||||
isInMainWorld: () => binding._isCalledFromMainWorld() as boolean
|
||||
};
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const CrashReporter = require('@electron/internal/common/crash-reporter');
|
||||
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils');
|
||||
|
||||
class CrashReporterRenderer extends CrashReporter {
|
||||
init (options) {
|
||||
return ipcRendererUtils.invokeSync('ELECTRON_CRASH_REPORTER_INIT', options);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new CrashReporterRenderer();
|
||||
50
lib/renderer/api/crash-reporter.ts
Normal file
50
lib/renderer/api/crash-reporter.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { invokeSync } from '../ipc-renderer-internal-utils';
|
||||
import { deprecate } from 'electron';
|
||||
|
||||
const binding = process.electronBinding('crash_reporter');
|
||||
|
||||
export default {
|
||||
start (options: Electron.CrashReporterStartOptions) {
|
||||
deprecate.log('crashReporter.start is deprecated in the renderer process. Call it from the main process instead.');
|
||||
for (const [k, v] of Object.entries(options.extra || {})) {
|
||||
binding.addExtraParameter(k, String(v));
|
||||
}
|
||||
},
|
||||
|
||||
getLastCrashReport (): Electron.CrashReport | null {
|
||||
deprecate.log('crashReporter.getLastCrashReport is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_GET_LAST_CRASH_REPORT');
|
||||
},
|
||||
|
||||
getUploadedReports () {
|
||||
deprecate.log('crashReporter.getUploadedReports is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_GET_UPLOADED_REPORTS');
|
||||
},
|
||||
|
||||
getUploadToServer () {
|
||||
deprecate.log('crashReporter.getUploadToServer is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_GET_UPLOAD_TO_SERVER');
|
||||
},
|
||||
|
||||
setUploadToServer (uploadToServer: boolean) {
|
||||
deprecate.log('crashReporter.setUploadToServer is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_SET_UPLOAD_TO_SERVER', uploadToServer);
|
||||
},
|
||||
|
||||
getCrashesDirectory () {
|
||||
deprecate.log('crashReporter.getCrashesDirectory is deprecated in the renderer process. Call it from the main process instead.');
|
||||
return invokeSync('ELECTRON_CRASH_REPORTER_GET_CRASHES_DIRECTORY');
|
||||
},
|
||||
|
||||
addExtraParameter (key: string, value: string) {
|
||||
binding.addExtraParameter(key, value);
|
||||
},
|
||||
|
||||
removeExtraParameter (key: string) {
|
||||
binding.removeExtraParameter(key);
|
||||
},
|
||||
|
||||
getParameters () {
|
||||
return binding.getParameters();
|
||||
}
|
||||
};
|
||||
@@ -5,28 +5,30 @@ const v8Util = process.electronBinding('v8_util');
|
||||
const ipcRenderer = v8Util.getHiddenValue<Electron.IpcRenderer>(global, 'ipc');
|
||||
const internal = false;
|
||||
|
||||
ipcRenderer.send = function (channel, ...args) {
|
||||
return ipc.send(internal, channel, args);
|
||||
};
|
||||
if (!ipcRenderer.send) {
|
||||
ipcRenderer.send = function (channel, ...args) {
|
||||
return ipc.send(internal, channel, args);
|
||||
};
|
||||
|
||||
ipcRenderer.sendSync = function (channel, ...args) {
|
||||
return ipc.sendSync(internal, channel, args)[0];
|
||||
};
|
||||
ipcRenderer.sendSync = function (channel, ...args) {
|
||||
return ipc.sendSync(internal, channel, args)[0];
|
||||
};
|
||||
|
||||
ipcRenderer.sendToHost = function (channel, ...args) {
|
||||
return ipc.sendToHost(channel, args);
|
||||
};
|
||||
ipcRenderer.sendToHost = function (channel, ...args) {
|
||||
return ipc.sendToHost(channel, args);
|
||||
};
|
||||
|
||||
ipcRenderer.sendTo = function (webContentsId, channel, ...args) {
|
||||
return ipc.sendTo(internal, false, webContentsId, channel, args);
|
||||
};
|
||||
ipcRenderer.sendTo = function (webContentsId, channel, ...args) {
|
||||
return ipc.sendTo(internal, false, webContentsId, channel, args);
|
||||
};
|
||||
|
||||
ipcRenderer.invoke = async function (channel, ...args) {
|
||||
const { error, result } = await ipc.invoke(internal, channel, args);
|
||||
if (error) {
|
||||
throw new Error(`Error invoking remote method '${channel}': ${error}`);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
ipcRenderer.invoke = async function (channel, ...args) {
|
||||
const { error, result } = await ipc.invoke(internal, channel, args);
|
||||
if (error) {
|
||||
throw new Error(`Error invoking remote method '${channel}': ${error}`);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
export default ipcRenderer;
|
||||
|
||||
@@ -5,26 +5,28 @@ const v8Util = process.electronBinding('v8_util');
|
||||
export const ipcRendererInternal = v8Util.getHiddenValue<Electron.IpcRendererInternal>(global, 'ipc-internal');
|
||||
const internal = true;
|
||||
|
||||
ipcRendererInternal.send = function (channel, ...args) {
|
||||
return ipc.send(internal, channel, args);
|
||||
};
|
||||
if (!ipcRendererInternal.send) {
|
||||
ipcRendererInternal.send = function (channel, ...args) {
|
||||
return ipc.send(internal, channel, args);
|
||||
};
|
||||
|
||||
ipcRendererInternal.sendSync = function (channel, ...args) {
|
||||
return ipc.sendSync(internal, channel, args)[0];
|
||||
};
|
||||
ipcRendererInternal.sendSync = function (channel, ...args) {
|
||||
return ipc.sendSync(internal, channel, args)[0];
|
||||
};
|
||||
|
||||
ipcRendererInternal.sendTo = function (webContentsId, channel, ...args) {
|
||||
return ipc.sendTo(internal, false, webContentsId, channel, args);
|
||||
};
|
||||
ipcRendererInternal.sendTo = function (webContentsId, channel, ...args) {
|
||||
return ipc.sendTo(internal, false, webContentsId, channel, args);
|
||||
};
|
||||
|
||||
ipcRendererInternal.sendToAll = function (webContentsId, channel, ...args) {
|
||||
return ipc.sendTo(internal, true, webContentsId, channel, args);
|
||||
};
|
||||
ipcRendererInternal.sendToAll = function (webContentsId, channel, ...args) {
|
||||
return ipc.sendTo(internal, true, webContentsId, channel, args);
|
||||
};
|
||||
|
||||
ipcRendererInternal.invoke = async function<T> (channel: string, ...args: any[]) {
|
||||
const { error, result } = await ipc.invoke<T>(internal, channel, args);
|
||||
if (error) {
|
||||
throw new Error(`Error invoking remote method '${channel}': ${error}`);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
ipcRendererInternal.invoke = async function<T> (channel: string, ...args: any[]) {
|
||||
const { error, result } = await ipc.invoke<T>(internal, channel, args);
|
||||
if (error) {
|
||||
throw new Error(`Error invoking remote method '${channel}': ${error}`);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { webFrame, IpcMessageEvent } from 'electron';
|
||||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
||||
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils';
|
||||
|
||||
import { WebViewImpl } from '@electron/internal/renderer/web-view/web-view-impl';
|
||||
|
||||
@@ -105,8 +106,13 @@ export function attachGuest (
|
||||
ipcRendererInternal.invoke('ELECTRON_GUEST_VIEW_MANAGER_ATTACH_GUEST', embedderFrameId, elementInstanceId, guestInstanceId, params);
|
||||
}
|
||||
|
||||
export function detachGuest (guestInstanceId: number) {
|
||||
return ipcRendererUtils.invokeSync('ELECTRON_GUEST_VIEW_MANAGER_DETACH_GUEST', guestInstanceId);
|
||||
}
|
||||
|
||||
export const guestViewInternalModule = {
|
||||
deregisterEvents,
|
||||
createGuest,
|
||||
attachGuest
|
||||
attachGuest,
|
||||
detachGuest
|
||||
};
|
||||
|
||||
@@ -66,6 +66,9 @@ const defineWebViewElement = (v8Util: NodeJS.V8UtilBinding, webViewImpl: typeof
|
||||
return;
|
||||
}
|
||||
guestViewInternal.deregisterEvents(internal.viewInstanceId);
|
||||
if (internal.guestInstanceId) {
|
||||
guestViewInternal.detachGuest(internal.guestInstanceId);
|
||||
}
|
||||
internal.elementAttached = false;
|
||||
this.internalInstanceId = 0;
|
||||
internal.reset();
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
||||
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils';
|
||||
import { internalContextBridge } from '@electron/internal/renderer/api/context-bridge';
|
||||
|
||||
// This file implements the following APIs:
|
||||
// - window.history.back()
|
||||
// - window.history.forward()
|
||||
// - window.history.go()
|
||||
// - window.history.length
|
||||
const { contextIsolationEnabled } = internalContextBridge;
|
||||
|
||||
// This file implements the following APIs over the ctx bridge:
|
||||
// - window.open()
|
||||
// - window.opener.blur()
|
||||
// - window.opener.close()
|
||||
@@ -13,7 +12,12 @@ import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-inte
|
||||
// - window.opener.focus()
|
||||
// - window.opener.location
|
||||
// - window.opener.print()
|
||||
// - window.opener.closed
|
||||
// - window.opener.postMessage()
|
||||
// - window.history.back()
|
||||
// - window.history.forward()
|
||||
// - window.history.go()
|
||||
// - window.history.length
|
||||
// - window.prompt()
|
||||
// - document.hidden
|
||||
// - document.visibilityState
|
||||
@@ -30,13 +34,13 @@ const toString = (value: any) => {
|
||||
|
||||
const windowProxies = new Map<number, BrowserWindowProxy>();
|
||||
|
||||
const getOrCreateProxy = (guestId: number) => {
|
||||
const getOrCreateProxy = (guestId: number): SafelyBoundBrowserWindowProxy => {
|
||||
let proxy = windowProxies.get(guestId);
|
||||
if (proxy == null) {
|
||||
proxy = new BrowserWindowProxy(guestId);
|
||||
windowProxies.set(guestId, proxy);
|
||||
}
|
||||
return proxy;
|
||||
return proxy.getSafe();
|
||||
};
|
||||
|
||||
const removeProxy = (guestId: number) => {
|
||||
@@ -64,6 +68,8 @@ class LocationProxy {
|
||||
*/
|
||||
private static ProxyProperty<T> (target: LocationProxy, propertyKey: LocationProperties) {
|
||||
Object.defineProperty(target, propertyKey, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: function (this: LocationProxy): T | string {
|
||||
const guestURL = this.getGuestURL();
|
||||
const value = guestURL ? guestURL[propertyKey] : '';
|
||||
@@ -82,6 +88,30 @@ class LocationProxy {
|
||||
});
|
||||
}
|
||||
|
||||
public getSafe = () => {
|
||||
const that = this;
|
||||
return {
|
||||
get href () { return that.href; },
|
||||
set href (newValue) { that.href = newValue; },
|
||||
get hash () { return that.hash; },
|
||||
set hash (newValue) { that.hash = newValue; },
|
||||
get host () { return that.host; },
|
||||
set host (newValue) { that.host = newValue; },
|
||||
get hostname () { return that.hostname; },
|
||||
set hostname (newValue) { that.hostname = newValue; },
|
||||
get origin () { return that.origin; },
|
||||
set origin (newValue) { that.origin = newValue; },
|
||||
get pathname () { return that.pathname; },
|
||||
set pathname (newValue) { that.pathname = newValue; },
|
||||
get port () { return that.port; },
|
||||
set port (newValue) { that.port = newValue; },
|
||||
get protocol () { return that.protocol; },
|
||||
set protocol (newValue) { that.protocol = newValue; },
|
||||
get search () { return that.search; },
|
||||
set search (newValue) { that.search = newValue; }
|
||||
};
|
||||
}
|
||||
|
||||
constructor (guestId: number) {
|
||||
// eslint will consider the constructor "useless"
|
||||
// unless we assign them in the body. It's fine, that's what
|
||||
@@ -114,6 +144,17 @@ class LocationProxy {
|
||||
}
|
||||
}
|
||||
|
||||
interface SafelyBoundBrowserWindowProxy {
|
||||
location: WindowProxy['location'];
|
||||
blur: WindowProxy['blur'];
|
||||
close: WindowProxy['close'];
|
||||
eval: typeof eval; // eslint-disable-line no-eval
|
||||
focus: WindowProxy['focus'];
|
||||
print: WindowProxy['print'];
|
||||
postMessage: WindowProxy['postMessage'];
|
||||
closed: boolean;
|
||||
}
|
||||
|
||||
class BrowserWindowProxy {
|
||||
public closed: boolean = false
|
||||
|
||||
@@ -124,7 +165,7 @@ class BrowserWindowProxy {
|
||||
// so for now, we'll have to make do with an "any" in the mix.
|
||||
// https://github.com/Microsoft/TypeScript/issues/2521
|
||||
public get location (): LocationProxy | any {
|
||||
return this._location;
|
||||
return this._location.getSafe();
|
||||
}
|
||||
public set location (url: string | any) {
|
||||
url = resolveURL(url, this.location.href);
|
||||
@@ -141,27 +182,48 @@ class BrowserWindowProxy {
|
||||
});
|
||||
}
|
||||
|
||||
public close () {
|
||||
public getSafe = (): SafelyBoundBrowserWindowProxy => {
|
||||
const that = this;
|
||||
return {
|
||||
postMessage: this.postMessage,
|
||||
blur: this.blur,
|
||||
close: this.close,
|
||||
focus: this.focus,
|
||||
print: this.print,
|
||||
eval: this.eval,
|
||||
get location () {
|
||||
return that.location;
|
||||
},
|
||||
set location (url: string | any) {
|
||||
that.location = url;
|
||||
},
|
||||
get closed () {
|
||||
return that.closed;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public close = () => {
|
||||
this._invokeWindowMethod('destroy');
|
||||
}
|
||||
|
||||
public focus () {
|
||||
public focus = () => {
|
||||
this._invokeWindowMethod('focus');
|
||||
}
|
||||
|
||||
public blur () {
|
||||
public blur = () => {
|
||||
this._invokeWindowMethod('blur');
|
||||
}
|
||||
|
||||
public print () {
|
||||
public print = () => {
|
||||
this._invokeWebContentsMethod('print');
|
||||
}
|
||||
|
||||
public postMessage (message: any, targetOrigin: string) {
|
||||
public postMessage = (message: any, targetOrigin: string) => {
|
||||
ipcRendererInternal.invoke('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', this.guestId, message, toString(targetOrigin), window.location.origin);
|
||||
}
|
||||
|
||||
public eval (code: string) {
|
||||
public eval = (code: string) => {
|
||||
this._invokeWebContentsMethod('executeJavaScript', code);
|
||||
}
|
||||
|
||||
@@ -182,9 +244,11 @@ export const windowSetup = (
|
||||
window.close = function () {
|
||||
ipcRendererInternal.send('ELECTRON_BROWSER_WINDOW_CLOSE');
|
||||
};
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['close'], window.close);
|
||||
}
|
||||
|
||||
if (!usesNativeWindowOpen) {
|
||||
// TODO(MarshallOfSound): Make compatible with ctx isolation without hole-punch
|
||||
// Make the browser window or guest view emit "new-window" event.
|
||||
(window as any).open = function (url?: string, frameName?: string, features?: string) {
|
||||
if (url != null && url !== '') {
|
||||
@@ -197,16 +261,19 @@ export const windowSetup = (
|
||||
return null;
|
||||
}
|
||||
};
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueWithDynamicPropsFromIsolatedWorld(['open'], window.open);
|
||||
}
|
||||
|
||||
if (openerId != null) {
|
||||
window.opener = getOrCreateProxy(openerId);
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueWithDynamicPropsFromIsolatedWorld(['opener'], window.opener);
|
||||
}
|
||||
|
||||
// But we do not support prompt().
|
||||
window.prompt = function () {
|
||||
throw new Error('prompt() is and will not be supported.');
|
||||
};
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['prompt'], window.prompt);
|
||||
|
||||
if (!usesNativeWindowOpen || openerId != null) {
|
||||
ipcRendererInternal.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (
|
||||
@@ -233,21 +300,24 @@ export const windowSetup = (
|
||||
window.history.back = function () {
|
||||
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK');
|
||||
};
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['history', 'back'], window.history.back);
|
||||
|
||||
window.history.forward = function () {
|
||||
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD');
|
||||
};
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['history', 'forward'], window.history.forward);
|
||||
|
||||
window.history.go = function (offset: number) {
|
||||
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset);
|
||||
};
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['history', 'go'], window.history.go);
|
||||
|
||||
const getHistoryLength = () => ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH');
|
||||
Object.defineProperty(window.history, 'length', {
|
||||
get: function () {
|
||||
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH');
|
||||
},
|
||||
get: getHistoryLength,
|
||||
set () {}
|
||||
});
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalPropertyFromIsolatedWorld(['history', 'length'], getHistoryLength);
|
||||
}
|
||||
|
||||
if (guestInstanceId != null) {
|
||||
@@ -269,16 +339,16 @@ export const windowSetup = (
|
||||
});
|
||||
|
||||
// Make document.hidden and document.visibilityState return the correct value.
|
||||
const getDocumentHidden = () => cachedVisibilityState !== 'visible';
|
||||
Object.defineProperty(document, 'hidden', {
|
||||
get: function () {
|
||||
return cachedVisibilityState !== 'visible';
|
||||
}
|
||||
get: getDocumentHidden
|
||||
});
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalPropertyFromIsolatedWorld(['document', 'hidden'], getDocumentHidden);
|
||||
|
||||
const getDocumentVisibilityState = () => cachedVisibilityState;
|
||||
Object.defineProperty(document, 'visibilityState', {
|
||||
get: function () {
|
||||
return cachedVisibilityState;
|
||||
}
|
||||
get: getDocumentVisibilityState
|
||||
});
|
||||
if (contextIsolationEnabled) internalContextBridge.overrideGlobalPropertyFromIsolatedWorld(['document', 'visibilityState'], getDocumentVisibilityState);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "9.0.0-beta.16",
|
||||
"version": "9.0.0-beta.24",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
@@ -9,6 +9,7 @@
|
||||
"@octokit/rest": "^16.3.2",
|
||||
"@primer/octicons": "^9.1.1",
|
||||
"@types/basic-auth": "^1.1.2",
|
||||
"@types/busboy": "^0.2.3",
|
||||
"@types/chai": "^4.1.7",
|
||||
"@types/chai-as-promised": "^7.1.0",
|
||||
"@types/dirty-chai": "^2.0.0",
|
||||
@@ -16,6 +17,7 @@
|
||||
"@types/fs-extra": "^5.0.5",
|
||||
"@types/mocha": "^5.2.6",
|
||||
"@types/node": "^12.0.10",
|
||||
"@types/rimraf": "^3.0.0",
|
||||
"@types/semver": "^6.0.1",
|
||||
"@types/send": "^0.14.5",
|
||||
"@types/split": "^1.0.0",
|
||||
@@ -139,7 +141,6 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/multiparty": "^0.0.32",
|
||||
"@types/temp": "^0.8.34"
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@ dom_storage_limits.patch
|
||||
render_widget_host_view_base.patch
|
||||
render_widget_host_view_mac.patch
|
||||
thread_capabilities.patch
|
||||
web_contents.patch
|
||||
webview_cross_drag.patch
|
||||
disable_user_gesture_requirement_for_beforeunload_dialogs.patch
|
||||
gin_enable_disable_v8_platform.patch
|
||||
@@ -50,7 +49,6 @@ tts.patch
|
||||
printing.patch
|
||||
verbose_generate_breakpad_symbols.patch
|
||||
support_mixed_sandbox_with_zygote.patch
|
||||
autofill_size_calculation.patch
|
||||
fix_disable_usage_of_abort_report_np_in_mas_builds.patch
|
||||
fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch
|
||||
fix_disable_usage_of_setapplicationisdaemon_and.patch
|
||||
@@ -91,4 +89,12 @@ feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
|
||||
gpu_notify_when_dxdiag_request_fails.patch
|
||||
feat_allow_embedders_to_add_observers_on_created_hunspell.patch
|
||||
fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
|
||||
revert_enable_samesitebydefaultcookies_and.patch
|
||||
web_contents.patch
|
||||
ui_gtk_public_header.patch
|
||||
layoutng_make_hittestresult_localpoint_for_inline_element.patch
|
||||
fix-ensure-edit-cmds-to-sent-focused-WebContents.patch
|
||||
crash_allow_setting_more_options.patch
|
||||
breakpad_disable_upload_compression.patch
|
||||
breakpad_treat_node_processes_as_browser_processes.patch
|
||||
upload_list_add_loadsync_method.patch
|
||||
breakpad_allow_getting_string_values_for_crash_keys.patch
|
||||
|
||||
@@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
|
||||
3. Ctrl-Shift-= should show as Ctrl-+
|
||||
|
||||
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
|
||||
index d7b79feb77f3595bcc8617b6e84c566357c336fe..3b1eab14a4348eab79f486aec43783fd8f629a8f 100644
|
||||
index 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c44617086b946a80 100644
|
||||
--- a/ui/base/accelerators/accelerator.cc
|
||||
+++ b/ui/base/accelerators/accelerator.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
@@ -29,9 +29,9 @@ index d7b79feb77f3595bcc8617b6e84c566357c336fe..3b1eab14a4348eab79f486aec43783fd
|
||||
#include "ui/events/keycodes/keyboard_code_conversion.h"
|
||||
-#endif
|
||||
|
||||
namespace ui {
|
||||
|
||||
@@ -154,7 +153,15 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "ui/base/ui_base_features.h"
|
||||
@@ -220,7 +219,15 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
shortcut = KeyCodeToName();
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,7 @@ index d7b79feb77f3595bcc8617b6e84c566357c336fe..3b1eab14a4348eab79f486aec43783fd
|
||||
#if defined(OS_WIN)
|
||||
// Our fallback is to try translate the key code to a regular character
|
||||
// unless it is one of digits (VK_0 to VK_9). Some keyboard
|
||||
@@ -163,21 +170,14 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
@@ -229,21 +236,14 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
// accent' for '0'). For display in the menu (e.g. Ctrl-0 for the
|
||||
// default zoom level), we leave VK_[0-9] alone without translation.
|
||||
wchar_t key;
|
||||
@@ -75,7 +75,7 @@ index d7b79feb77f3595bcc8617b6e84c566357c336fe..3b1eab14a4348eab79f486aec43783fd
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
@@ -360,7 +360,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
|
||||
@@ -426,7 +426,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
|
||||
// more information.
|
||||
if (IsCtrlDown())
|
||||
shortcut = ApplyModifierToAcceleratorString(shortcut, IDS_APP_CTRL_KEY);
|
||||
|
||||
@@ -10,7 +10,7 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
||||
index a52345eb5b5facaf4ad1308c9d21407370d4c8bd..343f76603bd217e1d333944d4b7f20927121642f 100644
|
||||
index 0a96d09d0deca530bc9e3ab649e1a9cc5045b1fb..9b22493abbd81c2f592e75fe32f7ab7efbb281d9 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -248,6 +248,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
|
||||
@@ -23,10 +23,10 @@ index 172b2a246e6cdda81212a2cf4ec9c7e13cd4e85f..3932bd0a4d3de963d22869caaadb8b9a
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 3a9e1b0aaccdfe2ae7b03426370592f620b87315..7a6562904eebbf55fcc4b08c9676a80350ce0863 100644
|
||||
index 2ab5e79b71cc8d5fa5c5690da0ac4fe3bf9a0def..902c33cac74cf66f97e7a900a736f59f0f3308fc 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4926,6 +4926,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4933,6 +4933,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index 3a9e1b0aaccdfe2ae7b03426370592f620b87315..7a6562904eebbf55fcc4b08c9676a803
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index 3b58f29dbc91c52dd0046d389c11d9fd698e3948..090ea1fec07cdfc0567af63407f8ad9b0dde7cdc 100644
|
||||
index 6a33dcf8df3d64f09a262fe62fff1bc7a310d0cb..7c1ac8d9bdbfd01faa0515a8d3094dfd34696d97 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -747,6 +747,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -750,6 +750,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
bool ShouldTrackUseCounter(const blink::WebURL& url) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index 3b58f29dbc91c52dd0046d389c11d9fd698e3948..090ea1fec07cdfc0567af63407f8ad9b
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index 8a2f1ab74873599448f27b784024b39ba13c7c6e..0720d9062272fdc823963a856f1e85e485e348c7 100644
|
||||
index d11faf48cf3cc2165598737a4624db7d1f224fcd..01b9eed5509ee7b2138e6c6c9d422c75d2ee0a90 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -555,6 +555,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -557,6 +557,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -67,10 +67,10 @@ index 8a2f1ab74873599448f27b784024b39ba13c7c6e..0720d9062272fdc823963a856f1e85e4
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index c7eb05be74884686abc4cbb43868464d1066904f..8b05af30571f0a68a56adf6d74b2c7fc39591c70 100644
|
||||
index 81457a2e2b5723aa2ff218b4e410d55d7b7f14f8..a62f6c58bb0aaac836edfd87ab2a6f61045059dc 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -203,6 +203,7 @@ void LocalWindowProxy::Initialize() {
|
||||
@@ -201,6 +201,7 @@ void LocalWindowProxy::Initialize() {
|
||||
}
|
||||
|
||||
InstallConditionalFeatures();
|
||||
@@ -79,7 +79,7 @@ index c7eb05be74884686abc4cbb43868464d1066904f..8b05af30571f0a68a56adf6d74b2c7fc
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
index 22919e83d2fa5329471357849db28fd94899e92f..106a099cdfc49bcfc5a396fac46e93699f99f5e1 100644
|
||||
index cb7aa76af1c748548a62f881f59b4879d4a7f0d4..5703bff85cac07aa9755d0ac8c603ba09c5cddc9 100644
|
||||
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
@@ -344,6 +344,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -97,7 +97,7 @@ index 22919e83d2fa5329471357849db28fd94899e92f..106a099cdfc49bcfc5a396fac46e9369
|
||||
v8::Local<v8::Context> context,
|
||||
int32_t world_id) {
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
index 77194e8e0b10946df54e536df3f556ff66b3aac5..99e21afc95504ca4427f73cb6a268d0a57c0cb8f 100644
|
||||
index 74f08e06333566337f4a2c00319192106630bcf2..fe018133f56078c796d4bae934fb7359b21229f2 100644
|
||||
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
@@ -78,6 +78,8 @@ class LocalFrameClientImpl final : public LocalFrameClient {
|
||||
@@ -110,10 +110,10 @@ index 77194e8e0b10946df54e536df3f556ff66b3aac5..99e21afc95504ca4427f73cb6a268d0a
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
index 5cd032934257d957b1e6ce85bf83e5a89dc6a87d..afca3554d93f7a6d5b3c10a7b594dcb1a3b6df07 100644
|
||||
index 5faee38f8a79c635d166ece00c845489fde53ebe..f35d1598ce62c1be35e51e39578454023e481f03 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
@@ -288,6 +288,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
@@ -289,6 +289,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
@@ -123,10 +123,10 @@ index 5cd032934257d957b1e6ce85bf83e5a89dc6a87d..afca3554d93f7a6d5b3c10a7b594dcb1
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
index ad193eee54963de001cee76153c6fafa25b814a1..d232898dfac0ba8f4b54a96b87e604dfea7ff7fc 100644
|
||||
index bbfe2870e688c446a85570b63e96a4457649e496..b2ec2661284c12c123bb17f31ed11f09432f0502 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -340,6 +340,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
@@ -341,6 +341,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
|
||||
@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
|
||||
|
||||
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
index e514c85d34e59f0f7bde3f62f567def06266bc79..c947c36b15d2cb8eac9d560b9aba9b0069bfc091 100644
|
||||
index 696a6170a584c1bb71c8ad253963d9f64395a13e..9677aa931cd543adfc1e9844d6afee8dcb0f4c2d 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
@@ -681,6 +681,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
@@ -661,6 +661,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
size, ArrayBufferContents::kDontInitialize);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,10 +49,10 @@ index a46aab1db2de282e0ff3561a98bad1dac659b67a..31ce9719f63c564baf88e48c7494e030
|
||||
NetworkIsolationKey? network_isolation_key;
|
||||
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d26753c44ff50 100644
|
||||
index 3dc126f94737cbf7f01afcfe21e108b93b630b27..9ee5cd1bf6aefa28c2a58c648736f857383485e4 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -486,6 +486,7 @@ URLLoader::URLLoader(
|
||||
@@ -487,6 +487,7 @@ URLLoader::URLLoader(
|
||||
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
|
||||
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
|
||||
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
|
||||
@@ -60,7 +60,7 @@ index fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d2675
|
||||
mojom::OriginPolicyManager* origin_policy_manager,
|
||||
std::unique_ptr<TrustTokenRequestHelper> trust_token_helper)
|
||||
: url_request_context_(url_request_context),
|
||||
@@ -546,6 +547,11 @@ URLLoader::URLLoader(
|
||||
@@ -543,6 +544,11 @@ URLLoader::URLLoader(
|
||||
header_client_.set_disconnect_handler(
|
||||
base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
|
||||
}
|
||||
@@ -72,7 +72,7 @@ index fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d2675
|
||||
if (want_raw_headers_) {
|
||||
options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
|
||||
mojom::kURLLoadOptionSendSSLInfoForCertificateError;
|
||||
@@ -1020,7 +1026,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
|
||||
@@ -1012,7 +1018,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
|
||||
|
||||
void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
const net::AuthChallengeInfo& auth_info) {
|
||||
@@ -81,7 +81,7 @@ index fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d2675
|
||||
OnAuthCredentials(base::nullopt);
|
||||
return;
|
||||
}
|
||||
@@ -1036,11 +1042,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
@@ -1028,11 +1034,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
if (url_request->response_headers())
|
||||
head->headers = url_request->response_headers();
|
||||
head->auth_challenge_info = auth_info;
|
||||
@@ -108,7 +108,7 @@ index fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d2675
|
||||
auth_challenge_responder_receiver_.set_disconnect_handler(
|
||||
base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this)));
|
||||
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
|
||||
index 9a07d08baf1f52234898951f8680a8b3a5c6e82f..e99228fd574cd5291d71de6a5f77cdda2debea7c 100644
|
||||
index 9098fa1e35f8935c4c8183dac294fada6a0c113c..ab20b4fce4bc79f69cf1dea1989ceb817ab04fe6 100644
|
||||
--- a/services/network/url_loader.h
|
||||
+++ b/services/network/url_loader.h
|
||||
@@ -111,6 +111,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Heilig Benedek <benecene@gmail.com>
|
||||
Date: Wed, 30 Jan 2019 17:04:33 +0100
|
||||
Subject: autofill_size_calculation.patch
|
||||
|
||||
We don't want to call into chrome internals for autofill popup size
|
||||
calculations. The default GetWindowBounds calls into chrome internal
|
||||
functions to find out the size of the window - this can be overridden
|
||||
but even then some methods call into the original. Let's just return
|
||||
an empty gfx::Rect and do the actual job in the subclass.
|
||||
|
||||
diff --git a/chrome/browser/ui/autofill/popup_view_common.cc b/chrome/browser/ui/autofill/popup_view_common.cc
|
||||
index 25e2cfce4999bdf6a94d61aae4558470d18f89ed..c9880bcd639eb59ae52c38dbdabbd86ebac3b530 100644
|
||||
--- a/chrome/browser/ui/autofill/popup_view_common.cc
|
||||
+++ b/chrome/browser/ui/autofill/popup_view_common.cc
|
||||
@@ -8,15 +8,19 @@
|
||||
#include <utility>
|
||||
|
||||
#include "build/build_config.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/platform_util.h"
|
||||
+#endif
|
||||
#include "ui/gfx/geometry/vector2d.h"
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
#include "ui/android/view_android.h"
|
||||
#include "ui/android/window_android.h"
|
||||
#else // defined(OS_ANDROID)
|
||||
+#if 0
|
||||
#include "chrome/browser/ui/browser_finder.h"
|
||||
#include "chrome/browser/ui/browser_window.h"
|
||||
+#endif
|
||||
#include "ui/views/widget/widget.h"
|
||||
#endif // !defined(OS_ANDROID)
|
||||
|
||||
@@ -176,14 +180,14 @@ gfx::Rect PopupViewCommon::GetWindowBounds(gfx::NativeView container_view) {
|
||||
views::Widget::GetTopLevelWidgetForNativeView(container_view);
|
||||
if (widget)
|
||||
return widget->GetWindowBoundsInScreen();
|
||||
-
|
||||
+#if 0
|
||||
// If the widget is null, try to get these bounds from a browser window. This
|
||||
// is common on Mac when the window is drawn using Cocoa.
|
||||
gfx::NativeWindow window = platform_util::GetTopLevel(container_view);
|
||||
Browser* browser = chrome::FindBrowserWithWindow(window);
|
||||
if (browser)
|
||||
return browser->window()->GetBounds();
|
||||
-
|
||||
+#endif
|
||||
// If the browser is null, simply return an empty rect. The most common reason
|
||||
// to end up here is that the NativeView has been destroyed externally, which
|
||||
// can happen at any time. This happens fairly commonly on Windows (e.g., at
|
||||
@@ -6,10 +6,10 @@ Subject: blink-worker-enable-csp-in-file-scheme.patch
|
||||
This allows file:// URLs in workers to have a CSP.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
index d490f57f7ad056a278bc50786e285d6757de6433..6bd0614c388dc581b50c6b01e9c6dabad5419b19 100644
|
||||
index e15412a87803f38bceca93cf460386c9fd8e8903..ac09d3997e1018d227178c29f2fd714d9bb4000a 100644
|
||||
--- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
@@ -312,7 +312,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(
|
||||
@@ -323,7 +323,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(
|
||||
// document (which is implemented in WorkerMessagingProxy, and
|
||||
// m_contentSecurityPolicy should be left as nullptr to inherit the policy).
|
||||
if (!response.CurrentRequestUrl().ProtocolIs("blob") &&
|
||||
|
||||
@@ -14,10 +14,10 @@ when there is code doing that.
|
||||
This patch reverts the change to fix the crash in Electron.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index adf78283c04036c92dede354be0a1835ba620ca4..a02ffcaef8e29a934d4e3a8f795ca9dd38537b55 100644
|
||||
index ab0d55c3de88faf10e25ef8cbb6ebd3f7f580654..4660af81c248fe39c1df428a3b892a251a957363 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -473,10 +473,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -472,10 +472,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
CHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -28,7 +28,7 @@ index adf78283c04036c92dede354be0a1835ba620ca4..a02ffcaef8e29a934d4e3a8f795ca9dd
|
||||
if (!Client())
|
||||
return;
|
||||
|
||||
@@ -494,6 +490,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -493,6 +489,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
// Notify ScriptController that the frame is closing, since its cleanup ends
|
||||
// up calling back to LocalFrameClient via WindowProxy.
|
||||
GetScriptController().ClearForClose();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Tue, 5 May 2020 12:36:39 -0700
|
||||
Subject: breakpad: allow getting string values for crash keys
|
||||
|
||||
Linux is currently recording both crashpad and breakpad keys on linux
|
||||
(because upstream is experimenting with crashpad-on-linux). We can fetch
|
||||
the string values for crashpad keys on win/mac, and they're easily
|
||||
available on linux too, this just exposes them.
|
||||
|
||||
Should be upstreamed, or failing that, deleted once crashpad is enabled
|
||||
on linux. If removing this patch doesn't cause a compile failure, it's
|
||||
fine to delete!
|
||||
|
||||
diff --git a/components/crash/core/common/crash_key.h b/components/crash/core/common/crash_key.h
|
||||
index 9d193ea962e919d4509eef296c900e47059761f4..225b8ce822a42d31d59bc89aab473710384c3010 100644
|
||||
--- a/components/crash/core/common/crash_key.h
|
||||
+++ b/components/crash/core/common/crash_key.h
|
||||
@@ -212,6 +212,10 @@ class CrashKeyStringCombined : public internal::CrashKeyStringCombinedImpl {
|
||||
crashpad_key_.Set(value);
|
||||
}
|
||||
|
||||
+ const base::StringPiece value() const {
|
||||
+ return crashpad_key_.value();
|
||||
+ }
|
||||
+
|
||||
private:
|
||||
CrashKeyStringBreakpad<MaxLength> breakpad_key_;
|
||||
crashpad::StringAnnotation<MaxLength> crashpad_key_;
|
||||
49
patches/chromium/breakpad_disable_upload_compression.patch
Normal file
49
patches/chromium/breakpad_disable_upload_compression.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Wed, 29 Apr 2020 16:28:35 -0700
|
||||
Subject: breakpad: disable upload compression
|
||||
|
||||
Our prior implementation of breakpad uploading did not compress files on
|
||||
upload. In order to maintain that behavior, this disables compression in
|
||||
//components/crash.
|
||||
|
||||
Ideally, this would be made configurable.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 364af690879d79d25d118d5b2fdbaabe21a1c52d..390cca9edc26d3153c8dbc86024cb50097d7ac78 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -1334,6 +1334,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
|
||||
#else // defined(OS_CHROMEOS)
|
||||
|
||||
+ /*
|
||||
// Compress |dumpfile| with gzip.
|
||||
const pid_t gzip_child = sys_fork();
|
||||
if (gzip_child < 0) {
|
||||
@@ -1377,13 +1378,16 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
WriteLog(msg, sizeof(msg) - 1);
|
||||
sys__exit(1);
|
||||
}
|
||||
+ */
|
||||
|
||||
// The --header argument to wget looks like:
|
||||
// --header=Content-Encoding: gzip
|
||||
// --header=Content-Type: multipart/form-data; boundary=XYZ
|
||||
// where the boundary has two fewer leading '-' chars
|
||||
+ /*
|
||||
static const char header_content_encoding[] =
|
||||
"--header=Content-Encoding: gzip";
|
||||
+ */
|
||||
static const char header_msg[] =
|
||||
"--header=Content-Type: multipart/form-data; boundary=";
|
||||
const size_t header_content_type_size =
|
||||
@@ -1412,7 +1416,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
static const char kWgetBinary[] = "/usr/bin/wget";
|
||||
const char* args[] = {
|
||||
kWgetBinary,
|
||||
- header_content_encoding,
|
||||
+ //header_content_encoding,
|
||||
header_content_type,
|
||||
post_file,
|
||||
upload_url,
|
||||
@@ -0,0 +1,45 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Thu, 30 Apr 2020 17:04:13 -0700
|
||||
Subject: breakpad: treat node processes as browser processes
|
||||
|
||||
On Linux, to avoid the need to pass breakpad FDs to child node processes
|
||||
spawned by child_process.fork(), each child process must re-initialize
|
||||
breakpad independently, as a "browser" process. This patches
|
||||
//components/crash so that it will correctly report 'ptype=node' as a
|
||||
crash annotation.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 390cca9edc26d3153c8dbc86024cb50097d7ac78..2ae2429e6054f2d54e785c49a49fc243469bb72b 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -722,8 +722,13 @@ bool CrashDone(const MinidumpDescriptor& minidump,
|
||||
log_path[log_path_len] = '\0';
|
||||
info.log_filename = log_path;
|
||||
#endif
|
||||
- info.process_type = "browser";
|
||||
- info.process_type_length = 7;
|
||||
+ if (g_is_node) {
|
||||
+ info.process_type = "node";
|
||||
+ info.process_type_length = 4;
|
||||
+ } else {
|
||||
+ info.process_type = "browser";
|
||||
+ info.process_type_length = 7;
|
||||
+ }
|
||||
info.distro = base::g_linux_distro;
|
||||
info.distro_length = my_strlen(base::g_linux_distro);
|
||||
info.upload = upload;
|
||||
@@ -2050,8 +2055,13 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
process_type == kWebViewSingleProcessType ||
|
||||
process_type == kBrowserProcessType ||
|
||||
#endif
|
||||
+ process_type == "node" ||
|
||||
process_type.empty();
|
||||
|
||||
+ if (process_type == "node") {
|
||||
+ g_is_node = true;
|
||||
+ }
|
||||
+
|
||||
std::string upload_url;
|
||||
if (GetCrashReporterClient()->GetUploadUrl(&upload_url))
|
||||
SetUploadURL(upload_url);
|
||||
@@ -9,7 +9,7 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
index 6b54a537e4d9282a3af95364e9925cbdd6ce5812..979a9ca641971ca706f9ea00580fdceaaf64b3d2 100644
|
||||
index 657306b0c95c9a499ca626c033c4b5b73de71d59..d1503246dfa0edf16a918d0c5b141bf89ae95bb1 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -4324,6 +4324,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -91,10 +91,10 @@ index f0cb4833442be24dee52e2e172a0d22474d1135b..5e83b930fa0f32c368ce1d5980436d4c
|
||||
// moved on send.
|
||||
bool is_background_tab =
|
||||
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
index 33d795d25197745f870e967f34348fc4c4db953f..90afa523c8d093018a5d8a45acd88dd656405648 100644
|
||||
index b8dd24b1b654e80505de8ea8c52a92c219b259fe..15c6d7c07fdc38a578af0463158be3ee81a98c95 100644
|
||||
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
@@ -367,6 +367,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
@@ -366,6 +366,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
|
||||
@@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from
|
||||
Electrons grit header instead of Chromes
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 93001a62c6daea08854466429a5f17aff236a09b..83e2eabb262418627ee2a040989cfdd79939e50c 100644
|
||||
index b3f8ac152722daf79878d83f14d2ee0bf625004c..e70d15134e8ffe75311da48dfa222f4d3d85bf2d 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -5329,6 +5329,7 @@ jumbo_static_library("browser") {
|
||||
@@ -5331,6 +5331,7 @@ jumbo_static_library("browser") {
|
||||
deps += [
|
||||
"//components/spellcheck/browser",
|
||||
"//components/spellcheck/common",
|
||||
|
||||
@@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously
|
||||
in atom::CommonWebContentsDelegate::ResetManageWebContents.
|
||||
|
||||
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
|
||||
index 8591e0018c58baaca66f14cab82faea523183afc..3570d543170eeb63167d786312294b04e49f7e93 100644
|
||||
index e9609ef58a821c494232d02fc30f62150fea4c28..1c960c2b98b8ab3e8876aa974a72eedd3b46b2fc 100644
|
||||
--- a/content/browser/browser_main_loop.cc
|
||||
+++ b/content/browser/browser_main_loop.cc
|
||||
@@ -1487,7 +1487,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
@@ -1492,7 +1492,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
NOTREACHED();
|
||||
#else
|
||||
base::RunLoop run_loop;
|
||||
|
||||
201
patches/chromium/crash_allow_setting_more_options.patch
Normal file
201
patches/chromium/crash_allow_setting_more_options.patch
Normal file
@@ -0,0 +1,201 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <jeremya@chromium.org>
|
||||
Date: Thu, 30 Apr 2020 10:08:06 -0700
|
||||
Subject: crash: allow setting more options
|
||||
|
||||
This allows the client of //components/crash to set upload url,
|
||||
rate-limiting, compression and global annotations.
|
||||
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 192b0a7f137f311abb6a991f997e11f5eba52256..364af690879d79d25d118d5b2fdbaabe21a1c52d 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -103,9 +103,18 @@ namespace {
|
||||
// while we do have functions to deal with uint64_t's.
|
||||
uint64_t g_crash_loop_before_time = 0;
|
||||
#else
|
||||
-const char kUploadURL[] = "https://clients2.google.com/cr/report";
|
||||
+const char kDefaultUploadURL[] = "https://clients2.google.com/cr/report";
|
||||
+char* g_upload_url = nullptr;
|
||||
#endif
|
||||
|
||||
+void SetUploadURL(const std::string& url) {
|
||||
+ const size_t url_len = url.size() + 1;
|
||||
+ DCHECK(!g_upload_url);
|
||||
+ g_upload_url = new char[url_len];
|
||||
+ strncpy(g_upload_url, url.c_str(), url_len);
|
||||
+}
|
||||
+
|
||||
+bool g_is_node = false;
|
||||
bool g_is_crash_reporter_enabled = false;
|
||||
uint64_t g_process_start_time = 0;
|
||||
pid_t g_pid = 0;
|
||||
@@ -1398,13 +1407,15 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
char* status_fd_path =
|
||||
StringFromPrefixAndUint("/dev/fd/", upload_status_fd, allocator);
|
||||
|
||||
+ const char* upload_url = g_upload_url ? g_upload_url : kDefaultUploadURL;
|
||||
+
|
||||
static const char kWgetBinary[] = "/usr/bin/wget";
|
||||
const char* args[] = {
|
||||
kWgetBinary,
|
||||
header_content_encoding,
|
||||
header_content_type,
|
||||
post_file,
|
||||
- kUploadURL,
|
||||
+ upload_url,
|
||||
"--timeout=10", // Set a timeout so we don't hang forever.
|
||||
"--tries=1", // Don't retry if the upload fails.
|
||||
"-O", // Output reply to the file descriptor path.
|
||||
@@ -2037,6 +2048,10 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
#endif
|
||||
process_type.empty();
|
||||
|
||||
+ std::string upload_url;
|
||||
+ if (GetCrashReporterClient()->GetUploadUrl(&upload_url))
|
||||
+ SetUploadURL(upload_url);
|
||||
+
|
||||
if (is_browser_process) {
|
||||
bool enable_breakpad = GetCrashReporterClient()->GetCollectStatsConsent() ||
|
||||
GetCrashReporterClient()->IsRunningUnattended();
|
||||
diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc
|
||||
index e778f68af30f8c071d1360d06b553cc957160c5b..b7f6ca60ef9c2367989d39e1268bf9f9a517951c 100644
|
||||
--- a/components/crash/core/app/crash_reporter_client.cc
|
||||
+++ b/components/crash/core/app/crash_reporter_client.cc
|
||||
@@ -148,6 +148,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+bool CrashReporterClient::GetShouldRateLimit() {
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+bool CrashReporterClient::GetShouldCompressUploads() {
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+void CrashReporterClient::GetProcessSimpleAnnotations(std::map<std::string, std::string>* annotations) {
|
||||
+}
|
||||
+
|
||||
#if defined(OS_ANDROID)
|
||||
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
|
||||
return 100;
|
||||
@@ -196,6 +207,10 @@ void CrashReporterClient::GetSanitizationInformation(
|
||||
}
|
||||
#endif
|
||||
|
||||
+bool CrashReporterClient::GetUploadUrl(std::string* url) {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
|
||||
return false;
|
||||
}
|
||||
diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h
|
||||
index 9cc78fc2584061d26fd1e83b3ebf5ada0a12c138..aa63d7b95c37e4a143283450798b8bd500dc17a1 100644
|
||||
--- a/components/crash/core/app/crash_reporter_client.h
|
||||
+++ b/components/crash/core/app/crash_reporter_client.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
|
||||
#define COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
|
||||
|
||||
+#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "base/strings/string16.h"
|
||||
@@ -153,6 +154,19 @@ class CrashReporterClient {
|
||||
// that case, |breakpad_enabled| is set to the value enforced by policies.
|
||||
virtual bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled);
|
||||
|
||||
+ // Returns true if crash uploads should be rate limited. If false, no
|
||||
+ // throttling will be applied for uploads.
|
||||
+ virtual bool GetShouldRateLimit();
|
||||
+
|
||||
+ // Returns true if crash uploads should be compressed with gzip. If false,
|
||||
+ // reports will be uploaded uncompressed.
|
||||
+ virtual bool GetShouldCompressUploads();
|
||||
+
|
||||
+ // Allows the client to add or edit global annotations passed to the crashpad
|
||||
+ // handler.
|
||||
+ virtual void GetProcessSimpleAnnotations(
|
||||
+ std::map<std::string, std::string>* annotations);
|
||||
+
|
||||
#if defined(OS_ANDROID)
|
||||
// Used by WebView to sample crashes without generating the unwanted dumps. If
|
||||
// the returned value is less than 100, crash dumping will be sampled to that
|
||||
@@ -194,6 +208,9 @@ class CrashReporterClient {
|
||||
bool* sanitize_stacks);
|
||||
#endif
|
||||
|
||||
+ // Override the default upload url. Returns true if overridden.
|
||||
+ virtual bool GetUploadUrl(std::string* url);
|
||||
+
|
||||
// This method should return true to configure a crash reporter capable of
|
||||
// monitoring itself for its own crashes to do so, even if self-monitoring
|
||||
// would be expensive. "Expensive" self-monitoring dedicates an additional
|
||||
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
|
||||
index b579521d55860823722df2ee849f6b1628b3c950..f4f71e5174cf8fb706a2f8385252ba877d1a03a7 100644
|
||||
--- a/components/crash/core/app/crashpad_mac.mm
|
||||
+++ b/components/crash/core/app/crashpad_mac.mm
|
||||
@@ -67,6 +67,8 @@ std::map<std::string, std::string> GetProcessSimpleAnnotations() {
|
||||
} // @autoreleasepool
|
||||
return process_annotations;
|
||||
}();
|
||||
+ CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
|
||||
+ crash_reporter_client->GetProcessSimpleAnnotations(&annotations);
|
||||
return annotations;
|
||||
}
|
||||
|
||||
@@ -140,9 +142,17 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
#else
|
||||
std::string url;
|
||||
#endif
|
||||
+ crash_reporter_client->GetUploadUrl(&url);
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
|
||||
+ if (!crash_reporter_client->GetShouldRateLimit()) {
|
||||
+ arguments.push_back("--no-rate-limit");
|
||||
+ }
|
||||
+ if (!crash_reporter_client->GetShouldCompressUploads()) {
|
||||
+ arguments.push_back("--no-upload-gzip");
|
||||
+ }
|
||||
+
|
||||
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
|
||||
arguments.push_back("--monitor-self");
|
||||
}
|
||||
diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc
|
||||
index 669f5bea844d75f0e5c34b58994f4cfb8e856af0..8c1fb8fb8f2e02466b51ef08de25b056f8b2052d 100644
|
||||
--- a/components/crash/core/app/crashpad_win.cc
|
||||
+++ b/components/crash/core/app/crashpad_win.cc
|
||||
@@ -84,12 +84,14 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
|
||||
std::map<std::string, std::string> process_annotations;
|
||||
GetPlatformCrashpadAnnotations(&process_annotations);
|
||||
+ crash_reporter_client->GetProcessSimpleAnnotations(&process_annotations);
|
||||
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
std::string url = "https://clients2.google.com/cr/report";
|
||||
#else
|
||||
std::string url;
|
||||
#endif
|
||||
+ crash_reporter_client->GetUploadUrl(&url);
|
||||
|
||||
// Allow the crash server to be overridden for testing. If the variable
|
||||
// isn't present in the environment then the default URL will remain.
|
||||
@@ -126,6 +128,13 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
|
||||
std::vector<std::string> arguments(start_arguments);
|
||||
|
||||
+ if (!crash_reporter_client->GetShouldRateLimit()) {
|
||||
+ arguments.push_back("--no-rate-limit");
|
||||
+ }
|
||||
+ if (!crash_reporter_client->GetShouldCompressUploads()) {
|
||||
+ arguments.push_back("--no-upload-gzip");
|
||||
+ }
|
||||
+
|
||||
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
|
||||
arguments.push_back("--monitor-self");
|
||||
for (const std::string& start_argument : start_arguments) {
|
||||
@@ -19,10 +19,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try
|
||||
re-submitting the patch.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index d769b656dbe9e88a3e2533f82cb8daebe871d88b..0955e03a1ff9347b1d7d692e16ff62f350453f7d 100644
|
||||
index bb72915a26e298bdb81009248fb3fb4df7bddab5..00d991ad0183ec0c82d23633c86a3c0d7a6e6754 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -670,7 +670,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
@@ -671,7 +671,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ index cb69e08c0185f55497089505ed5b226e57140321..362f28accc248248f3bcb54955c23528
|
||||
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
|
||||
#if defined(OS_MACOSX)
|
||||
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
|
||||
index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625adb68e93 100644
|
||||
index 5062680dac94c24aa4c6ad3f8508b5a2a25dad54..31700af38ea7d309dfe85fde69d0eb0566346ba1 100644
|
||||
--- a/components/viz/service/display/gl_renderer.cc
|
||||
+++ b/components/viz/service/display/gl_renderer.cc
|
||||
@@ -84,6 +84,9 @@
|
||||
@@ -79,7 +79,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
namespace viz {
|
||||
namespace {
|
||||
|
||||
@@ -588,8 +591,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
@@ -581,8 +584,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
|
||||
SetBlendEnabled(quad->ShouldDrawWithBlending());
|
||||
|
||||
@@ -91,7 +91,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
|
||||
// Use the full quad_rect for debug quads to not move the edges based on
|
||||
// partial swaps.
|
||||
@@ -1547,7 +1551,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
@@ -1540,7 +1544,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
params->use_color_matrix, tint_gl_composited_content_,
|
||||
params->apply_shader_based_rounded_corner &&
|
||||
ShouldApplyRoundedCorner(params->quad)),
|
||||
@@ -101,7 +101,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
}
|
||||
|
||||
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
|
||||
@@ -2018,7 +2023,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
@@ -2011,7 +2016,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -111,7 +111,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
SetShaderColor(color, opacity);
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -2173,7 +2179,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2166,7 +2172,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
: NON_PREMULTIPLIED_ALPHA,
|
||||
false, false, tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -121,7 +121,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2269,7 +2276,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2262,7 +2269,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -131,7 +131,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2371,7 +2379,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
@@ -2364,7 +2372,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
// The source color space should never be RGB.
|
||||
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
|
||||
|
||||
@@ -140,7 +140,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Force sRGB output on Windows for overlay candidate video quads to match
|
||||
@@ -2535,7 +2543,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
@@ -2528,7 +2536,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
|
||||
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -150,7 +150,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
|
||||
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
|
||||
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
|
||||
@@ -2600,8 +2609,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
@@ -2593,8 +2602,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
|
||||
|
||||
// Bind the program to the GL state.
|
||||
@@ -161,7 +161,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -3340,7 +3349,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
@@ -3333,7 +3342,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
|
||||
const gfx::ColorSpace& src_color_space,
|
||||
const gfx::ColorSpace& dst_color_space) {
|
||||
@@ -172,7 +172,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
|
||||
// If the input color space is PQ, and it did not specify a white level,
|
||||
// override it with the frame's white level.
|
||||
@@ -3722,9 +3733,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
@@ -3715,9 +3726,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
|
||||
gfx::SizeF((*overlay_texture)->texture.size()));
|
||||
|
||||
@@ -3943,8 +3954,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
@@ -3936,8 +3947,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
|
||||
PrepareGeometry(SHARED_BINDING);
|
||||
|
||||
@@ -196,7 +196,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
|
||||
|
||||
gfx::Transform render_matrix;
|
||||
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
|
||||
@@ -4053,3 +4064,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
@@ -4046,3 +4057,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
}
|
||||
|
||||
} // namespace viz
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: disable_hidden.patch
|
||||
Electron uses this to disable background throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 5ad66a6af94f07d7a989e738ea587ce467a542d6..8c54e34e716a647a72ffce78b56f94a03a5dd978 100644
|
||||
index fc06067480b091cd9051e4068180c999b0d1753b..2bb18f88be18093cd5b4d97ae2f8a43edf86b3ed 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -660,6 +660,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -34,7 +34,7 @@ index 013b2165038f1f21df394a0742f7927f26ab1671..894ddaa62fe8aa24eccbe7f9885a4dbb
|
||||
const base::TimeDelta& delay) {
|
||||
new_content_rendering_delay_ = delay;
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 3e2190700aee4ea6184ea59d8bb4a480cd52697b..0ccdaa8d037cb71ee3eebae027a74e96ffe1e846 100644
|
||||
index f7f9dafb97983d05b3d13af3c178aa2f392b09ef..b43d1e528acaa4f0ead02c13d13a072216e2638c 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -692,7 +692,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
|
||||
See https://github.com/electron/electron/issues/10754
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
|
||||
index 474d302e08510884846e71c0dea41c30f8caa09e..59396d8a77b86ac0cb224fb91dec91fa79ade53d 100644
|
||||
index ef44c779973737d2abc024553b317f0dc2ccccdc..ae9608974be11e28d8d2737302f0d377cd8f674c 100644
|
||||
--- a/third_party/blink/renderer/core/dom/document.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/document.cc
|
||||
@@ -4153,7 +4153,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
@@ -4151,7 +4151,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
"frame that never had a user gesture since its load. "
|
||||
"https://www.chromestatus.com/feature/5082396709879808";
|
||||
Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: feat: allow disabling blink scheduler throttling per RenderView
|
||||
This allows us to disable throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
index f27504c70d635a3b45cd53ca675a473d39e74b44..297eb00c16fc683e420d74b720a4b005015aa9cc 100644
|
||||
index 01a4e3dc134b3cf267ec637dde1066db51ac78e7..9178621b483b3790fe41f75f40463001cde4f133 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -453,6 +453,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -458,6 +458,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb3
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index 84a16ad496b5e443555ac41bb969b855f5aed091..e2a478ef9b51117316a0c1fca45c5e193053b4c0 100644
|
||||
index eb1a0ae5ca25f56a261ef1e747ecdfc7fb3dccff..0c335fcf26aef770cc30c4147e1c112eec8098bb 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -111,6 +111,8 @@ viz_component("service") {
|
||||
@@ -442,10 +442,10 @@ index 0000000000000000000000000000000000000000..48fa86caaab3c15764f105eb7ad2aecf
|
||||
+
|
||||
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
index 94ea55487f85ab32d862e913c476bc95f388dce9..d055a18bbc186facd88d496d589be78068c4ca64 100644
|
||||
index 2bb30e5318b6b48c2e6d4b1f64a6a36c68f963d1..9e805f27a9d7d1c0aa68cdf9f48895c055ca7791 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
@@ -268,7 +268,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
|
||||
@@ -188,7 +188,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
|
||||
if (!canvas_)
|
||||
return;
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 30 Apr 2020 13:39:46 -0500
|
||||
Subject: fix: ensure edit cmds to sent focused WebContents
|
||||
|
||||
Fixes an issue whereby some edit commands were not being
|
||||
sent to the focused WebContents. This fixes the issue by
|
||||
adding the malfunctioning commands to RenderFrameHostDelegate
|
||||
and then calling them that way.
|
||||
|
||||
diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc
|
||||
index 72f9b6d582345736d1b0b05f52925e8e036cf131..7fecac21ea36670a20bc2b317cfe11eb5e0b2524 100644
|
||||
--- a/content/browser/frame_host/interstitial_page_impl.cc
|
||||
+++ b/content/browser/frame_host/interstitial_page_impl.cc
|
||||
@@ -451,6 +451,22 @@ void InterstitialPageImpl::ExecuteEditCommand(
|
||||
input_handler->ExecuteEditCommand(command, value);
|
||||
}
|
||||
|
||||
+void InterstitialPageImpl::Undo() {
|
||||
+ auto* input_handler = GetFocusedFrameInputHandler();
|
||||
+ if (!input_handler)
|
||||
+ return;
|
||||
+ input_handler->Undo();
|
||||
+ RecordAction(base::UserMetricsAction("Undo"));
|
||||
+}
|
||||
+
|
||||
+void InterstitialPageImpl::Redo() {
|
||||
+ auto* input_handler = GetFocusedFrameInputHandler();
|
||||
+ if (!input_handler)
|
||||
+ return;
|
||||
+ input_handler->Redo();
|
||||
+ RecordAction(base::UserMetricsAction("Redo"));
|
||||
+}
|
||||
+
|
||||
void InterstitialPageImpl::Copy() {
|
||||
auto* input_handler = GetFocusedFrameInputHandler();
|
||||
if (!input_handler)
|
||||
@@ -467,6 +483,14 @@ void InterstitialPageImpl::Paste() {
|
||||
RecordAction(base::UserMetricsAction("Paste"));
|
||||
}
|
||||
|
||||
+void InterstitialPageImpl::PasteAndMatchStyle() {
|
||||
+ auto* input_handler = GetFocusedFrameInputHandler();
|
||||
+ if (!input_handler)
|
||||
+ return;
|
||||
+ input_handler->PasteAndMatchStyle();
|
||||
+ RecordAction(base::UserMetricsAction("PasteAndMatchStyle"));
|
||||
+}
|
||||
+
|
||||
void InterstitialPageImpl::SelectAll() {
|
||||
auto* input_handler = GetFocusedFrameInputHandler();
|
||||
if (!input_handler)
|
||||
diff --git a/content/browser/frame_host/interstitial_page_impl.h b/content/browser/frame_host/interstitial_page_impl.h
|
||||
index e645cd75128085e15c1213df206847dd02fb5a83..095ae4dffb1f576a8ceefd2a4ab9f8f93473e460 100644
|
||||
--- a/content/browser/frame_host/interstitial_page_impl.h
|
||||
+++ b/content/browser/frame_host/interstitial_page_impl.h
|
||||
@@ -119,9 +119,12 @@ class CONTENT_EXPORT InterstitialPageImpl : public InterstitialPage,
|
||||
ui::AXMode GetAccessibilityMode() override;
|
||||
void ExecuteEditCommand(const std::string& command,
|
||||
const base::Optional<base::string16>& value) override;
|
||||
+ void Undo() override;
|
||||
+ void Redo() override;
|
||||
void Cut() override;
|
||||
void Copy() override;
|
||||
void Paste() override;
|
||||
+ void PasteAndMatchStyle() override;
|
||||
void SelectAll() override;
|
||||
RenderFrameHostDelegate* CreateNewWindow(
|
||||
RenderFrameHost* opener,
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
|
||||
index 234baaefaa36a2a64f7c365462c44807b0a1eabb..ef04420a733ef3d2bdc7d50af1d149db337494a4 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_delegate.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_delegate.h
|
||||
@@ -148,9 +148,12 @@ class CONTENT_EXPORT RenderWidgetHostDelegate {
|
||||
virtual void ExecuteEditCommand(
|
||||
const std::string& command,
|
||||
const base::Optional<base::string16>& value) = 0;
|
||||
+ virtual void Undo() = 0;
|
||||
+ virtual void Redo() = 0;
|
||||
virtual void Cut() = 0;
|
||||
virtual void Copy() = 0;
|
||||
virtual void Paste() = 0;
|
||||
+ virtual void PasteAndMatchStyle() = 0;
|
||||
virtual void SelectAll() = 0;
|
||||
|
||||
// Requests the renderer to move the selection extent to a new position.
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
|
||||
index 5697455918f9aa2f4225eba1a5566950e34ec410..f5a7fdaa218742249cde04c73bcab43de0d83eed 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
|
||||
@@ -426,9 +426,12 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
|
||||
const std::string& command,
|
||||
const base::Optional<base::string16>& value) override {}
|
||||
|
||||
+ void Undo() override {}
|
||||
+ void Redo() override {}
|
||||
void Cut() override {}
|
||||
void Copy() override {}
|
||||
void Paste() override {}
|
||||
+ void PasteAndMatchStyle() override {}
|
||||
void SelectAll() override {}
|
||||
|
||||
private:
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index 472869202ff8a62d854c9ca39ca9f14e2f91e8cf..17e3fe40522e088057eaf01a290b658a0b6d1d01 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -1799,15 +1799,15 @@ void RenderWidgetHostViewMac::ExecuteEditCommand(const std::string& command) {
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::Undo() {
|
||||
- WebContents* web_contents = GetWebContents();
|
||||
- if (web_contents)
|
||||
- web_contents->Undo();
|
||||
+ if (auto* delegate = GetFocusedRenderWidgetHostDelegate()) {
|
||||
+ delegate->Undo();
|
||||
+ }
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::Redo() {
|
||||
- WebContents* web_contents = GetWebContents();
|
||||
- if (web_contents)
|
||||
- web_contents->Redo();
|
||||
+ if (auto* delegate = GetFocusedRenderWidgetHostDelegate()) {
|
||||
+ delegate->Redo();
|
||||
+ }
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::Cut() {
|
||||
@@ -1835,9 +1835,9 @@ void RenderWidgetHostViewMac::Paste() {
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::PasteAndMatchStyle() {
|
||||
- WebContents* web_contents = GetWebContents();
|
||||
- if (web_contents)
|
||||
- web_contents->PasteAndMatchStyle();
|
||||
+ if (auto* delegate = GetFocusedRenderWidgetHostDelegate()) {
|
||||
+ delegate->PasteAndMatchStyle();
|
||||
+ }
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::SelectAll() {
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
|
||||
index 760e47e9edd7b92b7bc6074f6da9c76048be8f28..2b0f1135e584852048081629eb6297e4e1fcc574 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
|
||||
@@ -91,9 +91,12 @@ class RenderWidgetHostDelegateEditCommandCounter
|
||||
const base::Optional<base::string16>& value) override {
|
||||
edit_command_message_count_++;
|
||||
}
|
||||
+ void Undo() override {}
|
||||
+ void Redo() override {}
|
||||
void Cut() override {}
|
||||
void Copy() override {}
|
||||
void Paste() override {}
|
||||
+ void PasteAndMatchStyle() override {}
|
||||
void SelectAll() override {}
|
||||
};
|
||||
|
||||
diff --git a/content/browser/renderer_host/text_input_client_mac_unittest.mm b/content/browser/renderer_host/text_input_client_mac_unittest.mm
|
||||
index 158e0507af7433e16c47227e7519b12e14554f1b..e7b8109cdc78e76d737bd0c067f8d33e0c171117 100644
|
||||
--- a/content/browser/renderer_host/text_input_client_mac_unittest.mm
|
||||
+++ b/content/browser/renderer_host/text_input_client_mac_unittest.mm
|
||||
@@ -40,9 +40,12 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
|
||||
void ExecuteEditCommand(
|
||||
const std::string& command,
|
||||
const base::Optional<base::string16>& value) override {}
|
||||
+ void Undo() override {}
|
||||
+ void Redo() override {}
|
||||
void Cut() override {}
|
||||
void Copy() override {}
|
||||
void Paste() override {}
|
||||
+ void PasteAndMatchStyle() override {}
|
||||
void SelectAll() override {}
|
||||
};
|
||||
|
||||
diff --git a/content/test/mock_render_widget_host_delegate.cc b/content/test/mock_render_widget_host_delegate.cc
|
||||
index 8e7922a2e83b1272e93fbd7c8c5323ad7ed9c3a7..4aa08a55c036569e39d4d02254b347d8470462af 100644
|
||||
--- a/content/test/mock_render_widget_host_delegate.cc
|
||||
+++ b/content/test/mock_render_widget_host_delegate.cc
|
||||
@@ -31,12 +31,18 @@ void MockRenderWidgetHostDelegate::ExecuteEditCommand(
|
||||
const std::string& command,
|
||||
const base::Optional<base::string16>& value) {}
|
||||
|
||||
+void MockRenderWidgetHostDelegate::Undo() {}
|
||||
+
|
||||
+void MockRenderWidgetHostDelegate::Redo() {}
|
||||
+
|
||||
void MockRenderWidgetHostDelegate::Cut() {}
|
||||
|
||||
void MockRenderWidgetHostDelegate::Copy() {}
|
||||
|
||||
void MockRenderWidgetHostDelegate::Paste() {}
|
||||
|
||||
+void MockRenderWidgetHostDelegate::PasteAndMatchStyle() {}
|
||||
+
|
||||
void MockRenderWidgetHostDelegate::SelectAll() {}
|
||||
|
||||
void MockRenderWidgetHostDelegate::CreateInputEventRouter() {
|
||||
diff --git a/content/test/mock_render_widget_host_delegate.h b/content/test/mock_render_widget_host_delegate.h
|
||||
index 5cdc010273f0bd03419c14046ee6cb8603a29dbf..16273c2ec761668249277a0be77aa429bcba1aef 100644
|
||||
--- a/content/test/mock_render_widget_host_delegate.h
|
||||
+++ b/content/test/mock_render_widget_host_delegate.h
|
||||
@@ -42,9 +42,12 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
|
||||
const NativeWebKeyboardEvent& event) override;
|
||||
void ExecuteEditCommand(const std::string& command,
|
||||
const base::Optional<base::string16>& value) override;
|
||||
+ void Undo() override;
|
||||
+ void Redo() override;
|
||||
void Cut() override;
|
||||
void Copy() override;
|
||||
void Paste() override;
|
||||
+ void PasteAndMatchStyle() override;
|
||||
void SelectAll() override;
|
||||
RenderWidgetHostInputEventRouter* GetInputEventRouter() override;
|
||||
RenderWidgetHostImpl* GetFocusedRenderWidgetHost(
|
||||
@@ -13,10 +13,10 @@ This patch can be removed once app.allowRendererProcessReuse is forced
|
||||
to true as then Chromiums assumptions around processes become correct.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 552f4cf6e09855e9bc1ceecbdeb959dd85a1ce05..be2540b359525d3adbd8f4a37834566a71f150cb 100644
|
||||
index 0fe5a498d6981962dba2f7de1603b3f0fd0c1ffa..484e2325a618ea2e665544a625dfbb60ef6124da 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2350,11 +2350,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
@@ -2347,11 +2347,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
WebContentsImpl* outermost = GetOutermostWebContents();
|
||||
if (event.button == blink::WebPointerProperties::Button::kBack &&
|
||||
outermost->controller_.CanGoBack()) {
|
||||
|
||||
@@ -42,10 +42,10 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
|
||||
// another SiteInstance for the same site.
|
||||
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
|
||||
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
|
||||
index a0225751ed6f881e8f7b4e7233282ff2e8aeaac7..22f49e6f6c779adc929ee173591d7f5355bfe457 100644
|
||||
index f0b9f9634264e9073f22560903307332986df2fe..934fa63595053156b446dbc5fdccb196f1a0ba15 100644
|
||||
--- a/content/browser/frame_host/navigation_request.cc
|
||||
+++ b/content/browser/frame_host/navigation_request.cc
|
||||
@@ -1259,6 +1259,24 @@ void NavigationRequest::BeginNavigation() {
|
||||
@@ -1264,6 +1264,24 @@ void NavigationRequest::BeginNavigation() {
|
||||
// it immediately.
|
||||
EnterChildTraceEvent("ResponseStarted", this);
|
||||
|
||||
@@ -71,10 +71,10 @@ index a0225751ed6f881e8f7b4e7233282ff2e8aeaac7..22f49e6f6c779adc929ee173591d7f53
|
||||
render_frame_host_ =
|
||||
frame_tree_node_->render_manager()->GetFrameHostForNavigation(this);
|
||||
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
index 50533c338dd75f606ba542813cfe724301ad6527..d18482d9a934ea5fd10035328be540ba89af7441 100644
|
||||
index 4c370c23a2217b45d7f023708305b3d1b115790a..9a3a207eab69464f35ffd39b75417311a9102cc2 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
@@ -2392,6 +2392,16 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
@@ -2391,6 +2391,16 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
scoped_refptr<SiteInstance>
|
||||
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
NavigationRequest* request) {
|
||||
@@ -91,7 +91,7 @@ index 50533c338dd75f606ba542813cfe724301ad6527..d18482d9a934ea5fd10035328be540ba
|
||||
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
|
||||
|
||||
// All children of MHTML documents must be MHTML documents. They all live in
|
||||
@@ -2411,10 +2421,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -2410,10 +2420,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
//
|
||||
// TODO(clamy): We should also consider as a candidate SiteInstance the
|
||||
// speculative SiteInstance that was computed on redirects.
|
||||
|
||||
@@ -12,10 +12,10 @@ rendering and there is no signal from browser process on this event
|
||||
to identify it.
|
||||
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
|
||||
index ba01477a3deea383f538adfe519bc53154df3321..441010b3e5cbe70f49e8aece3120dc24bd41e43c 100644
|
||||
index db9780a6c0b679354a5f74b1f89e32a8ff9dd2e3..cc51d41f88a60ccb936b0608973b76ba84c2a47b 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl.cc
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
|
||||
@@ -147,6 +147,11 @@ bool GpuDataManagerImpl::Dx12VulkanRequested() const {
|
||||
@@ -161,6 +161,11 @@ bool GpuDataManagerImpl::Dx12VulkanRequested() const {
|
||||
return private_->Dx12VulkanRequested();
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ index ba01477a3deea383f538adfe519bc53154df3321..441010b3e5cbe70f49e8aece3120dc24
|
||||
base::AutoLock auto_lock(lock_);
|
||||
private_->OnBrowserThreadsStarted();
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
|
||||
index c5515870a1dcf017b3477d890510a672e82e00e3..436a16a581f5d39bd64e0101d2c0e59d5f8a4dc6 100644
|
||||
index d5595c91f4d63362e575ad31070335ee344261fa..19c012313550cf9d9bf591a54e739fc34239e4dd 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl.h
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl.h
|
||||
@@ -87,6 +87,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
|
||||
@@ -90,6 +90,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
|
||||
void UpdateDxDiagNodeRequestStatus(bool request_continues);
|
||||
void UpdateDx12VulkanRequestStatus(bool request_continues);
|
||||
bool Dx12VulkanRequested() const;
|
||||
|
||||
@@ -6,12 +6,12 @@ Subject: gtk_visibility.patch
|
||||
Allow electron to depend on GTK in the GN build.
|
||||
|
||||
diff --git a/build/config/linux/gtk/BUILD.gn b/build/config/linux/gtk/BUILD.gn
|
||||
index 8bfa5592441136ae13b97187682fdd10864a54e1..6e3a02ad3f3d8881a9f0a9b7f8ed13383eafde1f 100644
|
||||
index 9249f88e3234d0c11fe870169fc3fe8ce3c00ff1..7c4261f06c74f13d29b4cb2d2e3c047bf319b7f0 100644
|
||||
--- a/build/config/linux/gtk/BUILD.gn
|
||||
+++ b/build/config/linux/gtk/BUILD.gn
|
||||
@@ -25,6 +25,8 @@ group("gtk") {
|
||||
# This is the only target that should depend on GTK.
|
||||
"//ui/gtk:*",
|
||||
@@ -28,6 +28,8 @@ group("gtk") {
|
||||
# This should probably be moved into //ui/gtk.
|
||||
"//ui/ozone/platform/wayland",
|
||||
|
||||
+ "//electron:*",
|
||||
+
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Yoshifumi Inoue <yosin@chromium.org>
|
||||
Date: Fri, 17 Apr 2020 09:22:24 +0000
|
||||
Subject: Make HitTestResult::LocalPoint() for inline element as same as legacy
|
||||
layout
|
||||
|
||||
This patch changes |NGBoxFragmentPainter::NodeAtPoint()| to set offset in
|
||||
containing block instead of offset in underlying element for inline element as
|
||||
legacy layout to make hit testing on inline element with ::after pseudo class
|
||||
with adapting |PositionForPoint()|.
|
||||
|
||||
The document[1] contains investigation notes of this CL.
|
||||
|
||||
[1] https://bit.ly/2REZ7P9 Hit Test with ::after
|
||||
|
||||
Bug: 1043471
|
||||
Change-Id: I81ada0ccd7bff31a84ce4746785ea83eb175937c
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2151775
|
||||
Commit-Queue: Koji Ishii <kojii@chromium.org>
|
||||
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
|
||||
Reviewed-by: Koji Ishii <kojii@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#759982}
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/layout/hit_testing_test.cc b/third_party/blink/renderer/core/layout/hit_testing_test.cc
|
||||
index 8927df5bbd218cf3dc400930a9894103780a58f6..76f912f90958e3532e203d7d28a2751f2cb5317d 100644
|
||||
--- a/third_party/blink/renderer/core/layout/hit_testing_test.cc
|
||||
+++ b/third_party/blink/renderer/core/layout/hit_testing_test.cc
|
||||
@@ -3,11 +3,72 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "third_party/blink/renderer/core/css/css_property_names.h"
|
||||
+#include "third_party/blink/renderer/core/editing/text_affinity.h"
|
||||
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
-class HitTestingTest : public RenderingTest {};
|
||||
+class HitTestingTest : public RenderingTest {
|
||||
+ protected:
|
||||
+ bool LayoutNGEnabled() const {
|
||||
+ return RuntimeEnabledFeatures::LayoutNGEnabled();
|
||||
+ }
|
||||
+
|
||||
+ PositionWithAffinity HitTest(const PhysicalOffset offset) {
|
||||
+ const HitTestRequest hit_request(HitTestRequest::kActive);
|
||||
+ const HitTestLocation hit_location(offset);
|
||||
+ HitTestResult hit_result(hit_request, hit_location);
|
||||
+ if (!GetLayoutView().HitTest(hit_location, hit_result))
|
||||
+ return PositionWithAffinity();
|
||||
+ // Simulate |PositionWithAffinityOfHitTestResult()| in
|
||||
+ // "selection_controller.cc"
|
||||
+ LayoutObject* const layout_object =
|
||||
+ hit_result.InnerPossiblyPseudoNode()->GetLayoutObject();
|
||||
+ if (!layout_object)
|
||||
+ return PositionWithAffinity();
|
||||
+ return layout_object->PositionForPoint(hit_result.LocalPoint());
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+// http://crbug.com/1043471
|
||||
+TEST_F(HitTestingTest, PseudoElementAfter) {
|
||||
+ LoadAhem();
|
||||
+ InsertStyleElement(
|
||||
+ "body { margin: 0px; font: 10px/10px Ahem; }"
|
||||
+ "#cd::after { content: 'XYZ'; margin-left: 100px; }");
|
||||
+ SetBodyInnerHTML("<div id=ab>ab<span id=cd>cd</span></div>");
|
||||
+ const auto& text_ab = *To<Text>(GetElementById("ab")->firstChild());
|
||||
+ const auto& text_cd = *To<Text>(GetElementById("cd")->lastChild());
|
||||
+
|
||||
+ EXPECT_EQ(PositionWithAffinity(Position(text_ab, 0)),
|
||||
+ HitTest(PhysicalOffset(5, 5)));
|
||||
+ // Because of hit testing at "b", position should be |kDownstream|.
|
||||
+ EXPECT_EQ(PositionWithAffinity(Position(text_ab, 1),
|
||||
+ LayoutNGEnabled() ? TextAffinity::kDownstream
|
||||
+ : TextAffinity::kUpstream),
|
||||
+ HitTest(PhysicalOffset(15, 5)));
|
||||
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 0)),
|
||||
+ HitTest(PhysicalOffset(25, 5)));
|
||||
+ // Because of hit testing at "d", position should be |kDownstream|.
|
||||
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 1),
|
||||
+ LayoutNGEnabled() ? TextAffinity::kDownstream
|
||||
+ : TextAffinity::kUpstream),
|
||||
+ HitTest(PhysicalOffset(35, 5)));
|
||||
+ // Because of hit testing at right of <span cd>, result position should be
|
||||
+ // |kUpstream|.
|
||||
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 2),
|
||||
+ LayoutNGEnabled() ? TextAffinity::kUpstream
|
||||
+ : TextAffinity::kDownstream),
|
||||
+ HitTest(PhysicalOffset(45, 5)));
|
||||
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 2),
|
||||
+ LayoutNGEnabled() ? TextAffinity::kUpstream
|
||||
+ : TextAffinity::kDownstream),
|
||||
+ HitTest(PhysicalOffset(55, 5)));
|
||||
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 2),
|
||||
+ LayoutNGEnabled() ? TextAffinity::kUpstream
|
||||
+ : TextAffinity::kDownstream),
|
||||
+ HitTest(PhysicalOffset(65, 5)));
|
||||
+}
|
||||
|
||||
TEST_F(HitTestingTest, OcclusionHitTest) {
|
||||
SetBodyInnerHTML(R"HTML(
|
||||
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.cc
|
||||
index bb39e1b44f13f27ec93045d7568147044ace6b41..23aeaff74d65cfd9f269d22747e36e39d82bfefe 100644
|
||||
--- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.cc
|
||||
+++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.cc
|
||||
@@ -819,6 +819,25 @@ PositionWithAffinity NGInlineCursor::PositionForPointInInlineBox(
|
||||
}
|
||||
}
|
||||
|
||||
+ if (container->Type() == NGFragmentItem::kLine) {
|
||||
+ // There are no inline items to hit in this line box, e.g. <span> with
|
||||
+ // size and border. We try in lines before |this| line in the block.
|
||||
+ // See editing/selection/last-empty-inline.html
|
||||
+ NGInlineCursor cursor;
|
||||
+ cursor.MoveTo(*this);
|
||||
+ const PhysicalOffset point_in_line =
|
||||
+ point - Current().OffsetInContainerBlock();
|
||||
+ for (;;) {
|
||||
+ cursor.MoveToPreviousLine();
|
||||
+ if (!cursor)
|
||||
+ break;
|
||||
+ const PhysicalOffset adjusted_point =
|
||||
+ point_in_line + cursor.Current().OffsetInContainerBlock();
|
||||
+ if (auto position = cursor.PositionForPointInInlineBox(adjusted_point))
|
||||
+ return position;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return PositionWithAffinity();
|
||||
}
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
|
||||
index e8ff0f43f2f97c740d3ec744c858c2097d0085b2..da66f973636c75fb511d2cf795cc592a802a5cee 100644
|
||||
--- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
|
||||
+++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
|
||||
@@ -1713,9 +1713,25 @@ bool NGBoxFragmentPainter::NodeAtPoint(const HitTestContext& hit_test,
|
||||
if (fragment.IsInlineBox())
|
||||
bounds_rect = PhysicalRect(PixelSnappedIntRect(bounds_rect));
|
||||
if (hit_test.location.Intersects(bounds_rect)) {
|
||||
- if (hit_test.AddNodeToResult(fragment.NodeForHitTest(), bounds_rect,
|
||||
- physical_offset))
|
||||
- return true;
|
||||
+ // We set offset in container block instead of offset in |fragment| like
|
||||
+ // |NGBoxFragmentPainter::HitTestTextFragment()|.
|
||||
+ // See http://crbug.com/1043471
|
||||
+ if (box_item_ && box_item_->IsInlineBox()) {
|
||||
+ if (hit_test.AddNodeToResult(
|
||||
+ fragment.NodeForHitTest(), bounds_rect,
|
||||
+ physical_offset - box_item_->OffsetInContainerBlock()))
|
||||
+ return true;
|
||||
+ } else if (paint_fragment_ &&
|
||||
+ paint_fragment_->PhysicalFragment().IsInline()) {
|
||||
+ if (hit_test.AddNodeToResult(
|
||||
+ fragment.NodeForHitTest(), bounds_rect,
|
||||
+ physical_offset - paint_fragment_->OffsetInContainerBlock()))
|
||||
+ return true;
|
||||
+ } else {
|
||||
+ if (hit_test.AddNodeToResult(fragment.NodeForHitTest(), bounds_rect,
|
||||
+ physical_offset))
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
|
||||
index 9cd79dd07b2098fbf7efe7d85b3a63b0382ff1c2..bec5324a026e679965873afe387236a0b5e60f85 100644
|
||||
--- a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
|
||||
+++ b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
|
||||
@@ -1039,6 +1039,25 @@ PositionWithAffinity NGPaintFragment::PositionForPointInInlineLevelBox(
|
||||
return child_position.value();
|
||||
}
|
||||
|
||||
+ if (PhysicalFragment().IsLineBox()) {
|
||||
+ // There are no inline items to hit in this line box, e.g. <span> with
|
||||
+ // size and border. We try in lines before |this| line in the block.
|
||||
+ // See editing/selection/last-empty-inline.html
|
||||
+ NGInlineCursor cursor(*Parent());
|
||||
+ cursor.MoveTo(*this);
|
||||
+ const PhysicalOffset point_in_line = point - OffsetInContainerBlock();
|
||||
+ for (;;) {
|
||||
+ cursor.MoveToPreviousLine();
|
||||
+ if (!cursor)
|
||||
+ break;
|
||||
+ const NGPaintFragment& line = *cursor.CurrentPaintFragment();
|
||||
+ const PhysicalOffset adjusted_point =
|
||||
+ point_in_line + line.OffsetInContainerBlock();
|
||||
+ if (auto position = line.PositionForPointInInlineLevelBox(adjusted_point))
|
||||
+ return position;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return PositionWithAffinity();
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1652925 removed colors
|
||||
needed in chromium but our autofill implementation uses them. This patch can be removed if we refactor
|
||||
our autofill implementation to work like Chromium's.
|
||||
|
||||
diff --git a/chrome/browser/ui/gtk/native_theme_gtk.cc b/chrome/browser/ui/gtk/native_theme_gtk.cc
|
||||
index 990e2f0539dea8a4f2b47df1cc93715901fc5a7d..84a67a0efb3deed4a273be0f939abef71543e4fa 100644
|
||||
--- a/chrome/browser/ui/gtk/native_theme_gtk.cc
|
||||
+++ b/chrome/browser/ui/gtk/native_theme_gtk.cc
|
||||
diff --git a/ui/gtk/native_theme_gtk.cc b/ui/gtk/native_theme_gtk.cc
|
||||
index 352bc3d9fb59ea46829ff02f779b3372efadf8db..70a49a4b473bc03e92625c57383dc9fddd85de42 100644
|
||||
--- a/ui/gtk/native_theme_gtk.cc
|
||||
+++ b/ui/gtk/native_theme_gtk.cc
|
||||
@@ -351,6 +351,27 @@ base::Optional<SkColor> SkColorFromColorId(
|
||||
case ui::NativeTheme::kColorId_TableHeaderSeparator:
|
||||
return GetBorderColor("GtkTreeView#treeview.view GtkButton#button");
|
||||
@@ -40,7 +40,7 @@ index 990e2f0539dea8a4f2b47df1cc93715901fc5a7d..84a67a0efb3deed4a273be0f939abef7
|
||||
// TODO(thomasanderson): Render GtkSpinner directly.
|
||||
case ui::NativeTheme::kColorId_ThrobberSpinningColor:
|
||||
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
|
||||
index cbef81b92f2589937c67370335713e5e9de44532..e850e603101e54e33b96fcd2c67a9e33a6819302 100644
|
||||
index aac3821e6d977a8f80e4ded5b5944b43a7f200b1..83b3f97113244108c8648f21b646ef7262f282b5 100644
|
||||
--- a/ui/native_theme/common_theme.cc
|
||||
+++ b/ui/native_theme/common_theme.cc
|
||||
@@ -43,7 +43,8 @@ base::Optional<SkColor> GetHighContrastColor(
|
||||
@@ -68,7 +68,7 @@ index cbef81b92f2589937c67370335713e5e9de44532..e850e603101e54e33b96fcd2c67a9e33
|
||||
// FocusableBorder
|
||||
case NativeTheme::kColorId_FocusedBorderColor:
|
||||
return SkColorSetA(gfx::kGoogleBlue300, 0x4D);
|
||||
@@ -484,6 +493,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
|
||||
@@ -487,6 +496,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
|
||||
case NativeTheme::kColorId_UnfocusedBorderColor:
|
||||
return gfx::kGoogleGrey300;
|
||||
|
||||
@@ -87,7 +87,7 @@ index cbef81b92f2589937c67370335713e5e9de44532..e850e603101e54e33b96fcd2c67a9e33
|
||||
// Material spinner/throbber
|
||||
case NativeTheme::kColorId_ThrobberSpinningColor:
|
||||
return gfx::kGoogleBlue600;
|
||||
@@ -543,7 +564,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
|
||||
@@ -549,7 +570,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
|
||||
}
|
||||
|
||||
if (color_scheme == NativeTheme::ColorScheme::kDark) {
|
||||
|
||||
@@ -52,7 +52,7 @@ Some alternatives to this patch:
|
||||
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index 23eb5fcfd9889aadd615d6a347258ff9db604bab..22844351c09b50ba958dfbbe416f4a645aaa035f 100644
|
||||
index d113eedf7afc704b0c2e8d112413e3bd7c58d8c7..fcd838d69b23e6799702353a551a0a7ac5c4ae15 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -1470,7 +1470,7 @@ if (is_chrome_branded && !is_android) {
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Lily Chen <chlily@chromium.org>
|
||||
Date: Fri, 3 Apr 2020 00:25:12 +0000
|
||||
Subject: Revert "Enable SameSiteByDefaultCookies and
|
||||
CookiesWithoutSameSiteMustBeSecure"
|
||||
|
||||
This reverts commit 2507555fe83d314ef6300317cd6f90ff165150bd.
|
||||
|
||||
Reason for revert: Expected full rollout delayed
|
||||
|
||||
Original change's description:
|
||||
> Enable SameSiteByDefaultCookies and CookiesWithoutSameSiteMustBeSecure
|
||||
>
|
||||
> TBR=jschuh@chromium.org
|
||||
>
|
||||
> Bug: 953306
|
||||
> Change-Id: I5bde61d8ff66261ade4e68caadafda73c522df00
|
||||
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2122809
|
||||
> Reviewed-by: Lily Chen <chlily@chromium.org>
|
||||
> Commit-Queue: Lily Chen <chlily@chromium.org>
|
||||
> Cr-Commit-Position: refs/heads/master@{#753807}
|
||||
|
||||
TBR=jschuh@chromium.org,chlily@chromium.org
|
||||
|
||||
# Not skipping CQ checks because original CL landed > 1 day ago.
|
||||
|
||||
Bug: 953306
|
||||
Change-Id: Ic7da4e9938184e2833895ff263325c01948be6f0
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135046
|
||||
Reviewed-by: Lily Chen <chlily@chromium.org>
|
||||
Commit-Queue: Lily Chen <chlily@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#756087}
|
||||
|
||||
diff --git a/net/base/features.cc b/net/base/features.cc
|
||||
index 0a0c2da968ca115eb6422ee244a7a97bb4627375..46b4562c621633c19bb7033a3c95618b8578e227 100644
|
||||
--- a/net/base/features.cc
|
||||
+++ b/net/base/features.cc
|
||||
@@ -57,11 +57,11 @@ const base::FeatureParam<int> kEsniDnsMaxAbsoluteAdditionalWaitMilliseconds{
|
||||
const base::FeatureParam<int> kEsniDnsMaxRelativeAdditionalWaitPercent{
|
||||
&kRequestEsniDnsRecords, "EsniDnsMaxRelativeAdditionalWaitPercent", 5};
|
||||
|
||||
-const base::Feature kSameSiteByDefaultCookies{"SameSiteByDefaultCookies",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+const base::Feature kSameSiteByDefaultCookies{
|
||||
+ "SameSiteByDefaultCookies", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kCookiesWithoutSameSiteMustBeSecure{
|
||||
- "CookiesWithoutSameSiteMustBeSecure", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ "CookiesWithoutSameSiteMustBeSecure", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
const base::Feature kShortLaxAllowUnsafeThreshold{
|
||||
"ShortLaxAllowUnsafeThreshold", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
@@ -9,10 +9,10 @@ for every navigation to keep Node.js working properly. Once Native Modules in th
|
||||
are required to be NAPI or context aware (Electron v11), this patch can be removed.
|
||||
|
||||
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
|
||||
index 42383cda5a9ccb39e64ee65d0202bee60639623f..c9099e58ba6f552a83a7994529c7999e4e22cd07 100644
|
||||
index b96048aec4f7d58438a5b08d688756d8c639a6fc..df3bbd1a2a5bfe8804b97447e7671b7dd8b8fd36 100644
|
||||
--- a/chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ b/chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -1272,6 +1272,25 @@ bool ChromeContentRendererClient::AllowPopup() {
|
||||
@@ -1275,6 +1275,25 @@ bool ChromeContentRendererClient::AllowPopup() {
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ index 42383cda5a9ccb39e64ee65d0202bee60639623f..c9099e58ba6f552a83a7994529c7999e
|
||||
WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
|
||||
index 8969adb44800e925c9066e51793463c09eb78622..d11a4fdf04f7632fb1191c28c83f1d66ce0e5bf2 100644
|
||||
index c210526bfedc468dd6ba314e337aaae46154de01..e4532372a0e54e42bd708bfad275d5c543080cd2 100644
|
||||
--- a/chrome/renderer/chrome_content_renderer_client.h
|
||||
+++ b/chrome/renderer/chrome_content_renderer_client.h
|
||||
@@ -126,6 +126,11 @@ class ChromeContentRendererClient
|
||||
@@ -55,7 +55,7 @@ index 8969adb44800e925c9066e51793463c09eb78622..d11a4fdf04f7632fb1191c28c83f1d66
|
||||
ui::PageTransition transition_type,
|
||||
const blink::WebURL& url,
|
||||
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
|
||||
index c4c0e27127ff2976db4e78cf5a02bd22d1c667d3..a4318511d1081d4f101cb2f18ca5fa200fb9773c 100644
|
||||
index 84db33f5fb464c3df36e5ea230ea76f06ae9a919..d538b0d1b7d58c4f466334d787cd524420186e9e 100644
|
||||
--- a/content/public/renderer/content_renderer_client.cc
|
||||
+++ b/content/public/renderer/content_renderer_client.cc
|
||||
@@ -104,6 +104,14 @@ bool ContentRendererClient::HandleNavigation(
|
||||
@@ -74,10 +74,10 @@ index c4c0e27127ff2976db4e78cf5a02bd22d1c667d3..a4318511d1081d4f101cb2f18ca5fa20
|
||||
blink::WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index ee2079537feb23869fe4f812bcef33e1d7de29a7..93287ae0928b52f9df34834ad1a8ef0e54367882 100644
|
||||
index f409df27977c6d43e6738c4557cb6201507b7fce..a94b2b289eb1b5da820dd3bf620911f2edef7c68 100644
|
||||
--- a/content/public/renderer/content_renderer_client.h
|
||||
+++ b/content/public/renderer/content_renderer_client.h
|
||||
@@ -213,6 +213,13 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -214,6 +214,13 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
bool is_redirect);
|
||||
#endif
|
||||
|
||||
@@ -92,10 +92,10 @@ index ee2079537feb23869fe4f812bcef33e1d7de29a7..93287ae0928b52f9df34834ad1a8ef0e
|
||||
// |url|. If the function returns a valid |new_url|, the request must be
|
||||
// updated to use it. The |attach_same_site_cookies| output parameter
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 7a6562904eebbf55fcc4b08c9676a80350ce0863..bc18d55a6556adc1e8376f42d21fc64593ac1a59 100644
|
||||
index 902c33cac74cf66f97e7a900a736f59f0f3308fc..52243ef165ca5cb5adf9d9453bdb5e67f97365f1 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -5694,6 +5694,23 @@ void RenderFrameImpl::BeginNavigation(
|
||||
@@ -5716,6 +5716,23 @@ void RenderFrameImpl::BeginNavigation(
|
||||
int cumulative_bindings = RenderProcess::current()->GetEnabledBindings();
|
||||
bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
|
||||
(cumulative_bindings & kWebUIBindingsPolicyMask);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user