chore: strip trailing whitespace (#35969)

This commit is contained in:
Milan Burda 2023-02-01 12:59:16 +01:00 committed by GitHub
parent dbdbb6fb3b
commit fd761ec8f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 91 additions and 94 deletions

View file

@ -13,7 +13,7 @@ parameters:
run-docs-only: run-docs-only:
type: boolean type: boolean
default: false default: false
upload-to-storage: upload-to-storage:
type: string type: string
default: '1' default: '1'

View file

@ -4,7 +4,7 @@ parameters:
run-docs-only: run-docs-only:
type: boolean type: boolean
default: false default: false
upload-to-storage: upload-to-storage:
type: string type: string
default: '1' default: '1'
@ -141,7 +141,7 @@ env-mas-apple-silicon: &env-mas-apple-silicon
env-send-slack-notifications: &env-send-slack-notifications env-send-slack-notifications: &env-send-slack-notifications
NOTIFY_SLACK: true NOTIFY_SLACK: true
env-global: &env-global env-global: &env-global
ELECTRON_OUT_DIR: Default ELECTRON_OUT_DIR: Default
@ -694,7 +694,7 @@ step-show-goma-stats: &step-show-goma-stats
run: run:
shell: /bin/bash shell: /bin/bash
name: Check goma stats after build name: Check goma stats after build
command: | command: |
set +e set +e
set +o pipefail set +o pipefail
$LOCAL_GOMA_DIR/goma_ctl.py stat $LOCAL_GOMA_DIR/goma_ctl.py stat
@ -798,7 +798,7 @@ step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
elif [ "$TARGET_ARCH" == "arm64" ]; then elif [ "$TARGET_ARCH" == "arm64" ]; then
export MKSNAPSHOT_PATH="clang_x64_v8_arm64" export MKSNAPSHOT_PATH="clang_x64_v8_arm64"
fi fi
cp "out/Default/$MKSNAPSHOT_PATH/mksnapshot" out/Default cp "out/Default/$MKSNAPSHOT_PATH/mksnapshot" out/Default
cp "out/Default/$MKSNAPSHOT_PATH/v8_context_snapshot_generator" out/Default cp "out/Default/$MKSNAPSHOT_PATH/v8_context_snapshot_generator" out/Default
if [ "`uname`" == "Linux" ]; then if [ "`uname`" == "Linux" ]; then
cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.so" out/Default cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.so" out/Default
@ -1012,7 +1012,7 @@ commands:
else else
echo 'Using Python install from cache' echo 'Using Python install from cache'
fi fi
sudo installer -pkg python-downloads/python-2.7.18-macosx10.9.pkg -target / sudo installer -pkg python-downloads/python-2.7.18-macosx10.9.pkg -target /
fi fi
- save_cache: - save_cache:
paths: paths:
@ -1420,7 +1420,7 @@ commands:
artifact-key: << parameters.artifact-key >> artifact-key: << parameters.artifact-key >>
build-nonproprietary-ffmpeg: << parameters.build-nonproprietary-ffmpeg >> build-nonproprietary-ffmpeg: << parameters.build-nonproprietary-ffmpeg >>
- steps: << parameters.after-build-and-save >> - steps: << parameters.after-build-and-save >>
# Save all data needed for a further tests run. # Save all data needed for a further tests run.
- when: - when:
condition: << parameters.persist >> condition: << parameters.persist >>
@ -2124,7 +2124,7 @@ jobs:
- electron-tests: - electron-tests:
artifact-key: darwin-x64 artifact-key: darwin-x64
darwin-testing-arm64-tests: darwin-testing-arm64-tests:
executor: apple-silicon executor: apple-silicon
environment: environment:
<<: *env-mac-large <<: *env-mac-large
@ -2239,9 +2239,9 @@ workflows:
filters: filters:
branches: branches:
# Do not run this on forked pull requests # Do not run this on forked pull requests
ignore: /pull\/[0-9]+/ ignore: /pull\/[0-9]+/
requires: requires:
- linux-arm-testing - linux-arm-testing
- linux-arm64-testing: - linux-arm64-testing:
requires: requires:
- linux-make-src-cache - linux-make-src-cache
@ -2249,7 +2249,7 @@ workflows:
filters: filters:
branches: branches:
# Do not run this on forked pull requests # Do not run this on forked pull requests
ignore: /pull\/[0-9]+/ ignore: /pull\/[0-9]+/
requires: requires:
- linux-arm64-testing - linux-arm64-testing
- linux-arm64-testing-gn-check: - linux-arm64-testing-gn-check:

View file

@ -7,9 +7,9 @@ services:
volumes: volumes:
- ..:/workspaces/gclient/src/electron:cached - ..:/workspaces/gclient/src/electron:cached
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
command: /bin/sh -c "while sleep 1000; do :; done" command: /bin/sh -c "while sleep 1000; do :; done"
user: builduser user: builduser

View file

@ -19,7 +19,7 @@ body:
label: Electron Version label: Electron Version
description: | description: |
What version of Electron are you using? What version of Electron are you using?
Note: Please only report issues for [currently supported versions of Electron](https://www.electronjs.org/docs/latest/tutorial/support#currently-supported-versions). Note: Please only report issues for [currently supported versions of Electron](https://www.electronjs.org/docs/latest/tutorial/support#currently-supported-versions).
placeholder: 17.0.0 placeholder: 17.0.0
validations: validations:

View file

@ -29,7 +29,7 @@ body:
- type: textarea - type: textarea
attributes: attributes:
label: Alternatives Considered label: Alternatives Considered
description: A clear and concise description of any alternative solutions or features you've considered. description: A clear and concise description of any alternative solutions or features you've considered.
validations: validations:
required: true required: true
- type: textarea - type: textarea

View file

@ -23,6 +23,6 @@ jobs:
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small test cases and makes it easy to publish your test case to a [gist](https://gist.github.com) that Electron maintainers can use. Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small test cases and makes it easy to publish your test case to a [gist](https://gist.github.com) that Electron maintainers can use.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
Now adding the `blocked/need-repro` label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed. Now adding the `blocked/need-repro` label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

View file

@ -18,7 +18,7 @@ environment:
PYTHONIOENCODING: UTF-8 PYTHONIOENCODING: UTF-8
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP before bake begins # Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP before bake begins
# install: # install:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
build_script: build_script:
# Uncomment/change the following line if the hard drive/partition size needs to change # Uncomment/change the following line if the hard drive/partition size needs to change
# - ps: Resize-Partition -DriveLetter C -Size (256GB) # ensure initial partition size # - ps: Resize-Partition -DriveLetter C -Size (256GB) # ensure initial partition size
@ -28,8 +28,8 @@ build_script:
if (-not (Test-Path -Path .\src)) { if (-not (Test-Path -Path .\src)) {
New-Item -Path .\src -ItemType Directory New-Item -Path .\src -ItemType Directory
} }
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git - ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH" - ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- update_depot_tools.bat - update_depot_tools.bat
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron - ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
# Uncomment the following line if windows deps change # Uncomment the following line if windows deps change

View file

@ -1,5 +1,5 @@
# NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor.yml # NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor.yml
# IF APPLICABLE!!!! # IF APPLICABLE!!!!
# #
# #
# The config expects the following environment variables to be set: # The config expects the following environment variables to be set:
@ -119,7 +119,7 @@ for:
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] " $env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
} }
- gclient config --name "src\electron" --unmanaged %GCLIENT_EXTRA_ARGS% "https://github.com/electron/electron" - gclient config --name "src\electron" --unmanaged %GCLIENT_EXTRA_ARGS% "https://github.com/electron/electron"
# Patches are applied in the image bake. Check depshash to see if patches have changed. # Patches are applied in the image bake. Check depshash to see if patches have changed.
- ps: $env:RUN_GCLIENT_SYNC="false" - ps: $env:RUN_GCLIENT_SYNC="false"
- ps: $depshash_baked = Get-Content .\src\.depshash -Raw - ps: $depshash_baked = Get-Content .\src\.depshash -Raw
- ps: cd src\electron - ps: cd src\electron
@ -261,7 +261,7 @@ for:
cd src cd src
New-Item .\out\Default\gen\node_headers\Release -Type directory New-Item .\out\Default\gen\node_headers\Release -Type directory
Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
- set npm_config_nodedir=%cd%\out\Default\gen\node_headers - set npm_config_nodedir=%cd%\out\Default\gen\node_headers
- set npm_config_arch=arm64 - set npm_config_arch=arm64
- cd electron - cd electron
# Explicitly set npm_config_arch because the .env doesn't persist # Explicitly set npm_config_arch because the .env doesn't persist
@ -272,7 +272,7 @@ for:
- echo Running main test suite & node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion - echo Running main test suite & node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion
- cd .. - cd ..
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg - echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
on_finish: on_finish:
# Uncomment these lines to enable RDP # Uncomment these lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

