Compare commits

...

12 Commits

Author SHA1 Message Date
trop[bot]
b6070c34d4 docs: update docs.microsoft.com links to learn.microsoft.com (#37751)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-03-30 09:41:35 -04:00
trop[bot]
6101b9cd29 fix: draggable regions shouldn't capture clicks on frames windows (#37741)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-28 13:34:14 -04:00
trop[bot]
363fb370ac docs: updated package.json content and electron version in build first app guide (#37743)
* Docs: updated package.json content and electron version in build first app guide

Co-authored-by: Mikołaj <32898551+dufipl@users.noreply.github.com>

* docs: removed caret from electron version

Co-authored-by: Mikołaj Sawicki <32898551+dufipl@users.noreply.github.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Mikołaj <32898551+dufipl@users.noreply.github.com>
2023-03-28 12:31:45 -04:00
trop[bot]
58d0564825 chore: generator objects can't be sent over the context bridge (#37730)
chore: generator objects can't be sent over the context bridge (#37593)

* chore: generator objects can't be sent over the context bridge

* Trigger Build

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-28 11:15:28 -04:00
trop[bot]
f38c3d91a2 fix: crash in MessagePortMain with some postMessage params (#37726)
* fix: crash in MessagePortMain postMessage

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* Update shell/browser/api/message_port.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-03-28 10:29:02 -04:00
trop[bot]
7682c2d950 docs: fixup incorrect value for disabling sandbox (#37723)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Peter Xu <sysu.peter.hsu@gmail.com>
2023-03-27 18:28:14 -04:00
electron-roller[bot]
7588eb5a72 chore: bump chromium to 112.0.5615.39 (24-x-y) (#37700)
* chore: bump chromium in DEPS to 112.0.5615.39

* chore: update patches

* chore: update chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4295455

Our patch changes the signature of `LinuxUiTheme::GetWindowFrameProvider()`.
Upstream 4295455 added a new subclass (FallbackLinuxUi) so sync its version
of GetWindowFrameProvider() to match our changes.

(cherry picked from commit 79408b5fb8)

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-03-27 13:22:01 -04:00
trop[bot]
ce82646f5c fix: allow cancelling of bluetooth requests (#37717)
* fix: allow cancelling of bluetooth requests

allows cancelling of bluetooth requests when no devices present

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* docs: update docs to reflect how bluetooth works.

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-03-27 12:54:36 -04:00
Erick Zhao
1cd40681a9 docs: delete synopsis.md (#37687)
docs: delete synopsis.md (#37580)

* docs: delete synopsis.md

* remove code references to doc
2023-03-27 12:24:06 -04:00
trop[bot]
7892de74ee docs: change MSDN links to new Microsoft docs (#37703)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2023-03-27 09:38:14 -04:00
John Kleinschmidt
d4798f64e7 ci: update appveyor image to e-112.0.5615.29 (#37683) 2023-03-23 19:33:13 -04:00
trop[bot]
c77eb753e5 ci: fixup gn check to actually run gn check (#37679)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-03-23 18:26:26 -04:00
54 changed files with 234 additions and 228 deletions

View File

@@ -970,26 +970,13 @@ step-ts-compile: &step-ts-compile
# List of all steps.
steps-electron-gn-check: &steps-electron-gn-check
steps:
- *step-checkout-electron
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- install-python2-mac
- *step-setup-env-for-build
- *step-setup-goma-for-build
- *step-generate-deps-hash
- *step-touch-sync-done
- maybe-restore-portaled-src-cache
- run:
name: Ensure src checkout worked
command: |
if [ ! -d "src/third_party/blink" ]; then
echo src cache was not restored for an unknown reason
exit 1
fi
- run:
name: Wipe Electron
command: rm -rf src/electron
- *step-checkout-electron
- checkout-from-cache
- *step-setup-env-for-build
- *step-wait-for-goma
- *step-gn-gen-default
- *step-gn-check
steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
steps:

2
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'112.0.5615.29',
'112.0.5615.39',
'node_version':
'v18.14.0',
'nan_version':

View File

@@ -6,7 +6,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-112.0.5607.0-vs2022
image: e-112.0.5615.29
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-112.0.5607.0-vs2022
image: e-112.0.5615.29
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-112.0.5607.0-vs2022
image: e-112.0.5615.29
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default

View File

@@ -90,7 +90,6 @@ These individual tutorials expand on topics discussed in the guide above.
## API References
* [Synopsis](api/synopsis.md)
* [Process Object](api/process.md)
* [Supported Command Line Switches](api/command-line-switches.md)
* [Environment Variables](api/environment-variables.md)

View File

@@ -804,7 +804,7 @@ editor. Please refer to [Apple's documentation][CFBundleURLTypes] for details.
**Note:** In a Windows Store environment (when packaged as an `appx`) this API
will return `true` for all calls but the registry key it sets won't be accessible
by other applications. In order to register your Windows Store application
as a default protocol handler you must [declare the protocol in your manifest](https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol).
as a default protocol handler you must [declare the protocol in your manifest](https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol).
The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internally.
@@ -1510,8 +1510,8 @@ dock on macOS.
A `boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.
[tasks]:https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
[tasks]:https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#tasks
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[electron-forge]: https://www.electronforge.io/
[electron-packager]: https://github.com/electron/electron-packager
[CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115
@@ -1521,7 +1521,7 @@ A `boolean` property that returns `true` if the app is packaged, `false` otherw
[unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher
[mas-builds]: ../tutorial/mac-app-store-submission-guide.md
[Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows
[JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx
[JumpListBeginListMSDN]: https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-icustomdestinationlist-beginlist
[about-panel-options]: https://developer.apple.com/reference/appkit/nsapplication/1428479-orderfrontstandardaboutpanelwith?language=objc
### `app.name`

View File

@@ -140,5 +140,5 @@ application starts.
[installer]: https://github.com/electron/grunt-electron-installer
[installer-lib]: https://github.com/electron/windows-installer
[electron-forge-lib]: https://github.com/electron/forge
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

View File

@@ -629,7 +629,7 @@ Returns:
* `event` Event
* `command` string
Emitted when an [App Command](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646275(v=vs.85).aspx)
Emitted when an [App Command](https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-appcommand)
is invoked. These are typically related to keyboard media keys or browser
commands, as well as the "Back" button built into some mice on Windows.
@@ -1664,13 +1664,13 @@ in the taskbar.
#### `win.setAppDetails(options)` _Windows_
* `options` Object
* `appId` string (optional) - Window's [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx).
* `appId` string (optional) - Window's [App User Model ID](https://learn.microsoft.com/en-us/windows/win32/shell/appids).
It has to be set, otherwise the other options will have no effect.
* `appIconPath` string (optional) - Window's [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx).
* `appIconPath` string (optional) - Window's [Relaunch Icon](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchiconresource).
* `appIconIndex` Integer (optional) - Index of the icon in `appIconPath`.
Ignored when `appIconPath` is not set. Default is `0`.
* `relaunchCommand` string (optional) - Window's [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx).
* `relaunchDisplayName` string (optional) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx).
* `relaunchCommand` string (optional) - Window's [Relaunch Command](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchcommand).
* `relaunchDisplayName` string (optional) - Window's [Relaunch Display Name](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchdisplaynameresource).
Sets the properties for the window's taskbar button.

View File

@@ -49,7 +49,7 @@ quality, it is recommended to include at least the following sizes in the:
Check the *Size requirements* section in [this article][icons].
[icons]:https://msdn.microsoft.com/en-us/library/windows/desktop/dn742485(v=vs.85).aspx
[icons]: https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-icons
## High Resolution Image

View File

@@ -7,7 +7,7 @@
* `isDefault` boolean - whether or not a given printer is set as the default printer on the OS.
* `options` Object - an object containing a variable number of platform-specific printer information.
The number represented by `status` means different things on different platforms: on Windows its potential values can be found [here](https://docs.microsoft.com/en-us/windows/win32/printdocs/printer-info-2), and on Linux and macOS they can be found [here](https://www.cups.org/doc/cupspm.html).
The number represented by `status` means different things on different platforms: on Windows its potential values can be found [here](https://learn.microsoft.com/en-us/windows/win32/printdocs/printer-info-2), and on Linux and macOS they can be found [here](https://www.cups.org/doc/cupspm.html).
## Example

View File

@@ -1,93 +0,0 @@
# Synopsis
> How to use Node.js and Electron APIs.
All of [Node.js's built-in modules](https://nodejs.org/api/) are available in
Electron and third-party node modules also fully supported as well (including
the [native modules](../tutorial/using-native-node-modules.md)).
Electron also provides some extra built-in modules for developing native
desktop applications. Some modules are only available in the main process, some
are only available in the renderer process (web page), and some can be used in
either process type.
The basic rule is: if a module is [GUI][gui] or low-level system related, then
it should be only available in the main process. You need to be familiar with
the concept of main process vs. renderer process
scripts to be able to use those modules.
The main process script is like a normal Node.js script:
```javascript
const { app, BrowserWindow } = require('electron')
let win = null
app.whenReady().then(() => {
win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('https://github.com')
})
```
The renderer process is no different than a normal web page, except for the
extra ability to use node modules if `nodeIntegration` is enabled:
```html
<!DOCTYPE html>
<html>
<body>
<script>
const fs = require('fs')
console.log(fs.readFileSync(__filename, 'utf8'))
</script>
</body>
</html>
```
## Destructuring assignment
As of 0.37, you can use
[destructuring assignment][destructuring-assignment] to make it easier to use
built-in modules.
```javascript
const { app, BrowserWindow } = require('electron')
let win
app.whenReady().then(() => {
win = new BrowserWindow()
win.loadURL('https://github.com')
})
```
If you need the entire `electron` module, you can require it and then using
destructuring to access the individual modules from `electron`.
```javascript
const electron = require('electron')
const { app, BrowserWindow } = electron
let win
app.whenReady().then(() => {
win = new BrowserWindow()
win.loadURL('https://github.com')
})
```
This is equivalent to the following code:
```javascript
const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
let win
app.whenReady().then(() => {
win = new BrowserWindow()
win.loadURL('https://github.com')
})
```
[gui]: https://en.wikipedia.org/wiki/Graphical_user_interface
[destructuring-assignment]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

View File

@@ -235,7 +235,7 @@ if (browserOptions.transparent) {
}
```
[dwm-composition]:https://msdn.microsoft.com/en-us/library/windows/desktop/aa969540.aspx
[dwm-composition]: https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw
### `systemPreferences.getAccentColor()` _Windows_ _macOS_
@@ -336,8 +336,8 @@ See the [Windows docs][windows-colors] and the [macOS docs][macos-colors] for mo
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`.
[windows-colors]:https://msdn.microsoft.com/en-us/library/windows/desktop/ms724371(v=vs.85).aspx
[macos-colors]:https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#dynamic-system-colors
[windows-colors]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsyscolor
[macos-colors]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#dynamic-system-colors
### `systemPreferences.getSystemColor(color)` _macOS_

View File

@@ -269,9 +269,9 @@ Returns `boolean` - Whether double click events will be ignored.
Displays a tray balloon.
[NIIF_NOSOUND]: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_nosound-0x00000010
[NIIF_LARGE_ICON]: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_large_icon-0x00000020
[NIIF_RESPECT_QUIET_TIME]: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_respect_quiet_time-0x00000080
[NIIF_NOSOUND]: https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_nosound-0x00000010
[NIIF_LARGE_ICON]: https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_large_icon-0x00000020
[NIIF_RESPECT_QUIET_TIME]: https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_respect_quiet_time-0x00000080
#### `tray.removeBalloon()` _Windows_

View File

@@ -721,20 +721,24 @@ Returns:
* `callback` Function
* `deviceId` string
Emitted when bluetooth device needs to be selected on call to
`navigator.bluetooth.requestDevice`. To use `navigator.bluetooth` api
`webBluetooth` should be enabled. If `event.preventDefault` is not called,
first available device will be selected. `callback` should be called with
`deviceId` to be selected, passing empty string to `callback` will
cancel the request.
Emitted when a bluetooth device needs to be selected when a call to
`navigator.bluetooth.requestDevice` is made. `callback` should be called with
the `deviceId` of the device to be selected. Passing an empty string to
`callback` will cancel the request.
If no event listener is added for this event, all bluetooth requests will be cancelled.
If an event listener is not added for this event, or if `event.preventDefault`
is not called when handling this event, the first available device will be
automatically selected.
Due to the nature of bluetooth, scanning for devices when
`navigator.bluetooth.requestDevice` is called may take time and will cause
`select-bluetooth-device` to fire multiple times until `callback` is called
with either a device id or an empty string to cancel the request.
```javascript title='main.js'
const { app, BrowserWindow } = require('electron')
let win = null
app.commandLine.appendSwitch('enable-experimental-web-platform-features')
app.whenReady().then(() => {
win = new BrowserWindow({ width: 800, height: 600 })
@@ -744,6 +748,9 @@ app.whenReady().then(() => {
return device.deviceName === 'test'
})
if (!result) {
// The device wasn't found so we need to either wait longer (eg until the
// device is turned on) or cancel the request by calling the callback
// with an empty string.
callback('')
} else {
callback(result.deviceId)

View File

@@ -1,6 +1,6 @@
# Updating an Appveyor Azure Image
Electron CI on Windows uses AppVeyor, which in turn uses Azure VM images to run. Occasionally, these VM images need to be updated due to changes in Chromium requirements. In order to update you will need [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-6) and the [Azure PowerShell module](https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-1.8.0&viewFallbackFrom=azurermps-6.13.0).
Electron CI on Windows uses AppVeyor, which in turn uses Azure VM images to run. Occasionally, these VM images need to be updated due to changes in Chromium requirements. In order to update you will need [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.3&viewFallbackFrom=powershell-6) and the [Azure PowerShell module](https://learn.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-9.5.0&viewFallbackFrom=azps-1.8.0).
Occasionally we need to update these images owing to changes in Chromium or other miscellaneous build requirement changes.

View File

@@ -94,7 +94,7 @@ out [this video tutorial][procmon-instructions] provided by Microsoft.
## Using WinDbg
<!-- TODO(@codebytere): add images and more information here? -->
It's possible to debug crashes and issues in the Renderer process with [WinDbg](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/getting-started-with-windbg).
It's possible to debug crashes and issues in the Renderer process with [WinDbg](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/getting-started-with-windbg).
To attach to a debug a process with WinDbg:

View File

@@ -79,7 +79,7 @@ the Node.js source tree.
#### Missing fonts
[Some Windows 10 devices](https://docs.microsoft.com/en-us/typography/fonts/windows_10_font_list) do not ship with the Meiryo font installed, which may cause a font fallback test to fail. To install Meiryo:
[Some Windows 10 devices](https://learn.microsoft.com/en-us/typography/fonts/windows_10_font_list) do not ship with the Meiryo font installed, which may cause a font fallback test to fail. To install Meiryo:
1. Push the Windows key and search for _Manage optional features_.
2. Click _Add a feature_.

View File

@@ -60,7 +60,7 @@ garbage collected.
If you encounter this problem, the following articles may prove helpful:
* [Memory Management][memory-management]
* [Variable Scope][variable-scope]
* [Closures][closures]
If you want a quick fix, you can make the variables global by changing your
code from this:
@@ -153,7 +153,7 @@ The effect is visible only on (some?) LCD screens. Even if you don't see a diffe
Notice that just setting the background in the CSS does not have the desired effect.
[memory-management]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management
[variable-scope]: https://msdn.microsoft.com/library/bzt2dkta(v=vs.94).aspx
[closures]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures
[storage]: https://developer.mozilla.org/en-US/docs/Web/API/Storage
[local-storage]: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
[session-storage]: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage

View File

@@ -9,6 +9,7 @@
<h1>Web Bluetooth API</h1>
<button id="clickme">Test Bluetooth</button>
<button id="cancel">Cancel Bluetooth Request</button>
<p>Currently selected bluetooth device: <strong id="device-name""></strong></p>

View File

@@ -1,6 +1,9 @@
const {app, BrowserWindow, ipcMain} = require('electron')
const path = require('path')
let bluetoothPinCallback
let selectBluetoothCallback
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
@@ -12,11 +15,23 @@ function createWindow () {
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
event.preventDefault()
if (deviceList && deviceList.length > 0) {
callback(deviceList[0].deviceId)
}
selectBluetoothCallback = callback
const result = deviceList.find((device) => {
return device.deviceName === 'test'
})
if (result) {
callback(result.deviceId)
} else {
// The device wasn't found so we need to either wait longer (eg until the
// device is turned on) or until the user cancels the request
}
})
ipcMain.on('cancel-bluetooth-request', (event) => {
selectBluetoothCallback('')
})
// Listen for a message from the renderer to get the response for the Bluetooth pairing.
ipcMain.on('bluetooth-pairing-response', (event, response) => {
bluetoothPinCallback(response)

View File

@@ -1,6 +1,7 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
cancelBluetoothRequest: (callback) => ipcRenderer.send('cancel-bluetooth-request', callback),
bluetoothPairingRequest: (callback) => ipcRenderer.on('bluetooth-pairing-request', callback),
bluetoothPairingResponse: (response) => ipcRenderer.send('bluetooth-pairing-response', response)
})

View File

@@ -7,6 +7,12 @@ async function testIt() {
document.getElementById('clickme').addEventListener('click',testIt)
function cancelRequest() {
window.electronAPI.cancelBluetoothRequest()
}
document.getElementById('cancel').addEventListener('click', cancelRequest)
window.electronAPI.bluetoothPairingRequest((event, details) => {
const response = {}

View File

@@ -70,7 +70,7 @@
</li>
<li>
<a
href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb226797(v=vs.85).aspx"
href="https://learn.microsoft.com/en-us/previous-versions/windows/desktop/bb226797"
>Windows<span
>(opens in new window)</span
></a

View File

@@ -234,7 +234,7 @@ embedded content.
[context isolation]: tutorial/context-isolation.md
[mac app store submission guide]: tutorial/mac-app-store-submission-guide.md
[main]: #main-process
[msi]: https://docs.microsoft.com/en-us/windows/win32/msi/windows-installer-portal
[msi]: https://learn.microsoft.com/en-us/windows/win32/msi/windows-installer-portal
[Native Node Modules]: tutorial/using-native-node-modules.md
[offscreen rendering]: tutorial/offscreen-rendering.md
[process sandboxing]: tutorial/sandbox.md

View File

@@ -200,4 +200,4 @@ See the [Windows Store Guide][].
[windows store guide]: ./windows-store-guide.md
[maker-squirrel]: https://www.electronforge.io/config/makers/squirrel.windows
[maker-msi]: https://www.electronforge.io/config/makers/wix-msi
[signtool.exe]: https://docs.microsoft.com/en-us/dotnet/framework/tools/signtool-exe
[signtool.exe]: https://learn.microsoft.com/en-us/dotnet/framework/tools/signtool-exe

View File

@@ -138,5 +138,5 @@ of `app` module will be emitted for it.
[dock-menu-image]: https://cloud.githubusercontent.com/assets/639601/5069610/2aa80758-6e97-11e4-8cfb-c1a414a10774.png
[addrecentdocument]: ../api/app.md#appaddrecentdocumentpath-macos-windows
[clearrecentdocuments]: ../api/app.md#appclearrecentdocuments-macos-windows
[app-registration]: https://msdn.microsoft.com/en-us/library/cc144104(VS.85).aspx
[app-registration]: https://learn.microsoft.com/en-us/windows/win32/shell/app-registration
[menu-item-image]: https://user-images.githubusercontent.com/3168941/33003655-ea601c3a-cd70-11e7-97fa-7c062149cfb1.png

View File

@@ -84,7 +84,7 @@ the `sandbox: false` preference in the [`BrowserWindow`][browser-window] constru
app.whenReady().then(() => {
const win = new BrowserWindow({
webPreferences: {
sandbox: true
sandbox: false
}
})
win.loadURL('https://google.com')

View File

@@ -81,10 +81,13 @@ the exact dependency versions to install.
"version": "1.0.0",
"description": "Hello World!",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jane Doe",
"license": "MIT",
"devDependencies": {
"electron": "19.0.0"
"electron": "23.1.3"
}
}
```
@@ -137,13 +140,14 @@ script in the current directory and run it in dev mode.
"version": "1.0.0",
"description": "Hello World!",
"main": "main.js",
"scripts": {
"start": "electron .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jane Doe",
"license": "MIT",
"scripts": {
"start": "electron ."
},
"devDependencies": {
"electron": "^19.0.0"
"electron": "23.1.3"
}
}
```
@@ -465,7 +469,7 @@ privileged APIs and how to communicate between processes.
[repl]: ./repl.md
[webpack]: https://webpack.js.org
[window-all-closed]: ../api/app.md#event-window-all-closed
[wsl]: https://docs.microsoft.com/en-us/windows/wsl/about#what-is-wsl-2
[wsl]: https://learn.microsoft.com/en-us/windows/wsl/about#what-is-wsl-2
<!-- Tutorial links -->

View File

@@ -110,7 +110,7 @@ On Windows, by default, `node-gyp` links native modules against `node.dll`.
However, in Electron 4.x and higher, the symbols needed by native modules are
exported by `electron.exe`, and there is no `node.dll`. In order to load native
modules on Windows, `node-gyp` installs a [delay-load
hook](https://msdn.microsoft.com/en-us/library/z9h1h6ty.aspx) that triggers
hook](https://learn.microsoft.com/en-us/cpp/build/reference/error-handling-and-notification?view=msvc-170#notification-hooks) that triggers
when the native module is loaded, and redirects the `node.dll` reference to use
the loading executable instead of looking for `node.dll` in the library search
path (which would turn up nothing). As such, on Electron 4.x and higher,

View File

@@ -88,7 +88,7 @@ After completing all of the above, open your cross-compilation command prompt an
## Debugging native modules
Debugging native modules can be done with Visual Studio 2017 (running on your development machine) and corresponding [Visual Studio Remote Debugger](https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging-cpp?view=vs-2019) running on the target device. To debug:
Debugging native modules can be done with Visual Studio 2017 (running on your development machine) and corresponding [Visual Studio Remote Debugger](https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-cpp?view=vs-2019) running on the target device. To debug:
1. Launch your app `.exe` on the target device via the _Command Prompt_ (passing `--inspect-brk` to pause it before any native modules are loaded).
2. Launch Visual Studio 2017 on your development machine.

View File

@@ -89,7 +89,7 @@ app.setUserTasks([])
> NOTE: The user tasks will still be displayed even after closing your
application, so the icon and program path specified for a task should exist until your application is uninstalled.
[msdn-jumplist]: https://docs.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#tasks
[msdn-jumplist]: https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#tasks
### Thumbnail Toolbars
@@ -156,7 +156,7 @@ const win = new BrowserWindow()
win.setThumbarButtons([])
```
[msdn-thumbnail]: https://docs.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#thumbnail-toolbars
[msdn-thumbnail]: https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#thumbnail-toolbars
### Icon Overlays in Taskbar
@@ -196,7 +196,7 @@ const win = new BrowserWindow()
win.setOverlayIcon('path/to/overlay.png', 'Description for overlay')
```
[msdn-icon-overlay]: https://docs.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#icon-overlays
[msdn-icon-overlay]: https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#icon-overlays
### Flash Frame
@@ -230,7 +230,7 @@ win.flashFrame(true)
In the above example, it is called when the window comes into focus,
but you might use a timeout or some other event to disable it.
[msdn-flash-frame]: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-flashwindow#remarks
[msdn-flash-frame]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-flashwindow#remarks
[setthumbarbuttons]: ../api/browser-window.md#winsetthumbarbuttonsbuttons-windows
[setusertaskstasks]: ../api/app.md#appsetusertaskstasks-windows

View File

@@ -49,7 +49,6 @@ auto_filenames = {
"docs/api/share-menu.md",
"docs/api/shell.md",
"docs/api/structures",
"docs/api/synopsis.md",
"docs/api/system-preferences.md",
"docs/api/touch-bar-button.md",
"docs/api/touch-bar-color-picker.md",

View File

@@ -8,7 +8,7 @@ decorations in maximized mode where needed, preventing empty space caused
by decoration shadows and rounded titlebars around the window while maximized.
diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc
index 31917ffefc42e5073c12ff153ec1db9bf0876ff6..fedccd7966fe6de7bfe8b0e5664f47c484798652 100644
index 47a773cb11d59f6edfdb9302ce76fcfaab4eb172..5283069de57e3d13e179862f635453bef6d88681 100644
--- a/ui/gtk/gtk_ui.cc
+++ b/ui/gtk/gtk_ui.cc
@@ -480,11 +480,13 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
@@ -29,11 +29,11 @@ index 31917ffefc42e5073c12ff153ec1db9bf0876ff6..fedccd7966fe6de7bfe8b0e5664f47c4
return provider.get();
}
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
index ebc31db3dad9ba7904fbd345c6a1ba31ed6fd813..1d2ffc82bb67ed80f508631c8c7d045be76f6761 100644
index adf91ed69c33c5da4ba8cf55d7cbfc482d0762ba..d2fe3b7f0de0fcf848c2be4abc3728d73ee17f5b 100644
--- a/ui/gtk/gtk_ui.h
+++ b/ui/gtk/gtk_ui.h
@@ -106,7 +106,7 @@ class GtkUi : public ui::LinuxUiAndTheme {
SkColor GetInactiveSelectionFgColor() const override;
void GetInactiveSelectionFgColor(SkColor* color) const override;
bool PreferDarkTheme() const override;
std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
- ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
@@ -173,8 +173,34 @@ index 32c3d63ae4598339965c58443a8c2d12b99fb89a..91496d957b8291cd37948e237a1cc4bf
};
} // namespace gtk
diff --git a/ui/linux/fallback_linux_ui.cc b/ui/linux/fallback_linux_ui.cc
index ee3e7b96eba0ade61e229aea05f5417e7822a5f5..b393cc2fbc039afa062a8b3ab880c7ff9db8b681 100644
--- a/ui/linux/fallback_linux_ui.cc
+++ b/ui/linux/fallback_linux_ui.cc
@@ -134,7 +134,7 @@ FallbackLinuxUi::CreateNavButtonProvider() {
}
ui::WindowFrameProvider* FallbackLinuxUi::GetWindowFrameProvider(
- bool solid_frame) {
+ bool solid_frame, bool maximized) {
return nullptr;
}
diff --git a/ui/linux/fallback_linux_ui.h b/ui/linux/fallback_linux_ui.h
index d5b12df3f4e32aef6d974986ceeb666edecc4e11..e836f661a17f2e9916685d497ee5f487c4000661 100644
--- a/ui/linux/fallback_linux_ui.h
+++ b/ui/linux/fallback_linux_ui.h
@@ -67,7 +67,7 @@ class FallbackLinuxUi : public LinuxUiAndTheme {
void GetInactiveSelectionFgColor(SkColor* color) const override;
bool PreferDarkTheme() const override;
std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
- ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
+ ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override;
private:
std::string default_font_family_;
diff --git a/ui/linux/linux_ui.h b/ui/linux/linux_ui.h
index b5fd57741d2f47bda9499cf10e73cc9b3dd1b4dc..35e5bedb719af699485b575ece4bdb4f90df07df 100644
index 82d40cb5fa1b9ad54e43502793a7d1d3e94e2ebb..6f6296c4f8334e59e1522abe291d65bb508f9541 100644
--- a/ui/linux/linux_ui.h
+++ b/ui/linux/linux_ui.h
@@ -273,7 +273,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUiTheme {

View File

@@ -33,10 +33,10 @@ index 53363189fe649fa92040811ee9e858e9363f29e7..48883669d54ec7b7421b88fcaf7776e7
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index d04103392bf00d8661ef08a71c2fb8aaa582bac3..6d57d1aab07f363e3bc2acdfaf73f707abc24599 100644
index 0ddbd541f7ef4041aecc5693a366e6c87f74f313..a97f4cba4512ae1e7d34f9f29c33b366420b0822 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4589,7 +4589,7 @@ static_library("browser") {
@@ -4591,7 +4591,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
@@ -46,7 +46,7 @@ index d04103392bf00d8661ef08a71c2fb8aaa582bac3..6d57d1aab07f363e3bc2acdfaf73f707
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index f426627840a68ecb9b66d5ac4226a70f7478b781..9f674660d51d48a7cc8679af9e73fdcaf4a6f152 100644
index 9bd4a7f817389a1e6256b0570864ab5de5f541fb..66c42163f0d99eb447df4279eba47f4f50da3172 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -6297,7 +6297,6 @@ test("unit_tests") {
@@ -68,7 +68,7 @@ index f426627840a68ecb9b66d5ac4226a70f7478b781..9f674660d51d48a7cc8679af9e73fdca
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -7239,7 +7242,7 @@ test("unit_tests") {
@@ -7240,7 +7243,7 @@ test("unit_tests") {
}
deps += [
@@ -77,7 +77,7 @@ index f426627840a68ecb9b66d5ac4226a70f7478b781..9f674660d51d48a7cc8679af9e73fdca
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:test_support",
"//chrome/browser/enterprise/connectors/analysis:features",
@@ -7369,6 +7372,10 @@ test("unit_tests") {
@@ -7370,6 +7373,10 @@ test("unit_tests") {
}
}

View File

@@ -68,7 +68,7 @@ index 74b30a0d050468ad1f450d86621308c090a699b5..a1f555b07519ad07441c0bca0c20ddd5
if (is_android || use_ozone) {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 9abeee72c68fe0db55a529535a9aaaf9dfaef5da..504c9f53fb8111322fbe2ded99d1ad425ad2416e 100644
index 63892e1dfee945b3057771c0ed93eb8355c57704..ef4a65f832d35a051a8ee5e53e9a76a25c27d62f 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -56,6 +56,7 @@ source_set("browser") {

View File

@@ -9,7 +9,7 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 435be1e6e1abba9e28dd7967db6968750c0bcdfd..75eda6e9d10092df37540b6fc61b30591398a062 100644
index ab87f8dcc327696796c268beda22d7652a56d19e..bac63eafa4463529a27dfe9daa34e1a69c2d4805 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7632,6 +7632,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -21,7 +21,7 @@ index 435be1e6e1abba9e28dd7967db6968750c0bcdfd..75eda6e9d10092df37540b6fc61b3059
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index b04b88882583c2117621c917334d2a1445e09c5f..ae5da52cf66b83cea6322a4b3bb20367c74ae9bf 100644
index ddfd5e91cf73a143e446692006188857b43a0de7..5b7ac8ea0c06da208e1e79a6bec0b9df4f404abd 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4122,6 +4122,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(

View File

@@ -218,7 +218,7 @@ index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3b8dd5edb388b2c87fd38314c55bc649072ede69..a25a899bda3845b645ffdea2a622e3a3bddfdb4b 100644
index b507599df8e4163866bb50a1769d4dfb9e868c90..a5375eae688691b3d09e760d56c9ee8110e2f1d0 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4025,8 +4025,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(

View File

@@ -112,7 +112,7 @@ index 48d273dd5db3b9db89fc543b04d47d1da9ccfede..0b95993bc7e5b8bd675e295f8d4acd2a
string mime_type;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 7cf2c3a4fc3b233e202c73ea22db9beba55ad5f3..c8cfcb9da9c60e9554e026c2fbc9142a05a848c8 100644
index 5cc4757d4ad263d6d72240777242d2e41abfa04c..c8209fc1ab09156bdd94d7fac05cf41bdd0f87bb 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -646,6 +646,7 @@ URLLoader::URLLoader(

View File

@@ -6,7 +6,7 @@ Subject: fix: allow guest webcontents to enter fullscreen
This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a1c62f06eafb10c27756b6f9f933d593d4f6cf62..956d1b92e7f4b06880c2c4a877be164f90a844b1 100644
index 7cde8071def74ed63a6c4a860013d118522b9314..f4ce2dec339a5c68df06a2e4055ca6dc75fa75bc 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3547,7 +3547,7 @@ void WebContentsImpl::EnterFullscreenMode(

View File

@@ -17,10 +17,10 @@ policy->CanCommitOriginAndUrl.
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
index 05de1c051b9c5942b93fb4f549c0bc6bc574d99e..854093bb0eb5b4d8f9f24e8e0e1aedeb99e09f4f 100644
index d979fc0def505512f6847899f4c039a96e6d83ec..aac2bf5c5bd372f8d38e0f89e0ef3ed9f057ac4d 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -7055,10 +7055,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
@@ -7074,10 +7074,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
if (IsForMhtmlSubframe())
return origin_with_debug_info;
@@ -37,10 +37,10 @@ index 05de1c051b9c5942b93fb4f549c0bc6bc574d99e..854093bb0eb5b4d8f9f24e8e0e1aedeb
}
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h
index 95dc8c6adb056ac2e58b60af6c6942e85a313915..00621eca392b508ab25d347291fd6d9a240564d0 100644
index 39e71fff6496af7f2b8e94538d8f6fc42de5d60c..0006789a128b618197028ce5c9db25753076695e 100644
--- a/content/browser/renderer_host/render_frame_host_impl.h
+++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -2840,6 +2840,17 @@ class CONTENT_EXPORT RenderFrameHostImpl
@@ -2856,6 +2856,17 @@ class CONTENT_EXPORT RenderFrameHostImpl
// last committed document.
CookieChangeListener::CookieChangeInfo GetCookieChangeInfo();
@@ -58,7 +58,7 @@ index 95dc8c6adb056ac2e58b60af6c6942e85a313915..00621eca392b508ab25d347291fd6d9a
protected:
friend class RenderFrameHostFactory;
@@ -3163,17 +3174,6 @@ class CONTENT_EXPORT RenderFrameHostImpl
@@ -3179,17 +3190,6 @@ class CONTENT_EXPORT RenderFrameHostImpl
// relevant.
void ResetWaitingState();

View File

@@ -45,10 +45,10 @@ index 2ca4e42342ff6bf3f2ad104208944e36d572aa3c..7421cc779873b580d6f5a109d57ff744
// RenderFrameMetadataProvider::Observer implementation.
void OnRenderFrameMetadataChangedBeforeActivation(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 956d1b92e7f4b06880c2c4a877be164f90a844b1..02802bb50b73900d67b2d56c455b954b5807d0e9 100644
index f4ce2dec339a5c68df06a2e4055ca6dc75fa75bc..5158d3e36570704f129a82f96e479e1b350cc5fb 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -8037,7 +8037,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
@@ -8043,7 +8043,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

View File

@@ -822,10 +822,10 @@ index c7be37dc31f4725c945e7fde016b542d6e2b5902..03eff9ffcec9c655542d9c6508d9eb2f
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index bb6b30e24c466c5f26b9bfede8d275fcd72c7d20..9abeee72c68fe0db55a529535a9aaaf9dfaef5da 100644
index 9961afba10bcbd5c81ca4363899f331b42d8abb1..63892e1dfee945b3057771c0ed93eb8355c57704 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2815,8 +2815,9 @@ source_set("browser") {
@@ -2817,8 +2817,9 @@ source_set("browser") {
"//ppapi/shared_impl",
]

View File

@@ -43,7 +43,7 @@ index 43981927fd7f9e02865abaeb117f08e5d8ad13e5..8435be99edbaf09e1c7835d7543f3975
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index ae5da52cf66b83cea6322a4b3bb20367c74ae9bf..3b8dd5edb388b2c87fd38314c55bc649072ede69 100644
index 5b7ac8ea0c06da208e1e79a6bec0b9df4f404abd..b507599df8e4163866bb50a1769d4dfb9e868c90 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4714,6 +4714,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {

View File

@@ -9,7 +9,7 @@ is needed for OSR.
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a25a899bda3845b645ffdea2a622e3a3bddfdb4b..a1c62f06eafb10c27756b6f9f933d593d4f6cf62 100644
index a5375eae688691b3d09e760d56c9ee8110e2f1d0..7cde8071def74ed63a6c4a860013d118522b9314 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3165,6 +3165,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,

View File

@@ -14,7 +14,7 @@ Note that we also need to manually update embedder's
`api::WebContents::IsFullscreenForTabOrPending` value.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 75eda6e9d10092df37540b6fc61b30591398a062..8e0e987ad951433f60ce9e9ab8f656bc3acf72aa 100644
index bac63eafa4463529a27dfe9daa34e1a69c2d4805..dabe90bb827d0ed8536a18cd25f0f1ea44f9b3bd 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -6879,6 +6879,17 @@ void RenderFrameHostImpl::EnterFullscreen(

View File

@@ -14,8 +14,8 @@ const ROLLER_BRANCH_PATTERN = /^roller\/chromium$/;
const DEFAULT_BUILD_CLOUD_ID = '1598';
const DEFAULT_BUILD_CLOUD = 'electronhq-16-core';
const DEFAULT_BAKE_BASE_IMAGE = 'e-112.0.5607.0-vs2022';
const DEFAULT_BUILD_IMAGE = 'e-112.0.5607.0-vs2022';
const DEFAULT_BAKE_BASE_IMAGE = 'e-112.0.5615.29';
const DEFAULT_BUILD_IMAGE = 'e-112.0.5615.29';
const appveyorBakeJob = 'electron-bake-image';
const appVeyorJobs = {

View File

@@ -1877,6 +1877,9 @@ void WebContents::MessageHost(const std::string& channel,
void WebContents::UpdateDraggableRegions(
std::vector<mojom::DraggableRegionPtr> regions) {
if (owner_window() && owner_window()->has_frame())
return;
draggable_region_ = DraggableRegionsToSkRegion(regions);
}

View File

@@ -26,6 +26,25 @@
namespace electron {
namespace {
bool IsValidWrappable(const v8::Local<v8::Value>& obj) {
v8::Local<v8::Object> port = v8::Local<v8::Object>::Cast(obj);
if (!port->IsObject())
return false;
if (port->InternalFieldCount() != gin::kNumberOfInternalFields)
return false;
const auto* info = static_cast<gin::WrapperInfo*>(
port->GetAlignedPointerFromInternalField(gin::kWrapperInfoIndex));
return info && info->embedder == gin::kEmbedderNativeGin;
}
} // namespace
gin::WrapperInfo MessagePort::kWrapperInfo = {gin::kEmbedderNativeGin};
MessagePort::MessagePort() = default;
@@ -48,10 +67,11 @@ void MessagePort::PostMessage(gin::Arguments* args) {
DCHECK(!IsNeutered());
blink::TransferableMessage transferable_message;
gin_helper::ErrorThrower thrower(args->isolate());
v8::Local<v8::Value> message_value;
if (!args->GetNext(&message_value)) {
args->ThrowTypeError("Expected at least one argument to postMessage");
thrower.ThrowTypeError("Expected at least one argument to postMessage");
return;
}
@@ -61,8 +81,23 @@ void MessagePort::PostMessage(gin::Arguments* args) {
v8::Local<v8::Value> transferables;
std::vector<gin::Handle<MessagePort>> wrapped_ports;
if (args->GetNext(&transferables)) {
std::vector<v8::Local<v8::Value>> wrapped_port_values;
if (!gin::ConvertFromV8(args->isolate(), transferables,
&wrapped_port_values)) {
thrower.ThrowTypeError("transferables must be an array of MessagePorts");
return;
}
for (unsigned i = 0; i < wrapped_port_values.size(); ++i) {
if (!IsValidWrappable(wrapped_port_values[i])) {
thrower.ThrowTypeError("Port at index " + base::NumberToString(i) +
" is not a valid port");
return;
}
}
if (!gin::ConvertFromV8(args->isolate(), transferables, &wrapped_ports)) {
args->ThrowError();
thrower.ThrowTypeError("Passed an invalid MessagePort");
return;
}
}
@@ -70,9 +105,8 @@ void MessagePort::PostMessage(gin::Arguments* args) {
// Make sure we aren't connected to any of the passed-in ports.
for (unsigned i = 0; i < wrapped_ports.size(); ++i) {
if (wrapped_ports[i].get() == this) {
gin_helper::ErrorThrower(args->isolate())
.ThrowError("Port at index " + base::NumberToString(i) +
" contains the source port.");
thrower.ThrowError("Port at index " + base::NumberToString(i) +
" contains the source port.");
return;
}
}

View File

@@ -27,8 +27,6 @@ namespace electron {
namespace {
const int kMaxScanRetries = 5;
void OnDeviceChosen(const content::BluetoothChooser::EventHandler& handler,
const std::string& device_id) {
if (device_id.empty()) {
@@ -66,29 +64,15 @@ void BluetoothChooser::SetAdapterPresence(AdapterPresence presence) {
}
void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
bool idle_state = false;
switch (state) {
case DiscoveryState::FAILED_TO_START:
refreshing_ = false;
event_handler_.Run(content::BluetoothChooserEvent::CANCELLED, "");
break;
return;
case DiscoveryState::IDLE:
refreshing_ = false;
if (device_map_.empty()) {
auto event = ++num_retries_ > kMaxScanRetries
? content::BluetoothChooserEvent::CANCELLED
: content::BluetoothChooserEvent::RESCAN;
event_handler_.Run(event, "");
} else {
bool prevent_default = api_web_contents_->Emit(
"select-bluetooth-device", GetDeviceList(),
base::BindOnce(&OnDeviceChosen, event_handler_));
if (!prevent_default) {
auto it = device_map_.begin();
auto device_id = it->first;
event_handler_.Run(content::BluetoothChooserEvent::SELECTED,
device_id);
}
}
idle_state = true;
break;
case DiscoveryState::DISCOVERING:
// The first time this state fires is due to a rescan triggering so set a
@@ -101,6 +85,18 @@ void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
}
break;
}
bool prevent_default =
api_web_contents_->Emit("select-bluetooth-device", GetDeviceList(),
base::BindOnce(&OnDeviceChosen, event_handler_));
if (!prevent_default && idle_state) {
if (device_map_.empty()) {
event_handler_.Run(content::BluetoothChooserEvent::CANCELLED, "");
} else {
auto it = device_map_.begin();
auto device_id = it->first;
event_handler_.Run(content::BluetoothChooserEvent::SELECTED, device_id);
}
}
}
void BluetoothChooser::AddOrUpdateDevice(const std::string& device_id,

View File

@@ -44,7 +44,6 @@ class BluetoothChooser : public content::BluetoothChooser {
std::map<std::string, std::u16string> device_map_;
api::WebContents* api_web_contents_;
EventHandler event_handler_;
int num_retries_ = 0;
bool refreshing_ = false;
bool rescan_ = false;
};

View File

@@ -96,9 +96,9 @@ bool IsPlainObject(const v8::Local<v8::Value>& object) {
object->IsWeakMap() || object->IsWeakSet() ||
object->IsArrayBuffer() || object->IsArrayBufferView() ||
object->IsArray() || object->IsDataView() ||
object->IsSharedArrayBuffer() || object->IsProxy() ||
object->IsSharedArrayBuffer() || object->IsGeneratorObject() ||
object->IsWasmModuleObject() || object->IsWasmMemoryObject() ||
object->IsModuleNamespaceObject());
object->IsModuleNamespaceObject() || object->IsProxy());
}
bool IsPlainArray(const v8::Local<v8::Value>& arr) {

View File

@@ -357,6 +357,31 @@ describe('ipc module', () => {
expect(port2).not.to.be.null();
});
it('throws an error when an invalid parameter is sent to postMessage', () => {
const { port1 } = new MessageChannelMain();
expect(() => {
const buffer = new ArrayBuffer(10) as any;
port1.postMessage(null, [buffer]);
}).to.throw(/Port at index 0 is not a valid port/);
expect(() => {
port1.postMessage(null, ['1' as any]);
}).to.throw(/Port at index 0 is not a valid port/);
expect(() => {
port1.postMessage(null, [new Date() as any]);
}).to.throw(/Port at index 0 is not a valid port/);
});
it('throws when postMessage transferables contains the source port', () => {
const { port1 } = new MessageChannelMain();
expect(() => {
port1.postMessage(null, [port1]);
}).to.throw(/Port at index 0 contains the source port./);
});
it('can send messages within the process', async () => {
const { port1, port2 } = new MessageChannelMain();
port2.postMessage('hello');
@@ -425,7 +450,7 @@ describe('ipc module', () => {
const { port1 } = new MessageChannelMain();
expect(() => {
port1.postMessage(null, [null] as any);
}).to.throw(/conversion failure/);
}).to.throw(/Port at index 0 is not a valid port/);
});
it('throws when passing duplicate ports', () => {

View File

@@ -332,9 +332,6 @@ ipcMain.on('online-status-changed', (event: any, status: any) => {
console.log(status)
})
// Synopsis
// https://github.com/electron/electron/blob/master/docs/api/synopsis.md
app.whenReady().then(() => {
window = new BrowserWindow({
width: 800,