View file

@ -1,5 +1,5 @@
# NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor-woa.yml # NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor-woa.yml
# IF APPLICABLE!!!! # IF APPLICABLE!!!!
# #
# #
# The config expects the following environment variables to be set: # The config expects the following environment variables to be set:
@ -117,7 +117,7 @@ for:
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] " $env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
} }
- gclient config --name "src\electron" --unmanaged %GCLIENT_EXTRA_ARGS% "https://github.com/electron/electron" - gclient config --name "src\electron" --unmanaged %GCLIENT_EXTRA_ARGS% "https://github.com/electron/electron"
# Patches are applied in the image bake. Check depshash to see if patches have changed. # Patches are applied in the image bake. Check depshash to see if patches have changed.
- ps: $env:RUN_GCLIENT_SYNC="false" - ps: $env:RUN_GCLIENT_SYNC="false"
- ps: $depshash_baked = Get-Content .\src\.depshash -Raw - ps: $depshash_baked = Get-Content .\src\.depshash -Raw
- ps: cd src\electron - ps: cd src\electron
@ -272,7 +272,7 @@ for:
- echo "Done verifying mksnapshot" - echo "Done verifying mksnapshot"
- echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% - echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd%
- echo "Done verifying chromedriver" - echo "Done verifying chromedriver"
on_finish: on_finish:
# Uncomment these lines to enable RDP # Uncomment these lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

View file

@ -9,7 +9,7 @@
</head> </head>
<body> <body>
<h1>Hello World!</h1> <h1>Hello World!</h1>
<p>Hit any key with this window focused to see it captured here.</p> <p>Hit any key with this window focused to see it captured here.</p>
<div><span>Last Key Pressed: </span><span id="last-keypress"></span></div> <div><span>Last Key Pressed: </span><span id="last-keypress"></span></div>
<script src="./renderer.js"></script> <script src="./renderer.js"></script>

View file

@ -19,7 +19,7 @@ function createWindow () {
// Some APIs can only be used after this event occurs. // Some APIs can only be used after this event occurs.
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the // On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open. // dock icon is clicked and there are no other windows open.

View file

@ -7,7 +7,7 @@
</head> </head>
<body> <body>
<h1>Connection status: <strong id='status'></strong></h1> <h1>Connection status: <strong id='status'></strong></h1>
<script src="renderer.js"></script> <script src="renderer.js"></script>
</body> </body>
</html> </html>

View file

@ -7,14 +7,14 @@ function createWindow () {
height: 600, height: 600,
webPreferences: { webPreferences: {
preload: path.join(__dirname, 'preload.js') preload: path.join(__dirname, 'preload.js')
} }
}) })
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => { mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
event.preventDefault() event.preventDefault()
if (deviceList && deviceList.length > 0) { if (deviceList && deviceList.length > 0) {
callback(deviceList[0].deviceId) callback(deviceList[0].deviceId)
} }
}) })
// Listen for a message from the renderer to get the response for the Bluetooth pairing. // Listen for a message from the renderer to get the response for the Bluetooth pairing.
@ -27,14 +27,14 @@ function createWindow () {
bluetoothPinCallback = callback bluetoothPinCallback = callback
// Send a message to the renderer to prompt the user to confirm the pairing. // Send a message to the renderer to prompt the user to confirm the pairing.
mainWindow.webContents.send('bluetooth-pairing-request', details) mainWindow.webContents.send('bluetooth-pairing-request', details)
}) })
mainWindow.loadFile('index.html') mainWindow.loadFile('index.html')
} }
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow()
}) })

View file

@ -9,7 +9,7 @@ document.getElementById('clickme').addEventListener('click',testIt)
window.electronAPI.bluetoothPairingRequest((event, details) => { window.electronAPI.bluetoothPairingRequest((event, details) => {
const response = {} const response = {}
switch (details.pairingKind) { switch (details.pairingKind) {
case 'confirm': { case 'confirm': {
response.confirmed = confirm(`Do you want to connect to device ${details.deviceId}?`) response.confirmed = confirm(`Do you want to connect to device ${details.deviceId}?`)

View file

@ -12,7 +12,7 @@
<h3>HID devices automatically granted access via <i>setDevicePermissionHandler</i></h3> <h3>HID devices automatically granted access via <i>setDevicePermissionHandler</i></h3>
<div id="granted-devices"></div> <div id="granted-devices"></div>
<h3>HID devices automatically granted access via <i>select-hid-device</i></h3> <h3>HID devices automatically granted access via <i>select-hid-device</i></h3>
<div id="granted-devices2"></div> <div id="granted-devices2"></div>

View file

@ -6,16 +6,16 @@ function createWindow () {
width: 800, width: 800,
height: 600 height: 600
}) })
mainWindow.webContents.session.on('select-hid-device', (event, details, callback) => { mainWindow.webContents.session.on('select-hid-device', (event, details, callback) => {
//Add events to handle devices being added or removed before the callback on //Add events to handle devices being added or removed before the callback on
//`select-hid-device` is called. //`select-hid-device` is called.
mainWindow.webContents.session.on('hid-device-added', (event, device) => { mainWindow.webContents.session.on('hid-device-added', (event, device) => {
console.log('hid-device-added FIRED WITH', device) console.log('hid-device-added FIRED WITH', device)
//Optionally update details.deviceList //Optionally update details.deviceList
}) })
mainWindow.webContents.session.on('hid-device-removed', (event, device) => { mainWindow.webContents.session.on('hid-device-removed', (event, device) => {
console.log('hid-device-removed FIRED WITH', device) console.log('hid-device-removed FIRED WITH', device)
//Optionally update details.deviceList //Optionally update details.deviceList
}) })
@ -37,13 +37,13 @@ function createWindow () {
return true return true
} }
}) })
mainWindow.loadFile('index.html') mainWindow.loadFile('index.html')
} }
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow()
}) })

View file

@ -6,7 +6,7 @@ function createWindow () {
width: 800, width: 800,
height: 600 height: 600
}) })
mainWindow.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => { mainWindow.webContents.session.on('select-serial-port', (event, portList, webContents, callback) => {
//Add listeners to handle ports being added or removed before the callback for `select-serial-port` //Add listeners to handle ports being added or removed before the callback for `select-serial-port`
@ -15,7 +15,7 @@ function createWindow () {
console.log('serial-port-added FIRED WITH', port) console.log('serial-port-added FIRED WITH', port)
//Optionally update portList to add the new port //Optionally update portList to add the new port
}) })
mainWindow.webContents.session.on('serial-port-removed', (event, port) => { mainWindow.webContents.session.on('serial-port-removed', (event, port) => {
console.log('serial-port-removed FIRED WITH', port) console.log('serial-port-removed FIRED WITH', port)
//Optionally update portList to remove the port //Optionally update portList to remove the port
@ -33,7 +33,7 @@ function createWindow () {
if (permission === 'serial' && details.securityOrigin === 'file:///') { if (permission === 'serial' && details.securityOrigin === 'file:///') {
return true return true
} }
return false return false
}) })
@ -41,10 +41,10 @@ function createWindow () {
if (details.deviceType === 'serial' && details.origin === 'file://') { if (details.deviceType === 'serial' && details.origin === 'file://') {
return true return true
} }
return false return false
}) })
mainWindow.loadFile('index.html') mainWindow.loadFile('index.html')
mainWindow.webContents.openDevTools() mainWindow.webContents.openDevTools()
@ -52,7 +52,7 @@ function createWindow () {
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow()
}) })

View file

@ -12,7 +12,7 @@
<h3>USB devices automatically granted access via <i>setDevicePermissionHandler</i></h3> <h3>USB devices automatically granted access via <i>setDevicePermissionHandler</i></h3>
<div id="granted-devices"></div> <div id="granted-devices"></div>
<h3>USB devices automatically granted access via <i>select-usb-device</i></h3> <h3>USB devices automatically granted access via <i>select-usb-device</i></h3>
<div id="granted-devices2"></div> <div id="granted-devices2"></div>

View file

@ -7,17 +7,17 @@ function createWindow () {
width: 800, width: 800,
height: 600 height: 600
}) })
let grantedDeviceThroughPermHandler let grantedDeviceThroughPermHandler
mainWindow.webContents.session.on('select-usb-device', (event, details, callback) => { mainWindow.webContents.session.on('select-usb-device', (event, details, callback) => {
//Add events to handle devices being added or removed before the callback on //Add events to handle devices being added or removed before the callback on
//`select-usb-device` is called. //`select-usb-device` is called.
mainWindow.webContents.session.on('usb-device-added', (event, device) => { mainWindow.webContents.session.on('usb-device-added', (event, device) => {
console.log('usb-device-added FIRED WITH', device) console.log('usb-device-added FIRED WITH', device)
//Optionally update details.deviceList //Optionally update details.deviceList
}) })
mainWindow.webContents.session.on('usb-device-removed', (event, device) => { mainWindow.webContents.session.on('usb-device-removed', (event, device) => {
console.log('usb-device-removed FIRED WITH', device) console.log('usb-device-removed FIRED WITH', device)
//Optionally update details.deviceList //Optionally update details.deviceList
@ -31,7 +31,7 @@ function createWindow () {
} }
}) })
if (deviceToReturn) { if (deviceToReturn) {
callback(deviceToReturn.deviceId) callback(deviceToReturn.deviceId)
} else { } else {
callback() callback()
} }
@ -44,10 +44,10 @@ function createWindow () {
} }
}) })
mainWindow.webContents.session.setDevicePermissionHandler((details) => { mainWindow.webContents.session.setDevicePermissionHandler((details) => {
if (details.deviceType === 'usb' && details.origin === 'file://') { if (details.deviceType === 'usb' && details.origin === 'file://') {
if (!grantedDeviceThroughPermHandler) { if (!grantedDeviceThroughPermHandler) {
grantedDeviceThroughPermHandler = details.device grantedDeviceThroughPermHandler = details.device
return true return true
} else { } else {
@ -55,13 +55,13 @@ function createWindow () {
} }
} }
}) })
mainWindow.loadFile('index.html') mainWindow.loadFile('index.html')
} }
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow()
}) })

View file

@ -6,10 +6,10 @@ async function testIt() {
const noDevicesFoundMsg = 'No devices found' const noDevicesFoundMsg = 'No devices found'
const grantedDevices = await navigator.usb.getDevices() const grantedDevices = await navigator.usb.getDevices()
let grantedDeviceList = '' let grantedDeviceList = ''
if (grantedDevices.length > 0) { if (grantedDevices.length > 0) {
grantedDevices.forEach(device => { grantedDevices.forEach(device => {
grantedDeviceList += `<hr>${getDeviceDetails(device)}</hr>` grantedDeviceList += `<hr>${getDeviceDetails(device)}</hr>`
}) })
} else { } else {
grantedDeviceList = noDevicesFoundMsg grantedDeviceList = noDevicesFoundMsg
} }
@ -21,7 +21,7 @@ async function testIt() {
filters: [] filters: []
}) })
grantedDeviceList += `<hr>${getDeviceDetails(device)}</hr>` grantedDeviceList += `<hr>${getDeviceDetails(device)}</hr>`
} catch (ex) { } catch (ex) {
if (ex.name === 'NotFoundError') { if (ex.name === 'NotFoundError') {
grantedDeviceList = noDevicesFoundMsg grantedDeviceList = noDevicesFoundMsg

View file

@ -19,7 +19,7 @@ function createWindow () {
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow()
}) })

View file

@ -37,7 +37,7 @@ app.whenReady().then(() => {
console.log(value) // will print value to Node console console.log(value) // will print value to Node console
}) })
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow()
}) })

View file

@ -28,7 +28,7 @@
const exLinksBtn = document.getElementById('open-ex-links') const exLinksBtn = document.getElementById('open-ex-links')
exLinksBtn.addEventListener('click', (event) => { exLinksBtn.addEventListener('click', (event) => {
shell.openExternal('https://electronjs.org') shell.openExternal('https://electronjs.org')
}) })
</code></pre> </code></pre>
<div class="demo-protip"> <div class="demo-protip">

View file

@ -6,7 +6,7 @@
</head> </head>
<body> <body>
<div> <div>
<h1> <h1>
Open external links and the file manager Open external links and the file manager
</h1> </h1>
<h3> <h3>

View file

@ -14,7 +14,7 @@
<p> <p>
Electron conveniently allows developers to send notifications with the Electron conveniently allows developers to send notifications with the
<a href="https://notifications.spec.whatwg.org/">HTML5 Notification API</a>, <a href="https://notifications.spec.whatwg.org/">HTML5 Notification API</a>,
using the currently running operating systems native notification using the currently running operating systems native notification
APIs to display it. APIs to display it.
</p> </p>

View file

@ -27,7 +27,7 @@ ipcMain.handle('clipboard:writeText', (event, text) => {
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow()
}) })

View file

@ -31,7 +31,7 @@ ipcMain.handle('clipboard:writeText', (event, text) => {
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
app.on('activate', function () { app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createWindow()
}) })

View file

@ -23,7 +23,7 @@ if (!gotTheLock) {
if (mainWindow.isMinimized()) mainWindow.restore() if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.focus() mainWindow.focus()
} }
dialog.showErrorBox('Welcome Back', `You arrived from: ${commandLine.pop().slice(0,-1)}`) dialog.showErrorBox('Welcome Back', `You arrived from: ${commandLine.pop().slice(0,-1)}`)
}) })
@ -31,7 +31,7 @@ if (!gotTheLock) {
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createWindow()
}) })
app.on('open-url', (event, url) => { app.on('open-url', (event, url) => {
dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`) dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`)
}) })

View file

@ -23,4 +23,4 @@
require('./renderer.js') require('./renderer.js')
</script> </script>
</body> </body>
</html> </html>

View file

@ -10,7 +10,7 @@
<i>Supports: Win, macOS, Linux <span>|</span> Process: Main</i> <i>Supports: Win, macOS, Linux <span>|</span> Process: Main</i>
<div> <div>
<p>A frameless window is a window that has no <i>"chrome"</i>, <p>A frameless window is a window that has no <i>"chrome"</i>,
such as toolbars, title bars, status bars, borders, etc. You can make such as toolbars, title bars, status bars, borders, etc. You can make
a browser window frameless by setting a browser window frameless by setting
<code>frame</code> to <code>false</code> when creating the window.</p> <code>frame</code> to <code>false</code> when creating the window.</p>
<div> <div>

View file

@ -17,7 +17,7 @@ def copy_debug_from_binaries(directory, out_dir, target_cpu, compress):
def copy_debug_from_binary(binary_path, out_dir, target_cpu, compress): def copy_debug_from_binary(binary_path, out_dir, target_cpu, compress):
if PLATFORM == 'linux' and target_cpu in ('x86', 'arm', 'arm64'): if PLATFORM == 'linux' and target_cpu in ('x86', 'arm', 'arm64'):
# Skip because no objcopy binary on the given target. # Skip because no objcopy binary on the given target.
return return
debug_name = get_debug_name(binary_path) debug_name = get_debug_name(binary_path)
cmd = ['objcopy', '--only-keep-debug'] cmd = ['objcopy', '--only-keep-debug']
if compress: if compress:

View file

@ -58,7 +58,7 @@ def upload_node(version):
elif get_target_arch() == 'arm64': elif get_target_arch() == 'arm64':
node_lib = os.path.join(DIST_DIR, 'arm64', 'node.lib') node_lib = os.path.join(DIST_DIR, 'arm64', 'node.lib')
iojs_lib = os.path.join(DIST_DIR, 'win-arm64', 'iojs.lib') iojs_lib = os.path.join(DIST_DIR, 'win-arm64', 'iojs.lib')
v4_node_lib = os.path.join(DIST_DIR, 'win-arm64', 'node.lib') v4_node_lib = os.path.join(DIST_DIR, 'win-arm64', 'node.lib')
else: else:
node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib') node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib')
iojs_lib = os.path.join(DIST_DIR, 'win-x64', 'iojs.lib') iojs_lib = os.path.join(DIST_DIR, 'win-x64', 'iojs.lib')

View file

@ -93,7 +93,7 @@ def main():
dsym_snapshot_zip = os.path.join(OUT_DIR, DSYM_SNAPSHOT_NAME) dsym_snapshot_zip = os.path.join(OUT_DIR, DSYM_SNAPSHOT_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'dsym-snapshot.zip'), dsym_snapshot_zip) shutil.copy2(os.path.join(OUT_DIR, 'dsym-snapshot.zip'), dsym_snapshot_zip)
upload_electron(release, dsym_snapshot_zip, args) upload_electron(release, dsym_snapshot_zip, args)
elif PLATFORM == 'win32': elif PLATFORM == 'win32':
pdb_zip = os.path.join(OUT_DIR, PDB_NAME) pdb_zip = os.path.join(OUT_DIR, PDB_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'pdb.zip'), pdb_zip) shutil.copy2(os.path.join(OUT_DIR, 'pdb.zip'), pdb_zip)

View file

@ -20,7 +20,7 @@ function parseCommandLine () {
--bump=patch to increment patch version\n --bump=patch to increment patch version\n
--version={version} to set version number directly\n --version={version} to set version number directly\n
--dryRun to print the next version without updating files --dryRun to print the next version without updating files
Note that you can use both --bump and --stable simultaneously. Note that you can use both --bump and --stable simultaneously.
`); `);
process.exit(0); process.exit(0);
} }

View file

@ -1,10 +1,10 @@
param([string]$gomaDir=$PWD) param([string]$gomaDir=$PWD)
$cmdPath = Join-Path -Path $gomaDir -ChildPath "goma_ctl.py" $cmdPath = Join-Path -Path $gomaDir -ChildPath "goma_ctl.py"
Start-Process -FilePath cmd -ArgumentList "/C", "python", "$cmdPath", "ensure_start" Start-Process -FilePath cmd -ArgumentList "/C", "python", "$cmdPath", "ensure_start"
$timedOut = $false; $waitTime = 0; $waitIncrement = 5; $timeout=120; $timedOut = $false; $waitTime = 0; $waitIncrement = 5; $timeout=120;
Do { sleep $waitIncrement; $timedOut = (($waitTime+=$waitIncrement) -gt $timeout); iex "$gomaDir\gomacc.exe port 2" > $null; } Until(($LASTEXITCODE -eq 0) -or $timedOut) Do { sleep $waitIncrement; $timedOut = (($waitTime+=$waitIncrement) -gt $timeout); iex "$gomaDir\gomacc.exe port 2" > $null; } Until(($LASTEXITCODE -eq 0) -or $timedOut)
if ($timedOut) { if ($timedOut) {
write-error 'Timed out waiting for goma to start'; exit 1; write-error 'Timed out waiting for goma to start'; exit 1;
} else { } else {
Write-Output "Successfully started goma!" Write-Output "Successfully started goma!"
} }

View file

@ -28,7 +28,7 @@
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string>AtomApplication</string> <string>AtomApplication</string>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>

View file

@ -76,7 +76,7 @@ describe('contextBridge', () => {
const gc=require('vm').runInNewContext('gc'); const gc=require('vm').runInNewContext('gc');
renderer_1.webFrame.setIsolatedWorldInfo(${worldId}, { renderer_1.webFrame.setIsolatedWorldInfo(${worldId}, {
name: "Isolated World" name: "Isolated World"
}); });
renderer_1.contextBridge.exposeInIsolatedWorld(${worldId}, 'GCRunner', { renderer_1.contextBridge.exposeInIsolatedWorld(${worldId}, 'GCRunner', {
run: () => gc() run: () => gc()
});`} });`}

View file

@ -74,7 +74,7 @@ describe('ipcRenderer module', () => {
it('can send objects that both reference the same object', async () => { it('can send objects that both reference the same object', async () => {
w.webContents.executeJavaScript(`{ w.webContents.executeJavaScript(`{
const { ipcRenderer } = require('electron') const { ipcRenderer } = require('electron')
const child = { hello: 'world' } const child = { hello: 'world' }
const foo = { name: 'foo', child: child } const foo = { name: 'foo', child: child }
const bar = { name: 'bar', child: child } const bar = { name: 'bar', child: child }

View file

@ -163,7 +163,7 @@ describe('asar package', function () {
fs = require('fs') fs = require('fs')
path = require('path') path = require('path')
asarDir = ${JSON.stringify(asarDir)} asarDir = ${JSON.stringify(asarDir)}
// This is used instead of util.promisify for some tests to dodge the // This is used instead of util.promisify for some tests to dodge the
// util.promisify.custom behavior. // util.promisify.custom behavior.
promisify = (f) => { promisify = (f) => {
@ -174,7 +174,7 @@ describe('asar package', function () {
}) })
}) })
} }
null null
` `
}); });

View file

@ -10,5 +10,4 @@
} }
], ],
"manifest_version": 2 "manifest_version": 2
} }

View file

@ -10,5 +10,4 @@
} }
], ],
"manifest_version": 2 "manifest_version": 2
} }

View file

@ -10,5 +10,4 @@
} }
], ],
"manifest_version": 2 "manifest_version": 2
} }

View file

@ -55,7 +55,7 @@
const {x, y, width, height} = navigator.windowControlsOverlay.getTitlebarAreaRect(); const {x, y, width, height} = navigator.windowControlsOverlay.getTitlebarAreaRect();
ipcRenderer.send('geometrychange', {x, y, width, height}); ipcRenderer.send('geometrychange', {x, y, width, height});
}; };
</script> </script>
<div id="titleBarContainer"> <div id="titleBarContainer">
<div id="titleBar" class=" draggable"> <div id="titleBar" class=" draggable">
<span class="draggable">Title goes here</span> <span class="draggable">Title goes here</span>
@ -76,7 +76,7 @@
} }
function getJSOverlayProperties() { function getJSOverlayProperties() {
const {x, y, width, height} = navigator.windowControlsOverlay.getTitlebarAreaRect(); const {x, y, width, height} = navigator.windowControlsOverlay.getTitlebarAreaRect();
return {x, y, width, height}; return {x, y, width, height};
} }
</script> </script>

View file

@ -1,6 +1,6 @@
<script> <script>
const ipcRenderer = require('electron').ipcRenderer; const ipcRenderer = require('electron').ipcRenderer;
let search = (new URL(document.location)).search; let search = (new URL(document.location)).search;
async function testIt() { async function testIt() {
if (search === '?clearBadge') { if (search === '?clearBadge') {