mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
495 Commits
test/nativ
...
ensure_boo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0be6d43f4c | ||
|
|
e0ea069859 | ||
|
|
7cc76c094a | ||
|
|
3660432f42 | ||
|
|
687e50b4f3 | ||
|
|
d426667a01 | ||
|
|
208bbc0504 | ||
|
|
e2f496cfbc | ||
|
|
1da150f9a3 | ||
|
|
5dd6481e53 | ||
|
|
d72e622a3f | ||
|
|
8efd24c339 | ||
|
|
dc34e8732c | ||
|
|
77c58658c5 | ||
|
|
d720aea700 | ||
|
|
e2bcd8f0aa | ||
|
|
99a3e360ec | ||
|
|
883f48b9b4 | ||
|
|
9a7b73b533 | ||
|
|
6170a5af40 | ||
|
|
d65a856bf3 | ||
|
|
f2639d13cc | ||
|
|
11fa915724 | ||
|
|
9aacc473e6 | ||
|
|
c218128675 | ||
|
|
e3e647d21e | ||
|
|
7ab032f594 | ||
|
|
2493e530d0 | ||
|
|
10e4f9ad37 | ||
|
|
b9f0aebb2f | ||
|
|
8ecd731e96 | ||
|
|
75cf8ea96d | ||
|
|
376634c75a | ||
|
|
8e8d3a4f3e | ||
|
|
2cbd968da5 | ||
|
|
aea7b4ae8c | ||
|
|
9f8a629126 | ||
|
|
d4ca829069 | ||
|
|
54a6bbb4cb | ||
|
|
24f1f7ed57 | ||
|
|
153dae5b48 | ||
|
|
580fa57a29 | ||
|
|
37639b5400 | ||
|
|
a8695d4387 | ||
|
|
924a8da940 | ||
|
|
c16ea8d54e | ||
|
|
b7ae162716 | ||
|
|
e876cecbc7 | ||
|
|
c4ac192aa4 | ||
|
|
8308ac29c8 | ||
|
|
206544cbc0 | ||
|
|
a5ec3f7476 | ||
|
|
be399f2fee | ||
|
|
b90de7d07e | ||
|
|
9460300506 | ||
|
|
3362db0655 | ||
|
|
2e2776611f | ||
|
|
1f4f1b4afc | ||
|
|
cb445b3bbd | ||
|
|
91626a8eac | ||
|
|
5390728cb7 | ||
|
|
074b9344b5 | ||
|
|
3faddd5ae2 | ||
|
|
7153008bfa | ||
|
|
f6b297a06a | ||
|
|
ede84fc327 | ||
|
|
2b07e6450c | ||
|
|
63114e2b8e | ||
|
|
df4564dc39 | ||
|
|
4f89c31956 | ||
|
|
25d77fd1ce | ||
|
|
d842d17ff3 | ||
|
|
ecd745305e | ||
|
|
2734088d20 | ||
|
|
4641bc9619 | ||
|
|
3f3c297c7a | ||
|
|
062d3a6168 | ||
|
|
f2240e07f0 | ||
|
|
0c103f390c | ||
|
|
27f6adf8df | ||
|
|
b03c71213e | ||
|
|
c2ab63f6d7 | ||
|
|
b92c68b053 | ||
|
|
450b2d0ba3 | ||
|
|
b40b4dc015 | ||
|
|
8fa7d324d1 | ||
|
|
7fa297a849 | ||
|
|
55505ba4df | ||
|
|
372cdb5dee | ||
|
|
973e5d0249 | ||
|
|
0171f648b1 | ||
|
|
74c4ae0b55 | ||
|
|
06a99d6770 | ||
|
|
1976e935e7 | ||
|
|
51dbe69e45 | ||
|
|
08318dc05d | ||
|
|
3e78bbde6a | ||
|
|
37f8db15e9 | ||
|
|
08b7a1f801 | ||
|
|
e9f279afd1 | ||
|
|
c7b0bdab7e | ||
|
|
686ae47696 | ||
|
|
dd03cceda0 | ||
|
|
d0e13cc262 | ||
|
|
858a93f886 | ||
|
|
e383eaa465 | ||
|
|
274b148554 | ||
|
|
7083419361 | ||
|
|
ac2c0c76fe | ||
|
|
3ad87787f8 | ||
|
|
ec8f7f185e | ||
|
|
f15fa56e38 | ||
|
|
297c4297b1 | ||
|
|
3a982ecad5 | ||
|
|
926a6ee8bd | ||
|
|
437542767a | ||
|
|
a29e1170b9 | ||
|
|
352a403efd | ||
|
|
e8117f8e40 | ||
|
|
32fea719b3 | ||
|
|
14df4aab83 | ||
|
|
24e46849c7 | ||
|
|
489d30edfb | ||
|
|
e748b521b2 | ||
|
|
51bffb533e | ||
|
|
62b5b5f99d | ||
|
|
a9b2ec514b | ||
|
|
3064b24c9d | ||
|
|
74d641c7b3 | ||
|
|
446d0769ed | ||
|
|
013133867b | ||
|
|
de407e82b7 | ||
|
|
c6e6a03a24 | ||
|
|
c1c74b0a6c | ||
|
|
45a0494287 | ||
|
|
521108e2a5 | ||
|
|
93a51cc756 | ||
|
|
ab23758e51 | ||
|
|
9069542d0b | ||
|
|
636cbc19ac | ||
|
|
1a6de10da8 | ||
|
|
b1731407bc | ||
|
|
4bb7a4ceb0 | ||
|
|
e22b83abf2 | ||
|
|
bbc9d1cdc1 | ||
|
|
85dce12be3 | ||
|
|
a6875c732c | ||
|
|
c0fdf09f28 | ||
|
|
41d8f90d68 | ||
|
|
3c5c9c8e19 | ||
|
|
ac18decc56 | ||
|
|
052da50aeb | ||
|
|
4e33d1690d | ||
|
|
c2ae4afb8f | ||
|
|
e81e3acd2d | ||
|
|
9c019b6147 | ||
|
|
0a5da83a1b | ||
|
|
7601af5200 | ||
|
|
e46b0c8ddc | ||
|
|
0e3246e20d | ||
|
|
0ff98810ba | ||
|
|
f48680a983 | ||
|
|
682ea345ac | ||
|
|
a21c805ece | ||
|
|
6f24dbaab4 | ||
|
|
36e233797c | ||
|
|
c02e5bc72c | ||
|
|
5499c800a7 | ||
|
|
0492f0f745 | ||
|
|
ac1ffb1bff | ||
|
|
5a6f1ede6a | ||
|
|
0e687d3082 | ||
|
|
08da2b0b07 | ||
|
|
9c4720766d | ||
|
|
5da75c4a97 | ||
|
|
77833eddfb | ||
|
|
1730062c8f | ||
|
|
09135443a0 | ||
|
|
fcd836e34f | ||
|
|
28fd7c5a17 | ||
|
|
ae6930030a | ||
|
|
2fa4fb0da9 | ||
|
|
bf93427cbb | ||
|
|
72fc65d2c5 | ||
|
|
2baa4a3514 | ||
|
|
49aba471dc | ||
|
|
46b108e9a4 | ||
|
|
ac616ef41d | ||
|
|
e09712f0e1 | ||
|
|
35c90fd807 | ||
|
|
756423e81e | ||
|
|
dc61a6ab80 | ||
|
|
a0c859fc4f | ||
|
|
17e38230d5 | ||
|
|
3ae285b614 | ||
|
|
3212f60d69 | ||
|
|
a5076a663b | ||
|
|
d2c2261c58 | ||
|
|
8412d78310 | ||
|
|
48a38c0289 | ||
|
|
6e44662f15 | ||
|
|
c8d3184a95 | ||
|
|
bb0ddcad27 | ||
|
|
4eda76de36 | ||
|
|
ced8fdbce8 | ||
|
|
f7ba0d3b4b | ||
|
|
4f4e23a3b3 | ||
|
|
1d6cb348b4 | ||
|
|
8e856dfdb8 | ||
|
|
cf82c3215f | ||
|
|
307d4f94c7 | ||
|
|
cfada0347e | ||
|
|
7cb921369b | ||
|
|
a86e44b176 | ||
|
|
abaef13c0b | ||
|
|
cfd64b5f89 | ||
|
|
cbcd779610 | ||
|
|
b75e802280 | ||
|
|
9ec14b91e7 | ||
|
|
47cf4e7bfd | ||
|
|
b8150f33db | ||
|
|
02a4bd5942 | ||
|
|
7ed4f0ca27 | ||
|
|
964090d086 | ||
|
|
e9082ea57a | ||
|
|
5623c96dd7 | ||
|
|
3fd35abe98 | ||
|
|
a81e11d9de | ||
|
|
db47267be4 | ||
|
|
6723bfbe32 | ||
|
|
603057b198 | ||
|
|
9ccc63d682 | ||
|
|
4d7161f36e | ||
|
|
32141eacfb | ||
|
|
1b5db9989e | ||
|
|
46967ca9c9 | ||
|
|
273baf4ec2 | ||
|
|
c4800d9934 | ||
|
|
86cc9f626f | ||
|
|
09a3bcf0f0 | ||
|
|
bf64967b68 | ||
|
|
bf1d377e08 | ||
|
|
d424c3aee7 | ||
|
|
e4d660af86 | ||
|
|
2efd75e2ca | ||
|
|
b13f05e2dc | ||
|
|
dcbab692c0 | ||
|
|
71f3ff6bf2 | ||
|
|
ff0a14a7c6 | ||
|
|
4bf99c9bea | ||
|
|
9513486bf3 | ||
|
|
bea7d618f1 | ||
|
|
4ad20ccb39 | ||
|
|
73a017577e | ||
|
|
2d8a547692 | ||
|
|
5f0603ed28 | ||
|
|
afca4e271e | ||
|
|
30d2fadb28 | ||
|
|
3271b82094 | ||
|
|
c0e180758b | ||
|
|
5817d27429 | ||
|
|
4812b4e6c2 | ||
|
|
7c0b7b417b | ||
|
|
785fe5f3b6 | ||
|
|
502a6b0166 | ||
|
|
4a28e60e89 | ||
|
|
a90d50e13f | ||
|
|
962d8b325a | ||
|
|
c813bc2a92 | ||
|
|
5ce41bac8d | ||
|
|
6bc7bde229 | ||
|
|
2de8fd7d93 | ||
|
|
dcd319cfbe | ||
|
|
cd56b96544 | ||
|
|
22262c14f1 | ||
|
|
6e056709be | ||
|
|
2f63b20acf | ||
|
|
eb126eecb0 | ||
|
|
4e1a915f1a | ||
|
|
f2b09ff0bd | ||
|
|
b0c11371e0 | ||
|
|
9b2e7db469 | ||
|
|
f04c06a0db | ||
|
|
8ac061ebe7 | ||
|
|
b30f31e1f6 | ||
|
|
288ef37b1d | ||
|
|
20414f66ca | ||
|
|
458b14b8ed | ||
|
|
530ccfe350 | ||
|
|
041ada1586 | ||
|
|
d987bee007 | ||
|
|
431a791a99 | ||
|
|
9441cf4627 | ||
|
|
bb1c3dff21 | ||
|
|
49a27cba6b | ||
|
|
99c943df23 | ||
|
|
8c11764800 | ||
|
|
54136042c6 | ||
|
|
28ed8a821a | ||
|
|
ec9b589402 | ||
|
|
2a7133b7a6 | ||
|
|
64158114aa | ||
|
|
e8631b2f3a | ||
|
|
21ad7cdda5 | ||
|
|
add374ef6a | ||
|
|
eac270bea7 | ||
|
|
36ec9d7236 | ||
|
|
3041fd66cd | ||
|
|
b504f65ace | ||
|
|
5cb87b7110 | ||
|
|
d19cac6772 | ||
|
|
eac1a7ff68 | ||
|
|
00089a951b | ||
|
|
b8d0f18ff8 | ||
|
|
96c2022483 | ||
|
|
ff05d4a96c | ||
|
|
989918a59c | ||
|
|
6c4b5d81dd | ||
|
|
7d045dcddb | ||
|
|
199f6d64db | ||
|
|
b82e4585cf | ||
|
|
9303a3fae9 | ||
|
|
9b6ba1ced1 | ||
|
|
7870ade07a | ||
|
|
9699422cd6 | ||
|
|
3ee2ec8e4f | ||
|
|
0de1e8e610 | ||
|
|
01554f39a8 | ||
|
|
69eb076bca | ||
|
|
f3259be73c | ||
|
|
698cce6707 | ||
|
|
3eab549369 | ||
|
|
3e51ee516e | ||
|
|
e3f61b465d | ||
|
|
a63f6143ea | ||
|
|
2a383e9ddd | ||
|
|
612da3ec47 | ||
|
|
6248c2436a | ||
|
|
8d58999135 | ||
|
|
324fc0f62a | ||
|
|
f62668e2e3 | ||
|
|
a15fa87558 | ||
|
|
ceaa0e26c7 | ||
|
|
4867b5dc75 | ||
|
|
340fdaf511 | ||
|
|
5ea885c87f | ||
|
|
d8baceb08c | ||
|
|
d6f4982522 | ||
|
|
9d558cec5e | ||
|
|
159e1a42b3 | ||
|
|
b50066f420 | ||
|
|
22b7403cd1 | ||
|
|
670e0ca076 | ||
|
|
ee67bc7dcb | ||
|
|
ecd7eb36ac | ||
|
|
47572286f3 | ||
|
|
6be1151ffc | ||
|
|
c0422d7cc9 | ||
|
|
e9ba5876d1 | ||
|
|
02be7c1185 | ||
|
|
7dfcec931a | ||
|
|
a329024793 | ||
|
|
137a552641 | ||
|
|
a841d6484c | ||
|
|
2af57c4b6a | ||
|
|
47dbab3856 | ||
|
|
a1e4550c9e | ||
|
|
2b8706bf44 | ||
|
|
3a3595f2af | ||
|
|
9a2ee763d0 | ||
|
|
237429bb85 | ||
|
|
50d1c803dd | ||
|
|
0d3e34d0be | ||
|
|
aa06b065c0 | ||
|
|
9f47c9a051 | ||
|
|
6fdfca6e49 | ||
|
|
196352bf0b | ||
|
|
46d316692d | ||
|
|
2f288bc7cc | ||
|
|
f5025b6246 | ||
|
|
e055ce7c39 | ||
|
|
14fe0932f0 | ||
|
|
3ba85878a5 | ||
|
|
70168c8bdc | ||
|
|
e4cd162433 | ||
|
|
4085185e2d | ||
|
|
a141f68c83 | ||
|
|
9199d5c610 | ||
|
|
96460becf9 | ||
|
|
d7c6fb8250 | ||
|
|
3db691804b | ||
|
|
4512b2b5c4 | ||
|
|
7bde100a1a | ||
|
|
d0110d897d | ||
|
|
ef34892a76 | ||
|
|
67f5ac5bbc | ||
|
|
517935cd55 | ||
|
|
326957009a | ||
|
|
213165a467 | ||
|
|
3dad07f338 | ||
|
|
6adc737a89 | ||
|
|
c0282eb9c8 | ||
|
|
471b1a873d | ||
|
|
aee8ea8b10 | ||
|
|
57cf4fc846 | ||
|
|
9fe12cd01b | ||
|
|
6486ce8191 | ||
|
|
bec6ddda70 | ||
|
|
e9d5eeb118 | ||
|
|
c147e4fa81 | ||
|
|
1d27a27813 | ||
|
|
d3bead5e0e | ||
|
|
9f1bb531ba | ||
|
|
9971087678 | ||
|
|
e7fa5c709c | ||
|
|
7a1d410e0a | ||
|
|
e2a7981dd3 | ||
|
|
26da3c5d6e | ||
|
|
bc22ee7897 | ||
|
|
784201ecee | ||
|
|
6e72cbb5e0 | ||
|
|
233b99a0a8 | ||
|
|
43e328f363 | ||
|
|
8543820d98 | ||
|
|
93f4a93e12 | ||
|
|
ecd5d0a3a4 | ||
|
|
8cf2e46c1f | ||
|
|
50387043d1 | ||
|
|
e715607178 | ||
|
|
0e388bce3e | ||
|
|
9457a56607 | ||
|
|
f9553a35d5 | ||
|
|
e2ef160beb | ||
|
|
ae56a03e33 | ||
|
|
4629e449a9 | ||
|
|
74c6669a8e | ||
|
|
5c67cd9150 | ||
|
|
f66a0c2acf | ||
|
|
a467d0684e | ||
|
|
75eac86506 | ||
|
|
996477152d | ||
|
|
e09577b123 | ||
|
|
26d228ccfe | ||
|
|
aafb1ba72c | ||
|
|
db7ef90159 | ||
|
|
863faea542 | ||
|
|
5aabb6bec5 | ||
|
|
5e05dff949 | ||
|
|
3ea623364b | ||
|
|
cf67dc8898 | ||
|
|
d7b568a1c0 | ||
|
|
fe9031eb23 | ||
|
|
f5eba67f0d | ||
|
|
e1762e6e44 | ||
|
|
9d32b6ddfc | ||
|
|
7a413ff2ad | ||
|
|
0090d171fd | ||
|
|
980b68e9cc | ||
|
|
44a630e634 | ||
|
|
81d12fa452 | ||
|
|
83666ddc36 | ||
|
|
fa5de40f86 | ||
|
|
7d05fb2a1b | ||
|
|
51a249f380 | ||
|
|
90754e5fd2 | ||
|
|
0e5fe3fa60 | ||
|
|
6953f5505f | ||
|
|
45f90cd5dd | ||
|
|
8294f44c74 | ||
|
|
6f7999ad0d | ||
|
|
d829ee3145 | ||
|
|
88b4e1a9b7 | ||
|
|
7c784a1758 | ||
|
|
5680c628b6 | ||
|
|
e57b69f106 | ||
|
|
19ee4464c2 | ||
|
|
7d05b78479 | ||
|
|
062d14e553 | ||
|
|
59ed1db9a2 | ||
|
|
da8288106b | ||
|
|
679eb3c266 | ||
|
|
c2d0a28fa2 | ||
|
|
2745771a22 | ||
|
|
1ecb2a2998 | ||
|
|
e0f72dc332 | ||
|
|
caf24ef417 | ||
|
|
ff13bcd08d | ||
|
|
dc74092a09 | ||
|
|
f89813401d | ||
|
|
3aa0014d23 | ||
|
|
69479b2fb7 | ||
|
|
e2e71502b1 | ||
|
|
be1a3dce83 | ||
|
|
a5b4339884 | ||
|
|
6961e9458a |
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"name": "Electron Core Development Environment",
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
"service": "buildtools",
|
"service": "buildtools",
|
||||||
"onCreateCommand": ".devcontainer/on-create-command.sh",
|
"onCreateCommand": ".devcontainer/on-create-command.sh",
|
||||||
@@ -33,27 +34,15 @@
|
|||||||
"surajbarkale.ninja",
|
"surajbarkale.ninja",
|
||||||
"ms-vscode.cpptools",
|
"ms-vscode.cpptools",
|
||||||
"mutantdino.resourcemonitor",
|
"mutantdino.resourcemonitor",
|
||||||
|
"dsanders11.vscode-electron-build-tools",
|
||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"shakram02.bash-beautify",
|
"shakram02.bash-beautify",
|
||||||
"marshallofsound.gnls-electron",
|
"marshallofsound.gnls-electron"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"editor.tabSize": 2,
|
"editor.tabSize": 2,
|
||||||
"bashBeautify.tabSize": 2,
|
"bashBeautify.tabSize": 2,
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
"[gn]": {
|
|
||||||
"editor.formatOnSave": true
|
|
||||||
},
|
|
||||||
"[javascript]": {
|
|
||||||
"editor.codeActionsOnSave": {
|
|
||||||
"source.fixAll.eslint": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"[typescript]": {
|
|
||||||
"editor.codeActionsOnSave": {
|
|
||||||
"source.fixAll.eslint": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"javascript.preferences.quoteStyle": "single",
|
"javascript.preferences.quoteStyle": "single",
|
||||||
"typescript.preferences.quoteStyle": "single"
|
"typescript.preferences.quoteStyle": "single"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
buildtools:
|
buildtools:
|
||||||
image: ghcr.io/electron/devcontainer:77262e58c37631ab082482f42c33cdf68c6c394b
|
image: ghcr.io/electron/devcontainer:424eedbf277ad9749ffa9219068aa72ed4a5e373
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- ..:/workspaces/gclient/src/electron:cached
|
- ..:/workspaces/gclient/src/electron:cached
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
# These env vars are only necessary for creating Electron releases.
|
# These env vars are only necessary for creating Electron releases.
|
||||||
# See docs/development/releasing.md
|
# See docs/development/releasing.md
|
||||||
|
|
||||||
APPVEYOR_CLOUD_TOKEN=
|
|
||||||
ELECTRON_GITHUB_TOKEN=
|
ELECTRON_GITHUB_TOKEN=
|
||||||
|
|||||||
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,6 +1,9 @@
|
|||||||
# `git apply` and friends don't understand CRLF, even on windows. Force those
|
# `git apply` and friends don't understand CRLF, even on windows. Force those
|
||||||
# files to be checked out with LF endings even if core.autocrlf is true.
|
# files to be checked out with LF endings even if core.autocrlf is true.
|
||||||
*.patch text eol=lf
|
*.patch text eol=lf
|
||||||
|
DEPS text eol=lf
|
||||||
|
yarn.lock text eol=lf
|
||||||
|
script/zip_manifests/*.manifest text eol=lf
|
||||||
patches/**/.patches merge=union
|
patches/**/.patches merge=union
|
||||||
|
|
||||||
# Source code and markdown files should always use LF as line ending.
|
# Source code and markdown files should always use LF as line ending.
|
||||||
|
|||||||
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
@@ -8,13 +8,9 @@
|
|||||||
DEPS @electron/wg-upgrades
|
DEPS @electron/wg-upgrades
|
||||||
|
|
||||||
# Releases WG
|
# Releases WG
|
||||||
/.github/workflows/update_appveyor_image.yml @electron/wg-releases
|
|
||||||
/docs/breaking-changes.md @electron/wg-releases
|
/docs/breaking-changes.md @electron/wg-releases
|
||||||
/npm/ @electron/wg-releases
|
/npm/ @electron/wg-releases
|
||||||
/script/release @electron/wg-releases
|
/script/release @electron/wg-releases
|
||||||
appveyor.yml @electron/wg-releases
|
|
||||||
appveyor-bake.yml @electron/wg-releases
|
|
||||||
appveyor-woa.yml @electron/wg-releases
|
|
||||||
|
|
||||||
# Security WG
|
# Security WG
|
||||||
/lib/browser/devtools.ts @electron/wg-security
|
/lib/browser/devtools.ts @electron/wg-security
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -73,7 +73,7 @@ body:
|
|||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: Testcase Gist URL
|
label: Testcase Gist URL
|
||||||
description: If you can reproduce the issue in a standalone test case, please use [Electron Fiddle](https://github.com/electron/fiddle) to create one and to publish it as a [GitHub gist](https://gist.github.com) and put the gist URL here. This is **the best way** to ensure this issue is triaged quickly.
|
description: Electron maintainers need a standalone test case to reproduce and fix your issue. Please use [Electron Fiddle](https://github.com/electron/fiddle) to create one and to publish it as a [GitHub gist](https://gist.github.com). Then put the gist URL here. Issues without testcase gists receive less attention and might be closed without a maintainer taking a closer look. To maximize how much attention your issue receives, please include a testcase gist right from the start.
|
||||||
placeholder: https://gist.github.com/...
|
placeholder: https://gist.github.com/...
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
1
.github/ISSUE_TEMPLATE/config.yml
vendored
1
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Discord Chat
|
- name: Discord Chat
|
||||||
url: https://discord.gg/APGC3k5yaH
|
url: https://discord.gg/APGC3k5yaH
|
||||||
|
|||||||
14
.github/ISSUE_TEMPLATE/maintainer_issue.yml
vendored
Normal file
14
.github/ISSUE_TEMPLATE/maintainer_issue.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: Maintainer Issue (not for public use)
|
||||||
|
description: Only to be created by Electron maintainers
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Confirmation
|
||||||
|
options:
|
||||||
|
- label: I am a [maintainer](https://github.com/orgs/electron/people) of the Electron project. (If not, please create a [different issue type](https://github.com/electron/electron/issues/new/).)
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -13,7 +13,7 @@ Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.
|
|||||||
- [ ] PR description included and stakeholders cc'd
|
- [ ] PR description included and stakeholders cc'd
|
||||||
- [ ] `npm test` passes
|
- [ ] `npm test` passes
|
||||||
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
|
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
|
||||||
- [ ] relevant documentation, tutorials, templates and examples are changed or added
|
- [ ] relevant API documentation, tutorials, and examples are updated and follow the [documentation style guide](https://github.com/electron/electron/blob/main/docs/development/style-guide.md)
|
||||||
- [ ] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).
|
- [ ] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).
|
||||||
|
|
||||||
#### Release Notes
|
#### Release Notes
|
||||||
|
|||||||
41
.github/actions/build-electron/action.yml
vendored
41
.github/actions/build-electron/action.yml
vendored
@@ -5,10 +5,10 @@ inputs:
|
|||||||
description: 'Target arch'
|
description: 'Target arch'
|
||||||
required: true
|
required: true
|
||||||
target-platform:
|
target-platform:
|
||||||
description: 'Target platform'
|
description: 'Target platform, should be linux, win, macos'
|
||||||
required: true
|
required: true
|
||||||
artifact-platform:
|
artifact-platform:
|
||||||
description: 'Artifact platform, should be linux, darwin or mas'
|
description: 'Artifact platform, should be linux, win, darwin or mas'
|
||||||
required: true
|
required: true
|
||||||
step-suffix:
|
step-suffix:
|
||||||
description: 'Suffix for build steps'
|
description: 'Suffix for build steps'
|
||||||
@@ -69,9 +69,9 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
e build --target electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
|
e build --target electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES -d explain
|
||||||
if [ "${{ inputs.is-asan }}" != "true" ]; then
|
if [ "${{ inputs.is-asan }}" != "true" ]; then
|
||||||
target_os=${{ inputs.target-platform == 'linux' && 'linux' || 'mac'}}
|
target_os=${{ inputs.target-platform == 'macos' && 'mac' || inputs.target-platform }}
|
||||||
if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
|
if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
|
||||||
target_os="${target_os}_mas"
|
target_os="${target_os}_mas"
|
||||||
fi
|
fi
|
||||||
@@ -82,7 +82,7 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
e build --target electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
|
e build --target electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
ELECTRON_DEPOT_TOOLS_DISABLE_LOG=1 e d gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||||
# Remove unused args from mksnapshot_args
|
# Remove unused args from mksnapshot_args
|
||||||
SEDOPTION="-i"
|
SEDOPTION="-i"
|
||||||
if [ "`uname`" = "Darwin" ]; then
|
if [ "`uname`" = "Darwin" ]; then
|
||||||
@@ -91,7 +91,7 @@ runs:
|
|||||||
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
|
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
|
||||||
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
||||||
|
|
||||||
if [ "`uname`" = "Linux" ]; then
|
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||||
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||||
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
|
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
|
||||||
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
|
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
|
||||||
@@ -105,7 +105,15 @@ runs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
e build --target electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
|
e build --target electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
cd out/Default
|
||||||
|
powershell Compress-Archive -update mksnapshot_args mksnapshot.zip
|
||||||
|
powershell mkdir mktmp\\gen\\v8
|
||||||
|
powershell Copy-Item gen\\v8\\embedded.S mktmp\\gen\\v8
|
||||||
|
powershell Compress-Archive -update -Path mktmp\\gen mksnapshot.zip
|
||||||
|
else
|
||||||
|
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
|
||||||
|
fi
|
||||||
- name: Generate Cross-Arch Snapshot (arm/arm64) ${{ inputs.step-suffix }}
|
- name: Generate Cross-Arch Snapshot (arm/arm64) ${{ inputs.step-suffix }}
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}
|
if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}
|
||||||
@@ -137,6 +145,25 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
e build --target electron:node_headers
|
e build --target electron:node_headers
|
||||||
|
- name: Create installed_software.json ${{ inputs.step-suffix }}
|
||||||
|
shell: powershell
|
||||||
|
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
|
||||||
|
- name: Profile Windows Toolchain ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
|
||||||
|
- name: Add msdia140.dll to Path ${{ inputs.step-suffix }}
|
||||||
|
shell: bash
|
||||||
|
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
|
||||||
|
run: |
|
||||||
|
# Needed for msdia140.dll on 64-bit windows
|
||||||
|
cd src
|
||||||
|
export PATH="$PATH:$(pwd)/third_party/llvm-build/Release+Asserts/bin"
|
||||||
- name: Generate & Zip Symbols ${{ inputs.step-suffix }}
|
- name: Generate & Zip Symbols ${{ inputs.step-suffix }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
120
.github/actions/checkout/action.yml
vendored
120
.github/actions/checkout/action.yml
vendored
@@ -5,6 +5,12 @@ inputs:
|
|||||||
description: 'Whether to generate and persist a SAS token for the item in the cache'
|
description: 'Whether to generate and persist a SAS token for the item in the cache'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
use-cache:
|
||||||
|
description: 'Whether to persist the cache to the shared drive'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
target-platform:
|
||||||
|
description: 'Target platform, should be linux, win, macos'
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@@ -13,65 +19,62 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
|
echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
shell: bash
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
run: |
|
- name: Set Chromium Git Cookie
|
||||||
cd src/electron
|
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||||
node script/yarn install --frozen-lockfile
|
- name: Install Build Tools
|
||||||
- name: Get Depot Tools
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
||||||
|
|
||||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
|
||||||
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
|
|
||||||
cd depot_tools
|
|
||||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
|
||||||
|
|
||||||
# Ensure depot_tools does not update.
|
|
||||||
test -d depot_tools && cd depot_tools
|
|
||||||
touch .disable_auto_update
|
|
||||||
- name: Add Depot Tools to PATH
|
|
||||||
shell: bash
|
|
||||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
|
||||||
- name: Generate DEPS Hash
|
- name: Generate DEPS Hash
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
node src/electron/script/generate-deps-hash.js
|
||||||
echo "DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
|
DEPSHASH="v1-src-cache-$(cat src/electron/.depshash)"
|
||||||
|
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||||
|
echo "CACHE_FILE=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
echo "CACHE_DRIVE=/mnt/win-cache" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "CACHE_DRIVE=/mnt/cross-instance-cache" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
- name: Generate SAS Key
|
- name: Generate SAS Key
|
||||||
if: ${{ inputs.generate-sas-token == 'true' }}
|
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
curl --unix-socket /var/run/sas/sas.sock --fail "http://foo/$DEPSHASH.tar" > sas-token
|
curl --unix-socket /var/run/sas/sas.sock --fail "http://foo/$CACHE_FILE?platform=${{ inputs.target-platform }}" > sas-token
|
||||||
- name: Save SAS Key
|
- name: Save SAS Key
|
||||||
if: ${{ inputs.generate-sas-token == 'true' }}
|
if: ${{ inputs.generate-sas-token == 'true' }}
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||||
with:
|
with:
|
||||||
path: |
|
path: sas-token
|
||||||
sas-token
|
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-${{ github.run_attempt }}
|
||||||
key: sas-key-${{ github.run_number }}-${{ github.run_attempt }}
|
enableCrossOsArchive: true
|
||||||
- name: Check If Cache Exists
|
- name: Check If Cache Exists
|
||||||
id: check-cache
|
id: check-cache
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
if [[ "${{ inputs.use-cache }}" == "false" ]]; then
|
||||||
echo "Using cache key: $DEPSHASH"
|
echo "Not using cache this time..."
|
||||||
echo "Checking for cache in: $cache_path"
|
|
||||||
if [ ! -f "$cache_path" ] || [ `du $cache_path | cut -f1` = "0" ]; then
|
|
||||||
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
||||||
echo "Cache Does Not Exist for $DEPSHASH"
|
|
||||||
else
|
else
|
||||||
echo "cache_exists=true" >> $GITHUB_OUTPUT
|
cache_path=$CACHE_DRIVE/$CACHE_FILE
|
||||||
echo "Cache Already Exists for $DEPSHASH, Skipping.."
|
echo "Using cache key: $DEPSHASH"
|
||||||
|
echo "Checking for cache in: $cache_path"
|
||||||
|
if [ ! -f "$cache_path" ] || [ `du $cache_path | cut -f1` = "0" ]; then
|
||||||
|
echo "cache_exists=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "Cache Does Not Exist for $DEPSHASH"
|
||||||
|
else
|
||||||
|
echo "cache_exists=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Cache Already Exists for $DEPSHASH, Skipping.."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
- name: Check cross instance cache disk space
|
- name: Check cross instance cache disk space
|
||||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
if: steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# if there is less than 20 GB free space then creating the cache might fail so exit early
|
# if there is less than 35 GB free space then creating the cache might fail so exit early
|
||||||
freespace=`df -m /mnt/cross-instance-cache | grep -w /mnt/cross-instance-cache | awk '{print $4}'`
|
freespace=`df -m $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
|
||||||
freespace_human=`df -h /mnt/cross-instance-cache | grep -w /mnt/cross-instance-cache | awk '{print $4}'`
|
freespace_human=`df -h $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
|
||||||
if [ $freespace -le 20000 ]; then
|
if [ $freespace -le 35000 ]; then
|
||||||
echo "The cross mount cache has $freespace_human free space which is not enough - exiting"
|
echo "The cross mount cache has $freespace_human free space which is not enough - exiting"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
@@ -81,14 +84,18 @@ runs:
|
|||||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
if: steps.check-cache.outputs.cache_exists == 'false'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
gclient config \
|
e d gclient config \
|
||||||
--name "src/electron" \
|
--name "src/electron" \
|
||||||
--unmanaged \
|
--unmanaged \
|
||||||
${GCLIENT_EXTRA_ARGS} \
|
${GCLIENT_EXTRA_ARGS} \
|
||||||
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
|
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
|
||||||
|
|
||||||
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags -vvvvv
|
if [ "$TARGET_OS" != "" ]; then
|
||||||
if [ "${{ inputs.is-release }}" != "true" && -n "${{ env.PATCH_UP_APP_CREDS }}" ]; then
|
echo "target_os=['$TARGET_OS']" >> ./.gclient
|
||||||
|
fi
|
||||||
|
|
||||||
|
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 e d gclient sync --with_branch_heads --with_tags -vv
|
||||||
|
if [[ "${{ inputs.is-release }}" != "true" ]]; then
|
||||||
# Re-export all the patches to check if there were changes.
|
# Re-export all the patches to check if there were changes.
|
||||||
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
|
||||||
cd src/electron
|
cd src/electron
|
||||||
@@ -117,6 +124,8 @@ runs:
|
|||||||
cat ../../patches/update-patches.patch
|
cat ../../patches/update-patches.patch
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "No changes to patches detected"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -128,13 +137,13 @@ runs:
|
|||||||
# https://dawn-review.googlesource.com/c/dawn/+/83901
|
# https://dawn-review.googlesource.com/c/dawn/+/83901
|
||||||
# TODO: maybe better to always leave out */.git/HEAD file for all targets ?
|
# TODO: maybe better to always leave out */.git/HEAD file for all targets ?
|
||||||
- name: Delete .git directories under src to free space
|
- name: Delete .git directories under src to free space
|
||||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" -not -path "./electron/*" ) | xargs rm -rf
|
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" -not -path "./electron/*" ) | xargs rm -rf
|
||||||
- name: Minimize Cache Size for Upload
|
- name: Minimize Cache Size for Upload
|
||||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
rm -rf src/android_webview
|
rm -rf src/android_webview
|
||||||
@@ -145,20 +154,23 @@ runs:
|
|||||||
rm -rf src/third_party/angle/third_party/VK-GL-CTS/src
|
rm -rf src/third_party/angle/third_party/VK-GL-CTS/src
|
||||||
rm -rf src/third_party/swift-toolchain
|
rm -rf src/third_party/swift-toolchain
|
||||||
rm -rf src/third_party/swiftshader/tests/regres/testlists
|
rm -rf src/third_party/swiftshader/tests/regres/testlists
|
||||||
|
cp src/electron/.github/actions/checkout/action.yml ./
|
||||||
rm -rf src/electron
|
rm -rf src/electron
|
||||||
|
mkdir -p src/electron/.github/actions/checkout
|
||||||
|
mv action.yml src/electron/.github/actions/checkout
|
||||||
- name: Compress Src Directory
|
- name: Compress Src Directory
|
||||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
|
echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
|
||||||
tar -cf $DEPSHASH.tar src
|
tar -cf $CACHE_FILE src
|
||||||
echo "Compressed src to $(du -sh $DEPSHASH.tar | cut -f1 -d' ')"
|
echo "Compressed src to $(du -sh $CACHE_FILE | cut -f1 -d' ')"
|
||||||
cp ./$DEPSHASH.tar /mnt/cross-instance-cache/
|
cp ./$CACHE_FILE $CACHE_DRIVE/
|
||||||
- name: Persist Src Cache
|
- name: Persist Src Cache
|
||||||
if: steps.check-cache.outputs.cache_exists == 'false'
|
if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
final_cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
final_cache_path=$CACHE_DRIVE/$CACHE_FILE
|
||||||
echo "Using cache key: $DEPSHASH"
|
echo "Using cache key: $DEPSHASH"
|
||||||
echo "Checking path: $final_cache_path"
|
echo "Checking path: $final_cache_path"
|
||||||
if [ ! -f "$final_cache_path" ]; then
|
if [ ! -f "$final_cache_path" ]; then
|
||||||
@@ -167,3 +179,11 @@ runs:
|
|||||||
else
|
else
|
||||||
echo "Cache key persisted in $final_cache_path"
|
echo "Cache key persisted in $final_cache_path"
|
||||||
fi
|
fi
|
||||||
|
- name: Wait for active SSH sessions
|
||||||
|
shell: bash
|
||||||
|
if: always() && !cancelled()
|
||||||
|
run: |
|
||||||
|
while [ -f /var/.ssh-lock ]
|
||||||
|
do
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
|
|||||||
40
.github/actions/cipd-install/action.yml
vendored
Normal file
40
.github/actions/cipd-install/action.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: 'CIPD install'
|
||||||
|
description: 'Installs the specified CIPD package'
|
||||||
|
inputs:
|
||||||
|
cipd-root-prefix-path:
|
||||||
|
description: 'Path to prepend to installation directory'
|
||||||
|
default: ''
|
||||||
|
dependency:
|
||||||
|
description: 'Name of dependency to install'
|
||||||
|
deps-file:
|
||||||
|
description: 'Location of DEPS file that defines the dependency'
|
||||||
|
installation-dir:
|
||||||
|
description: 'Location to install dependency'
|
||||||
|
target-platform:
|
||||||
|
description: 'Target platform, should be linux, win, macos'
|
||||||
|
package:
|
||||||
|
description: 'Package to install'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Delete wrong ${{ inputs.dependency }}
|
||||||
|
shell: bash
|
||||||
|
run : |
|
||||||
|
rm -rf ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }}
|
||||||
|
- name: Create ensure file for ${{ inputs.dependency }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo '${{ inputs.package }}' `e d gclient getdep --deps-file=${{ inputs.deps-file }} -r '${{ inputs.installation-dir }}:${{ inputs.package }}'` > ${{ inputs.dependency }}_ensure_file
|
||||||
|
cat ${{ inputs.dependency }}_ensure_file
|
||||||
|
- name: CIPD installation of ${{ inputs.dependency }} (macOS)
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "ensuring ${{ inputs.dependency }} on macOS"
|
||||||
|
e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
|
||||||
|
- name: CIPD installation of ${{ inputs.dependency }} (Windows)
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
echo "ensuring ${{ inputs.dependency }} on Windows"
|
||||||
|
e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
|
||||||
61
.github/actions/fix-sync-macos/action.yml
vendored
61
.github/actions/fix-sync-macos/action.yml
vendored
@@ -1,61 +0,0 @@
|
|||||||
name: 'Fix Sync macOS'
|
|
||||||
description: 'Checks out Electron and stores it in the AKS Cache'
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Fix Sync
|
|
||||||
shell: bash
|
|
||||||
# This step is required to correct for differences between "gclient sync"
|
|
||||||
# on Linux and the expected state on macOS. This requires:
|
|
||||||
# 1. Fixing Clang Install (wrong binary)
|
|
||||||
# 2. Fixing esbuild (wrong binary)
|
|
||||||
# 3. Fixing rustc (wrong binary)
|
|
||||||
# 4. Fixing gn (wrong binary)
|
|
||||||
# 5. Fix reclient (wrong binary)
|
|
||||||
# 6. Fixing dsymutil (wrong binary)
|
|
||||||
# 7. Ensuring we are using the correct ninja and adding it to PATH
|
|
||||||
# 8. Fixing angle (wrong remote)
|
|
||||||
run : |
|
|
||||||
SEDOPTION="-i ''"
|
|
||||||
rm -rf src/third_party/llvm-build
|
|
||||||
python3 src/tools/clang/scripts/update.py
|
|
||||||
|
|
||||||
echo 'infra/3pp/tools/esbuild/${platform}' `gclient getdep --deps-file=src/third_party/devtools-frontend/src/DEPS -r 'third_party/esbuild:infra/3pp/tools/esbuild/${platform}'` > esbuild_ensure_file
|
|
||||||
# Remove extra output from calling gclient getdep which always calls update_depot_tools
|
|
||||||
sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
|
|
||||||
cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
|
|
||||||
|
|
||||||
rm -rf src/third_party/rust-toolchain
|
|
||||||
python3 src/tools/rust/update_rust.py
|
|
||||||
|
|
||||||
# Prevent calling gclient getdep which always calls update_depot_tools
|
|
||||||
echo 'gn/gn/mac-${arch}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/mac:gn/gn/mac-${arch}'` > gn_ensure_file
|
|
||||||
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
|
|
||||||
cipd ensure --root src/buildtools/mac -ensure-file gn_ensure_file
|
|
||||||
|
|
||||||
# Prevent calling gclient getdep which always calls update_depot_tools
|
|
||||||
echo 'infra/rbe/client/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/reclient:infra/rbe/client/${platform}'` > gn_ensure_file
|
|
||||||
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
|
|
||||||
cipd ensure --root src/buildtools/reclient -ensure-file gn_ensure_file
|
|
||||||
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
|
|
||||||
|
|
||||||
if [ "${{ env.TARGET_ARCH }}" == "arm64" ]; then
|
|
||||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
|
|
||||||
else
|
|
||||||
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
|
|
||||||
fi
|
|
||||||
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
|
|
||||||
|
|
||||||
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
|
|
||||||
sed $SEDOPTION "s/Updating depot_tools... //g" ninja_ensure_file
|
|
||||||
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
|
|
||||||
|
|
||||||
echo "$(pwd)/src/third_party/ninja" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
cd src/third_party/angle
|
|
||||||
rm -f .git/objects/info/alternates
|
|
||||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
|
||||||
cp .git/config .git/config.backup
|
|
||||||
git remote remove origin
|
|
||||||
mv .git/config.backup .git/config
|
|
||||||
git fetch
|
|
||||||
120
.github/actions/fix-sync/action.yml
vendored
Normal file
120
.github/actions/fix-sync/action.yml
vendored
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
name: 'Fix Sync'
|
||||||
|
description: 'Ensures proper binaries are in place'
|
||||||
|
# This action is required to correct for differences between "gclient sync"
|
||||||
|
# on Linux and the expected state on macOS/windows. This requires:
|
||||||
|
# 1. Fixing Clang Install (wrong binary)
|
||||||
|
# 2. Fixing esbuild (wrong binary)
|
||||||
|
# 3. Fixing rustc (wrong binary)
|
||||||
|
# 4. Fixing gn (wrong binary)
|
||||||
|
# 5. Fix reclient (wrong binary)
|
||||||
|
# 6. Fixing dsymutil (wrong binary)
|
||||||
|
# 7. Ensuring we are using the correct ninja and adding it to PATH
|
||||||
|
# 8. Fixing angle (wrong remote)
|
||||||
|
# 9. Install windows toolchain on Windows
|
||||||
|
# 10. Fix node binary on Windows
|
||||||
|
# 11. Fix rc binary on Windows
|
||||||
|
inputs:
|
||||||
|
target-platform:
|
||||||
|
description: 'Target platform, should be linux, win, macos'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Fix clang
|
||||||
|
shell: bash
|
||||||
|
run : |
|
||||||
|
rm -rf src/third_party/llvm-build
|
||||||
|
python3 src/tools/clang/scripts/update.py
|
||||||
|
- name: Fix esbuild
|
||||||
|
uses: ./src/electron/.github/actions/cipd-install
|
||||||
|
with:
|
||||||
|
cipd-root-prefix-path: src/third_party/devtools-frontend/src/
|
||||||
|
dependency: esbuild
|
||||||
|
deps-file: src/third_party/devtools-frontend/src/DEPS
|
||||||
|
installation-dir: third_party/esbuild
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
package: infra/3pp/tools/esbuild/${platform}
|
||||||
|
- name: Fix rustc
|
||||||
|
shell: bash
|
||||||
|
run : |
|
||||||
|
rm -rf src/third_party/rust-toolchain
|
||||||
|
python3 src/tools/rust/update_rust.py
|
||||||
|
- name: Fix gn (macOS)
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
uses: ./src/electron/.github/actions/cipd-install
|
||||||
|
with:
|
||||||
|
dependency: gn
|
||||||
|
deps-file: src/DEPS
|
||||||
|
installation-dir: src/buildtools/mac
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
package: gn/gn/mac-${arch}
|
||||||
|
- name: Fix gn (Windows)
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
uses: ./src/electron/.github/actions/cipd-install
|
||||||
|
with:
|
||||||
|
dependency: gn
|
||||||
|
deps-file: src/DEPS
|
||||||
|
installation-dir: src/buildtools/win
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
package: gn/gn/windows-amd64
|
||||||
|
- name: Fix reclient
|
||||||
|
uses: ./src/electron/.github/actions/cipd-install
|
||||||
|
with:
|
||||||
|
dependency: reclient
|
||||||
|
deps-file: src/DEPS
|
||||||
|
installation-dir: src/buildtools/reclient
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
package: infra/rbe/client/${platform}
|
||||||
|
- name: Configure reclient configs
|
||||||
|
shell: bash
|
||||||
|
run : |
|
||||||
|
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
|
||||||
|
- name: Fix dsymutil (macOS)
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
shell: bash
|
||||||
|
run : |
|
||||||
|
# Fix dsymutil
|
||||||
|
if [ "${{ inputs.target-platform }}" = "macos" ]; then
|
||||||
|
if [ "${{ env.TARGET_ARCH }}" == "arm64" ]; then
|
||||||
|
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
|
||||||
|
else
|
||||||
|
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
|
||||||
|
fi
|
||||||
|
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
|
||||||
|
fi
|
||||||
|
- name: Fix ninja
|
||||||
|
uses: ./src/electron/.github/actions/cipd-install
|
||||||
|
with:
|
||||||
|
dependency: ninja
|
||||||
|
deps-file: src/DEPS
|
||||||
|
installation-dir: src/third_party/ninja
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
package: infra/3pp/tools/ninja/${platform}
|
||||||
|
- name: Set ninja in path
|
||||||
|
shell: bash
|
||||||
|
run : |
|
||||||
|
echo "$(pwd)/src/third_party/ninja" >> $GITHUB_PATH
|
||||||
|
- name: Fixup angle git
|
||||||
|
shell: bash
|
||||||
|
run : |
|
||||||
|
cd src/third_party/angle
|
||||||
|
rm -f .git/objects/info/alternates
|
||||||
|
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||||
|
cp .git/config .git/config.backup
|
||||||
|
git remote remove origin
|
||||||
|
mv .git/config.backup .git/config
|
||||||
|
git fetch
|
||||||
|
- name: Get Windows toolchain
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: e d vpython3 src\build\vs_toolchain.py update --force
|
||||||
|
- name: Download nodejs
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
$nodedeps = e d gclient getdep --deps-file=src/DEPS -r src/third_party/node/win | ConvertFrom-JSON
|
||||||
|
python3 src\third_party\depot_tools\download_from_google_storage.py --no_resume --no_auth --bucket chromium-nodejs -o src\third_party\node\win\node.exe $nodedeps.object_name
|
||||||
|
- name: Install rc
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang/rc -s src/build/toolchain/win/rc/win/rc.exe.sha1
|
||||||
17
.github/actions/install-build-tools/action.yml
vendored
17
.github/actions/install-build-tools/action.yml
vendored
@@ -6,6 +6,21 @@ runs:
|
|||||||
- name: Install Build Tools
|
- name: Install Build Tools
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
export BUILD_TOOLS_SHA=eeb1a11392e4cec08fd926c93b31ab556dc0c23b
|
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||||
|
git config --global core.filemode false
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global branch.autosetuprebase always
|
||||||
|
git config --global core.fscache true
|
||||||
|
git config --global core.preloadindex true
|
||||||
|
fi
|
||||||
|
export BUILD_TOOLS_SHA=6e8526315ea3b4828882497e532b8340e64e053c
|
||||||
npm i -g @electron/build-tools
|
npm i -g @electron/build-tools
|
||||||
|
e d ensure_bootstrap
|
||||||
e auto-update disable
|
e auto-update disable
|
||||||
|
e d auto-update disable
|
||||||
|
if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
|
||||||
|
e d cipd.bat --version
|
||||||
|
cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
|
||||||
|
fi
|
||||||
|
echo "$HOME/.electron_build_tools/third_party/depot_tools" >> $GITHUB_PATH
|
||||||
|
echo "$HOME/.electron_build_tools/third_party/depot_tools/python-bin" >> $GITHUB_PATH
|
||||||
|
|||||||
21
.github/actions/install-dependencies/action.yml
vendored
Normal file
21
.github/actions/install-dependencies/action.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: 'Install Dependencies'
|
||||||
|
description: 'Installs yarn depdencies using cache when available'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Get yarn cache directory path
|
||||||
|
shell: bash
|
||||||
|
id: yarn-cache-dir-path
|
||||||
|
run: echo "dir=$(node src/electron/script/yarn cache dir)" >> $GITHUB_OUTPUT
|
||||||
|
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
|
||||||
|
id: yarn-cache
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('src/electron/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
- name: Install Dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src/electron
|
||||||
|
node script/yarn install --frozen-lockfile --prefer-offline
|
||||||
10
.github/actions/restore-cache-aks/action.yml
vendored
10
.github/actions/restore-cache-aks/action.yml
vendored
@@ -1,12 +1,20 @@
|
|||||||
name: 'Restore Cache AKS'
|
name: 'Restore Cache AKS'
|
||||||
description: 'Restores Electron src cache via AKS'
|
description: 'Restores Electron src cache via AKS'
|
||||||
|
inputs:
|
||||||
|
target-platform:
|
||||||
|
description: 'Target platform, should be linux, win, macos'
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Restore and Ensure Src Cache
|
- name: Restore and Ensure Src Cache
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
cache_path=/mnt/win-cache/$DEPSHASH.tar
|
||||||
|
else
|
||||||
|
cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Using cache key: $DEPSHASH"
|
echo "Using cache key: $DEPSHASH"
|
||||||
echo "Checking for cache in: $cache_path"
|
echo "Checking for cache in: $cache_path"
|
||||||
if [ ! -f "$cache_path" ]; then
|
if [ ! -f "$cache_path" ]; then
|
||||||
|
|||||||
75
.github/actions/restore-cache-azcopy/action.yml
vendored
75
.github/actions/restore-cache-azcopy/action.yml
vendored
@@ -1,22 +1,25 @@
|
|||||||
name: 'Restore Cache AZCopy'
|
name: 'Restore Cache AZCopy'
|
||||||
description: 'Restores Electron src cache via AZCopy'
|
description: 'Restores Electron src cache via AZCopy'
|
||||||
|
inputs:
|
||||||
|
target-platform:
|
||||||
|
description: 'Target platform, should be linux, win, macos'
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Obtain SAS Key
|
- name: Obtain SAS Key
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||||
with:
|
with:
|
||||||
path: |
|
path: sas-token
|
||||||
sas-token
|
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-1
|
||||||
key: sas-key-${{ github.run_number }}-1
|
enableCrossOsArchive: true
|
||||||
- name: Obtain SAS Key
|
- name: Obtain SAS Key
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
|
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf
|
||||||
with:
|
with:
|
||||||
path: |
|
path: sas-token
|
||||||
sas-token
|
key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-${{ github.run_attempt }}
|
||||||
key: sas-key-${{ github.run_number }}-${{ github.run_attempt }}
|
enableCrossOsArchive: true
|
||||||
- name: Download Src Cache from AKS
|
- name: Download Src Cache from AKS
|
||||||
# The cache will always exist here as a result of the checkout job
|
# The cache will always exist here as a result of the checkout job
|
||||||
# Either it was uploaded to Azure in the checkout job for this commit
|
# Either it was uploaded to Azure in the checkout job for this commit
|
||||||
@@ -26,21 +29,30 @@ runs:
|
|||||||
timeout_minutes: 30
|
timeout_minutes: 30
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
retry_on: error
|
retry_on: error
|
||||||
|
shell: bash
|
||||||
command: |
|
command: |
|
||||||
sas_token=$(cat sas-token)
|
sas_token=$(cat sas-token)
|
||||||
if [ -z $sas-token ]; then
|
if [ -z $sas-token ]; then
|
||||||
echo "SAS Token not found; exiting src cache download early..."
|
echo "SAS Token not found; exiting src cache download early..."
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
azcopy copy --log-level=ERROR \
|
||||||
|
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_WIN_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||||
|
else
|
||||||
|
azcopy copy --log-level=ERROR \
|
||||||
|
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
azcopy copy --log-level=ERROR \
|
|
||||||
"https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
|
|
||||||
env:
|
env:
|
||||||
AZURE_AKS_CACHE_STORAGE_ACCOUNT: f723719aa87a34622b5f7f3
|
AZURE_AKS_CACHE_STORAGE_ACCOUNT: f723719aa87a34622b5f7f3
|
||||||
AZURE_AKS_CACHE_SHARE_NAME: pvc-f6a4089f-b082-4bee-a3f9-c3e1c0c02d8f
|
AZURE_AKS_CACHE_SHARE_NAME: pvc-f6a4089f-b082-4bee-a3f9-c3e1c0c02d8f
|
||||||
|
AZURE_AKS_WIN_CACHE_SHARE_NAME: pvc-71dec4f2-0d44-4fd1-a2c3-add049d70bdf
|
||||||
- name: Clean SAS Key
|
- name: Clean SAS Key
|
||||||
shell: bash
|
shell: bash
|
||||||
run: rm -f sas-token
|
run: rm -f sas-token
|
||||||
- name: Unzip and Ensure Src Cache
|
- name: Unzip and Ensure Src Cache
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Downloaded cache is $(du -sh $DEPSHASH.tar | cut -f1)"
|
echo "Downloaded cache is $(du -sh $DEPSHASH.tar | cut -f1)"
|
||||||
@@ -68,4 +80,45 @@ runs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Wiping Electron Directory"
|
echo "Wiping Electron Directory"
|
||||||
rm -rf src/electron
|
rm -rf src/electron
|
||||||
|
|
||||||
|
- name: Unzip and Ensure Src Cache (Windows)
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
$src_cache = "$env:DEPSHASH.tar"
|
||||||
|
$cache_size = $(Get-Item $src_cache).length
|
||||||
|
Write-Host "Downloaded cache is $cache_size"
|
||||||
|
if ($cache_size -eq 0) {
|
||||||
|
Write-Host "Cache is empty - exiting"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
$TEMP_DIR=New-Item -ItemType Directory -Path temp-cache
|
||||||
|
$TEMP_DIR_PATH = $TEMP_DIR.FullName
|
||||||
|
C:\ProgramData\Chocolatey\bin\7z.exe -y x $src_cache -o"$TEMP_DIR_PATH"
|
||||||
|
|
||||||
|
- name: Move Src Cache (Windows)
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
|
||||||
|
with:
|
||||||
|
timeout_minutes: 30
|
||||||
|
max_attempts: 3
|
||||||
|
retry_on: error
|
||||||
|
shell: powershell
|
||||||
|
command: |
|
||||||
|
if (Test-Path "temp-cache\src") {
|
||||||
|
Write-Host "Relocating Cache"
|
||||||
|
Remove-Item -Recurse -Force src
|
||||||
|
Move-Item temp-cache\src src
|
||||||
|
|
||||||
|
Write-Host "Deleting zip file"
|
||||||
|
Remove-Item -Force $src_cache
|
||||||
|
}
|
||||||
|
if (-Not (Test-Path "src\third_party\blink")) {
|
||||||
|
Write-Host "Cache was not correctly restored - exiting"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Wiping Electron Directory"
|
||||||
|
Remove-Item -Recurse -Force src\electron
|
||||||
|
|||||||
58
.github/actions/set-chromium-cookie/action.yml
vendored
Normal file
58
.github/actions/set-chromium-cookie/action.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
name: 'Set Chromium Git Cookie'
|
||||||
|
description: 'Sets an authenticated cookie from Chromium to allow for a higher request limit'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set the git cookie from chromium.googlesource.com (Unix)
|
||||||
|
if: ${{ runner.os != 'Windows' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ -z "${{ env.CHROMIUM_GIT_COOKIE }}" ]]; then
|
||||||
|
echo "CHROMIUM_GIT_COOKIE is not set - cannot authenticate."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
eval 'set +o history' 2>/dev/null || setopt HIST_IGNORE_SPACE 2>/dev/null
|
||||||
|
touch ~/.gitcookies
|
||||||
|
chmod 0600 ~/.gitcookies
|
||||||
|
|
||||||
|
git config --global http.cookiefile ~/.gitcookies
|
||||||
|
|
||||||
|
tr , \\t <<\__END__ >>~/.gitcookies
|
||||||
|
${{ env.CHROMIUM_GIT_COOKIE }}
|
||||||
|
__END__
|
||||||
|
eval 'set -o history' 2>/dev/null || unsetopt HIST_IGNORE_SPACE 2>/dev/null
|
||||||
|
|
||||||
|
RESPONSE=$(curl -s -b ~/.gitcookies https://chromium-review.googlesource.com/a/accounts/self)
|
||||||
|
if [[ $RESPONSE == ")]}'"* ]]; then
|
||||||
|
# Extract account email for verification
|
||||||
|
EMAIL=$(echo "$RESPONSE" | tail -c +5 | jq -r '.email // "No email found"')
|
||||||
|
echo "Cookie authentication successful - authenticated as: $EMAIL"
|
||||||
|
else
|
||||||
|
echo "Cookie authentication failed - ensure CHROMIUM_GIT_COOKIE is set correctly"
|
||||||
|
echo $RESPONSE
|
||||||
|
fi
|
||||||
|
- name: Set the git cookie from chromium.googlesource.com (Windows)
|
||||||
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
if "%CHROMIUM_GIT_COOKIE_WINDOWS_STRING%"=="" (
|
||||||
|
echo CHROMIUM_GIT_COOKIE_WINDOWS_STRING is not set - cannot authenticate.
|
||||||
|
exit /b 0
|
||||||
|
)
|
||||||
|
|
||||||
|
git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
|
||||||
|
powershell -noprofile -nologo -command Write-Output "${{ env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}" >>"%USERPROFILE%\.gitcookies"
|
||||||
|
|
||||||
|
curl -s -b "%USERPROFILE%\.gitcookies" https://chromium-review.googlesource.com/a/accounts/self > response.txt
|
||||||
|
|
||||||
|
findstr /B /C:")]}'" response.txt > nul
|
||||||
|
if %ERRORLEVEL% EQU 0 (
|
||||||
|
echo Cookie authentication successful
|
||||||
|
powershell -NoProfile -Command "& {$content = Get-Content -Raw response.txt; $content = $content.Substring(4); try { $json = ConvertFrom-Json $content; if($json.email) { Write-Host 'Authenticated as:' $json.email } else { Write-Host 'No email found in response' } } catch { Write-Host 'Error parsing JSON:' $_ }}"
|
||||||
|
) else (
|
||||||
|
echo Cookie authentication failed - ensure CHROMIUM_GIT_COOKIE_WINDOWS_STRING is set correctly
|
||||||
|
type response.txt
|
||||||
|
)
|
||||||
|
|
||||||
|
del response.txt
|
||||||
6
.github/workflows/archaeologist-dig.yml
vendored
6
.github/workflows/archaeologist-dig.yml
vendored
@@ -13,9 +13,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup Node.js/npm
|
- name: Setup Node.js/npm
|
||||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||||
with:
|
with:
|
||||||
node-version: 20.11.x
|
node-version: 20.19.x
|
||||||
- name: Setting Up Dig Site
|
- name: Setting Up Dig Site
|
||||||
run: |
|
run: |
|
||||||
echo "remote: ${{ github.event.pull_request.head.repo.clone_url }}"
|
echo "remote: ${{ github.event.pull_request.head.repo.clone_url }}"
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
sha-file: .dig-old
|
sha-file: .dig-old
|
||||||
filename: electron.old.d.ts
|
filename: electron.old.d.ts
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4.4.3
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
|
||||||
with:
|
with:
|
||||||
name: artifacts
|
name: artifacts
|
||||||
path: electron/artifacts
|
path: electron/artifacts
|
||||||
|
|||||||
9
.github/workflows/branch-created.yml
vendored
9
.github/workflows/branch-created.yml
vendored
@@ -94,7 +94,7 @@ jobs:
|
|||||||
}))
|
}))
|
||||||
- name: Create Release Project Board
|
- name: Create Release Project Board
|
||||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||||
uses: dsanders11/project-actions/copy-project@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/copy-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
id: create-release-board
|
id: create-release-board
|
||||||
with:
|
with:
|
||||||
drafts: true
|
drafts: true
|
||||||
@@ -114,14 +114,15 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||||
- name: Find Previous Release Project Board
|
- name: Find Previous Release Project Board
|
||||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||||
uses: dsanders11/project-actions/find-project@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/find-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
id: find-prev-release-board
|
id: find-prev-release-board
|
||||||
with:
|
with:
|
||||||
|
fail-if-project-not-found: false
|
||||||
title: ${{ steps.generate-project-metadata.outputs.prev-prev-major }}-x-y
|
title: ${{ steps.generate-project-metadata.outputs.prev-prev-major }}-x-y
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
- name: Close Previous Release Project Board
|
- name: Close Previous Release Project Board
|
||||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
if: ${{ steps.find-prev-release-board.outputs.number }}
|
||||||
uses: dsanders11/project-actions/close-project@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/close-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
with:
|
with:
|
||||||
project-number: ${{ steps.find-prev-release-board.outputs.number }}
|
project-number: ${{ steps.find-prev-release-board.outputs.number }}
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
|
|||||||
151
.github/workflows/build.yml
vendored
151
.github/workflows/build.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
build-image-sha:
|
build-image-sha:
|
||||||
type: string
|
type: string
|
||||||
description: 'SHA for electron/build image'
|
description: 'SHA for electron/build image'
|
||||||
default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
|
default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
|
||||||
required: true
|
required: true
|
||||||
skip-macos:
|
skip-macos:
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -18,6 +18,11 @@ on:
|
|||||||
description: 'Skip Linux builds'
|
description: 'Skip Linux builds'
|
||||||
default: false
|
default: false
|
||||||
required: false
|
required: false
|
||||||
|
skip-windows:
|
||||||
|
type: boolean
|
||||||
|
description: 'Skip Windows builds'
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
skip-lint:
|
skip-lint:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: 'Skip lint check'
|
description: 'Skip lint check'
|
||||||
@@ -28,7 +33,11 @@ on:
|
|||||||
- main
|
- main
|
||||||
- '[1-9][0-9]-x-y'
|
- '[1-9][0-9]-x-y'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -41,6 +50,8 @@ jobs:
|
|||||||
docs-only: ${{ steps.set-output.outputs.docs-only }}
|
docs-only: ${{ steps.set-output.outputs.docs-only }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.0.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.0.2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||||
id: filter
|
id: filter
|
||||||
with:
|
with:
|
||||||
@@ -53,7 +64,7 @@ jobs:
|
|||||||
id: set-output
|
id: set-output
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${{ inputs.build-image-sha }}" ]; then
|
if [ -z "${{ inputs.build-image-sha }}" ]; then
|
||||||
echo "build-image-sha=bc2f48b2415a670de18d13605b1cf0eb5fdbaae1" >> "$GITHUB_OUTPUT"
|
echo "build-image-sha=424eedbf277ad9749ffa9219068aa72ed4a5e373" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
|
echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
@@ -89,6 +100,7 @@ jobs:
|
|||||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
- /var/run/sas:/var/run/sas
|
- /var/run/sas:/var/run/sas
|
||||||
env:
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||||
outputs:
|
outputs:
|
||||||
build-image-sha: ${{ needs.setup.outputs.build-image-sha }}
|
build-image-sha: ${{ needs.setup.outputs.build-image-sha }}
|
||||||
@@ -98,10 +110,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Checkout & Sync & Save
|
- name: Checkout & Sync & Save
|
||||||
uses: ./src/electron/.github/actions/checkout
|
uses: ./src/electron/.github/actions/checkout
|
||||||
with:
|
with:
|
||||||
generate-sas-token: 'true'
|
generate-sas-token: 'true'
|
||||||
|
target-platform: macos
|
||||||
|
|
||||||
checkout-linux:
|
checkout-linux:
|
||||||
needs: setup
|
needs: setup
|
||||||
@@ -114,6 +128,7 @@ jobs:
|
|||||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
- /var/run/sas:/var/run/sas
|
- /var/run/sas:/var/run/sas
|
||||||
env:
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||||
PATCH_UP_APP_CREDS: ${{ secrets.PATCH_UP_APP_CREDS }}
|
PATCH_UP_APP_CREDS: ${{ secrets.PATCH_UP_APP_CREDS }}
|
||||||
outputs:
|
outputs:
|
||||||
@@ -124,9 +139,74 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Checkout & Sync & Save
|
- name: Checkout & Sync & Save
|
||||||
uses: ./src/electron/.github/actions/checkout
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
|
||||||
|
checkout-windows:
|
||||||
|
needs: setup
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
runs-on: electron-arc-linux-amd64-32core
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||||
|
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
|
||||||
|
volumes:
|
||||||
|
- /mnt/win-cache:/mnt/win-cache
|
||||||
|
- /var/run/sas:/var/run/sas
|
||||||
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
|
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
|
||||||
|
TARGET_OS: 'win'
|
||||||
|
ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
|
||||||
|
outputs:
|
||||||
|
build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Checkout & Sync & Save
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
with:
|
||||||
|
generate-sas-token: 'true'
|
||||||
|
target-platform: win
|
||||||
|
|
||||||
|
# GN Check Jobs
|
||||||
|
macos-gn-check:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||||
|
needs: checkout-macos
|
||||||
|
with:
|
||||||
|
target-platform: macos
|
||||||
|
target-archs: x64 arm64
|
||||||
|
check-runs-on: macos-14
|
||||||
|
gn-build-type: testing
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
linux-gn-check:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||||
|
needs: checkout-linux
|
||||||
|
with:
|
||||||
|
target-platform: linux
|
||||||
|
target-archs: x64 arm arm64
|
||||||
|
check-runs-on: electron-arc-linux-amd64-8core
|
||||||
|
check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
|
gn-build-type: testing
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-gn-check:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
with:
|
||||||
|
target-platform: win
|
||||||
|
target-archs: x64 x86 arm64
|
||||||
|
check-runs-on: electron-arc-linux-amd64-8core
|
||||||
|
check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-windows.outputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/win-cache:/mnt/win-cache"]}'
|
||||||
|
gn-build-type: testing
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
# Build Jobs - These cascade into testing jobs
|
# Build Jobs - These cascade into testing jobs
|
||||||
macos-x64:
|
macos-x64:
|
||||||
permissions:
|
permissions:
|
||||||
@@ -137,7 +217,6 @@ jobs:
|
|||||||
needs: checkout-macos
|
needs: checkout-macos
|
||||||
with:
|
with:
|
||||||
build-runs-on: macos-14-xlarge
|
build-runs-on: macos-14-xlarge
|
||||||
check-runs-on: macos-14
|
|
||||||
test-runs-on: macos-13
|
test-runs-on: macos-13
|
||||||
target-platform: macos
|
target-platform: macos
|
||||||
target-arch: x64
|
target-arch: x64
|
||||||
@@ -156,7 +235,6 @@ jobs:
|
|||||||
needs: checkout-macos
|
needs: checkout-macos
|
||||||
with:
|
with:
|
||||||
build-runs-on: macos-14-xlarge
|
build-runs-on: macos-14-xlarge
|
||||||
check-runs-on: macos-14
|
|
||||||
test-runs-on: macos-14
|
test-runs-on: macos-14
|
||||||
target-platform: macos
|
target-platform: macos
|
||||||
target-arch: arm64
|
target-arch: arm64
|
||||||
@@ -175,7 +253,6 @@ jobs:
|
|||||||
needs: checkout-linux
|
needs: checkout-linux
|
||||||
with:
|
with:
|
||||||
build-runs-on: electron-arc-linux-amd64-32core
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
check-runs-on: electron-arc-linux-amd64-8core
|
|
||||||
test-runs-on: electron-arc-linux-amd64-4core
|
test-runs-on: electron-arc-linux-amd64-4core
|
||||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||||
@@ -196,7 +273,6 @@ jobs:
|
|||||||
needs: checkout-linux
|
needs: checkout-linux
|
||||||
with:
|
with:
|
||||||
build-runs-on: electron-arc-linux-amd64-32core
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
check-runs-on: electron-arc-linux-amd64-8core
|
|
||||||
test-runs-on: electron-arc-linux-amd64-4core
|
test-runs-on: electron-arc-linux-amd64-4core
|
||||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||||
@@ -218,7 +294,6 @@ jobs:
|
|||||||
needs: checkout-linux
|
needs: checkout-linux
|
||||||
with:
|
with:
|
||||||
build-runs-on: electron-arc-linux-amd64-32core
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
check-runs-on: electron-arc-linux-amd64-8core
|
|
||||||
test-runs-on: electron-arc-linux-arm64-4core
|
test-runs-on: electron-arc-linux-arm64-4core
|
||||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
test-container: '{"image":"ghcr.io/electron/test:arm32v7-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init","volumes":["/home/runner/externals:/mnt/runner-externals"]}'
|
test-container: '{"image":"ghcr.io/electron/test:arm32v7-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init","volumes":["/home/runner/externals:/mnt/runner-externals"]}'
|
||||||
@@ -239,7 +314,6 @@ jobs:
|
|||||||
needs: checkout-linux
|
needs: checkout-linux
|
||||||
with:
|
with:
|
||||||
build-runs-on: electron-arc-linux-amd64-32core
|
build-runs-on: electron-arc-linux-amd64-32core
|
||||||
check-runs-on: electron-arc-linux-amd64-8core
|
|
||||||
test-runs-on: electron-arc-linux-arm64-4core
|
test-runs-on: electron-arc-linux-arm64-4core
|
||||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||||
test-container: '{"image":"ghcr.io/electron/test:arm64v8-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
test-container: '{"image":"ghcr.io/electron/test:arm64v8-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||||
@@ -251,10 +325,67 @@ jobs:
|
|||||||
upload-to-storage: '0'
|
upload-to-storage: '0'
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-x64:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
test-runs-on: windows-latest
|
||||||
|
target-platform: win
|
||||||
|
target-arch: x64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-x86:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
test-runs-on: windows-latest
|
||||||
|
target-platform: win
|
||||||
|
target-arch: x86
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
windows-arm64:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: read
|
||||||
|
pull-requests: read
|
||||||
|
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
|
with:
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
test-runs-on: electron-hosted-windows-arm64-4core
|
||||||
|
target-platform: win
|
||||||
|
target-arch: arm64
|
||||||
|
is-release: false
|
||||||
|
gn-build-type: testing
|
||||||
|
generate-symbols: false
|
||||||
|
upload-to-storage: '0'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
gha-done:
|
gha-done:
|
||||||
name: GitHub Actions Completed
|
name: GitHub Actions Completed
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64]
|
needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64, windows-x64, windows-x86, windows-arm64]
|
||||||
if: always() && !contains(needs.*.result, 'failure')
|
if: always() && !contains(needs.*.result, 'failure')
|
||||||
steps:
|
steps:
|
||||||
- name: GitHub Actions Jobs Done
|
- name: GitHub Actions Jobs Done
|
||||||
|
|||||||
12
.github/workflows/clean-src-cache.yml
vendored
12
.github/workflows/clean-src-cache.yml
vendored
@@ -1,8 +1,12 @@
|
|||||||
name: Clean Source Cache
|
name: Clean Source Cache
|
||||||
|
|
||||||
|
description: |
|
||||||
|
This workflow cleans up the source cache on the cross-instance cache volume
|
||||||
|
to free up space. It runs daily at midnight and clears files older than 15 days.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * SUN" # Run at midnight every Sunday
|
- cron: "0 0 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
clean-src-cache:
|
clean-src-cache:
|
||||||
@@ -12,10 +16,14 @@ jobs:
|
|||||||
options: --user root
|
options: --user root
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
|
- /mnt/win-cache:/mnt/win-cache
|
||||||
steps:
|
steps:
|
||||||
- name: Cleanup Source Cache
|
- name: Cleanup Source Cache
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
df -h /mnt/cross-instance-cache
|
df -h /mnt/cross-instance-cache
|
||||||
find /mnt/cross-instance-cache -type f -mtime +30 -delete
|
find /mnt/cross-instance-cache -type f -mtime +15 -delete
|
||||||
df -h /mnt/cross-instance-cache
|
df -h /mnt/cross-instance-cache
|
||||||
|
df -h /mnt/win-cache
|
||||||
|
find /mnt/win-cache -type f -mtime +15 -delete
|
||||||
|
df -h /mnt/win-cache
|
||||||
|
|||||||
14
.github/workflows/config/gclient.diff
vendored
14
.github/workflows/config/gclient.diff
vendored
@@ -1,14 +0,0 @@
|
|||||||
diff --git a/gclient.py b/gclient.py
|
|
||||||
index 59e2b4c5197928bdba1ef69bdbe637d7dfe471c1..b4bae5e48c83c84bd867187afaf40eed16e69851 100755
|
|
||||||
--- a/gclient.py
|
|
||||||
+++ b/gclient.py
|
|
||||||
@@ -783,7 +783,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
|
|
||||||
not condition or "non_git_source" not in condition):
|
|
||||||
continue
|
|
||||||
cipd_root = self.GetCipdRoot()
|
|
||||||
- for package in dep_value.get('packages', []):
|
|
||||||
+ packages = dep_value.get('packages', [])
|
|
||||||
+ for package in (x for x in packages if "infra/3pp/tools/swift-format" not in x.get('package')):
|
|
||||||
deps_to_add.append(
|
|
||||||
CipdDependency(parent=self,
|
|
||||||
name=name,
|
|
||||||
2
.github/workflows/issue-commented.yml
vendored
2
.github/workflows/issue-commented.yml
vendored
@@ -10,7 +10,7 @@ permissions: {}
|
|||||||
jobs:
|
jobs:
|
||||||
issue-commented:
|
issue-commented:
|
||||||
name: Remove blocked/{need-info,need-repro} on comment
|
name: Remove blocked/{need-info,need-repro} on comment
|
||||||
if: ${{ (contains(github.event.issue.labels.*.name, 'blocked/need-repro') || contains(github.event.issue.labels.*.name, 'blocked/need-info ❌')) && !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) && github.event.comment.user.type != 'Bot' }}
|
if: ${{ (contains(github.event.issue.labels.*.name, 'blocked/need-repro') || contains(github.event.issue.labels.*.name, 'blocked/need-info ❌')) && !contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.comment.author_association) && github.event.comment.user.type != 'Bot' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Generate GitHub App token
|
- name: Generate GitHub App token
|
||||||
|
|||||||
6
.github/workflows/issue-labeled.yml
vendored
6
.github/workflows/issue-labeled.yml
vendored
@@ -20,12 +20,13 @@ jobs:
|
|||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Set status
|
- name: Set status
|
||||||
uses: dsanders11/project-actions/edit-item@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 90
|
project-number: 90
|
||||||
field: Status
|
field: Status
|
||||||
field-value: ✅ Triaged
|
field-value: ✅ Triaged
|
||||||
|
fail-if-item-not-found: false
|
||||||
issue-labeled-blocked:
|
issue-labeled-blocked:
|
||||||
name: blocked/* label added
|
name: blocked/* label added
|
||||||
if: startsWith(github.event.label.name, 'blocked/')
|
if: startsWith(github.event.label.name, 'blocked/')
|
||||||
@@ -38,12 +39,13 @@ jobs:
|
|||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Set status
|
- name: Set status
|
||||||
uses: dsanders11/project-actions/edit-item@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 90
|
project-number: 90
|
||||||
field: Status
|
field: Status
|
||||||
field-value: 🛑 Blocked
|
field-value: 🛑 Blocked
|
||||||
|
fail-if-item-not-found: false
|
||||||
issue-labeled-blocked-need-repro:
|
issue-labeled-blocked-need-repro:
|
||||||
name: blocked/need-repro label added
|
name: blocked/need-repro label added
|
||||||
if: github.event.label.name == 'blocked/need-repro'
|
if: github.event.label.name == 'blocked/need-repro'
|
||||||
|
|||||||
2
.github/workflows/issue-opened.yml
vendored
2
.github/workflows/issue-opened.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Add to Issue Triage
|
- name: Add to Issue Triage
|
||||||
uses: dsanders11/project-actions/add-item@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/add-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
with:
|
with:
|
||||||
field: Reporter
|
field: Reporter
|
||||||
field-value: ${{ github.event.issue.user.login }}
|
field-value: ${{ github.event.issue.user.login }}
|
||||||
|
|||||||
5
.github/workflows/issue-transferred.yml
vendored
5
.github/workflows/issue-transferred.yml
vendored
@@ -10,6 +10,7 @@ jobs:
|
|||||||
issue-transferred:
|
issue-transferred:
|
||||||
name: Issue Transferred
|
name: Issue Transferred
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ !github.event.changes.new_repository.private }}
|
||||||
steps:
|
steps:
|
||||||
- name: Generate GitHub App token
|
- name: Generate GitHub App token
|
||||||
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
||||||
@@ -18,7 +19,9 @@ jobs:
|
|||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Remove from issue triage
|
- name: Remove from issue triage
|
||||||
uses: dsanders11/project-actions/delete-item@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/delete-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 90
|
project-number: 90
|
||||||
|
item: ${{ github.event.changes.new_issue.html_url }}
|
||||||
|
fail-if-item-not-found: false
|
||||||
|
|||||||
3
.github/workflows/issue-unlabeled.yml
vendored
3
.github/workflows/issue-unlabeled.yml
vendored
@@ -30,9 +30,10 @@ jobs:
|
|||||||
org: electron
|
org: electron
|
||||||
- name: Set status
|
- name: Set status
|
||||||
if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
|
if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
|
||||||
uses: dsanders11/project-actions/edit-item@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 90
|
project-number: 90
|
||||||
field: Status
|
field: Status
|
||||||
field-value: 📥 Was Blocked
|
field-value: 📥 Was Blocked
|
||||||
|
fail-if-item-not-found: false
|
||||||
|
|||||||
3
.github/workflows/linux-publish.yml
vendored
3
.github/workflows/linux-publish.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
build-image-sha:
|
build-image-sha:
|
||||||
type: string
|
type: string
|
||||||
description: 'SHA for electron/build image'
|
description: 'SHA for electron/build image'
|
||||||
default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
|
default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
|
||||||
upload-to-storage:
|
upload-to-storage:
|
||||||
description: 'Uploads to Azure storage'
|
description: 'Uploads to Azure storage'
|
||||||
required: false
|
required: false
|
||||||
@@ -27,6 +27,7 @@ jobs:
|
|||||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
- /var/run/sas:/var/run/sas
|
- /var/run/sas:/var/run/sas
|
||||||
env:
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Electron
|
- name: Checkout Electron
|
||||||
|
|||||||
4
.github/workflows/macos-publish.yml
vendored
4
.github/workflows/macos-publish.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
build-image-sha:
|
build-image-sha:
|
||||||
type: string
|
type: string
|
||||||
description: 'SHA for electron/build image'
|
description: 'SHA for electron/build image'
|
||||||
default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
|
default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
|
||||||
required: true
|
required: true
|
||||||
upload-to-storage:
|
upload-to-storage:
|
||||||
description: 'Uploads to Azure storage'
|
description: 'Uploads to Azure storage'
|
||||||
@@ -28,6 +28,7 @@ jobs:
|
|||||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||||
- /var/run/sas:/var/run/sas
|
- /var/run/sas:/var/run/sas
|
||||||
env:
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Electron
|
- name: Checkout Electron
|
||||||
@@ -39,6 +40,7 @@ jobs:
|
|||||||
uses: ./src/electron/.github/actions/checkout
|
uses: ./src/electron/.github/actions/checkout
|
||||||
with:
|
with:
|
||||||
generate-sas-token: 'true'
|
generate-sas-token: 'true'
|
||||||
|
target-platform: macos
|
||||||
|
|
||||||
publish-x64-darwin:
|
publish-x64-darwin:
|
||||||
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
target-platform:
|
target-platform:
|
||||||
type: string
|
type: string
|
||||||
description: 'Platform to run on, can be macos or linux'
|
description: 'Platform to run on, can be macos, win or linux.'
|
||||||
required: true
|
required: true
|
||||||
target-arch:
|
target-arch:
|
||||||
type: string
|
type: string
|
||||||
@@ -15,10 +15,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
description: 'What host to run the build'
|
description: 'What host to run the build'
|
||||||
required: true
|
required: true
|
||||||
check-runs-on:
|
|
||||||
type: string
|
|
||||||
description: 'What host to run the gn-check'
|
|
||||||
required: true
|
|
||||||
test-runs-on:
|
test-runs-on:
|
||||||
type: string
|
type: string
|
||||||
description: 'What host to run the tests on'
|
description: 'What host to run the tests on'
|
||||||
@@ -60,8 +56,8 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: electron-build-and-test-and-nan-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
|
group: electron-build-and-test-and-nan-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -76,16 +72,6 @@ jobs:
|
|||||||
generate-symbols: ${{ inputs.generate-symbols }}
|
generate-symbols: ${{ inputs.generate-symbols }}
|
||||||
upload-to-storage: ${{ inputs.upload-to-storage }}
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
gn-check:
|
|
||||||
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
|
||||||
with:
|
|
||||||
target-platform: ${{ inputs.target-platform }}
|
|
||||||
target-arch: ${{ inputs.target-arch }}
|
|
||||||
check-runs-on: ${{ inputs.check-runs-on }}
|
|
||||||
check-container: ${{ inputs.build-container }}
|
|
||||||
gn-build-type: ${{ inputs.gn-build-type }}
|
|
||||||
is-asan: ${{ inputs.is-asan }}
|
|
||||||
secrets: inherit
|
|
||||||
test:
|
test:
|
||||||
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
||||||
needs: build
|
needs: build
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
target-platform:
|
target-platform:
|
||||||
type: string
|
type: string
|
||||||
description: 'Platform to run on, can be macos or linux'
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
required: true
|
required: true
|
||||||
target-arch:
|
target-arch:
|
||||||
type: string
|
type: string
|
||||||
@@ -15,10 +15,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
description: 'What host to run the build'
|
description: 'What host to run the build'
|
||||||
required: true
|
required: true
|
||||||
check-runs-on:
|
|
||||||
type: string
|
|
||||||
description: 'What host to run the gn-check'
|
|
||||||
required: true
|
|
||||||
test-runs-on:
|
test-runs-on:
|
||||||
type: string
|
type: string
|
||||||
description: 'What host to run the tests on'
|
description: 'What host to run the tests on'
|
||||||
@@ -60,8 +56,8 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: electron-build-and-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
|
group: electron-build-and-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -82,16 +78,6 @@ jobs:
|
|||||||
upload-to-storage: ${{ inputs.upload-to-storage }}
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
is-asan: ${{ inputs.is-asan}}
|
is-asan: ${{ inputs.is-asan}}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
gn-check:
|
|
||||||
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
|
||||||
with:
|
|
||||||
target-platform: ${{ inputs.target-platform }}
|
|
||||||
target-arch: ${{ inputs.target-arch }}
|
|
||||||
check-runs-on: ${{ inputs.check-runs-on }}
|
|
||||||
check-container: ${{ inputs.build-container }}
|
|
||||||
gn-build-type: ${{ inputs.gn-build-type }}
|
|
||||||
is-asan: ${{ inputs.is-asan }}
|
|
||||||
secrets: inherit
|
|
||||||
test:
|
test:
|
||||||
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
uses: ./.github/workflows/pipeline-segment-electron-test.yml
|
||||||
needs: build
|
needs: build
|
||||||
|
|||||||
@@ -24,10 +24,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
cd src/electron
|
|
||||||
node script/yarn install --frozen-lockfile
|
|
||||||
- name: Run TS/JS compile
|
- name: Run TS/JS compile
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
14
.github/workflows/pipeline-electron-lint.yml
vendored
14
.github/workflows/pipeline-electron-lint.yml
vendored
@@ -9,8 +9,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: electron-lint-${{ github.ref }}
|
group: electron-lint-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
@@ -24,10 +27,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
cd src/electron
|
- name: Set Chromium Git Cookie
|
||||||
node script/yarn install --frozen-lockfile
|
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||||
- name: Setup third_party Depot Tools
|
- name: Setup third_party Depot Tools
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
target-platform:
|
target-platform:
|
||||||
type: string
|
type: string
|
||||||
description: 'Platform to run on, can be macos or linux'
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
required: true
|
required: true
|
||||||
target-arch:
|
target-arch:
|
||||||
type: string
|
type: string
|
||||||
description: 'Arch to build for, can be x64, arm64 or arm'
|
description: 'Arch to build for, can be x64, arm64, ia32 or arm'
|
||||||
required: true
|
required: true
|
||||||
target-variant:
|
target-variant:
|
||||||
type: string
|
type: string
|
||||||
@@ -61,19 +61,24 @@ on:
|
|||||||
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: electron-build-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.target-variant }}-${{ inputs.is-asan }}-${{ github.ref }}
|
group: electron-build-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.target-variant }}-${{ inputs.is-asan }}-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
|
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||||
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
|
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
|
||||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
||||||
SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
|
SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
|
||||||
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || inputs.target-platform == 'win' && '--custom-var=checkout_win=True' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
runs-on: ${{ inputs.build-runs-on }}
|
runs-on: ${{ inputs.build-runs-on }}
|
||||||
container: ${{ fromJSON(inputs.build-container) }}
|
container: ${{ fromJSON(inputs.build-container) }}
|
||||||
environment: ${{ inputs.environment }}
|
environment: ${{ inputs.environment }}
|
||||||
@@ -81,12 +86,14 @@ jobs:
|
|||||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
steps:
|
steps:
|
||||||
- name: Create src dir
|
- name: Create src dir
|
||||||
run: mkdir src
|
run: |
|
||||||
|
mkdir src
|
||||||
- name: Checkout Electron
|
- name: Checkout Electron
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Free up space (macOS)
|
- name: Free up space (macOS)
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
uses: ./src/electron/.github/actions/free-space-macos
|
uses: ./src/electron/.github/actions/free-space-macos
|
||||||
@@ -95,15 +102,13 @@ jobs:
|
|||||||
run: df -h
|
run: df -h
|
||||||
- name: Setup Node.js/npm
|
- name: Setup Node.js/npm
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||||
with:
|
with:
|
||||||
node-version: 20.11.x
|
node-version: 20.19.x
|
||||||
cache: yarn
|
cache: yarn
|
||||||
cache-dependency-path: src/electron/yarn.lock
|
cache-dependency-path: src/electron/yarn.lock
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
cd src/electron
|
|
||||||
node script/yarn install --frozen-lockfile
|
|
||||||
- name: Install AZCopy
|
- name: Install AZCopy
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
run: brew install azcopy
|
run: brew install azcopy
|
||||||
@@ -122,36 +127,21 @@ jobs:
|
|||||||
GN_EXTRA_ARGS='is_asan=true'
|
GN_EXTRA_ARGS='is_asan=true'
|
||||||
fi
|
fi
|
||||||
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
||||||
- name: Get Depot Tools
|
- name: Set Chromium Git Cookie
|
||||||
timeout-minutes: 5
|
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||||
run: |
|
- name: Install Build Tools
|
||||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
|
|
||||||
SEDOPTION="-i"
|
|
||||||
if [ "`uname`" = "Darwin" ]; then
|
|
||||||
SEDOPTION="-i ''"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
|
|
||||||
sed $SEDOPTION '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
|
||||||
|
|
||||||
# Ensure depot_tools does not update.
|
|
||||||
test -d depot_tools && cd depot_tools
|
|
||||||
if [ "`uname`" = "Linux" ]; then
|
|
||||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
|
||||||
fi
|
|
||||||
touch .disable_auto_update
|
|
||||||
- name: Add Depot Tools to PATH
|
|
||||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
|
||||||
- name: Generate DEPS Hash
|
- name: Generate DEPS Hash
|
||||||
run: |
|
run: |
|
||||||
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
node src/electron/script/generate-deps-hash.js
|
||||||
DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')
|
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
|
||||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||||
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||||
- name: Restore src cache via AZCopy
|
- name: Restore src cache via AZCopy
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform != 'linux' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||||
|
with:
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
- name: Restore src cache via AKS
|
- name: Restore src cache via AKS
|
||||||
if: ${{ inputs.target-platform == 'linux' }}
|
if: ${{ inputs.target-platform == 'linux' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||||
@@ -160,26 +150,29 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install Build Tools
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
uses: ./src/electron/.github/actions/install-build-tools
|
- name: Fix Sync
|
||||||
|
if: ${{ inputs.target-platform != 'linux' }}
|
||||||
|
uses: ./src/electron/.github/actions/fix-sync
|
||||||
|
with:
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
|
env:
|
||||||
|
ELECTRON_DEPOT_TOOLS_DISABLE_LOG: true
|
||||||
- name: Init Build Tools
|
- name: Init Build Tools
|
||||||
run: |
|
run: |
|
||||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||||
- name: Run Electron Only Hooks
|
- name: Run Electron Only Hooks
|
||||||
run: |
|
run: |
|
||||||
gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
e d gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
||||||
- name: Regenerate DEPS Hash
|
- name: Regenerate DEPS Hash
|
||||||
run: |
|
run: |
|
||||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
|
||||||
echo "DEPSHASH=$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
|
echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||||
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
||||||
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
||||||
- name: Fix Sync (macOS)
|
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
|
||||||
uses: ./src/electron/.github/actions/fix-sync-macos
|
|
||||||
- name: Setup Number of Ninja Processes
|
- name: Setup Number of Ninja Processes
|
||||||
run: |
|
run: |
|
||||||
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform == 'linux' && '300' || '200' }}" >> $GITHUB_ENV
|
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform != 'macos' && '300' || '200' }}" >> $GITHUB_ENV
|
||||||
- name: Free up space (macOS)
|
- name: Free up space (macOS)
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
uses: ./src/electron/.github/actions/free-space-macos
|
uses: ./src/electron/.github/actions/free-space-macos
|
||||||
@@ -189,7 +182,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
target-arch: ${{ inputs.target-arch }}
|
target-arch: ${{ inputs.target-arch }}
|
||||||
target-platform: ${{ inputs.target-platform }}
|
target-platform: ${{ inputs.target-platform }}
|
||||||
artifact-platform: ${{ inputs.target-platform == 'linux' && 'linux' || 'darwin' }}
|
artifact-platform: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}
|
||||||
is-release: '${{ inputs.is-release }}'
|
is-release: '${{ inputs.is-release }}'
|
||||||
generate-symbols: '${{ inputs.generate-symbols }}'
|
generate-symbols: '${{ inputs.generate-symbols }}'
|
||||||
strip-binaries: '${{ inputs.strip-binaries }}'
|
strip-binaries: '${{ inputs.strip-binaries }}'
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
target-platform:
|
target-platform:
|
||||||
type: string
|
type: string
|
||||||
description: 'Platform to run on, can be macos or linux'
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
required: true
|
required: true
|
||||||
target-arch:
|
target-archs:
|
||||||
type: string
|
type: string
|
||||||
description: 'Arch to build for, can be x64, arm64 or arm'
|
description: 'Archs to check for, can be x64, x86, arm64 or arm space separated'
|
||||||
required: true
|
required: true
|
||||||
check-runs-on:
|
check-runs-on:
|
||||||
type: string
|
type: string
|
||||||
@@ -25,35 +25,30 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
default: testing
|
default: testing
|
||||||
is-asan:
|
|
||||||
description: 'Building the Address Sanitizer (ASan) Linux build'
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: electron-gn-check-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref }}
|
group: electron-gn-check-${{ inputs.target-platform }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
|
GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || (inputs.target-platform == 'linux' && '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' || '--custom-var=checkout_win=True') }}
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
gn-check:
|
gn-check:
|
||||||
# TODO(codebytere): Change this to medium VM
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
runs-on: ${{ inputs.check-runs-on }}
|
runs-on: ${{ inputs.check-runs-on }}
|
||||||
container: ${{ fromJSON(inputs.check-container) }}
|
container: ${{ fromJSON(inputs.check-container) }}
|
||||||
env:
|
|
||||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Electron
|
- name: Checkout Electron
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Cleanup disk space on macOS
|
- name: Cleanup disk space on macOS
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -70,61 +65,49 @@ jobs:
|
|||||||
sudo rm -rf $TMPDIR/del-target
|
sudo rm -rf $TMPDIR/del-target
|
||||||
- name: Check disk space after freeing up space
|
- name: Check disk space after freeing up space
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
run: df -h
|
run: df -h
|
||||||
|
- name: Set Chromium Git Cookie
|
||||||
|
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||||
- name: Install Build Tools
|
- name: Install Build Tools
|
||||||
uses: ./src/electron/.github/actions/install-build-tools
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
- name: Init Build Tools
|
- name: Enable windows toolchain
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
run: |
|
run: |
|
||||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
|
||||||
- name: Get Depot Tools
|
|
||||||
timeout-minutes: 5
|
|
||||||
run: |
|
|
||||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
||||||
|
|
||||||
SEDOPTION="-i"
|
|
||||||
if [ "`uname`" = "Darwin" ]; then
|
|
||||||
SEDOPTION="-i ''"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
|
|
||||||
sed $SEDOPTION '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
|
||||||
|
|
||||||
# Ensure depot_tools does not update.
|
|
||||||
test -d depot_tools && cd depot_tools
|
|
||||||
if [ "`uname`" = "Linux" ]; then
|
|
||||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
|
||||||
fi
|
|
||||||
touch .disable_auto_update
|
|
||||||
- name: Add Depot Tools to PATH
|
|
||||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
|
||||||
- name: Set GN_EXTRA_ARGS for Linux
|
|
||||||
if: ${{ inputs.target-platform == 'linux' }}
|
|
||||||
run: |
|
|
||||||
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
|
||||||
GN_EXTRA_ARGS='build_tflite_with_xnnpack=false'
|
|
||||||
elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
|
|
||||||
GN_EXTRA_ARGS='fatal_linker_warnings=false enable_linux_installer=false'
|
|
||||||
fi
|
|
||||||
echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
|
|
||||||
- name: Generate DEPS Hash
|
- name: Generate DEPS Hash
|
||||||
run: |
|
run: |
|
||||||
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
node src/electron/script/generate-deps-hash.js
|
||||||
DEPSHASH=v1-src-cache-$(shasum src/electron/.depshash | cut -f1 -d' ')
|
DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
|
||||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||||
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||||
- name: Restore src cache via AZCopy
|
- name: Restore src cache via AZCopy
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||||
|
with:
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
- name: Restore src cache via AKS
|
- name: Restore src cache via AKS
|
||||||
if: ${{ inputs.target-platform == 'linux' }}
|
if: ${{ inputs.target-platform == 'linux' || inputs.target-platform == 'win' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||||
|
with:
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
- name: Run Electron Only Hooks
|
- name: Run Electron Only Hooks
|
||||||
run: |
|
run: |
|
||||||
gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False,'install_sysroot':False,'checkout_win':True},'managed':False}]" > tmpgclient
|
||||||
|
echo "target_os=['win']" >> tmpgclient
|
||||||
|
fi
|
||||||
|
e d gclient runhooks --gclientfile=tmpgclient
|
||||||
|
|
||||||
|
# Fix VS Toolchain
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
rm -rf src/third_party/depot_tools/win_toolchain/vs_files
|
||||||
|
e d python3 src/build/vs_toolchain.py update --force
|
||||||
|
fi
|
||||||
- name: Regenerate DEPS Hash
|
- name: Regenerate DEPS Hash
|
||||||
run: |
|
run: |
|
||||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
|
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
|
||||||
echo "DEPSHASH=$(shasum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
|
echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
|
||||||
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
- name: Add CHROMIUM_BUILDTOOLS_PATH to env
|
||||||
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
|
||||||
- name: Checkout Electron
|
- name: Checkout Electron
|
||||||
@@ -132,30 +115,46 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
cd src/electron
|
|
||||||
node script/yarn install --frozen-lockfile
|
|
||||||
- name: Default GN gen
|
- name: Default GN gen
|
||||||
run: |
|
run: |
|
||||||
cd src/electron
|
cd src/electron
|
||||||
git pack-refs
|
git pack-refs
|
||||||
cd ..
|
- name: Run GN Check for ${{ inputs.target-archs }}
|
||||||
|
|
||||||
e build --only-gen
|
|
||||||
- name: Run GN Check
|
|
||||||
run: |
|
run: |
|
||||||
cd src
|
for target_cpu in ${{ inputs.target-archs }}
|
||||||
gn check out/Default //electron:electron_lib
|
do
|
||||||
gn check out/Default //electron:electron_app
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu $target_cpu
|
||||||
gn check out/Default //electron/shell/common:mojo
|
cd src
|
||||||
gn check out/Default //electron/shell/common:plugin
|
export GN_EXTRA_ARGS="target_cpu=\"$target_cpu\""
|
||||||
|
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||||
|
if [ "$target_cpu" = "arm" ]; then
|
||||||
|
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS build_tflite_with_xnnpack=false"
|
||||||
|
elif [ "$target_cpu" = "arm64" ]; then
|
||||||
|
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS fatal_linker_warnings=false enable_linux_installer=false"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
|
||||||
|
fi
|
||||||
|
|
||||||
# Check the hunspell filenames
|
e build --only-gen
|
||||||
node electron/script/gen-hunspell-filenames.js --check
|
|
||||||
node electron/script/gen-libc++-filenames.js --check
|
e d gn check out/Default //electron:electron_lib
|
||||||
|
e d gn check out/Default //electron:electron_app
|
||||||
|
e d gn check out/Default //electron/shell/common:mojo
|
||||||
|
e d gn check out/Default //electron/shell/common:plugin
|
||||||
|
|
||||||
|
# Check the hunspell filenames
|
||||||
|
node electron/script/gen-hunspell-filenames.js --check
|
||||||
|
node electron/script/gen-libc++-filenames.js --check
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
- name: Wait for active SSH sessions
|
- name: Wait for active SSH sessions
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
while [ -f /var/.ssh-lock ]
|
while [ -f /var/.ssh-lock ]
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
target-platform:
|
target-platform:
|
||||||
type: string
|
type: string
|
||||||
description: 'Platform to run on, can be macos or linux'
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
required: true
|
required: true
|
||||||
target-arch:
|
target-arch:
|
||||||
type: string
|
type: string
|
||||||
@@ -27,8 +27,8 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref }}
|
group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -36,27 +36,52 @@ permissions:
|
|||||||
pull-requests: read
|
pull-requests: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
|
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
runs-on: ${{ inputs.test-runs-on }}
|
runs-on: ${{ inputs.test-runs-on }}
|
||||||
container: ${{ fromJSON(inputs.test-container) }}
|
container: ${{ fromJSON(inputs.test-container) }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || fromJSON('["linux"]') }}
|
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'win' && fromJSON('["win"]') || fromJSON('["linux"]')) }}
|
||||||
shard: ${{ inputs.target-platform == 'macos' && fromJSON('[1, 2]') || fromJSON('[1, 2, 3]') }}
|
shard: ${{ inputs.target-platform == 'linux' && fromJSON('[1, 2, 3]') || fromJSON('[1, 2]') }}
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: ${{ matrix.build-type }}
|
BUILD_TYPE: ${{ matrix.build-type }}
|
||||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
ARTIFACT_KEY: ${{ matrix.build-type }}_${{ inputs.target-arch }}
|
ARTIFACT_KEY: ${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||||
steps:
|
steps:
|
||||||
- name: Fix node20 on arm32 runners
|
- name: Fix node20 on arm32 runners
|
||||||
if: ${{ inputs.target-arch == 'arm' }}
|
if: ${{ inputs.target-arch == 'arm' && inputs.target-platform == 'linux' }}
|
||||||
run: |
|
run: |
|
||||||
cp $(which node) /mnt/runner-externals/node20/bin/
|
cp $(which node) /mnt/runner-externals/node20/bin/
|
||||||
|
- name: Install Git on Windows arm64 runners
|
||||||
|
if: ${{ inputs.target-arch == 'arm64' && inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
|
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||||
|
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||||
|
choco install -y --no-progress git.install --params "'/GitAndUnixToolsOnPath'"
|
||||||
|
choco install -y --no-progress git
|
||||||
|
choco install -y --no-progress python --version 3.11.9
|
||||||
|
choco install -y --no-progress visualstudio2022-workload-vctools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64"
|
||||||
|
echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
echo "C:\Python311" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||||
|
cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
|
||||||
|
- name: Setup Node.js/npm
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||||
|
with:
|
||||||
|
node-version: 20.19.x
|
||||||
- name: Add TCC permissions on macOS
|
- name: Add TCC permissions on macOS
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -90,29 +115,30 @@ jobs:
|
|||||||
configure_sys_tccdb "$values"
|
configure_sys_tccdb "$values"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
- name: Turn off the unexpectedly quit dialog on macOS
|
||||||
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
|
run: defaults write com.apple.CrashReporter DialogType server
|
||||||
- name: Checkout Electron
|
- name: Checkout Electron
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
cd src/electron
|
- name: Set Chromium Git Cookie
|
||||||
node script/yarn install --frozen-lockfile
|
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||||
- name: Get Depot Tools
|
- name: Get Depot Tools
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
run: |
|
run: |
|
||||||
|
git config --global core.filemode false
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global branch.autosetuprebase always
|
||||||
|
git config --global core.fscache true
|
||||||
|
git config --global core.preloadindex true
|
||||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
# Ensure depot_tools does not update.
|
# Ensure depot_tools does not update.
|
||||||
test -d depot_tools && cd depot_tools
|
test -d depot_tools && cd depot_tools
|
||||||
if [ "`uname`" = "Darwin" ]; then
|
|
||||||
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
|
|
||||||
sed -i '' '/ninjalog_uploader_wrapper.py/d' ./autoninja
|
|
||||||
else
|
|
||||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./autoninja
|
|
||||||
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
|
|
||||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
|
||||||
fi
|
|
||||||
touch .disable_auto_update
|
touch .disable_auto_update
|
||||||
- name: Add Depot Tools to PATH
|
- name: Add Depot Tools to PATH
|
||||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
||||||
@@ -123,18 +149,28 @@ jobs:
|
|||||||
echo "DISABLE_CRASH_REPORTER_TESTS=true" >> $GITHUB_ENV
|
echo "DISABLE_CRASH_REPORTER_TESTS=true" >> $GITHUB_ENV
|
||||||
echo "IS_ASAN=true" >> $GITHUB_ENV
|
echo "IS_ASAN=true" >> $GITHUB_ENV
|
||||||
- name: Download Generated Artifacts
|
- name: Download Generated Artifacts
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
with:
|
with:
|
||||||
name: generated_artifacts_${{ env.ARTIFACT_KEY }}
|
name: generated_artifacts_${{ env.ARTIFACT_KEY }}
|
||||||
path: ./generated_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
path: ./generated_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||||
- name: Download Src Artifacts
|
- name: Download Src Artifacts
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
with:
|
with:
|
||||||
name: src_artifacts_${{ env.ARTIFACT_KEY }}
|
name: src_artifacts_${{ env.ARTIFACT_KEY }}
|
||||||
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||||
- name: Restore Generated Artifacts
|
- name: Restore Generated Artifacts
|
||||||
run: ./src/electron/script/actions/restore-artifacts.sh
|
run: ./src/electron/script/actions/restore-artifacts.sh
|
||||||
- name: Unzip Dist, Mksnapshot & Chromedriver
|
- name: Unzip Dist, Mksnapshot & Chromedriver (win)
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
|
cd src/out/Default
|
||||||
|
Expand-Archive -Force dist.zip -DestinationPath ./
|
||||||
|
Expand-Archive -Force chromedriver.zip -DestinationPath ./
|
||||||
|
Expand-Archive -Force mksnapshot.zip -DestinationPath ./
|
||||||
|
- name: Unzip Dist, Mksnapshot & Chromedriver (unix)
|
||||||
|
if: ${{ inputs.target-platform != 'win' }}
|
||||||
run: |
|
run: |
|
||||||
cd src/out/Default
|
cd src/out/Default
|
||||||
unzip -:o dist.zip
|
unzip -:o dist.zip
|
||||||
@@ -158,15 +194,24 @@ jobs:
|
|||||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
||||||
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
||||||
DISPLAY: ':99.0'
|
DISPLAY: ':99.0'
|
||||||
|
NPM_CONFIG_MSVS_VERSION: '2022'
|
||||||
run: |
|
run: |
|
||||||
cd src/electron
|
cd src/electron
|
||||||
export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit
|
export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit
|
||||||
# Get which tests are on this shard
|
# Get which tests are on this shard
|
||||||
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'macos' && 2 || 3 }})
|
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'linux' && 3 || 2 }})
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
if [ "`uname`" = "Darwin" ]; then
|
if [ "${{ inputs.target-platform }}" != "linux" ]; then
|
||||||
echo "About to start tests"
|
echo "About to start tests"
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
if [ "${{ inputs.target-arch }}" = "x86" ]; then
|
||||||
|
export npm_config_arch="ia32"
|
||||||
|
fi
|
||||||
|
if [ "${{ inputs.target-arch }}" = "arm64" ]; then
|
||||||
|
export ELECTRON_FORCE_TEST_SUITE_EXIT="true"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
node script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
|
node script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
|
||||||
else
|
else
|
||||||
chown :builduser .. && chmod g+w ..
|
chown :builduser .. && chmod g+w ..
|
||||||
@@ -197,19 +242,21 @@ jobs:
|
|||||||
DD_CIVISIBILITY_LOGS_ENABLED: true
|
DD_CIVISIBILITY_LOGS_ENABLED: true
|
||||||
DD_TAGS: "os.architecture:${{ inputs.target-arch }},os.family:${{ inputs.target-platform }},os.platform:${{ inputs.target-platform }},asan:${{ inputs.is-asan }}"
|
DD_TAGS: "os.architecture:${{ inputs.target-arch }},os.family:${{ inputs.target-platform }},os.platform:${{ inputs.target-platform }},asan:${{ inputs.is-asan }}"
|
||||||
run: |
|
run: |
|
||||||
if ! [ -z $DD_API_KEY ]; then
|
if ! [ -z $DD_API_KEY ] && [ -f src/electron/junit/test-results-main.xml ]; then
|
||||||
datadog-ci junit upload src/electron/junit/test-results-main.xml
|
export DATADOG_PATH=`node src/electron/script/yarn global bin`
|
||||||
|
$DATADOG_PATH/datadog-ci junit upload src/electron/junit/test-results-main.xml
|
||||||
fi
|
fi
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
- name: Upload Test Artifacts
|
- name: Upload Test Artifacts
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||||
with:
|
with:
|
||||||
name: test_artifacts_${{ env.ARTIFACT_KEY }}
|
name: test_artifacts_${{ env.ARTIFACT_KEY }}_${{ matrix.shard }}
|
||||||
path: src/electron/spec/artifacts
|
path: src/electron/spec/artifacts
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
- name: Wait for active SSH sessions
|
- name: Wait for active SSH sessions
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
while [ -f /var/.ssh-lock ]
|
while [ -f /var/.ssh-lock ]
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
target-platform:
|
target-platform:
|
||||||
type: string
|
type: string
|
||||||
description: 'Platform to run on, can be macos or linux'
|
description: 'Platform to run on, can be macos, win or linux'
|
||||||
required: true
|
required: true
|
||||||
target-arch:
|
target-arch:
|
||||||
type: string
|
type: string
|
||||||
@@ -27,10 +27,11 @@ on:
|
|||||||
default: testing
|
default: testing
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: electron-node-nan-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref }}
|
group: electron-node-nan-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !endsWith(github.ref, '-x-y') }}
|
cancel-in-progress: ${{ github.ref_protected != true }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||||
ELECTRON_OUT_DIR: Default
|
ELECTRON_OUT_DIR: Default
|
||||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ jobs:
|
|||||||
node-tests:
|
node-tests:
|
||||||
name: Run Node.js Tests
|
name: Run Node.js Tests
|
||||||
runs-on: electron-arc-linux-amd64-8core
|
runs-on: electron-arc-linux-amd64-8core
|
||||||
timeout-minutes: 20
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
BUILD_TYPE: linux
|
BUILD_TYPE: linux
|
||||||
@@ -49,33 +50,23 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Set Chromium Git Cookie
|
||||||
|
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||||
- name: Install Build Tools
|
- name: Install Build Tools
|
||||||
uses: ./src/electron/.github/actions/install-build-tools
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
- name: Init Build Tools
|
- name: Init Build Tools
|
||||||
run: |
|
run: |
|
||||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
cd src/electron
|
|
||||||
node script/yarn install --frozen-lockfile
|
|
||||||
- name: Get Depot Tools
|
|
||||||
timeout-minutes: 5
|
|
||||||
run: |
|
|
||||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
||||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
|
||||||
# Ensure depot_tools does not update.
|
|
||||||
test -d depot_tools && cd depot_tools
|
|
||||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
|
||||||
touch .disable_auto_update
|
|
||||||
- name: Add Depot Tools to PATH
|
|
||||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
|
||||||
- name: Download Generated Artifacts
|
- name: Download Generated Artifacts
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
with:
|
with:
|
||||||
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||||
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||||
- name: Download Src Artifacts
|
- name: Download Src Artifacts
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
with:
|
with:
|
||||||
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||||
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||||
@@ -93,6 +84,7 @@ jobs:
|
|||||||
node electron/script/node-spec-runner.js --default --jUnitDir=junit
|
node electron/script/node-spec-runner.js --default --jUnitDir=junit
|
||||||
- name: Wait for active SSH sessions
|
- name: Wait for active SSH sessions
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
while [ -f /var/.ssh-lock ]
|
while [ -f /var/.ssh-lock ]
|
||||||
do
|
do
|
||||||
@@ -101,7 +93,7 @@ jobs:
|
|||||||
nan-tests:
|
nan-tests:
|
||||||
name: Run Nan Tests
|
name: Run Nan Tests
|
||||||
runs-on: electron-arc-linux-amd64-4core
|
runs-on: electron-arc-linux-amd64-4core
|
||||||
timeout-minutes: 20
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||||
BUILD_TYPE: linux
|
BUILD_TYPE: linux
|
||||||
@@ -112,33 +104,23 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: src/electron
|
path: src/electron
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Set Chromium Git Cookie
|
||||||
|
uses: ./src/electron/.github/actions/set-chromium-cookie
|
||||||
- name: Install Build Tools
|
- name: Install Build Tools
|
||||||
uses: ./src/electron/.github/actions/install-build-tools
|
uses: ./src/electron/.github/actions/install-build-tools
|
||||||
- name: Init Build Tools
|
- name: Init Build Tools
|
||||||
run: |
|
run: |
|
||||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }}
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }}
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
uses: ./src/electron/.github/actions/install-dependencies
|
||||||
cd src/electron
|
|
||||||
node script/yarn install --frozen-lockfile
|
|
||||||
- name: Get Depot Tools
|
|
||||||
timeout-minutes: 5
|
|
||||||
run: |
|
|
||||||
git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
||||||
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
|
|
||||||
# Ensure depot_tools does not update.
|
|
||||||
test -d depot_tools && cd depot_tools
|
|
||||||
git apply --3way ../src/electron/.github/workflows/config/gclient.diff
|
|
||||||
touch .disable_auto_update
|
|
||||||
- name: Add Depot Tools to PATH
|
|
||||||
run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
|
|
||||||
- name: Download Generated Artifacts
|
- name: Download Generated Artifacts
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
with:
|
with:
|
||||||
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||||
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
|
||||||
- name: Download Src Artifacts
|
- name: Download Src Artifacts
|
||||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||||
with:
|
with:
|
||||||
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
name: src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||||
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
|
||||||
@@ -155,6 +137,7 @@ jobs:
|
|||||||
cd src
|
cd src
|
||||||
node electron/script/nan-spec-runner.js
|
node electron/script/nan-spec-runner.js
|
||||||
- name: Wait for active SSH sessions
|
- name: Wait for active SSH sessions
|
||||||
|
shell: bash
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
run: |
|
run: |
|
||||||
while [ -f /var/.ssh-lock ]
|
while [ -f /var/.ssh-lock ]
|
||||||
|
|||||||
8
.github/workflows/pull-request-labeled.yml
vendored
8
.github/workflows/pull-request-labeled.yml
vendored
@@ -13,14 +13,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger Slack workflow
|
- name: Trigger Slack workflow
|
||||||
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
|
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
|
||||||
with:
|
with:
|
||||||
|
webhook: ${{ secrets.BACKPORT_REQUESTED_SLACK_WEBHOOK_URL }}
|
||||||
|
webhook-type: webhook-trigger
|
||||||
payload: |
|
payload: |
|
||||||
{
|
{
|
||||||
"url": "${{ github.event.pull_request.html_url }}"
|
"url": "${{ github.event.pull_request.html_url }}"
|
||||||
}
|
}
|
||||||
env:
|
|
||||||
SLACK_WEBHOOK_URL: ${{ secrets.BACKPORT_REQUESTED_SLACK_WEBHOOK_URL }}
|
|
||||||
pull-request-labeled-deprecation-review-complete:
|
pull-request-labeled-deprecation-review-complete:
|
||||||
name: deprecation-review/complete label added
|
name: deprecation-review/complete label added
|
||||||
if: github.event.label.name == 'deprecation-review/complete ✅'
|
if: github.event.label.name == 'deprecation-review/complete ✅'
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
|
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
|
||||||
org: electron
|
org: electron
|
||||||
- name: Set status
|
- name: Set status
|
||||||
uses: dsanders11/project-actions/edit-item@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
project-number: 94
|
project-number: 94
|
||||||
|
|||||||
6
.github/workflows/scorecards.yml
vendored
6
.github/workflows/scorecards.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
# This is a pre-submit / pre-release.
|
# This is a pre-submit / pre-release.
|
||||||
- name: "Run analysis"
|
- name: "Run analysis"
|
||||||
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
|
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
|
||||||
with:
|
with:
|
||||||
results_file: results.sarif
|
results_file: results.sarif
|
||||||
results_format: sarif
|
results_format: sarif
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||||
# format to the repository Actions tab.
|
# format to the repository Actions tab.
|
||||||
- name: "Upload artifact"
|
- name: "Upload artifact"
|
||||||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: SARIF file
|
name: SARIF file
|
||||||
path: results.sarif
|
path: results.sarif
|
||||||
@@ -50,6 +50,6 @@ jobs:
|
|||||||
|
|
||||||
# Upload the results to GitHub's code scanning dashboard.
|
# Upload the results to GitHub's code scanning dashboard.
|
||||||
- name: "Upload to code-scanning"
|
- name: "Upload to code-scanning"
|
||||||
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
|
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
|
|||||||
2
.github/workflows/stable-prep-items.yml
vendored
2
.github/workflows/stable-prep-items.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
PROJECT_NUMBER=$(gh project list --owner electron --format json | jq -r '.projects | map(select(.title | test("^[0-9]+-x-y$"))) | max_by(.number) | .number')
|
PROJECT_NUMBER=$(gh project list --owner electron --format json | jq -r '.projects | map(select(.title | test("^[0-9]+-x-y$"))) | max_by(.number) | .number')
|
||||||
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_OUTPUT"
|
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_OUTPUT"
|
||||||
- name: Update Completed Stable Prep Items
|
- name: Update Completed Stable Prep Items
|
||||||
uses: dsanders11/project-actions/completed-by@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
|
uses: dsanders11/project-actions/completed-by@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
|
||||||
with:
|
with:
|
||||||
field: Prep Status
|
field: Prep Status
|
||||||
field-value: ✅ Complete
|
field-value: ✅ Complete
|
||||||
|
|||||||
4
.github/workflows/stale.yml
vendored
4
.github/workflows/stale.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
id: generate-token
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # tag: v9.0.0
|
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # tag: v9.1.0
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.generate-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
days-before-stale: 90
|
days-before-stale: 90
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
id: generate-token
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||||
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # tag: v9.0.0
|
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # tag: v9.1.0
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ steps.generate-token.outputs.token }}
|
repo-token: ${{ steps.generate-token.outputs.token }}
|
||||||
days-before-stale: -1
|
days-before-stale: -1
|
||||||
|
|||||||
77
.github/workflows/update_appveyor_image.yml
vendored
77
.github/workflows/update_appveyor_image.yml
vendored
@@ -1,77 +0,0 @@
|
|||||||
name: Update AppVeyor Image
|
|
||||||
|
|
||||||
# Run chron daily Mon-Fri
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 8 * * 1-5' # runs 8:00 every business day (see https://crontab.guru)
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
bake-appveyor-image:
|
|
||||||
name: Bake AppVeyor Image
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Generate GitHub App token
|
|
||||||
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
|
||||||
id: generate-token
|
|
||||||
with:
|
|
||||||
creds: ${{ secrets.APPVEYOR_UPDATER_GH_APP_CREDS }}
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
|
||||||
with:
|
|
||||||
node-version: 20.11.x
|
|
||||||
- name: Yarn install
|
|
||||||
run: |
|
|
||||||
node script/yarn.js install --frozen-lockfile
|
|
||||||
- name: Set Repo for Commit
|
|
||||||
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
|
||||||
- name: Check AppVeyor Image
|
|
||||||
env:
|
|
||||||
APPVEYOR_TOKEN: ${{ secrets.APPVEYOR_TOKEN }}
|
|
||||||
run: |
|
|
||||||
node ./script/prepare-appveyor
|
|
||||||
if [ -f ./image_version.txt ]; then
|
|
||||||
echo "APPVEYOR_IMAGE_VERSION="$(cat image_version.txt)"" >> $GITHUB_ENV
|
|
||||||
rm image_version.txt
|
|
||||||
fi
|
|
||||||
- name: (Optionally) Update Appveyor Image
|
|
||||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
|
||||||
uses: mikefarah/yq@4839dbbf80445070a31c7a9c1055da527db2d5ee # v4.44.6
|
|
||||||
with:
|
|
||||||
cmd: |
|
|
||||||
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
|
|
||||||
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor-woa.yml" > "appveyor-woa2.yml"
|
|
||||||
- name: (Optionally) Generate Commit Diff
|
|
||||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
|
||||||
run: |
|
|
||||||
diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true
|
|
||||||
patch -f appveyor.yml < appveyor.diff
|
|
||||||
rm appveyor2.yml appveyor.diff
|
|
||||||
git add appveyor.yml
|
|
||||||
- name: (Optionally) Generate Commit Diff for WOA
|
|
||||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
|
||||||
run: |
|
|
||||||
diff -w -B appveyor-woa.yml appveyor-woa2.yml > appveyor-woa.diff || true
|
|
||||||
patch -f appveyor-woa.yml < appveyor-woa.diff
|
|
||||||
rm appveyor-woa2.yml appveyor-woa.diff
|
|
||||||
git add appveyor-woa.yml
|
|
||||||
- name: (Optionally) Commit to Branch
|
|
||||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
|
||||||
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
|
|
||||||
with:
|
|
||||||
message: 'build: update appveyor image to latest version'
|
|
||||||
ref: bump-appveyor-image
|
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
|
||||||
- name: (Optionally) Create Pull Request
|
|
||||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
|
||||||
run: |
|
|
||||||
printf "This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.\n\nNotes: none" | gh pr create --head bump-appveyor-image --label no-backport --label semver/none --title 'build: update appveyor image to latest version' --body-file=-
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
|
||||||
89
.github/workflows/windows-publish.yml
vendored
Normal file
89
.github/workflows/windows-publish.yml
vendored
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
name: Publish Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
build-image-sha:
|
||||||
|
type: string
|
||||||
|
description: 'SHA for electron/build image'
|
||||||
|
default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
|
||||||
|
required: true
|
||||||
|
upload-to-storage:
|
||||||
|
description: 'Uploads to Azure storage'
|
||||||
|
required: false
|
||||||
|
default: '1'
|
||||||
|
type: string
|
||||||
|
run-windows-publish:
|
||||||
|
description: 'Run the publish jobs vs just the build jobs'
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkout-windows:
|
||||||
|
runs-on: electron-arc-linux-amd64-32core
|
||||||
|
container:
|
||||||
|
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||||
|
options: --user root --device /dev/fuse --cap-add SYS_ADMIN
|
||||||
|
volumes:
|
||||||
|
- /mnt/win-cache:/mnt/win-cache
|
||||||
|
- /var/run/sas:/var/run/sas
|
||||||
|
env:
|
||||||
|
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
|
||||||
|
TARGET_OS: 'win'
|
||||||
|
ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
|
||||||
|
outputs:
|
||||||
|
build-image-sha: ${{ inputs.build-image-sha }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Electron
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
with:
|
||||||
|
path: src/electron
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Checkout & Sync & Save
|
||||||
|
uses: ./src/electron/.github/actions/checkout
|
||||||
|
with:
|
||||||
|
generate-sas-token: 'true'
|
||||||
|
target-platform: win
|
||||||
|
|
||||||
|
publish-x64-win:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
target-platform: win
|
||||||
|
target-arch: x64
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
publish-arm64-win:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
target-platform: win
|
||||||
|
target-arch: arm64
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
publish-x86-win:
|
||||||
|
uses: ./.github/workflows/pipeline-segment-electron-build.yml
|
||||||
|
needs: checkout-windows
|
||||||
|
with:
|
||||||
|
environment: production-release
|
||||||
|
build-runs-on: electron-arc-windows-amd64-16core
|
||||||
|
target-platform: win
|
||||||
|
target-arch: x86
|
||||||
|
is-release: true
|
||||||
|
gn-build-type: release
|
||||||
|
generate-symbols: true
|
||||||
|
upload-to-storage: ${{ inputs.upload-to-storage }}
|
||||||
|
secrets: inherit
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -48,7 +48,6 @@ ts-gen
|
|||||||
|
|
||||||
# Used to accelerate CI builds
|
# Used to accelerate CI builds
|
||||||
.depshash
|
.depshash
|
||||||
.depshash-target
|
|
||||||
|
|
||||||
# Used to accelerate builds after sync
|
# Used to accelerate builds after sync
|
||||||
patches/mtime-cache.json
|
patches/mtime-cache.json
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"config": {
|
"config": {
|
||||||
"extends": "@electron/lint-roller/configs/markdownlint.json",
|
"extends": "@electron/lint-roller/configs/markdownlint.json",
|
||||||
|
"descriptive-link-text": false,
|
||||||
"link-image-style": {
|
"link-image-style": {
|
||||||
"autolink": false,
|
"autolink": false,
|
||||||
"shortcut": false
|
"shortcut": false
|
||||||
@@ -26,6 +27,6 @@
|
|||||||
"no-newline-in-links": true
|
"no-newline-in-links": true
|
||||||
},
|
},
|
||||||
"customRules": [
|
"customRules": [
|
||||||
"@electron/lint-roller/markdownlint-rules/"
|
"./node_modules/@electron/lint-roller/markdownlint-rules/index.mjs"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
24
BUILD.gn
24
BUILD.gn
@@ -17,19 +17,19 @@ import("//tools/grit/repack.gni")
|
|||||||
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
|
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
|
||||||
import("//v8/gni/snapshot_toolchain.gni")
|
import("//v8/gni/snapshot_toolchain.gni")
|
||||||
import("build/asar.gni")
|
import("build/asar.gni")
|
||||||
|
import("build/electron_paks.gni")
|
||||||
import("build/extract_symbols.gni")
|
import("build/extract_symbols.gni")
|
||||||
|
import("build/js2c_toolchain.gni")
|
||||||
import("build/npm.gni")
|
import("build/npm.gni")
|
||||||
import("build/templated_file.gni")
|
import("build/templated_file.gni")
|
||||||
import("build/tsc.gni")
|
import("build/tsc.gni")
|
||||||
import("build/webpack/webpack.gni")
|
import("build/webpack/webpack.gni")
|
||||||
import("buildflags/buildflags.gni")
|
import("buildflags/buildflags.gni")
|
||||||
import("electron_paks.gni")
|
|
||||||
import("filenames.auto.gni")
|
import("filenames.auto.gni")
|
||||||
import("filenames.gni")
|
import("filenames.gni")
|
||||||
import("filenames.hunspell.gni")
|
import("filenames.hunspell.gni")
|
||||||
import("filenames.libcxx.gni")
|
import("filenames.libcxx.gni")
|
||||||
import("filenames.libcxxabi.gni")
|
import("filenames.libcxxabi.gni")
|
||||||
import("js2c_toolchain.gni")
|
|
||||||
|
|
||||||
if (is_mac) {
|
if (is_mac) {
|
||||||
import("//build/config/mac/rules.gni")
|
import("//build/config/mac/rules.gni")
|
||||||
@@ -224,11 +224,21 @@ webpack_build("electron_utility_bundle") {
|
|||||||
out_file = "$target_gen_dir/js2c/utility_init.js"
|
out_file = "$target_gen_dir/js2c/utility_init.js"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
webpack_build("electron_preload_realm_bundle") {
|
||||||
|
deps = [ ":build_electron_definitions" ]
|
||||||
|
|
||||||
|
inputs = auto_filenames.preload_realm_bundle_deps
|
||||||
|
|
||||||
|
config_file = "//electron/build/webpack/webpack.config.preload_realm.js"
|
||||||
|
out_file = "$target_gen_dir/js2c/preload_realm_bundle.js"
|
||||||
|
}
|
||||||
|
|
||||||
action("electron_js2c") {
|
action("electron_js2c") {
|
||||||
deps = [
|
deps = [
|
||||||
":electron_browser_bundle",
|
":electron_browser_bundle",
|
||||||
":electron_isolated_renderer_bundle",
|
":electron_isolated_renderer_bundle",
|
||||||
":electron_node_bundle",
|
":electron_node_bundle",
|
||||||
|
":electron_preload_realm_bundle",
|
||||||
":electron_renderer_bundle",
|
":electron_renderer_bundle",
|
||||||
":electron_sandboxed_renderer_bundle",
|
":electron_sandboxed_renderer_bundle",
|
||||||
":electron_utility_bundle",
|
":electron_utility_bundle",
|
||||||
@@ -240,6 +250,7 @@ action("electron_js2c") {
|
|||||||
"$target_gen_dir/js2c/browser_init.js",
|
"$target_gen_dir/js2c/browser_init.js",
|
||||||
"$target_gen_dir/js2c/isolated_bundle.js",
|
"$target_gen_dir/js2c/isolated_bundle.js",
|
||||||
"$target_gen_dir/js2c/node_init.js",
|
"$target_gen_dir/js2c/node_init.js",
|
||||||
|
"$target_gen_dir/js2c/preload_realm_bundle.js",
|
||||||
"$target_gen_dir/js2c/renderer_init.js",
|
"$target_gen_dir/js2c/renderer_init.js",
|
||||||
"$target_gen_dir/js2c/sandbox_bundle.js",
|
"$target_gen_dir/js2c/sandbox_bundle.js",
|
||||||
"$target_gen_dir/js2c/utility_init.js",
|
"$target_gen_dir/js2c/utility_init.js",
|
||||||
@@ -303,7 +314,7 @@ asar("default_app_asar") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
grit("resources") {
|
grit("resources") {
|
||||||
source = "electron_resources.grd"
|
source = "build/electron_resources.grd"
|
||||||
|
|
||||||
outputs = [
|
outputs = [
|
||||||
"grit/electron_resources.h",
|
"grit/electron_resources.h",
|
||||||
@@ -430,6 +441,7 @@ source_set("electron_lib") {
|
|||||||
"chromium_src:chrome_spellchecker",
|
"chromium_src:chrome_spellchecker",
|
||||||
"shell/common:mojo",
|
"shell/common:mojo",
|
||||||
"shell/common:plugin",
|
"shell/common:plugin",
|
||||||
|
"shell/common:web_contents_utility",
|
||||||
"shell/services/node/public/mojom",
|
"shell/services/node/public/mojom",
|
||||||
"//base:base_static",
|
"//base:base_static",
|
||||||
"//base/allocator:buildflags",
|
"//base/allocator:buildflags",
|
||||||
@@ -439,7 +451,7 @@ source_set("electron_lib") {
|
|||||||
"//components/autofill/core/common:features",
|
"//components/autofill/core/common:features",
|
||||||
"//components/certificate_transparency",
|
"//components/certificate_transparency",
|
||||||
"//components/compose:buildflags",
|
"//components/compose:buildflags",
|
||||||
"//components/embedder_support:browser_util",
|
"//components/embedder_support:user_agent",
|
||||||
"//components/input:input",
|
"//components/input:input",
|
||||||
"//components/language/core/browser",
|
"//components/language/core/browser",
|
||||||
"//components/net_log",
|
"//components/net_log",
|
||||||
@@ -658,6 +670,8 @@ source_set("electron_lib") {
|
|||||||
sources += [
|
sources += [
|
||||||
"shell/browser/certificate_manager_model.cc",
|
"shell/browser/certificate_manager_model.cc",
|
||||||
"shell/browser/certificate_manager_model.h",
|
"shell/browser/certificate_manager_model.h",
|
||||||
|
"shell/browser/linux/x11_util.cc",
|
||||||
|
"shell/browser/linux/x11_util.h",
|
||||||
"shell/browser/ui/gtk_util.cc",
|
"shell/browser/ui/gtk_util.cc",
|
||||||
"shell/browser/ui/gtk_util.h",
|
"shell/browser/ui/gtk_util.h",
|
||||||
]
|
]
|
||||||
@@ -1234,7 +1248,7 @@ if (is_mac) {
|
|||||||
"//components/crash/core/app:run_as_crashpad_handler",
|
"//components/crash/core/app:run_as_crashpad_handler",
|
||||||
]
|
]
|
||||||
|
|
||||||
ldflags = []
|
ldflags = [ "/DELAYLOAD:ffmpeg.dll" ]
|
||||||
|
|
||||||
libs = [
|
libs = [
|
||||||
"comctl32.lib",
|
"comctl32.lib",
|
||||||
|
|||||||
@@ -71,4 +71,4 @@ See [Coding Style](https://electronjs.org/docs/development/coding-style) for inf
|
|||||||
## Further Reading
|
## Further Reading
|
||||||
|
|
||||||
For more in-depth guides on developing Electron, see
|
For more in-depth guides on developing Electron, see
|
||||||
[/docs/development](/docs/development/README.md)
|
[/docs/development](/docs/development/README.md).
|
||||||
|
|||||||
10
DEPS
10
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
|||||||
|
|
||||||
vars = {
|
vars = {
|
||||||
'chromium_version':
|
'chromium_version':
|
||||||
'133.0.6878.0',
|
'138.0.7178.0',
|
||||||
'node_version':
|
'node_version':
|
||||||
'v22.9.0',
|
'v22.15.1',
|
||||||
'nan_version':
|
'nan_version':
|
||||||
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
||||||
'squirrel.mac_version':
|
'squirrel.mac_version':
|
||||||
@@ -62,10 +62,6 @@ vars = {
|
|||||||
|
|
||||||
'checkout_nacl':
|
'checkout_nacl':
|
||||||
False,
|
False,
|
||||||
'checkout_libaom':
|
|
||||||
True,
|
|
||||||
'checkout_oculus_sdk':
|
|
||||||
False,
|
|
||||||
'checkout_openxr':
|
'checkout_openxr':
|
||||||
False,
|
False,
|
||||||
'build_with_chromium':
|
'build_with_chromium':
|
||||||
@@ -74,8 +70,6 @@ vars = {
|
|||||||
False,
|
False,
|
||||||
'checkout_android_native_support':
|
'checkout_android_native_support':
|
||||||
False,
|
False,
|
||||||
'checkout_google_benchmark':
|
|
||||||
False,
|
|
||||||
'checkout_clang_tidy':
|
'checkout_clang_tidy':
|
||||||
True,
|
True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
[](https://electronjs.org)
|
[](https://electronjs.org)
|
||||||
|
|
||||||
[](https://github.com/electron/electron/actions/workflows/build.yml)
|
[](https://github.com/electron/electron/actions/workflows/build.yml)
|
||||||
[](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
|
|
||||||
[](https://discord.gg/electronjs)
|
[](https://discord.gg/electronjs)
|
||||||
|
|
||||||
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
|
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
# The config is used to bake appveyor images, not for running CI jobs.
|
|
||||||
# The config expects the following environment variables to be set:
|
|
||||||
# - "APPVEYOR_BAKE_IMAGE" e.g. 'electron-99.0.4767.0'. Name of the image to be baked.
|
|
||||||
# Typically named after the Chromium version on which the image is built.
|
|
||||||
# This can be set dynamically in the prepare-appveyor script.
|
|
||||||
|
|
||||||
version: 1.0.{build}
|
|
||||||
build_cloud: electronhq-16-core
|
|
||||||
image: base-bake-image
|
|
||||||
environment:
|
|
||||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
|
||||||
ELECTRON_OUT_DIR: Default
|
|
||||||
ELECTRON_ENABLE_STACK_DUMPING: 1
|
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
|
||||||
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
|
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
|
|
||||||
PYTHONIOENCODING: UTF-8
|
|
||||||
|
|
||||||
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
|
|
||||||
# init:
|
|
||||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
|
||||||
# - appveyor version
|
|
||||||
# - ps: $ErrorActionPreference = 'Stop'
|
|
||||||
# - ps: 'Write-Host "OS Build: $((Get-CimInstance Win32_OperatingSystem).BuildNumber)"'
|
|
||||||
|
|
||||||
# clone_folder: '%USERPROFILE%\image-bake-scripts'
|
|
||||||
|
|
||||||
# clone_script:
|
|
||||||
# - ps: Invoke-WebRequest "https://github.com/appveyor/build-images/archive/1f90d94e74c8243c909a09b994e527584dfcb838.zip" -OutFile "$env:temp\scripts.zip"
|
|
||||||
# - ps: Expand-Archive -Path "$env:temp\scripts.zip" -DestinationPath "$env:temp\scripts" -Force
|
|
||||||
# - ps: Copy-Item -Path "$env:temp\scripts\build-images-1f90d94e74c8243c909a09b994e527584dfcb838\scripts\Windows\*" -Destination $env:APPVEYOR_BUILD_FOLDER -Recurse
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
|
|
||||||
# - ps: .\init_server.ps1
|
|
||||||
# - ps: .\extend_system_volume.ps1
|
|
||||||
|
|
||||||
# # Restart VM
|
|
||||||
# - ps: Start-Sleep -s 5; Restart-Computer
|
|
||||||
# - ps: Start-Sleep -s 5
|
|
||||||
|
|
||||||
# - appveyor version
|
|
||||||
# - ps: .\install_path_utils.ps1
|
|
||||||
# - ps: .\install_powershell_core.ps1
|
|
||||||
# - ps: .\install_powershell_get.ps1
|
|
||||||
# - ps: .\install_7zip.ps1
|
|
||||||
# - ps: .\install_chocolatey.ps1
|
|
||||||
# - ps: .\install_webpi.ps1
|
|
||||||
# - ps: .\install_nuget.ps1
|
|
||||||
# - ps: .\install_pstools.ps1
|
|
||||||
|
|
||||||
# - ps: .\install_git.ps1
|
|
||||||
# - ps: .\install_git_lfs.ps1
|
|
||||||
|
|
||||||
# # Restart VM
|
|
||||||
# - ps: Start-Sleep -s 5; Restart-Computer
|
|
||||||
# - ps: Start-Sleep -s 5
|
|
||||||
# END LINES FOR COMPLETELY NEW IMAGE
|
|
||||||
|
|
||||||
- git config --global core.longpaths true
|
|
||||||
- ps: >-
|
|
||||||
if (-not (Test-Path -Path C:\projects\src)) {
|
|
||||||
New-Item -Path C:\projects\src -ItemType Directory
|
|
||||||
}
|
|
||||||
- cd C:\projects\
|
|
||||||
- git clone -q --branch=%APPVEYOR_REPO_BRANCH% https://github.com/electron/electron.git C:\projects\src\electron
|
|
||||||
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
||||||
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
|
||||||
- update_depot_tools.bat
|
|
||||||
# Uncomment the following line if windows deps change
|
|
||||||
- src\electron\script\setup-win-for-dev.bat
|
|
||||||
- >-
|
|
||||||
gclient config
|
|
||||||
--name "src\electron"
|
|
||||||
--unmanaged
|
|
||||||
%GCLIENT_EXTRA_ARGS%
|
|
||||||
"https://github.com/electron/electron"
|
|
||||||
- ps: cd src\electron
|
|
||||||
- ps: node script\generate-deps-hash.js
|
|
||||||
- ps: $depshash = Get-Content .\.depshash -Raw
|
|
||||||
- ps: Copy-Item -path .\.depshash -destination ..\.depshash
|
|
||||||
- ps: cd ..\..
|
|
||||||
- gclient sync --with_branch_heads --with_tags --nohooks
|
|
||||||
- ps: regsvr32 /s "C:\Program Files\Microsoft Visual Studio\2022\Community\DIA SDK\bin\amd64\msdia140.dll"
|
|
||||||
- ps: set vs2022_install="C:\Program Files\Microsoft Visual Studio\2022\Community"
|
|
||||||
|
|
||||||
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
|
|
||||||
# # Restart VM
|
|
||||||
# - ps: Start-Sleep -s 5; Restart-Computer
|
|
||||||
# - ps: Start-Sleep -s 5
|
|
||||||
|
|
||||||
# - cd %USERPROFILE%\image-bake-scripts
|
|
||||||
# - appveyor version
|
|
||||||
# - ps: .\optimize_dotnet_runtime.ps1
|
|
||||||
# - ps: .\disable_windows_background_services.ps1
|
|
||||||
# - ps: .\enforce_windows_firewall.ps1
|
|
||||||
# - ps: .\cleanup_windows.ps1
|
|
||||||
# END LINES FOR COMPLETELY NEW IMAGE
|
|
||||||
on_image_bake:
|
|
||||||
- ps: >-
|
|
||||||
echo "Baking image: $env:APPVEYOR_BAKE_IMAGE at dir $PWD"
|
|
||||||
- ps: Remove-Item -Recurse -Force C:\projects\depot_tools
|
|
||||||
- ps: Remove-Item -Recurse -Force C:\projects\src\electron
|
|
||||||
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP after bake is done
|
|
||||||
# # on_finish:
|
|
||||||
# - ps: >-
|
|
||||||
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
|
||||||
352
appveyor-woa.yml
352
appveyor-woa.yml
@@ -1,352 +0,0 @@
|
|||||||
# NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor.yml
|
|
||||||
# IF APPLICABLE!!!!
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# The config expects the following environment variables to be set:
|
|
||||||
# - "GN_CONFIG" Build type. One of {'testing', 'release'}.
|
|
||||||
# - "GN_EXTRA_ARGS" Additional gn arguments for a build config,
|
|
||||||
# e.g. 'target_cpu="x86"' to build for a 32bit platform.
|
|
||||||
# https://gn.googlesource.com/gn/+/main/docs/reference.md#var_target_cpu
|
|
||||||
# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordingly
|
|
||||||
# if you pass a custom value for 'target_cpu'.
|
|
||||||
# - "ELECTRON_RELEASE" Set it to '1' upload binaries on success.
|
|
||||||
# - "NPM_CONFIG_ARCH" E.g. 'x86'. Is used to build native Node.js modules.
|
|
||||||
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "TARGET_ARCH" value.
|
|
||||||
# - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64'}.
|
|
||||||
# Is used in some publishing scripts, but does NOT affect the Electron binary.
|
|
||||||
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
|
|
||||||
# - "UPLOAD_TO_STORAGE" Set it to '1' upload a release to the Azure bucket.
|
|
||||||
# Otherwise the release will be uploaded to the GitHub Releases.
|
|
||||||
# (The value is only checked if "ELECTRON_RELEASE" is defined.)
|
|
||||||
#
|
|
||||||
# The publishing scripts expect access tokens to be defined as env vars,
|
|
||||||
# but those are not covered here.
|
|
||||||
#
|
|
||||||
# AppVeyor docs on variables:
|
|
||||||
# https://www.appveyor.com/docs/environment-variables/
|
|
||||||
# https://www.appveyor.com/docs/build-configuration/#secure-variables
|
|
||||||
# https://www.appveyor.com/docs/build-configuration/#custom-environment-variables
|
|
||||||
|
|
||||||
version: 1.0.{build}
|
|
||||||
build_cloud: electronhq-16-core
|
|
||||||
image: e-133.0.6878.0
|
|
||||||
environment:
|
|
||||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
|
||||||
ELECTRON_OUT_DIR: Default
|
|
||||||
ELECTRON_ENABLE_STACK_DUMPING: 1
|
|
||||||
ELECTRON_ALSO_LOG_TO_STDERR: 1
|
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
|
||||||
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, mocha-junit-reporter, tap"
|
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
|
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
|
|
||||||
GYP_MSVS_HASH_7393122652: 3ba76c5c20
|
|
||||||
PYTHONIOENCODING: UTF-8
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
|
|
||||||
- job_name: Build Arm on X64 Windows
|
|
||||||
- job_name: Test On Windows On Arm Hardware 1
|
|
||||||
job_depends_on: Build Arm on X64 Windows
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: base-woa
|
|
||||||
APPVEYOR_BUILD_WORKER_CLOUD: electronhq-woa
|
|
||||||
shard: 1
|
|
||||||
- job_name: Test On Windows On Arm Hardware 2
|
|
||||||
job_depends_on: Build Arm on X64 Windows
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: base-woa
|
|
||||||
APPVEYOR_BUILD_WORKER_CLOUD: electronhq-woa
|
|
||||||
shard: 2
|
|
||||||
|
|
||||||
clone_script:
|
|
||||||
- ps: git clone -q $("--branch=" + $Env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env:APPVEYOR_REPO_NAME + ".git") $Env:APPVEYOR_BUILD_FOLDER
|
|
||||||
- ps: if (!$Env:APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $Env:APPVEYOR_REPO_COMMIT)}
|
|
||||||
- ps: if ($Env:APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($Env:APPVEYOR_PULL_REQUEST_NUMBER)/head; git checkout -qf FETCH_HEAD}
|
|
||||||
|
|
||||||
clone_folder: C:\projects\src\electron
|
|
||||||
|
|
||||||
skip_branch_with_pr: true
|
|
||||||
|
|
||||||
# the first failed job cancels other jobs and fails entire build
|
|
||||||
matrix:
|
|
||||||
fast_finish: true
|
|
||||||
|
|
||||||
for:
|
|
||||||
|
|
||||||
- matrix:
|
|
||||||
only:
|
|
||||||
- job_name: Build Arm on X64 Windows
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
# TODO: Remove --ignore-engines once WOA image is up to node 20
|
|
||||||
- ps: |
|
|
||||||
node script/yarn.js install --frozen-lockfile --ignore-engines
|
|
||||||
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
|
|
||||||
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
|
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Write-warning "Skipping build for doc-only change"
|
|
||||||
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true"
|
|
||||||
Exit-AppveyorBuild
|
|
||||||
} else {
|
|
||||||
$global:LASTEXITCODE = 0
|
|
||||||
}
|
|
||||||
- cd ..
|
|
||||||
- ps: Write-Host "Building $env:GN_CONFIG build"
|
|
||||||
- git config --global core.longpaths true
|
|
||||||
- ps: >-
|
|
||||||
if (Test-Path -Path "$pwd\depot_tools") {
|
|
||||||
Remove-Item -Recurse -Force $pwd\depot_tools
|
|
||||||
}
|
|
||||||
- ps: >-
|
|
||||||
if (Test-Path -Path "$pwd\build-tools") {
|
|
||||||
Remove-Item -Recurse -Force $pwd\build-tools
|
|
||||||
}
|
|
||||||
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
||||||
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
|
|
||||||
- depot_tools\bootstrap\win_tools.bat
|
|
||||||
- ps: |
|
|
||||||
Set-Content -Path $pwd\depot_tools\build_telemetry.cfg -Value '{"user": "info@electronjs.org", "status": "opt-out", "countdown": 10, "version": 1}'
|
|
||||||
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
|
||||||
- ps: >-
|
|
||||||
if (Test-Path -Path "$pwd\src\electron") {
|
|
||||||
Remove-Item -Recurse -Force $pwd\src\electron
|
|
||||||
}
|
|
||||||
- git clone https://github.com/electron/build-tools.git
|
|
||||||
- cd build-tools
|
|
||||||
- npx yarn --ignore-engines
|
|
||||||
- mkdir third_party
|
|
||||||
- ps: >-
|
|
||||||
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
|
|
||||||
- ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath({})"
|
|
||||||
- ps: >-
|
|
||||||
& $env:RECLIENT_HELPER login
|
|
||||||
- ps: >-
|
|
||||||
$env:RBE_service = node -e "console.log(require('./src/utils/reclient.js').serviceAddress)"
|
|
||||||
- ps: >-
|
|
||||||
$env:RBE_credentials_helper = $env:RECLIENT_HELPER
|
|
||||||
- ps: >-
|
|
||||||
$env:RBE_credentials_helper_args = "print"
|
|
||||||
- ps: >-
|
|
||||||
if ($env:ELECTRON_RBE_JWT -eq '') {
|
|
||||||
$env:RBE_fail_early_min_action_count = "0"
|
|
||||||
$env:RBE_fail_early_min_fallback_ratio = "0"
|
|
||||||
}
|
|
||||||
- cd ..\..
|
|
||||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
|
||||||
- ps: >-
|
|
||||||
if ($env:GN_CONFIG -ne 'release') {
|
|
||||||
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
|
|
||||||
}
|
|
||||||
- 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.
|
|
||||||
- ps: $env:RUN_GCLIENT_SYNC="false"
|
|
||||||
- ps: $depshash_baked = Get-Content .\src\.depshash -Raw
|
|
||||||
- ps: cd src\electron
|
|
||||||
- ps: node script\generate-deps-hash.js
|
|
||||||
- ps: $depshash = Get-Content .\.depshash -Raw
|
|
||||||
- ps: cd ..\..
|
|
||||||
- ps: >-
|
|
||||||
if ($depshash_baked -ne $depshash) {
|
|
||||||
$env:RUN_GCLIENT_SYNC="true"
|
|
||||||
}
|
|
||||||
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags ) else ( gclient runhooks )
|
|
||||||
- cd src
|
|
||||||
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
|
|
||||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
|
||||||
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") use_remoteexec=true %GN_EXTRA_ARGS% "
|
|
||||||
- gn check out/Default //electron:electron_lib
|
|
||||||
- gn check out/Default //electron:electron_app
|
|
||||||
- gn check out/Default //electron/shell/common:mojo
|
|
||||||
- gn check out/Default //electron/shell/common:plugin
|
|
||||||
- autoninja -j 300 -C out/Default electron:electron_app
|
|
||||||
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
|
||||||
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true %GN_EXTRA_ARGS%"
|
|
||||||
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
|
||||||
- autoninja -C out/Default electron:electron_dist_zip
|
|
||||||
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
|
|
||||||
# Remove unused args from mksnapshot_args
|
|
||||||
- ps: >-
|
|
||||||
Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') } | Set-Content out/Default/mksnapshot_args
|
|
||||||
- autoninja -C out/Default electron:electron_mksnapshot_zip
|
|
||||||
- cd out\Default
|
|
||||||
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
|
|
||||||
- cd ..\..
|
|
||||||
- autoninja -C out/Default electron:hunspell_dictionaries_zip
|
|
||||||
- autoninja -C out/Default electron:electron_chromedriver_zip
|
|
||||||
- autoninja -C out/Default electron:node_headers
|
|
||||||
- ps: >-
|
|
||||||
Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
|
|
||||||
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
|
|
||||||
- 7z a node_headers.zip out\Default\gen\node_headers
|
|
||||||
- 7z a nan.zip third_party\nan
|
|
||||||
- ps: >-
|
|
||||||
if ($env:GN_CONFIG -eq 'release') {
|
|
||||||
# Needed for msdia140.dll on 64-bit windows
|
|
||||||
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
|
||||||
}
|
|
||||||
- if "%GN_CONFIG%"=="release" ( autoninja -C out/Default electron:electron_symbols )
|
|
||||||
- ps: >-
|
|
||||||
if ($env:GN_CONFIG -eq 'release') {
|
|
||||||
python3 electron\script\zip-symbols.py
|
|
||||||
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
|
|
||||||
} else {
|
|
||||||
# It's useful to have pdb files when debugging testing builds that are
|
|
||||||
# built on CI.
|
|
||||||
7z a pdb.zip out\Default\*.pdb
|
|
||||||
}
|
|
||||||
- ps: |
|
|
||||||
$manifest_file = "electron/script/zip_manifests/dist_zip.win.$env:TARGET_ARCH.manifest"
|
|
||||||
python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip $manifest_file
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
|
||||||
throw "Zip contains files not listed in the manifest $manifest_file"
|
|
||||||
}
|
|
||||||
- ps: |
|
|
||||||
cd C:\projects\src
|
|
||||||
$missing_artifacts = $false
|
|
||||||
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
|
|
||||||
Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME"
|
|
||||||
} else {
|
|
||||||
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip','nan.zip'
|
|
||||||
foreach($artifact_name in $artifacts_to_validate) {
|
|
||||||
if ($artifact_name -eq 'ffmpeg.zip') {
|
|
||||||
$artifact_file = "out\ffmpeg\ffmpeg.zip"
|
|
||||||
} elseif (
|
|
||||||
$artifact_name -eq 'node_headers.zip') {
|
|
||||||
$artifact_file = $artifact_name
|
|
||||||
} elseif (
|
|
||||||
$artifact_name -eq 'nan.zip') {
|
|
||||||
$artifact_file = $artifact_name
|
|
||||||
} else {
|
|
||||||
$artifact_file = "out\Default\$artifact_name"
|
|
||||||
}
|
|
||||||
if (-not(Test-Path $artifact_file)) {
|
|
||||||
Write-warning "$artifact_name is missing and cannot be added to artifacts"
|
|
||||||
$missing_artifacts = $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($missing_artifacts) {
|
|
||||||
throw "Build failed due to missing artifacts"
|
|
||||||
}
|
|
||||||
|
|
||||||
deploy_script:
|
|
||||||
- cd electron
|
|
||||||
- ps: >-
|
|
||||||
if (Test-Path Env:\ELECTRON_RELEASE) {
|
|
||||||
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
|
|
||||||
Write-Output "Uploading Electron release distribution to azure"
|
|
||||||
& python3 script\release\uploaders\upload.py --verbose --upload_to_storage
|
|
||||||
} else {
|
|
||||||
Write-Output "Uploading Electron release distribution to github releases"
|
|
||||||
& python3 script\release\uploaders\upload.py --verbose
|
|
||||||
}
|
|
||||||
}
|
|
||||||
on_finish:
|
|
||||||
# Uncomment this lines to enable RDP
|
|
||||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
|
||||||
- cd C:\projects\src
|
|
||||||
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
|
|
||||||
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
|
|
||||||
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
|
|
||||||
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
|
|
||||||
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
|
|
||||||
- if exist nan.zip (appveyor-retry appveyor PushArtifact nan.zip)
|
|
||||||
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
|
|
||||||
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
|
|
||||||
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
|
|
||||||
- ps: >-
|
|
||||||
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
|
|
||||||
appveyor-retry appveyor PushArtifact pdb.zip
|
|
||||||
}
|
|
||||||
- matrix:
|
|
||||||
only:
|
|
||||||
- job_name: Test On Windows On Arm Hardware 1
|
|
||||||
- job_name: Test On Windows On Arm Hardware 2
|
|
||||||
|
|
||||||
environment:
|
|
||||||
IGNORE_YARN_INSTALL_ERROR: 1
|
|
||||||
ELECTRON_TEST_RESULTS_DIR: C:\projects\src\electron\junit
|
|
||||||
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, mocha-junit-reporter, tap"
|
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
|
||||||
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
|
|
||||||
DD_ENV: ci
|
|
||||||
DD_SERVICE: electron
|
|
||||||
DD_CIVISIBILITY_LOGS_ENABLED: true
|
|
||||||
DD_GIT_REPOSITORY_URL: "https://github.com/electron/electron.git"
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
- ps: |
|
|
||||||
node script/yarn.js install --frozen-lockfile --ignore-engines
|
|
||||||
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
|
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Write-warning "Skipping build for doc only change"
|
|
||||||
Exit-AppveyorBuild
|
|
||||||
} else {
|
|
||||||
$global:LASTEXITCODE = 0
|
|
||||||
}
|
|
||||||
- ps: Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64" -OutFile "C:\projects\src\electron\datadog-ci.exe"
|
|
||||||
- cd ..
|
|
||||||
- mkdir out\Default
|
|
||||||
- cd ..
|
|
||||||
- ps: |
|
|
||||||
# Download build artifacts
|
|
||||||
$apiUrl = 'https://ci.appveyor.com/api'
|
|
||||||
$build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
|
|
||||||
$artifacts_to_download = @('dist.zip','ffmpeg.zip','node_headers.zip','electron.lib', 'nan.zip')
|
|
||||||
foreach ($job in $build_info.build.jobs) {
|
|
||||||
if ($job.name -eq "Build Arm on X64 Windows") {
|
|
||||||
$jobId = $job.jobId
|
|
||||||
foreach($artifact_name in $artifacts_to_download) {
|
|
||||||
if ($artifact_name -eq 'electron.lib') {
|
|
||||||
$outfile = "src\out\Default\$artifact_name"
|
|
||||||
} else {
|
|
||||||
$outfile = $artifact_name
|
|
||||||
}
|
|
||||||
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
|
|
||||||
}
|
|
||||||
# Uncomment the following lines to download the pdb.zip to show real stacktraces when crashes happen during testing
|
|
||||||
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/pdb.zip" -OutFile pdb.zip
|
|
||||||
7z x -y -osrc pdb.zip
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- ps: |
|
|
||||||
$out_default_zips = @('dist.zip')
|
|
||||||
foreach($zip_name in $out_default_zips) {
|
|
||||||
7z x -y -osrc\out\Default $zip_name
|
|
||||||
}
|
|
||||||
- ps: 7z x -y -osrc\out\ffmpeg ffmpeg.zip
|
|
||||||
- ps: 7z x -y -osrc node_headers.zip
|
|
||||||
- ps: 7z x -y -osrc nan.zip
|
|
||||||
|
|
||||||
test_script:
|
|
||||||
# Workaround for https://github.com/appveyor/ci/issues/2420
|
|
||||||
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
|
|
||||||
- ps: |
|
|
||||||
cd src
|
|
||||||
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
|
|
||||||
- set npm_config_nodedir=%cd%\out\Default\gen\node_headers
|
|
||||||
- set npm_config_arch=arm64
|
|
||||||
- cd electron
|
|
||||||
# Explicitly set npm_config_arch because the .env doesn't persist
|
|
||||||
- ps: >-
|
|
||||||
if ($env:TARGET_ARCH -eq 'ia32') {
|
|
||||||
$env:npm_config_arch = "ia32"
|
|
||||||
}
|
|
||||||
- ps: $env:tests_files=node script\split-tests $env:shard 2
|
|
||||||
- echo "Running shard %shard% specs %tests_files%"
|
|
||||||
- echo Running main test suite & node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion --files %tests_files%
|
|
||||||
- cd ..
|
|
||||||
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
|
|
||||||
|
|
||||||
on_finish:
|
|
||||||
# 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'))
|
|
||||||
- if exist electron\junit\test-results-main.xml ( appveyor-retry appveyor PushArtifact electron\junit\test-results-main.xml )
|
|
||||||
- ps: |
|
|
||||||
if ($env:DD_API_KEY) {
|
|
||||||
$env:DD_GIT_COMMIT_SHA = $env:APPVEYOR_REPO_COMMIT
|
|
||||||
$env:DD_GIT_BRANCH = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH
|
|
||||||
$env:DD_TAGS = "os.architecture:$env:TARGET_ARCH,os.family:windows,os.platform:win32"
|
|
||||||
if (Test-Path -Path "C:\projects\src\electron\junit\test-results-main.xml") {
|
|
||||||
C:\projects\src\electron\datadog-ci.exe junit upload --verbose C:\projects\src\electron\junit\test-results-main.xml
|
|
||||||
}
|
|
||||||
}
|
|
||||||
345
appveyor.yml
345
appveyor.yml
@@ -1,345 +0,0 @@
|
|||||||
# NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor-woa.yml
|
|
||||||
# IF APPLICABLE!!!!
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# The config expects the following environment variables to be set:
|
|
||||||
# - "GN_CONFIG" Build type. One of {'testing', 'release'}.
|
|
||||||
# - "GN_EXTRA_ARGS" Additional gn arguments for a build config,
|
|
||||||
# e.g. 'target_cpu="x86"' to build for a 32bit platform.
|
|
||||||
# https://gn.googlesource.com/gn/+/main/docs/reference.md#var_target_cpu
|
|
||||||
# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordingly
|
|
||||||
# if you pass a custom value for 'target_cpu'.
|
|
||||||
# - "ELECTRON_RELEASE" Set it to '1' upload binaries on success.
|
|
||||||
# - "NPM_CONFIG_ARCH" E.g. 'x86'. Is used to build native Node.js modules.
|
|
||||||
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "TARGET_ARCH" value.
|
|
||||||
# - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64'}.
|
|
||||||
# Is used in some publishing scripts, but does NOT affect the Electron binary.
|
|
||||||
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
|
|
||||||
# - "UPLOAD_TO_STORAGE" Set it to '1' upload a release to the Azure bucket.
|
|
||||||
# Otherwise the release will be uploaded to the GitHub Releases.
|
|
||||||
# (The value is only checked if "ELECTRON_RELEASE" is defined.)
|
|
||||||
#
|
|
||||||
# The publishing scripts expect access tokens to be defined as env vars,
|
|
||||||
# but those are not covered here.
|
|
||||||
#
|
|
||||||
# AppVeyor docs on variables:
|
|
||||||
# https://www.appveyor.com/docs/environment-variables/
|
|
||||||
# https://www.appveyor.com/docs/build-configuration/#secure-variables
|
|
||||||
# https://www.appveyor.com/docs/build-configuration/#custom-environment-variables
|
|
||||||
|
|
||||||
version: 1.0.{build}
|
|
||||||
build_cloud: electronhq-16-core
|
|
||||||
image: e-133.0.6878.0
|
|
||||||
environment:
|
|
||||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
|
||||||
ELECTRON_OUT_DIR: Default
|
|
||||||
ELECTRON_ENABLE_STACK_DUMPING: 1
|
|
||||||
ELECTRON_ALSO_LOG_TO_STDERR: 1
|
|
||||||
MOCHA_REPORTER: mocha-multi-reporters
|
|
||||||
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, mocha-junit-reporter, tap"
|
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
|
|
||||||
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
|
|
||||||
GYP_MSVS_HASH_7393122652: 3ba76c5c20
|
|
||||||
PYTHONIOENCODING: UTF-8
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
|
|
||||||
- job_name: Build
|
|
||||||
- job_name: Test 1
|
|
||||||
job_depends_on: Build
|
|
||||||
shard: 1
|
|
||||||
- job_name: Test 2
|
|
||||||
job_depends_on: Build
|
|
||||||
shard: 2
|
|
||||||
|
|
||||||
clone_script:
|
|
||||||
- ps: git clone -q $("--branch=" + $Env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env:APPVEYOR_REPO_NAME + ".git") $Env:APPVEYOR_BUILD_FOLDER
|
|
||||||
- ps: if (!$Env:APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $Env:APPVEYOR_REPO_COMMIT)}
|
|
||||||
- ps: if ($Env:APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($Env:APPVEYOR_PULL_REQUEST_NUMBER)/head; git checkout -qf FETCH_HEAD}
|
|
||||||
|
|
||||||
clone_folder: C:\projects\src\electron
|
|
||||||
|
|
||||||
skip_branch_with_pr: true
|
|
||||||
|
|
||||||
# the first failed job cancels other jobs and fails entire build
|
|
||||||
matrix:
|
|
||||||
fast_finish: true
|
|
||||||
|
|
||||||
for:
|
|
||||||
|
|
||||||
- matrix:
|
|
||||||
only:
|
|
||||||
- job_name: Build
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
- ps: |
|
|
||||||
node script/yarn.js install --frozen-lockfile
|
|
||||||
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
|
|
||||||
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
|
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Write-warning "Skipping build for doc-only change"
|
|
||||||
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true"
|
|
||||||
Exit-AppveyorBuild
|
|
||||||
} else {
|
|
||||||
$global:LASTEXITCODE = 0
|
|
||||||
}
|
|
||||||
- cd ..
|
|
||||||
- ps: Write-Host "Building $env:GN_CONFIG build"
|
|
||||||
- git config --global core.longpaths true
|
|
||||||
- ps: >-
|
|
||||||
if (Test-Path -Path "$pwd\depot_tools") {
|
|
||||||
Remove-Item -Recurse -Force $pwd\depot_tools
|
|
||||||
}
|
|
||||||
- ps: >-
|
|
||||||
if (Test-Path -Path "$pwd\build-tools") {
|
|
||||||
Remove-Item -Recurse -Force $pwd\build-tools
|
|
||||||
}
|
|
||||||
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
||||||
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
|
|
||||||
- depot_tools\bootstrap\win_tools.bat
|
|
||||||
- ps: |
|
|
||||||
Set-Content -Path $pwd\depot_tools\build_telemetry.cfg -Value '{"user": "info@electronjs.org", "status": "opt-out", "countdown": 10, "version": 1}'
|
|
||||||
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
|
||||||
- ps: >-
|
|
||||||
if (Test-Path -Path "$pwd\src\electron") {
|
|
||||||
Remove-Item -Recurse -Force $pwd\src\electron
|
|
||||||
}
|
|
||||||
- git clone https://github.com/electron/build-tools.git
|
|
||||||
- cd build-tools
|
|
||||||
- npx yarn --ignore-engines
|
|
||||||
- mkdir third_party
|
|
||||||
- ps: >-
|
|
||||||
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
|
|
||||||
- ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath({})"
|
|
||||||
- ps: >-
|
|
||||||
& $env:RECLIENT_HELPER login
|
|
||||||
- ps: >-
|
|
||||||
$env:RBE_service = node -e "console.log(require('./src/utils/reclient.js').serviceAddress)"
|
|
||||||
- ps: >-
|
|
||||||
$env:RBE_credentials_helper = $env:RECLIENT_HELPER
|
|
||||||
- ps: >-
|
|
||||||
$env:RBE_credentials_helper_args = "print"
|
|
||||||
- ps: >-
|
|
||||||
if ($env:ELECTRON_RBE_JWT -eq '') {
|
|
||||||
$env:RBE_fail_early_min_action_count = "0"
|
|
||||||
$env:RBE_fail_early_min_fallback_ratio = "0"
|
|
||||||
}
|
|
||||||
- cd ..\..
|
|
||||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
|
||||||
- ps: >-
|
|
||||||
if ($env:GN_CONFIG -ne 'release') {
|
|
||||||
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
|
|
||||||
}
|
|
||||||
- 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.
|
|
||||||
- ps: $env:RUN_GCLIENT_SYNC="false"
|
|
||||||
- ps: $depshash_baked = Get-Content .\src\.depshash -Raw
|
|
||||||
- ps: cd src\electron
|
|
||||||
- ps: node script\generate-deps-hash.js
|
|
||||||
- ps: $depshash = Get-Content .\.depshash -Raw
|
|
||||||
- ps: cd ..\..
|
|
||||||
- ps: >-
|
|
||||||
if ($depshash_baked -ne $depshash) {
|
|
||||||
$env:RUN_GCLIENT_SYNC="true"
|
|
||||||
}
|
|
||||||
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags ) else ( gclient runhooks )
|
|
||||||
- cd src
|
|
||||||
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
|
|
||||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
|
||||||
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") use_remoteexec=true %GN_EXTRA_ARGS% "
|
|
||||||
- gn check out/Default //electron:electron_lib
|
|
||||||
- gn check out/Default //electron:electron_app
|
|
||||||
- gn check out/Default //electron/shell/common:mojo
|
|
||||||
- gn check out/Default //electron/shell/common:plugin
|
|
||||||
- autoninja -j 300 -C out/Default electron:electron_app
|
|
||||||
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
|
||||||
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true %GN_EXTRA_ARGS%"
|
|
||||||
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
|
||||||
- autoninja -C out/Default electron:electron_dist_zip
|
|
||||||
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
|
|
||||||
# Remove unused args from mksnapshot_args
|
|
||||||
- ps: >-
|
|
||||||
Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') } | Set-Content out/Default/mksnapshot_args
|
|
||||||
- autoninja -C out/Default electron:electron_mksnapshot_zip
|
|
||||||
- cd out\Default
|
|
||||||
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
|
|
||||||
- cd ..\..
|
|
||||||
- autoninja -C out/Default electron:hunspell_dictionaries_zip
|
|
||||||
- autoninja -C out/Default electron:electron_chromedriver_zip
|
|
||||||
- autoninja -C out/Default electron:node_headers
|
|
||||||
- ps: >-
|
|
||||||
Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
|
|
||||||
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
|
|
||||||
- 7z a node_headers.zip out\Default\gen\node_headers
|
|
||||||
- ps: >-
|
|
||||||
if ($env:GN_CONFIG -eq 'release') {
|
|
||||||
# Needed for msdia140.dll on 64-bit windows
|
|
||||||
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
|
||||||
}
|
|
||||||
- if "%GN_CONFIG%"=="release" ( autoninja -C out/Default electron:electron_symbols )
|
|
||||||
- ps: >-
|
|
||||||
if ($env:GN_CONFIG -eq 'release') {
|
|
||||||
python3 electron\script\zip-symbols.py
|
|
||||||
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
|
|
||||||
} else {
|
|
||||||
# It's useful to have pdb files when debugging testing builds that are
|
|
||||||
# built on CI.
|
|
||||||
7z a pdb.zip out\Default\*.pdb
|
|
||||||
}
|
|
||||||
- ps: |
|
|
||||||
$manifest_file = "electron/script/zip_manifests/dist_zip.win.$env:TARGET_ARCH.manifest"
|
|
||||||
python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip $manifest_file
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
|
||||||
throw "Zip contains files not listed in the manifest $manifest_file"
|
|
||||||
}
|
|
||||||
- ps: |
|
|
||||||
cd C:\projects\src
|
|
||||||
$missing_artifacts = $false
|
|
||||||
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
|
|
||||||
Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME"
|
|
||||||
} else {
|
|
||||||
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
|
|
||||||
foreach($artifact_name in $artifacts_to_validate) {
|
|
||||||
if ($artifact_name -eq 'ffmpeg.zip') {
|
|
||||||
$artifact_file = "out\ffmpeg\ffmpeg.zip"
|
|
||||||
} elseif (
|
|
||||||
$artifact_name -eq 'node_headers.zip') {
|
|
||||||
$artifact_file = $artifact_name
|
|
||||||
} else {
|
|
||||||
$artifact_file = "out\Default\$artifact_name"
|
|
||||||
}
|
|
||||||
if (-not(Test-Path $artifact_file)) {
|
|
||||||
Write-warning "$artifact_name is missing and cannot be added to artifacts"
|
|
||||||
$missing_artifacts = $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($missing_artifacts) {
|
|
||||||
throw "Build failed due to missing artifacts"
|
|
||||||
}
|
|
||||||
|
|
||||||
deploy_script:
|
|
||||||
- cd electron
|
|
||||||
- ps: >-
|
|
||||||
if (Test-Path Env:\ELECTRON_RELEASE) {
|
|
||||||
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
|
|
||||||
Write-Output "Uploading Electron release distribution to azure"
|
|
||||||
& python3 script\release\uploaders\upload.py --verbose --upload_to_storage
|
|
||||||
} else {
|
|
||||||
Write-Output "Uploading Electron release distribution to github releases"
|
|
||||||
& python3 script\release\uploaders\upload.py --verbose
|
|
||||||
}
|
|
||||||
}
|
|
||||||
on_finish:
|
|
||||||
# Uncomment this lines to enable RDP
|
|
||||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
|
||||||
- cd C:\projects\src
|
|
||||||
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
|
|
||||||
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
|
|
||||||
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
|
|
||||||
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
|
|
||||||
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
|
|
||||||
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
|
|
||||||
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
|
|
||||||
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
|
|
||||||
- ps: >-
|
|
||||||
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
|
|
||||||
appveyor-retry appveyor PushArtifact pdb.zip
|
|
||||||
}
|
|
||||||
- matrix:
|
|
||||||
only:
|
|
||||||
- job_name: Test 1
|
|
||||||
- job_name: Test 2
|
|
||||||
|
|
||||||
environment:
|
|
||||||
DD_ENV: ci
|
|
||||||
DD_SERVICE: electron
|
|
||||||
DD_CIVISIBILITY_LOGS_ENABLED: true
|
|
||||||
DD_GIT_REPOSITORY_URL: "https://github.com/electron/electron.git"
|
|
||||||
ELECTRON_TEST_RESULTS_DIR: C:\projects\src\electron\junit
|
|
||||||
|
|
||||||
init:
|
|
||||||
- ps: |
|
|
||||||
if ($env:RUN_TESTS -ne 'true') {
|
|
||||||
Write-warning "Skipping tests for $env:APPVEYOR_PROJECT_NAME"; Exit-AppveyorBuild
|
|
||||||
}
|
|
||||||
build_script:
|
|
||||||
- ps: |
|
|
||||||
node script/yarn.js install --frozen-lockfile
|
|
||||||
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
|
|
||||||
if ($LASTEXITCODE -eq 0) {
|
|
||||||
Write-warning "Skipping build for doc only change"
|
|
||||||
Exit-AppveyorBuild
|
|
||||||
} else {
|
|
||||||
$global:LASTEXITCODE = 0
|
|
||||||
}
|
|
||||||
- npm install -g @datadog/datadog-ci
|
|
||||||
- cd ..
|
|
||||||
- mkdir out\Default
|
|
||||||
- cd ..
|
|
||||||
- ps: |
|
|
||||||
# Download build artifacts
|
|
||||||
$apiUrl = 'https://ci.appveyor.com/api'
|
|
||||||
$build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
|
|
||||||
$artifacts_to_download = @('dist.zip','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib')
|
|
||||||
foreach ($job in $build_info.build.jobs) {
|
|
||||||
if ($job.name -eq "Build") {
|
|
||||||
$jobId = $job.jobId
|
|
||||||
foreach($artifact_name in $artifacts_to_download) {
|
|
||||||
if ($artifact_name -eq 'electron.lib') {
|
|
||||||
$outfile = "src\out\Default\$artifact_name"
|
|
||||||
} else {
|
|
||||||
$outfile = $artifact_name
|
|
||||||
}
|
|
||||||
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
|
|
||||||
}
|
|
||||||
# Uncomment the following lines to download the pdb.zip to show real stacktraces when crashes happen during testing
|
|
||||||
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/pdb.zip" -OutFile pdb.zip
|
|
||||||
7z x -y -osrc pdb.zip
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- ps: |
|
|
||||||
$out_default_zips = @('dist.zip','chromedriver.zip','mksnapshot.zip')
|
|
||||||
foreach($zip_name in $out_default_zips) {
|
|
||||||
7z x -y -osrc\out\Default $zip_name
|
|
||||||
}
|
|
||||||
- ps: 7z x -y -osrc\out\ffmpeg ffmpeg.zip
|
|
||||||
- ps: 7z x -y -osrc node_headers.zip
|
|
||||||
|
|
||||||
test_script:
|
|
||||||
# Workaround for https://github.com/appveyor/ci/issues/2420
|
|
||||||
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
|
|
||||||
- ps: |
|
|
||||||
cd src
|
|
||||||
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
|
|
||||||
- cd electron
|
|
||||||
# Explicitly set npm_config_arch because the .env doesn't persist
|
|
||||||
- ps: >-
|
|
||||||
if ($env:TARGET_ARCH -eq 'ia32') {
|
|
||||||
$env:npm_config_arch = "ia32"
|
|
||||||
}
|
|
||||||
- ps: $env:tests_files=node script\split-tests $env:shard 2
|
|
||||||
- echo "Running shard %shard% specs %tests_files%"
|
|
||||||
- echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging --files %tests_files%
|
|
||||||
- cd ..
|
|
||||||
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
|
|
||||||
- echo "About to verify mksnapshot"
|
|
||||||
- echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd%
|
|
||||||
- echo "Done verifying mksnapshot"
|
|
||||||
- echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd%
|
|
||||||
- echo "Done verifying chromedriver"
|
|
||||||
|
|
||||||
on_finish:
|
|
||||||
# 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'))
|
|
||||||
- if exist electron\junit\test-results-main.xml ( appveyor-retry appveyor PushArtifact electron\junit\test-results-main.xml )
|
|
||||||
- ps: |
|
|
||||||
if ($env:RUN_TESTS -eq 'true' -And $env:DD_API_KEY) {
|
|
||||||
$env:DD_GIT_COMMIT_SHA = $env:APPVEYOR_REPO_COMMIT
|
|
||||||
$env:DD_GIT_BRANCH = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH
|
|
||||||
$env:DD_TAGS = "os.architecture:$env:TARGET_ARCH,os.family:windows,os.platform:win32"
|
|
||||||
if (Test-Path -Path "C:\projects\src\electron\junit\test-results-main.xml") {
|
|
||||||
C:\Users\appveyor\AppData\Roaming\npm\datadog-ci.ps1 junit upload --verbose C:\projects\src\electron\junit\test-results-main.xml
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
|||||||
root_extra_deps = [ "//electron" ]
|
root_extra_deps = [ "//electron" ]
|
||||||
|
|
||||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
|
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
|
||||||
node_module_version = 132
|
node_module_version = 136
|
||||||
|
|
||||||
v8_promise_internal_field_count = 1
|
v8_promise_internal_field_count = 1
|
||||||
v8_embedder_string = "-electron.0"
|
v8_embedder_string = "-electron.0"
|
||||||
@@ -14,8 +14,8 @@ v8_enable_snapshot_native_code_counters = false
|
|||||||
v8_enable_javascript_promise_hooks = true
|
v8_enable_javascript_promise_hooks = true
|
||||||
|
|
||||||
enable_cdm_host_verification = false
|
enable_cdm_host_verification = false
|
||||||
proprietary_codecs = true
|
|
||||||
ffmpeg_branding = "Chrome"
|
ffmpeg_branding = "Chrome"
|
||||||
|
proprietary_codecs = true
|
||||||
|
|
||||||
enable_printing = true
|
enable_printing = true
|
||||||
|
|
||||||
@@ -48,7 +48,8 @@ enable_cet_shadow_stack = false
|
|||||||
is_cfi = false
|
is_cfi = false
|
||||||
|
|
||||||
# TODO: fix this once sysroots have been updated.
|
# TODO: fix this once sysroots have been updated.
|
||||||
use_qt = false
|
use_qt5 = false
|
||||||
|
use_qt6 = false
|
||||||
|
|
||||||
# Disables the builtins PGO for V8
|
# Disables the builtins PGO for V8
|
||||||
v8_builtins_profiling_log_file = ""
|
v8_builtins_profiling_log_file = ""
|
||||||
@@ -65,11 +66,6 @@ v8_enable_private_mapping_fork_optimization = true
|
|||||||
# Expose public V8 symbols for native modules.
|
# Expose public V8 symbols for native modules.
|
||||||
v8_expose_public_symbols = true
|
v8_expose_public_symbols = true
|
||||||
|
|
||||||
# Disables unsafe-buffers-usage plugin due to incompatibilities with our reclient implementation
|
|
||||||
# Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5426599
|
|
||||||
# Ref: https://github.com/electron/electron/commit/8e20f16ea35eeaeb149ae63bad3703d782665f6a
|
|
||||||
clang_unsafe_buffers_paths = ""
|
|
||||||
|
|
||||||
# Disable snapshotting a page when printing for its content to be analyzed for
|
# Disable snapshotting a page when printing for its content to be analyzed for
|
||||||
# sensitive content by enterprise users.
|
# sensitive content by enterprise users.
|
||||||
enterprise_cloud_content_analysis = false
|
enterprise_cloud_content_analysis = false
|
||||||
@@ -77,6 +73,3 @@ enterprise_cloud_content_analysis = false
|
|||||||
# TODO: remove dependency on legacy ipc
|
# TODO: remove dependency on legacy ipc
|
||||||
# https://issues.chromium.org/issues/40943039
|
# https://issues.chromium.org/issues/40943039
|
||||||
content_enable_legacy_ipc = true
|
content_enable_legacy_ipc = true
|
||||||
|
|
||||||
# Electron has its own unsafe-buffers enforcement directories.
|
|
||||||
clang_unsafe_buffers_paths = "//electron/electron_unsafe_buffers_paths.txt"
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import("all.gn")
|
import("//electron/build/args/all.gn")
|
||||||
is_component_build = false
|
is_component_build = false
|
||||||
is_component_ffmpeg = true
|
is_component_ffmpeg = true
|
||||||
is_official_build = true
|
is_official_build = true
|
||||||
proprietary_codecs = false
|
|
||||||
ffmpeg_branding = "Chromium"
|
ffmpeg_branding = "Chromium"
|
||||||
enable_dsyms = false
|
enable_dsyms = false
|
||||||
|
proprietary_codecs = false
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
import("all.gn")
|
import("//electron/build/args/all.gn")
|
||||||
is_component_build = false
|
is_component_build = false
|
||||||
is_official_build = true
|
is_official_build = true
|
||||||
|
|
||||||
# This may be guarded behind is_chrome_branded alongside
|
|
||||||
# proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
|
|
||||||
# explicitly override here to build OpenH264 encoder/FFmpeg decoder.
|
|
||||||
# The initialization of the decoder depends on whether ffmpeg has
|
|
||||||
# been built with H.264 support.
|
|
||||||
rtc_use_h264 = proprietary_codecs
|
|
||||||
|
|
||||||
# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
|
# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
|
||||||
# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
|
# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
|
||||||
# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
|
# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
import("all.gn")
|
import("//electron/build/args/all.gn")
|
||||||
is_debug = false
|
is_debug = false
|
||||||
is_component_build = false
|
is_component_build = false
|
||||||
is_component_ffmpeg = true
|
is_component_ffmpeg = true
|
||||||
is_official_build = false
|
is_official_build = false
|
||||||
dcheck_always_on = true
|
dcheck_always_on = true
|
||||||
symbol_level = 1
|
symbol_level = 1
|
||||||
|
|
||||||
# This may be guarded behind is_chrome_branded alongside
|
|
||||||
# proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
|
|
||||||
# explicitly override here to build OpenH264 encoder/FFmpeg decoder.
|
|
||||||
# The initialization of the decoder depends on whether ffmpeg has
|
|
||||||
# been built with H.264 support.
|
|
||||||
rtc_use_h264 = proprietary_codecs
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ template("electron_extra_paks") {
|
|||||||
"$root_gen_dir/chrome/accessibility_resources.pak",
|
"$root_gen_dir/chrome/accessibility_resources.pak",
|
||||||
"$root_gen_dir/chrome/browser_resources.pak",
|
"$root_gen_dir/chrome/browser_resources.pak",
|
||||||
"$root_gen_dir/chrome/common_resources.pak",
|
"$root_gen_dir/chrome/common_resources.pak",
|
||||||
"$root_gen_dir/chrome/dev_ui_browser_resources.pak",
|
|
||||||
"$root_gen_dir/components/components_resources.pak",
|
"$root_gen_dir/components/components_resources.pak",
|
||||||
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
|
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
|
||||||
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
||||||
@@ -69,7 +68,6 @@ template("electron_extra_paks") {
|
|||||||
"$target_gen_dir/electron_resources.pak",
|
"$target_gen_dir/electron_resources.pak",
|
||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
"//chrome/browser:dev_ui_browser_resources",
|
|
||||||
"//chrome/browser:resources",
|
"//chrome/browser:resources",
|
||||||
"//chrome/browser/resources/accessibility:resources",
|
"//chrome/browser/resources/accessibility:resources",
|
||||||
"//chrome/common:resources",
|
"//chrome/common:resources",
|
||||||
@@ -85,7 +83,7 @@ template("electron_extra_paks") {
|
|||||||
"//net:net_resources",
|
"//net:net_resources",
|
||||||
"//third_party/blink/public:devtools_inspector_resources",
|
"//third_party/blink/public:devtools_inspector_resources",
|
||||||
"//third_party/blink/public:resources",
|
"//third_party/blink/public:resources",
|
||||||
"//ui/resources",
|
"//ui/webui/resources",
|
||||||
]
|
]
|
||||||
if (defined(invoker.deps)) {
|
if (defined(invoker.deps)) {
|
||||||
deps += invoker.deps
|
deps += invoker.deps
|
||||||
@@ -98,7 +96,7 @@ template("electron_extra_paks") {
|
|||||||
sources += [
|
sources += [
|
||||||
"$root_gen_dir/content/browser/devtools/devtools_resources.pak",
|
"$root_gen_dir/content/browser/devtools/devtools_resources.pak",
|
||||||
"$root_gen_dir/content/process_resources.pak",
|
"$root_gen_dir/content/process_resources.pak",
|
||||||
"$root_gen_dir/ui/resources/webui_resources.pak",
|
"$root_gen_dir/ui/webui/resources/webui_resources.pak",
|
||||||
]
|
]
|
||||||
deps += [ "//content/browser/devtools:devtools_resources" ]
|
deps += [ "//content/browser/devtools:devtools_resources" ]
|
||||||
if (enable_pdf_viewer) {
|
if (enable_pdf_viewer) {
|
||||||
@@ -178,7 +176,7 @@ template("electron_paks") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
source_patterns = [
|
source_patterns = [
|
||||||
"${root_gen_dir}/chrome/chromium_strings_",
|
"${root_gen_dir}/chrome/branded_strings_",
|
||||||
"${root_gen_dir}/chrome/locale_settings_",
|
"${root_gen_dir}/chrome/locale_settings_",
|
||||||
"${root_gen_dir}/chrome/platform_locale_settings_",
|
"${root_gen_dir}/chrome/platform_locale_settings_",
|
||||||
"${root_gen_dir}/chrome/generated_resources_",
|
"${root_gen_dir}/chrome/generated_resources_",
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<!-- The Resource ids for messages start from 31750 and for includes
|
<!-- The Resource ids for messages start from 31750 and for includes
|
||||||
it starts from 31950, make sure they don't overlap when the limit
|
it starts from 31950, make sure they don't overlap when the limit
|
||||||
exceeds in //tools/gritsettings/resource_ids -->
|
exceeds in //tools/gritsettings/resource_ids -->
|
||||||
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false"
|
<grit latest_public_release="0" current_release="1"
|
||||||
source_lang_id="en">
|
source_lang_id="en">
|
||||||
<outputs>
|
<outputs>
|
||||||
<output filename="grit/electron_resources.h" type="rc_header">
|
<output filename="grit/electron_resources.h" type="rc_header">
|
||||||
@@ -45,7 +45,7 @@ def windows_profile():
|
|||||||
win_sdk_dir = SetEnvironmentAndGetSDKDir()
|
win_sdk_dir = SetEnvironmentAndGetSDKDir()
|
||||||
path = NormalizePath(os.environ['GYP_MSVS_OVERRIDE_PATH'])
|
path = NormalizePath(os.environ['GYP_MSVS_OVERRIDE_PATH'])
|
||||||
|
|
||||||
# since current windows executable are symbols path dependant,
|
# since current windows executable are symbols path dependent,
|
||||||
# profile the current directory too
|
# profile the current directory too
|
||||||
return {
|
return {
|
||||||
'pwd': os.getcwd(),
|
'pwd': os.getcwd(),
|
||||||
|
|||||||
6
build/webpack/webpack.config.preload_realm.js
Normal file
6
build/webpack/webpack.config.preload_realm.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
module.exports = require('./webpack.config.base')({
|
||||||
|
target: 'preload_realm',
|
||||||
|
alwaysHasNode: false,
|
||||||
|
wrapInitWithProfilingTimeout: true,
|
||||||
|
wrapInitWithTryCatch: true
|
||||||
|
});
|
||||||
@@ -59,7 +59,7 @@ def skip_path(dep, dist_zip, target_cpu):
|
|||||||
and dep == "snapshot_blob.bin"
|
and dep == "snapshot_blob.bin"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if should_skip:
|
if should_skip and os.environ.get('ELECTRON_DEBUG_ZIP_SKIP') == '1':
|
||||||
print("Skipping {}".format(dep))
|
print("Skipping {}".format(dep))
|
||||||
return should_skip
|
return should_skip
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/devtools/features.h",
|
"//chrome/browser/devtools/features.h",
|
||||||
"//chrome/browser/devtools/visual_logging.cc",
|
"//chrome/browser/devtools/visual_logging.cc",
|
||||||
"//chrome/browser/devtools/visual_logging.h",
|
"//chrome/browser/devtools/visual_logging.h",
|
||||||
"//chrome/browser/extensions/global_shortcut_listener.cc",
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener.h",
|
|
||||||
"//chrome/browser/file_system_access/file_system_access_features.cc",
|
"//chrome/browser/file_system_access/file_system_access_features.cc",
|
||||||
"//chrome/browser/file_system_access/file_system_access_features.h",
|
"//chrome/browser/file_system_access/file_system_access_features.h",
|
||||||
"//chrome/browser/icon_loader.cc",
|
"//chrome/browser/icon_loader.cc",
|
||||||
@@ -70,6 +68,8 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker_observer.h",
|
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker_observer.h",
|
||||||
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc",
|
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc",
|
||||||
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
|
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
|
||||||
|
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.cc",
|
||||||
|
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h",
|
||||||
"//chrome/browser/picture_in_picture/scoped_picture_in_picture_occlusion_observation.cc",
|
"//chrome/browser/picture_in_picture/scoped_picture_in_picture_occlusion_observation.cc",
|
||||||
"//chrome/browser/picture_in_picture/scoped_picture_in_picture_occlusion_observation.h",
|
"//chrome/browser/picture_in_picture/scoped_picture_in_picture_occlusion_observation.h",
|
||||||
"//chrome/browser/platform_util.cc",
|
"//chrome/browser/platform_util.cc",
|
||||||
@@ -85,6 +85,8 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/process_singleton.h",
|
"//chrome/browser/process_singleton.h",
|
||||||
"//chrome/browser/process_singleton_internal.cc",
|
"//chrome/browser/process_singleton_internal.cc",
|
||||||
"//chrome/browser/process_singleton_internal.h",
|
"//chrome/browser/process_singleton_internal.h",
|
||||||
|
"//chrome/browser/serial/serial_blocklist.cc",
|
||||||
|
"//chrome/browser/serial/serial_blocklist.h",
|
||||||
"//chrome/browser/themes/browser_theme_pack.cc",
|
"//chrome/browser/themes/browser_theme_pack.cc",
|
||||||
"//chrome/browser/themes/browser_theme_pack.h",
|
"//chrome/browser/themes/browser_theme_pack.h",
|
||||||
"//chrome/browser/themes/custom_theme_supplier.cc",
|
"//chrome/browser/themes/custom_theme_supplier.cc",
|
||||||
@@ -144,8 +146,12 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/ui/views/overlay/video_overlay_window_views.h",
|
"//chrome/browser/ui/views/overlay/video_overlay_window_views.h",
|
||||||
"//chrome/browser/ui/webui/accessibility/accessibility_ui.cc",
|
"//chrome/browser/ui/webui/accessibility/accessibility_ui.cc",
|
||||||
"//chrome/browser/ui/webui/accessibility/accessibility_ui.h",
|
"//chrome/browser/ui/webui/accessibility/accessibility_ui.h",
|
||||||
|
"//chrome/browser/usb/usb_blocklist.cc",
|
||||||
|
"//chrome/browser/usb/usb_blocklist.h",
|
||||||
"//extensions/browser/app_window/size_constraints.cc",
|
"//extensions/browser/app_window/size_constraints.cc",
|
||||||
"//extensions/browser/app_window/size_constraints.h",
|
"//extensions/browser/app_window/size_constraints.h",
|
||||||
|
"//ui/base/accelerators/global_accelerator_listener/global_accelerator_listener.cc",
|
||||||
|
"//ui/base/accelerators/global_accelerator_listener/global_accelerator_listener.h",
|
||||||
"//ui/views/native_window_tracker.h",
|
"//ui/views/native_window_tracker.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -155,8 +161,6 @@ static_library("chrome") {
|
|||||||
|
|
||||||
if (is_win) {
|
if (is_win) {
|
||||||
sources += [
|
sources += [
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_win.cc",
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_win.h",
|
|
||||||
"//chrome/browser/icon_loader_win.cc",
|
"//chrome/browser/icon_loader_win.cc",
|
||||||
"//chrome/browser/media/webrtc/window_icon_util_win.cc",
|
"//chrome/browser/media/webrtc/window_icon_util_win.cc",
|
||||||
"//chrome/browser/process_singleton_win.cc",
|
"//chrome/browser/process_singleton_win.cc",
|
||||||
@@ -178,7 +182,6 @@ static_library("chrome") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public_deps = [
|
public_deps = [
|
||||||
"//chrome/browser:dev_ui_browser_resources",
|
|
||||||
"//chrome/browser/resources/accessibility:resources",
|
"//chrome/browser/resources/accessibility:resources",
|
||||||
"//chrome/browser/ui/color:color_headers",
|
"//chrome/browser/ui/color:color_headers",
|
||||||
"//chrome/browser/ui/color:mixers",
|
"//chrome/browser/ui/color:mixers",
|
||||||
@@ -200,10 +203,12 @@ static_library("chrome") {
|
|||||||
"//chrome/browser/ui/webui/tab_search:mojo_bindings",
|
"//chrome/browser/ui/webui/tab_search:mojo_bindings",
|
||||||
"//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
|
"//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
|
||||||
"//components/enterprise/buildflags",
|
"//components/enterprise/buildflags",
|
||||||
|
"//components/enterprise/common/proto:browser_events_proto",
|
||||||
"//components/enterprise/common/proto:connectors_proto",
|
"//components/enterprise/common/proto:connectors_proto",
|
||||||
"//components/enterprise/obfuscation/core:enterprise_obfuscation",
|
"//components/enterprise/obfuscation/core:enterprise_obfuscation",
|
||||||
"//components/safe_browsing/core/browser/db:safebrowsing_proto",
|
"//components/safe_browsing/core/browser/db:safebrowsing_proto",
|
||||||
"//components/vector_icons:vector_icons",
|
"//components/vector_icons:vector_icons",
|
||||||
|
"//ui/base/accelerators/global_accelerator_listener",
|
||||||
"//ui/snapshot",
|
"//ui/snapshot",
|
||||||
"//ui/views/controls/webview",
|
"//ui/views/controls/webview",
|
||||||
]
|
]
|
||||||
@@ -220,17 +225,10 @@ static_library("chrome") {
|
|||||||
|
|
||||||
if (is_linux) {
|
if (is_linux) {
|
||||||
sources += [
|
sources += [
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_linux.cc",
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_linux.h",
|
|
||||||
"//chrome/browser/icon_loader_auralinux.cc",
|
"//chrome/browser/icon_loader_auralinux.cc",
|
||||||
|
"//ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_linux.cc",
|
||||||
|
"//ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_linux.h",
|
||||||
]
|
]
|
||||||
if (use_ozone) {
|
|
||||||
deps += [ "//ui/ozone" ]
|
|
||||||
sources += [
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_ozone.cc",
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_ozone.h",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
sources += [
|
sources += [
|
||||||
"//chrome/browser/ui/views/status_icons/concat_menu_model.cc",
|
"//chrome/browser/ui/views/status_icons/concat_menu_model.cc",
|
||||||
"//chrome/browser/ui/views/status_icons/concat_menu_model.h",
|
"//chrome/browser/ui/views/status_icons/concat_menu_model.h",
|
||||||
@@ -263,8 +261,6 @@ static_library("chrome") {
|
|||||||
|
|
||||||
if (is_mac) {
|
if (is_mac) {
|
||||||
sources += [
|
sources += [
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_mac.h",
|
|
||||||
"//chrome/browser/extensions/global_shortcut_listener_mac.mm",
|
|
||||||
"//chrome/browser/icon_loader_mac.mm",
|
"//chrome/browser/icon_loader_mac.mm",
|
||||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
|
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
|
||||||
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
|
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
|
||||||
|
|||||||
@@ -34,18 +34,25 @@ async function loadSVG (element: HTMLSpanElement) {
|
|||||||
|
|
||||||
async function initialize () {
|
async function initialize () {
|
||||||
const electronPath = await ipcRenderer.invoke('bootstrap');
|
const electronPath = await ipcRenderer.invoke('bootstrap');
|
||||||
|
function replaceText (selector: string, text: string, link?: string) {
|
||||||
function replaceText (selector: string, text: string) {
|
|
||||||
const element = document.querySelector<HTMLElement>(selector);
|
const element = document.querySelector<HTMLElement>(selector);
|
||||||
if (element) {
|
if (element) {
|
||||||
element.innerText = text;
|
if (link) {
|
||||||
|
const anchor = document.createElement('a');
|
||||||
|
anchor.textContent = text;
|
||||||
|
anchor.href = link;
|
||||||
|
anchor.target = '_blank';
|
||||||
|
element.appendChild(anchor);
|
||||||
|
} else {
|
||||||
|
element.innerText = text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
replaceText('.electron-version', `Electron v${process.versions.electron}`);
|
replaceText('.electron-version', `Electron v${process.versions.electron}`, 'https://electronjs.org/docs');
|
||||||
replaceText('.chrome-version', `Chromium v${process.versions.chrome}`);
|
replaceText('.chrome-version', `Chromium v${process.versions.chrome}`, 'https://developer.chrome.com/docs/chromium');
|
||||||
replaceText('.node-version', `Node v${process.versions.node}`);
|
replaceText('.node-version', `Node v${process.versions.node}`, `https://nodejs.org/docs/v${process.versions.node}/api`);
|
||||||
replaceText('.v8-version', `v8 v${process.versions.v8}`);
|
replaceText('.v8-version', `v8 v${process.versions.v8}`, 'https://v8.dev/docs');
|
||||||
replaceText('.command-example', `${electronPath} path-to-app`);
|
replaceText('.command-example', `${electronPath} path-to-app`);
|
||||||
|
|
||||||
for (const element of document.querySelectorAll<HTMLSpanElement>('.octicon')) {
|
for (const element of document.querySelectorAll<HTMLSpanElement>('.octicon')) {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ an issue:
|
|||||||
### Getting started
|
### Getting started
|
||||||
|
|
||||||
* [Introduction](tutorial/introduction.md)
|
* [Introduction](tutorial/introduction.md)
|
||||||
* [Quick Start](tutorial/quick-start.md)
|
|
||||||
* [Process Model](tutorial/process-model.md)
|
* [Process Model](tutorial/process-model.md)
|
||||||
|
|
||||||
### Learning the basics
|
### Learning the basics
|
||||||
@@ -97,8 +96,9 @@ These individual tutorials expand on topics discussed in the guide above.
|
|||||||
* [Chrome Extensions Support](api/extensions.md)
|
* [Chrome Extensions Support](api/extensions.md)
|
||||||
* [Breaking API Changes](breaking-changes.md)
|
* [Breaking API Changes](breaking-changes.md)
|
||||||
|
|
||||||
### Custom DOM Elements:
|
### Custom Web Features:
|
||||||
|
|
||||||
|
* [`-electron-corner-smoothing` CSS Rule](api/corner-smoothing-css.md)
|
||||||
* [`<webview>` Tag](api/webview-tag.md)
|
* [`<webview>` Tag](api/webview-tag.md)
|
||||||
* [`window.open` Function](api/window-open.md)
|
* [`window.open` Function](api/window-open.md)
|
||||||
|
|
||||||
@@ -128,6 +128,7 @@ These individual tutorials expand on topics discussed in the guide above.
|
|||||||
* [pushNotifications](api/push-notifications.md)
|
* [pushNotifications](api/push-notifications.md)
|
||||||
* [safeStorage](api/safe-storage.md)
|
* [safeStorage](api/safe-storage.md)
|
||||||
* [screen](api/screen.md)
|
* [screen](api/screen.md)
|
||||||
|
* [ServiceWorkerMain](api/service-worker-main.md)
|
||||||
* [session](api/session.md)
|
* [session](api/session.md)
|
||||||
* [ShareMenu](api/share-menu.md)
|
* [ShareMenu](api/share-menu.md)
|
||||||
* [systemPreferences](api/system-preferences.md)
|
* [systemPreferences](api/system-preferences.md)
|
||||||
|
|||||||
177
docs/api/app.md
177
docs/api/app.md
@@ -41,9 +41,10 @@ that was used to open the application, if it was launched from Notification Cent
|
|||||||
You can also call `app.isReady()` to check if this event has already fired and `app.whenReady()`
|
You can also call `app.isReady()` to check if this event has already fired and `app.whenReady()`
|
||||||
to get a Promise that is fulfilled when Electron is initialized.
|
to get a Promise that is fulfilled when Electron is initialized.
|
||||||
|
|
||||||
**Note**: The `ready` event is only fired after the main process has finished running the first
|
> [!NOTE]
|
||||||
tick of the event loop. If an Electron API needs to be called before the `ready` event, ensure
|
> The `ready` event is only fired after the main process has finished running the first
|
||||||
that it is called synchronously in the top-level context of the main process.
|
> tick of the event loop. If an Electron API needs to be called before the `ready` event, ensure
|
||||||
|
> that it is called synchronously in the top-level context of the main process.
|
||||||
|
|
||||||
### Event: 'window-all-closed'
|
### Event: 'window-all-closed'
|
||||||
|
|
||||||
@@ -66,12 +67,14 @@ Emitted before the application starts closing its windows.
|
|||||||
Calling `event.preventDefault()` will prevent the default behavior, which is
|
Calling `event.preventDefault()` will prevent the default behavior, which is
|
||||||
terminating the application.
|
terminating the application.
|
||||||
|
|
||||||
**Note:** If application quit was initiated by `autoUpdater.quitAndInstall()`,
|
> [!NOTE]
|
||||||
then `before-quit` is emitted _after_ emitting `close` event on all windows and
|
> If application quit was initiated by `autoUpdater.quitAndInstall()`,
|
||||||
closing them.
|
> then `before-quit` is emitted _after_ emitting `close` event on all windows and
|
||||||
|
> closing them.
|
||||||
|
|
||||||
**Note:** On Windows, this event will not be emitted if the app is closed due
|
> [!NOTE]
|
||||||
to a shutdown/restart of the system or a user logout.
|
> On Windows, this event will not be emitted if the app is closed due
|
||||||
|
> to a shutdown/restart of the system or a user logout.
|
||||||
|
|
||||||
### Event: 'will-quit'
|
### Event: 'will-quit'
|
||||||
|
|
||||||
@@ -86,8 +89,9 @@ terminating the application.
|
|||||||
See the description of the `window-all-closed` event for the differences between
|
See the description of the `window-all-closed` event for the differences between
|
||||||
the `will-quit` and `window-all-closed` events.
|
the `will-quit` and `window-all-closed` events.
|
||||||
|
|
||||||
**Note:** On Windows, this event will not be emitted if the app is closed due
|
> [!NOTE]
|
||||||
to a shutdown/restart of the system or a user logout.
|
> On Windows, this event will not be emitted if the app is closed due
|
||||||
|
> to a shutdown/restart of the system or a user logout.
|
||||||
|
|
||||||
### Event: 'quit'
|
### Event: 'quit'
|
||||||
|
|
||||||
@@ -98,8 +102,9 @@ Returns:
|
|||||||
|
|
||||||
Emitted when the application is quitting.
|
Emitted when the application is quitting.
|
||||||
|
|
||||||
**Note:** On Windows, this event will not be emitted if the app is closed due
|
> [!NOTE]
|
||||||
to a shutdown/restart of the system or a user logout.
|
> On Windows, this event will not be emitted if the app is closed due
|
||||||
|
> to a shutdown/restart of the system or a user logout.
|
||||||
|
|
||||||
### Event: 'open-file' _macOS_
|
### Event: 'open-file' _macOS_
|
||||||
|
|
||||||
@@ -470,24 +475,28 @@ and `workingDirectory` is its current working directory. Usually
|
|||||||
applications respond to this by making their primary window focused and
|
applications respond to this by making their primary window focused and
|
||||||
non-minimized.
|
non-minimized.
|
||||||
|
|
||||||
**Note:** `argv` will not be exactly the same list of arguments as those passed
|
> [!NOTE]
|
||||||
to the second instance. The order might change and additional arguments might be appended.
|
> `argv` will not be exactly the same list of arguments as those passed
|
||||||
If you need to maintain the exact same arguments, it's advised to use `additionalData` instead.
|
> to the second instance. The order might change and additional arguments might be appended.
|
||||||
|
> If you need to maintain the exact same arguments, it's advised to use `additionalData` instead.
|
||||||
|
|
||||||
**Note:** If the second instance is started by a different user than the first, the `argv` array will not include the arguments.
|
> [!NOTE]
|
||||||
|
> If the second instance is started by a different user than the first, the `argv` array will not include the arguments.
|
||||||
|
|
||||||
This event is guaranteed to be emitted after the `ready` event of `app`
|
This event is guaranteed to be emitted after the `ready` event of `app`
|
||||||
gets emitted.
|
gets emitted.
|
||||||
|
|
||||||
**Note:** Extra command line arguments might be added by Chromium,
|
> [!NOTE]
|
||||||
such as `--original-process-start-time`.
|
> Extra command line arguments might be added by Chromium,
|
||||||
|
> such as `--original-process-start-time`.
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
The `app` object has the following methods:
|
The `app` object has the following methods:
|
||||||
|
|
||||||
**Note:** Some methods are only available on specific operating systems and are
|
> [!NOTE]
|
||||||
labeled as such.
|
> Some methods are only available on specific operating systems and are
|
||||||
|
> labeled as such.
|
||||||
|
|
||||||
### `app.quit()`
|
### `app.quit()`
|
||||||
|
|
||||||
@@ -679,7 +688,8 @@ preferred over `name` by Electron.
|
|||||||
|
|
||||||
Overrides the current application's name.
|
Overrides the current application's name.
|
||||||
|
|
||||||
**Note:** This function overrides the name used internally by Electron; it does not affect the name that the OS uses.
|
> [!NOTE]
|
||||||
|
> This function overrides the name used internally by Electron; it does not affect the name that the OS uses.
|
||||||
|
|
||||||
### `app.getLocale()`
|
### `app.getLocale()`
|
||||||
|
|
||||||
@@ -688,18 +698,22 @@ Possible return values are documented [here](https://source.chromium.org/chromiu
|
|||||||
|
|
||||||
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](command-line-switches.md).
|
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](command-line-switches.md).
|
||||||
|
|
||||||
**Note:** When distributing your packaged app, you have to also ship the
|
> [!NOTE]
|
||||||
`locales` folder.
|
> When distributing your packaged app, you have to also ship the
|
||||||
|
> `locales` folder.
|
||||||
|
|
||||||
**Note:** This API must be called after the `ready` event is emitted.
|
> [!NOTE]
|
||||||
|
> This API must be called after the `ready` event is emitted.
|
||||||
|
|
||||||
**Note:** To see example return values of this API compared to other locale and language APIs, see [`app.getPreferredSystemLanguages()`](#appgetpreferredsystemlanguages).
|
> [!NOTE]
|
||||||
|
> To see example return values of this API compared to other locale and language APIs, see [`app.getPreferredSystemLanguages()`](#appgetpreferredsystemlanguages).
|
||||||
|
|
||||||
### `app.getLocaleCountryCode()`
|
### `app.getLocaleCountryCode()`
|
||||||
|
|
||||||
Returns `string` - User operating system's locale two-letter [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) country code. The value is taken from native OS APIs.
|
Returns `string` - User operating system's locale two-letter [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) country code. The value is taken from native OS APIs.
|
||||||
|
|
||||||
**Note:** When unable to detect locale country code, it returns empty string.
|
> [!NOTE]
|
||||||
|
> When unable to detect locale country code, it returns empty string.
|
||||||
|
|
||||||
### `app.getSystemLocale()`
|
### `app.getSystemLocale()`
|
||||||
|
|
||||||
@@ -712,9 +726,11 @@ Different operating systems also use the regional data differently:
|
|||||||
|
|
||||||
Therefore, this API can be used for purposes such as choosing a format for rendering dates and times in a calendar app, especially when the developer wants the format to be consistent with the OS.
|
Therefore, this API can be used for purposes such as choosing a format for rendering dates and times in a calendar app, especially when the developer wants the format to be consistent with the OS.
|
||||||
|
|
||||||
**Note:** This API must be called after the `ready` event is emitted.
|
> [!NOTE]
|
||||||
|
> This API must be called after the `ready` event is emitted.
|
||||||
|
|
||||||
**Note:** To see example return values of this API compared to other locale and language APIs, see [`app.getPreferredSystemLanguages()`](#appgetpreferredsystemlanguages).
|
> [!NOTE]
|
||||||
|
> To see example return values of this API compared to other locale and language APIs, see [`app.getPreferredSystemLanguages()`](#appgetpreferredsystemlanguages).
|
||||||
|
|
||||||
### `app.getPreferredSystemLanguages()`
|
### `app.getPreferredSystemLanguages()`
|
||||||
|
|
||||||
@@ -777,16 +793,18 @@ Once registered, all links with `your-protocol://` will be opened with the
|
|||||||
current executable. The whole link, including protocol, will be passed to your
|
current executable. The whole link, including protocol, will be passed to your
|
||||||
application as a parameter.
|
application as a parameter.
|
||||||
|
|
||||||
**Note:** On macOS, you can only register protocols that have been added to
|
> [!NOTE]
|
||||||
your app's `info.plist`, which cannot be modified at runtime. However, you can
|
> On macOS, you can only register protocols that have been added to
|
||||||
change the file during build time via [Electron Forge][electron-forge],
|
> your app's `info.plist`, which cannot be modified at runtime. However, you can
|
||||||
[Electron Packager][electron-packager], or by editing `info.plist` with a text
|
> change the file during build time via [Electron Forge][electron-forge],
|
||||||
editor. Please refer to [Apple's documentation][CFBundleURLTypes] for details.
|
> [Electron Packager][electron-packager], or by editing `info.plist` with a text
|
||||||
|
> editor. Please refer to [Apple's documentation][CFBundleURLTypes] for details.
|
||||||
|
|
||||||
**Note:** In a Windows Store environment (when packaged as an `appx`) this API
|
> [!NOTE]
|
||||||
will return `true` for all calls but the registry key it sets won't be accessible
|
> In a Windows Store environment (when packaged as an `appx`) this API
|
||||||
by other applications. In order to register your Windows Store application
|
> will return `true` for all calls but the registry key it sets won't be accessible
|
||||||
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).
|
> 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://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol).
|
||||||
|
|
||||||
The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internally.
|
The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internally.
|
||||||
|
|
||||||
@@ -810,11 +828,12 @@ protocol (aka URI scheme). If so, it will remove the app as the default handler.
|
|||||||
Returns `boolean` - Whether the current executable is the default handler for a
|
Returns `boolean` - Whether the current executable is the default handler for a
|
||||||
protocol (aka URI scheme).
|
protocol (aka URI scheme).
|
||||||
|
|
||||||
**Note:** On macOS, you can use this method to check if the app has been
|
> [!NOTE]
|
||||||
registered as the default protocol handler for a protocol. You can also verify
|
> On macOS, you can use this method to check if the app has been
|
||||||
this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
|
> registered as the default protocol handler for a protocol. You can also verify
|
||||||
macOS machine. Please refer to
|
> this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
|
||||||
[Apple's documentation][LSCopyDefaultHandlerForURLScheme] for details.
|
> macOS machine. Please refer to
|
||||||
|
> [Apple's documentation][LSCopyDefaultHandlerForURLScheme] for details.
|
||||||
|
|
||||||
The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme` internally.
|
The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme` internally.
|
||||||
|
|
||||||
@@ -858,8 +877,9 @@ Adds `tasks` to the [Tasks][tasks] category of the Jump List on Windows.
|
|||||||
|
|
||||||
Returns `boolean` - Whether the call succeeded.
|
Returns `boolean` - Whether the call succeeded.
|
||||||
|
|
||||||
**Note:** If you'd like to customize the Jump List even more use
|
> [!NOTE]
|
||||||
`app.setJumpList(categories)` instead.
|
> If you'd like to customize the Jump List even more use
|
||||||
|
> `app.setJumpList(categories)` instead.
|
||||||
|
|
||||||
### `app.getJumpListSettings()` _Windows_
|
### `app.getJumpListSettings()` _Windows_
|
||||||
|
|
||||||
@@ -897,21 +917,24 @@ following strings:
|
|||||||
If `categories` is `null` the previously set custom Jump List (if any) will be
|
If `categories` is `null` the previously set custom Jump List (if any) will be
|
||||||
replaced by the standard Jump List for the app (managed by Windows).
|
replaced by the standard Jump List for the app (managed by Windows).
|
||||||
|
|
||||||
**Note:** If a `JumpListCategory` object has neither the `type` nor the `name`
|
> [!NOTE]
|
||||||
property set then its `type` is assumed to be `tasks`. If the `name` property
|
> If a `JumpListCategory` object has neither the `type` nor the `name`
|
||||||
|
> property set then its `type` is assumed to be `tasks`. If the `name` property
|
||||||
is set but the `type` property is omitted then the `type` is assumed to be
|
is set but the `type` property is omitted then the `type` is assumed to be
|
||||||
`custom`.
|
`custom`.
|
||||||
|
|
||||||
**Note:** Users can remove items from custom categories, and Windows will not
|
> [!NOTE]
|
||||||
allow a removed item to be added back into a custom category until **after**
|
> Users can remove items from custom categories, and Windows will not
|
||||||
the next successful call to `app.setJumpList(categories)`. Any attempt to
|
> allow a removed item to be added back into a custom category until **after**
|
||||||
re-add a removed item to a custom category earlier than that will result in the
|
> the next successful call to `app.setJumpList(categories)`. Any attempt to
|
||||||
entire custom category being omitted from the Jump List. The list of removed
|
> re-add a removed item to a custom category earlier than that will result in the
|
||||||
items can be obtained using `app.getJumpListSettings()`.
|
> entire custom category being omitted from the Jump List. The list of removed
|
||||||
|
> items can be obtained using `app.getJumpListSettings()`.
|
||||||
|
|
||||||
**Note:** The maximum length of a Jump List item's `description` property is
|
> [!NOTE]
|
||||||
260 characters. Beyond this limit, the item will not be added to the Jump
|
> The maximum length of a Jump List item's `description` property is
|
||||||
List, nor will it be displayed.
|
> 260 characters. Beyond this limit, the item will not be added to the Jump
|
||||||
|
> List, nor will it be displayed.
|
||||||
|
|
||||||
Here's a very simple example of creating a custom Jump List:
|
Here's a very simple example of creating a custom Jump List:
|
||||||
|
|
||||||
@@ -1110,6 +1133,11 @@ indicates success while any other value indicates failure according to Chromium
|
|||||||
resolver will attempt to use the system's DNS settings to do DNS lookups
|
resolver will attempt to use the system's DNS settings to do DNS lookups
|
||||||
itself. Enabled by default on macOS, disabled by default on Windows and
|
itself. Enabled by default on macOS, disabled by default on Windows and
|
||||||
Linux.
|
Linux.
|
||||||
|
* `enableHappyEyeballs` boolean (optional) - Whether the
|
||||||
|
[Happy Eyeballs V3][happy-eyeballs-v3] algorithm should be used in creating
|
||||||
|
network connections. When enabled, hostnames resolving to multiple IP
|
||||||
|
addresses will be attempted in parallel to have a chance at establishing a
|
||||||
|
connection more quickly.
|
||||||
* `secureDnsMode` string (optional) - Can be 'off', 'automatic' or 'secure'.
|
* `secureDnsMode` string (optional) - Can be 'off', 'automatic' or 'secure'.
|
||||||
Configures the DNS-over-HTTP mode. When 'off', no DoH lookups will be
|
Configures the DNS-over-HTTP mode. When 'off', no DoH lookups will be
|
||||||
performed. When 'automatic', DoH lookups will be performed first if DoH is
|
performed. When 'automatic', DoH lookups will be performed first if DoH is
|
||||||
@@ -1183,7 +1211,8 @@ Returns [`ProcessMetric[]`](structures/process-metric.md): Array of `ProcessMetr
|
|||||||
|
|
||||||
Returns [`GPUFeatureStatus`](structures/gpu-feature-status.md) - The Graphics Feature Status from `chrome://gpu/`.
|
Returns [`GPUFeatureStatus`](structures/gpu-feature-status.md) - The Graphics Feature Status from `chrome://gpu/`.
|
||||||
|
|
||||||
**Note:** This information is only usable after the `gpu-info-update` event is emitted.
|
> [!NOTE]
|
||||||
|
> This information is only usable after the `gpu-info-update` event is emitted.
|
||||||
|
|
||||||
### `app.getGPUInfo(infoType)`
|
### `app.getGPUInfo(infoType)`
|
||||||
|
|
||||||
@@ -1237,11 +1266,13 @@ badge.
|
|||||||
|
|
||||||
On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
|
On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher.
|
||||||
|
|
||||||
**Note:** Unity launcher requires a `.desktop` file to work. For more information,
|
> [!NOTE]
|
||||||
please read the [Unity integration documentation][unity-requirement].
|
> Unity launcher requires a `.desktop` file to work. For more information,
|
||||||
|
> please read the [Unity integration documentation][unity-requirement].
|
||||||
|
|
||||||
**Note:** On macOS, you need to ensure that your application has the permission
|
> [!NOTE]
|
||||||
to display notifications for this method to work.
|
> On macOS, you need to ensure that your application has the permission
|
||||||
|
> to display notifications for this method to work.
|
||||||
|
|
||||||
### `app.getBadgeCount()` _Linux_ _macOS_
|
### `app.getBadgeCount()` _Linux_ _macOS_
|
||||||
|
|
||||||
@@ -1343,7 +1374,8 @@ details. Disabled by default.
|
|||||||
|
|
||||||
This API must be called after the `ready` event is emitted.
|
This API must be called after the `ready` event is emitted.
|
||||||
|
|
||||||
**Note:** Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.
|
> [!NOTE]
|
||||||
|
> Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.
|
||||||
|
|
||||||
### `app.showAboutPanel()`
|
### `app.showAboutPanel()`
|
||||||
|
|
||||||
@@ -1471,7 +1503,8 @@ By using this API, important information such as password and other sensitive in
|
|||||||
See [Apple's documentation](https://developer.apple.com/library/archive/technotes/tn2150/_index.html) for more
|
See [Apple's documentation](https://developer.apple.com/library/archive/technotes/tn2150/_index.html) for more
|
||||||
details.
|
details.
|
||||||
|
|
||||||
**Note:** Enable `Secure Keyboard Entry` only when it is needed and disable it when it is no longer needed.
|
> [!NOTE]
|
||||||
|
> Enable `Secure Keyboard Entry` only when it is needed and disable it when it is no longer needed.
|
||||||
|
|
||||||
### `app.setProxy(config)`
|
### `app.setProxy(config)`
|
||||||
|
|
||||||
@@ -1485,7 +1518,7 @@ and internal requests made by the runtime (ex: geolocation queries).
|
|||||||
|
|
||||||
This method can only be called after app is ready.
|
This method can only be called after app is ready.
|
||||||
|
|
||||||
#### `app.resolveProxy(url)`
|
### `app.resolveProxy(url)`
|
||||||
|
|
||||||
* `url` URL
|
* `url` URL
|
||||||
|
|
||||||
@@ -1533,7 +1566,8 @@ See [Chromium's accessibility docs](https://www.chromium.org/developers/design-d
|
|||||||
|
|
||||||
This API must be called after the `ready` event is emitted.
|
This API must be called after the `ready` event is emitted.
|
||||||
|
|
||||||
**Note:** Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.
|
> [!NOTE]
|
||||||
|
> Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.
|
||||||
|
|
||||||
### `app.applicationMenu`
|
### `app.applicationMenu`
|
||||||
|
|
||||||
@@ -1546,11 +1580,13 @@ An `Integer` property that returns the badge count for current app. Setting the
|
|||||||
|
|
||||||
On macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher.
|
On macOS, setting this with any nonzero integer shows on the dock icon. On Linux, this property only works for Unity launcher.
|
||||||
|
|
||||||
**Note:** Unity launcher requires a `.desktop` file to work. For more information,
|
> [!NOTE]
|
||||||
please read the [Unity integration documentation][unity-requirement].
|
> Unity launcher requires a `.desktop` file to work. For more information,
|
||||||
|
> please read the [Unity integration documentation][unity-requirement].
|
||||||
|
|
||||||
**Note:** On macOS, you need to ensure that your application has the permission
|
> [!NOTE]
|
||||||
to display notifications for this property to take effect.
|
> On macOS, you need to ensure that your application has the permission
|
||||||
|
> to display notifications for this property to take effect.
|
||||||
|
|
||||||
### `app.commandLine` _Readonly_
|
### `app.commandLine` _Readonly_
|
||||||
|
|
||||||
@@ -1559,8 +1595,8 @@ command line arguments that Chromium uses.
|
|||||||
|
|
||||||
### `app.dock` _macOS_ _Readonly_
|
### `app.dock` _macOS_ _Readonly_
|
||||||
|
|
||||||
A [`Dock`](./dock.md) `| undefined` object that allows you to perform actions on your app icon in the user's
|
A `Dock | undefined` property ([`Dock`](./dock.md) on macOS, `undefined` on all other
|
||||||
dock on macOS.
|
platforms) that allows you to perform actions on your app icon in the user's dock.
|
||||||
|
|
||||||
### `app.isPackaged` _Readonly_
|
### `app.isPackaged` _Readonly_
|
||||||
|
|
||||||
@@ -1579,6 +1615,7 @@ A `boolean` property that returns `true` if the app is packaged, `false` otherw
|
|||||||
[Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows
|
[Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows
|
||||||
[JumpListBeginListMSDN]: https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-icustomdestinationlist-beginlist
|
[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
|
[about-panel-options]: https://developer.apple.com/reference/appkit/nsapplication/1428479-orderfrontstandardaboutpanelwith?language=objc
|
||||||
|
[happy-eyeballs-v3]: https://datatracker.ietf.org/doc/draft-pauly-happy-happyeyeballs-v3/
|
||||||
|
|
||||||
### `app.name`
|
### `app.name`
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,9 @@ requirements, you can read [Server Support][server-support]. Note that
|
|||||||
update process. Apps that need to disable ATS can add the
|
update process. Apps that need to disable ATS can add the
|
||||||
`NSAllowsArbitraryLoads` key to their app's plist.
|
`NSAllowsArbitraryLoads` key to their app's plist.
|
||||||
|
|
||||||
**Note:** Your application must be signed for automatic updates on macOS.
|
> [!IMPORTANT]
|
||||||
This is a requirement of `Squirrel.Mac`.
|
> Your application must be signed for automatic updates on macOS.
|
||||||
|
> This is a requirement of `Squirrel.Mac`.
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
@@ -93,8 +94,9 @@ Emitted when an update has been downloaded.
|
|||||||
|
|
||||||
On Windows only `releaseName` is available.
|
On Windows only `releaseName` is available.
|
||||||
|
|
||||||
**Note:** It is not strictly necessary to handle this event. A successfully
|
> [!NOTE]
|
||||||
downloaded update will still be applied the next time the application starts.
|
> It is not strictly necessary to handle this event. A successfully
|
||||||
|
> downloaded update will still be applied the next time the application starts.
|
||||||
|
|
||||||
### Event: 'before-quit-for-update'
|
### Event: 'before-quit-for-update'
|
||||||
|
|
||||||
@@ -125,8 +127,9 @@ Returns `string` - The current update feed URL.
|
|||||||
Asks the server whether there is an update. You must call `setFeedURL` before
|
Asks the server whether there is an update. You must call `setFeedURL` before
|
||||||
using this API.
|
using this API.
|
||||||
|
|
||||||
**Note:** If an update is available it will be downloaded automatically.
|
> [!NOTE]
|
||||||
Calling `autoUpdater.checkForUpdates()` twice will download the update two times.
|
> If an update is available it will be downloaded automatically.
|
||||||
|
> Calling `autoUpdater.checkForUpdates()` twice will download the update two times.
|
||||||
|
|
||||||
### `autoUpdater.quitAndInstall()`
|
### `autoUpdater.quitAndInstall()`
|
||||||
|
|
||||||
@@ -137,9 +140,10 @@ Under the hood calling `autoUpdater.quitAndInstall()` will close all application
|
|||||||
windows first, and automatically call `app.quit()` after all windows have been
|
windows first, and automatically call `app.quit()` after all windows have been
|
||||||
closed.
|
closed.
|
||||||
|
|
||||||
**Note:** It is not strictly necessary to call this function to apply an update,
|
> [!NOTE]
|
||||||
as a successfully downloaded update will always be applied the next time the
|
> It is not strictly necessary to call this function to apply an update,
|
||||||
application starts.
|
> as a successfully downloaded update will always be applied the next time the
|
||||||
|
> application starts.
|
||||||
|
|
||||||
[squirrel-mac]: https://github.com/Squirrel/Squirrel.Mac
|
[squirrel-mac]: https://github.com/Squirrel/Squirrel.Mac
|
||||||
[server-support]: https://github.com/Squirrel/Squirrel.Mac#server-support
|
[server-support]: https://github.com/Squirrel/Squirrel.Mac#server-support
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Process: [Main](../glossary.md#main-process)
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
> **Note**
|
> [!NOTE]
|
||||||
> `BaseWindow` provides a flexible way to compose multiple web views in a
|
> `BaseWindow` provides a flexible way to compose multiple web views in a
|
||||||
> single window. For windows with only a single, full-size web view, the
|
> single window. For windows with only a single, full-size web view, the
|
||||||
> [`BrowserWindow`](browser-window.md) class may be a simpler option.
|
> [`BrowserWindow`](browser-window.md) class may be a simpler option.
|
||||||
@@ -107,8 +107,9 @@ It creates a new `BaseWindow` with native properties as set by the `options`.
|
|||||||
|
|
||||||
Objects created with `new BaseWindow` emit the following events:
|
Objects created with `new BaseWindow` emit the following events:
|
||||||
|
|
||||||
**Note:** Some events are only available on specific operating systems and are
|
> [!NOTE]
|
||||||
labeled as such.
|
> Some events are only available on specific operating systems and are
|
||||||
|
> labeled as such.
|
||||||
|
|
||||||
#### Event: 'close'
|
#### Event: 'close'
|
||||||
|
|
||||||
@@ -137,7 +138,11 @@ window.onbeforeunload = (e) => {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
_**Note**: There is a subtle difference between the behaviors of `window.onbeforeunload = handler` and `window.addEventListener('beforeunload', handler)`. It is recommended to always set the `event.returnValue` explicitly, instead of only returning a value, as the former works more consistently within Electron._
|
> [!NOTE]
|
||||||
|
> There is a subtle difference between the behaviors of `window.onbeforeunload = handler` and
|
||||||
|
> `window.addEventListener('beforeunload', handler)`. It is recommended to always set the
|
||||||
|
> `event.returnValue` explicitly, instead of only returning a value, as the former works more
|
||||||
|
> consistently within Electron.
|
||||||
|
|
||||||
#### Event: 'closed'
|
#### Event: 'closed'
|
||||||
|
|
||||||
@@ -252,7 +257,8 @@ Emitted when the window is being moved to a new position.
|
|||||||
|
|
||||||
Emitted once when the window is moved to a new position.
|
Emitted once when the window is moved to a new position.
|
||||||
|
|
||||||
**Note**: On macOS this event is an alias of `move`.
|
> [!NOTE]
|
||||||
|
> On macOS, this event is an alias of `move`.
|
||||||
|
|
||||||
#### Event: 'enter-full-screen'
|
#### Event: 'enter-full-screen'
|
||||||
|
|
||||||
@@ -342,12 +348,12 @@ Emitted when the window has closed a sheet.
|
|||||||
|
|
||||||
Emitted when the native new tab button is clicked.
|
Emitted when the native new tab button is clicked.
|
||||||
|
|
||||||
#### Event: 'system-context-menu' _Windows_
|
#### Event: 'system-context-menu' _Windows_ _Linux_
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
* `event` Event
|
* `event` Event
|
||||||
* `point` [Point](structures/point.md) - The screen coordinates the context menu was triggered at
|
* `point` [Point](structures/point.md) - The screen coordinates where the context menu was triggered.
|
||||||
|
|
||||||
Emitted when the system context menu is triggered on the window, this is
|
Emitted when the system context menu is triggered on the window, this is
|
||||||
normally only triggered when the user right clicks on the non-client area
|
normally only triggered when the user right clicks on the non-client area
|
||||||
@@ -356,6 +362,8 @@ as `-webkit-app-region: drag` in a frameless window.
|
|||||||
|
|
||||||
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
||||||
|
|
||||||
|
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows-linux).
|
||||||
|
|
||||||
### Static Methods
|
### Static Methods
|
||||||
|
|
||||||
The `BaseWindow` class has the following static methods:
|
The `BaseWindow` class has the following static methods:
|
||||||
@@ -396,7 +404,7 @@ A `View` property for the content view of the window.
|
|||||||
|
|
||||||
A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.
|
A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.
|
||||||
|
|
||||||
#### `win.autoHideMenuBar`
|
#### `win.autoHideMenuBar` _Linux_ _Windows_
|
||||||
|
|
||||||
A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.
|
A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.
|
||||||
|
|
||||||
@@ -419,7 +427,8 @@ A `boolean` property that determines whether the window is focusable.
|
|||||||
|
|
||||||
A `boolean` property that determines whether the window is visible on all workspaces.
|
A `boolean` property that determines whether the window is visible on all workspaces.
|
||||||
|
|
||||||
**Note:** Always returns false on Windows.
|
> [!NOTE]
|
||||||
|
> Always returns false on Windows.
|
||||||
|
|
||||||
#### `win.shadow`
|
#### `win.shadow`
|
||||||
|
|
||||||
@@ -429,7 +438,8 @@ A `boolean` property that determines whether the window has a shadow.
|
|||||||
|
|
||||||
A `boolean` property that determines whether the menu bar should be visible.
|
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.
|
> [!NOTE]
|
||||||
|
> If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.
|
||||||
|
|
||||||
#### `win.kiosk`
|
#### `win.kiosk`
|
||||||
|
|
||||||
@@ -450,7 +460,8 @@ and the icon of the file will show in window's title bar.
|
|||||||
|
|
||||||
A `string` property that determines the title of the native window.
|
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.
|
> [!NOTE]
|
||||||
|
> The title of the web page can be different from the title of the native window.
|
||||||
|
|
||||||
#### `win.minimizable` _macOS_ _Windows_
|
#### `win.minimizable` _macOS_ _Windows_
|
||||||
|
|
||||||
@@ -511,12 +522,17 @@ A `string` property that defines an alternative title provided only to
|
|||||||
accessibility tools such as screen readers. This string is not directly
|
accessibility tools such as screen readers. This string is not directly
|
||||||
visible to users.
|
visible to users.
|
||||||
|
|
||||||
|
#### `win.snapped` _Windows_ _Readonly_
|
||||||
|
|
||||||
|
A `boolean` property that indicates whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
|
||||||
|
|
||||||
### Instance Methods
|
### Instance Methods
|
||||||
|
|
||||||
Objects created with `new BaseWindow` have the following instance methods:
|
Objects created with `new BaseWindow` have the following instance methods:
|
||||||
|
|
||||||
**Note:** Some methods are only available on specific operating systems and are
|
> [!NOTE]
|
||||||
labeled as such.
|
> Some methods are only available on specific operating systems and are
|
||||||
|
> labeled as such.
|
||||||
|
|
||||||
#### `win.setContentView(view)`
|
#### `win.setContentView(view)`
|
||||||
|
|
||||||
@@ -608,7 +624,8 @@ Returns `boolean` - Whether the window is minimized.
|
|||||||
|
|
||||||
Sets whether the window should be in fullscreen mode.
|
Sets whether the window should be in fullscreen mode.
|
||||||
|
|
||||||
**Note:** On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the ['enter-full-screen'](base-window.md#event-enter-full-screen) or ['leave-full-screen'](base-window.md#event-leave-full-screen) events.
|
> [!NOTE]
|
||||||
|
> On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the ['enter-full-screen'](base-window.md#event-enter-full-screen) or > ['leave-full-screen'](base-window.md#event-leave-full-screen) events.
|
||||||
|
|
||||||
#### `win.isFullScreen()`
|
#### `win.isFullScreen()`
|
||||||
|
|
||||||
@@ -722,13 +739,15 @@ win.setBounds({ width: 100 })
|
|||||||
console.log(win.getBounds())
|
console.log(win.getBounds())
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** On macOS, the y-coordinate value cannot be smaller than the [Tray](tray.md) height. The tray height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the tray height will result in a window that is flush to the tray.
|
> [!NOTE]
|
||||||
|
> On macOS, the y-coordinate value cannot be smaller than the [Tray](tray.md) height. The tray height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the tray height will result in a window that is flush to the tray.
|
||||||
|
|
||||||
#### `win.getBounds()`
|
#### `win.getBounds()`
|
||||||
|
|
||||||
Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `Object`.
|
Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `Object`.
|
||||||
|
|
||||||
**Note:** On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.
|
> [!NOTE]
|
||||||
|
> On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.
|
||||||
|
|
||||||
#### `win.getBackgroundColor()`
|
#### `win.getBackgroundColor()`
|
||||||
|
|
||||||
@@ -736,7 +755,8 @@ Returns `string` - Gets the background color of the window in Hex (`#RRGGBB`) fo
|
|||||||
|
|
||||||
See [Setting `backgroundColor`](browser-window.md#setting-the-backgroundcolor-property).
|
See [Setting `backgroundColor`](browser-window.md#setting-the-backgroundcolor-property).
|
||||||
|
|
||||||
**Note:** The alpha value is _not_ returned alongside the red, green, and blue values.
|
> [!NOTE]
|
||||||
|
> The alpha value is _not_ returned alongside the red, green, and blue values.
|
||||||
|
|
||||||
#### `win.setContentBounds(bounds[, animate])`
|
#### `win.setContentBounds(bounds[, animate])`
|
||||||
|
|
||||||
@@ -754,7 +774,8 @@ Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window's cl
|
|||||||
|
|
||||||
Returns [`Rectangle`](structures/rectangle.md) - Contains the window bounds of the normal state
|
Returns [`Rectangle`](structures/rectangle.md) - Contains the window bounds of the normal state
|
||||||
|
|
||||||
**Note:** whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same [`Rectangle`](structures/rectangle.md).
|
> [!NOTE]
|
||||||
|
> Whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same [`Rectangle`](structures/rectangle.md).
|
||||||
|
|
||||||
#### `win.setEnabled(enable)`
|
#### `win.setEnabled(enable)`
|
||||||
|
|
||||||
@@ -951,8 +972,9 @@ Changes the title of native window to `title`.
|
|||||||
|
|
||||||
Returns `string` - The title of the native window.
|
Returns `string` - The title of the native window.
|
||||||
|
|
||||||
**Note:** The title of the web page can be different from the title of the native
|
> [!NOTE]
|
||||||
window.
|
> The title of the web page can be different from the title of the native
|
||||||
|
> window.
|
||||||
|
|
||||||
#### `win.setSheetOffset(offsetY[, offsetX])` _macOS_
|
#### `win.setSheetOffset(offsetY[, offsetX])` _macOS_
|
||||||
|
|
||||||
@@ -1226,8 +1248,9 @@ in the taskbar.
|
|||||||
|
|
||||||
Sets the properties for the window's taskbar button.
|
Sets the properties for the window's taskbar button.
|
||||||
|
|
||||||
**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
|
> [!NOTE]
|
||||||
together. If one of those properties is not set, then neither will be used.
|
> `relaunchCommand` and `relaunchDisplayName` must always be set
|
||||||
|
> together. If one of those properties is not set, then neither will be used.
|
||||||
|
|
||||||
#### `win.setIcon(icon)` _Windows_ _Linux_
|
#### `win.setIcon(icon)` _Windows_ _Linux_
|
||||||
|
|
||||||
@@ -1264,6 +1287,13 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
|||||||
|
|
||||||
Returns `boolean` - Whether the menu bar is visible.
|
Returns `boolean` - Whether the menu bar is visible.
|
||||||
|
|
||||||
|
#### `win.isSnapped()` _Windows_
|
||||||
|
|
||||||
|
Returns `boolean` - whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
|
||||||
|
|
||||||
|
The window is snapped via buttons shown when the mouse is hovered over window
|
||||||
|
maximize button, or by dragging it to the edges of the screen.
|
||||||
|
|
||||||
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
|
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
|
||||||
|
|
||||||
* `visible` boolean
|
* `visible` boolean
|
||||||
@@ -1280,13 +1310,15 @@ Returns `boolean` - Whether the menu bar is visible.
|
|||||||
|
|
||||||
Sets whether the window should be visible on all workspaces.
|
Sets whether the window should be visible on all workspaces.
|
||||||
|
|
||||||
**Note:** This API does nothing on Windows.
|
> [!NOTE]
|
||||||
|
> This API does nothing on Windows.
|
||||||
|
|
||||||
#### `win.isVisibleOnAllWorkspaces()` _macOS_ _Linux_
|
#### `win.isVisibleOnAllWorkspaces()` _macOS_ _Linux_
|
||||||
|
|
||||||
Returns `boolean` - Whether the window is visible on all workspaces.
|
Returns `boolean` - Whether the window is visible on all workspaces.
|
||||||
|
|
||||||
**Note:** This API always returns false on Windows.
|
> [!NOTE]
|
||||||
|
> This API always returns false on Windows.
|
||||||
|
|
||||||
#### `win.setIgnoreMouseEvents(ignore[, options])`
|
#### `win.setIgnoreMouseEvents(ignore[, options])`
|
||||||
|
|
||||||
@@ -1403,7 +1435,8 @@ This method sets the browser window's system-drawn background material, includin
|
|||||||
|
|
||||||
See the [Windows documentation](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type) for more details.
|
See the [Windows documentation](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type) for more details.
|
||||||
|
|
||||||
**Note:** This method is only supported on Windows 11 22H2 and up.
|
> [!NOTE]
|
||||||
|
> This method is only supported on Windows 11 22H2 and up.
|
||||||
|
|
||||||
#### `win.setWindowButtonPosition(position)` _macOS_
|
#### `win.setWindowButtonPosition(position)` _macOS_
|
||||||
|
|
||||||
@@ -1425,8 +1458,9 @@ Sets the touchBar layout for the current window. Specifying `null` or
|
|||||||
`undefined` clears the touch bar. This method only has an effect if the
|
`undefined` clears the touch bar. This method only has an effect if the
|
||||||
machine has a touch bar.
|
machine has a touch bar.
|
||||||
|
|
||||||
**Note:** The TouchBar API is currently experimental and may change or be
|
> [!NOTE]
|
||||||
removed in future Electron releases.
|
> The TouchBar API is currently experimental and may change or be
|
||||||
|
> removed in future Electron releases.
|
||||||
|
|
||||||
#### `win.setTitleBarOverlay(options)` _Windows_ _Linux_
|
#### `win.setTitleBarOverlay(options)` _Windows_ _Linux_
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ deprecated:
|
|||||||
```
|
```
|
||||||
-->
|
-->
|
||||||
|
|
||||||
> **Note**
|
> [!NOTE]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ deprecated:
|
|||||||
|
|
||||||
> Create and control views.
|
> Create and control views.
|
||||||
|
|
||||||
> **Note**
|
> [!NOTE]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
@@ -176,4 +176,5 @@ Examples of valid `color` values:
|
|||||||
* Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
* Similar to CSS Color Module Level 3 keywords, but case-sensitive.
|
||||||
* e.g. `blueviolet` or `red`
|
* e.g. `blueviolet` or `red`
|
||||||
|
|
||||||
**Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or `RGB`.
|
> [!NOTE]
|
||||||
|
> Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_ `RRGGBBAA` or `RGB`.
|
||||||
|
|||||||
@@ -158,7 +158,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
|||||||
|
|
||||||
Objects created with `new BrowserWindow` emit the following events:
|
Objects created with `new BrowserWindow` emit the following events:
|
||||||
|
|
||||||
**Note:** Some events are only available on specific operating systems and are
|
> [!NOTE]
|
||||||
|
> Some events are only available on specific operating systems and are
|
||||||
labeled as such.
|
labeled as such.
|
||||||
|
|
||||||
#### Event: 'page-title-updated'
|
#### Event: 'page-title-updated'
|
||||||
@@ -200,7 +201,11 @@ window.onbeforeunload = (e) => {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
_**Note**: There is a subtle difference between the behaviors of `window.onbeforeunload = handler` and `window.addEventListener('beforeunload', handler)`. It is recommended to always set the `event.returnValue` explicitly, instead of only returning a value, as the former works more consistently within Electron._
|
> [!NOTE]
|
||||||
|
> There is a subtle difference between the behaviors of `window.onbeforeunload = handler` and
|
||||||
|
> `window.addEventListener('beforeunload', handler)`. It is recommended to always set the
|
||||||
|
> `event.returnValue` explicitly, instead of only returning a value, as the former works more
|
||||||
|
> consistently within Electron.
|
||||||
|
|
||||||
#### Event: 'closed'
|
#### Event: 'closed'
|
||||||
|
|
||||||
@@ -323,7 +328,8 @@ Emitted when the window is being moved to a new position.
|
|||||||
|
|
||||||
Emitted once when the window is moved to a new position.
|
Emitted once when the window is moved to a new position.
|
||||||
|
|
||||||
**Note**: On macOS this event is an alias of `move`.
|
> [!NOTE]
|
||||||
|
> On macOS, this event is an alias of `move`.
|
||||||
|
|
||||||
#### Event: 'enter-full-screen'
|
#### Event: 'enter-full-screen'
|
||||||
|
|
||||||
@@ -421,12 +427,12 @@ Emitted when the window has closed a sheet.
|
|||||||
|
|
||||||
Emitted when the native new tab button is clicked.
|
Emitted when the native new tab button is clicked.
|
||||||
|
|
||||||
#### Event: 'system-context-menu' _Windows_
|
#### Event: 'system-context-menu' _Windows_ _Linux_
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
* `event` Event
|
* `event` Event
|
||||||
* `point` [Point](structures/point.md) - The screen coordinates the context menu was triggered at
|
* `point` [Point](structures/point.md) - The screen coordinates where the context menu was triggered.
|
||||||
|
|
||||||
Emitted when the system context menu is triggered on the window, this is
|
Emitted when the system context menu is triggered on the window, this is
|
||||||
normally only triggered when the user right clicks on the non-client area
|
normally only triggered when the user right clicks on the non-client area
|
||||||
@@ -435,6 +441,8 @@ as `-webkit-app-region: drag` in a frameless window.
|
|||||||
|
|
||||||
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
Calling `event.preventDefault()` will prevent the menu from being displayed.
|
||||||
|
|
||||||
|
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows-linux).
|
||||||
|
|
||||||
### Static Methods
|
### Static Methods
|
||||||
|
|
||||||
The `BrowserWindow` class has the following static methods:
|
The `BrowserWindow` class has the following static methods:
|
||||||
@@ -458,7 +466,7 @@ or `null` if the contents are not owned by a window.
|
|||||||
|
|
||||||
* `browserView` [BrowserView](browser-view.md)
|
* `browserView` [BrowserView](browser-view.md)
|
||||||
|
|
||||||
> **Note**
|
> [!NOTE]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
@@ -497,7 +505,7 @@ A `Integer` property representing the unique ID of the window. Each ID is unique
|
|||||||
|
|
||||||
A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.
|
A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set.
|
||||||
|
|
||||||
#### `win.autoHideMenuBar`
|
#### `win.autoHideMenuBar` _Linux_ _Windows_
|
||||||
|
|
||||||
A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.
|
A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key.
|
||||||
|
|
||||||
@@ -520,7 +528,8 @@ A `boolean` property that determines whether the window is focusable.
|
|||||||
|
|
||||||
A `boolean` property that determines whether the window is visible on all workspaces.
|
A `boolean` property that determines whether the window is visible on all workspaces.
|
||||||
|
|
||||||
**Note:** Always returns false on Windows.
|
> [!NOTE]
|
||||||
|
> Always returns false on Windows.
|
||||||
|
|
||||||
#### `win.shadow`
|
#### `win.shadow`
|
||||||
|
|
||||||
@@ -530,7 +539,8 @@ A `boolean` property that determines whether the window has a shadow.
|
|||||||
|
|
||||||
A `boolean` property that determines whether the menu bar should be visible.
|
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.
|
> [!NOTE]
|
||||||
|
> If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.
|
||||||
|
|
||||||
#### `win.kiosk`
|
#### `win.kiosk`
|
||||||
|
|
||||||
@@ -551,7 +561,8 @@ and the icon of the file will show in window's title bar.
|
|||||||
|
|
||||||
A `string` property that determines the title of the native window.
|
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.
|
> [!NOTE]
|
||||||
|
> The title of the web page can be different from the title of the native window.
|
||||||
|
|
||||||
#### `win.minimizable` _macOS_ _Windows_
|
#### `win.minimizable` _macOS_ _Windows_
|
||||||
|
|
||||||
@@ -611,12 +622,17 @@ A `string` property that defines an alternative title provided only to
|
|||||||
accessibility tools such as screen readers. This string is not directly
|
accessibility tools such as screen readers. This string is not directly
|
||||||
visible to users.
|
visible to users.
|
||||||
|
|
||||||
|
#### `win.snapped` _Windows_ _Readonly_
|
||||||
|
|
||||||
|
A `boolean` property that indicates whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
|
||||||
|
|
||||||
### Instance Methods
|
### Instance Methods
|
||||||
|
|
||||||
Objects created with `new BrowserWindow` have the following instance methods:
|
Objects created with `new BrowserWindow` have the following instance methods:
|
||||||
|
|
||||||
**Note:** Some methods are only available on specific operating systems and are
|
> [!NOTE]
|
||||||
labeled as such.
|
> Some methods are only available on specific operating systems and are
|
||||||
|
> labeled as such.
|
||||||
|
|
||||||
#### `win.destroy()`
|
#### `win.destroy()`
|
||||||
|
|
||||||
@@ -698,13 +714,15 @@ Returns `boolean` - Whether the window is minimized.
|
|||||||
|
|
||||||
Sets whether the window should be in fullscreen mode.
|
Sets whether the window should be in fullscreen mode.
|
||||||
|
|
||||||
**Note:** On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the ['enter-full-screen'](browser-window.md#event-enter-full-screen) or ['leave-full-screen'](browser-window.md#event-leave-full-screen) events.
|
> [!NOTE]
|
||||||
|
> On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the ['enter-full-screen'](browser-window.md#event-enter-full-screen) or ['leave-full-screen'](browser-window.md#event-leave-full-screen) events.
|
||||||
|
|
||||||
#### `win.isFullScreen()`
|
#### `win.isFullScreen()`
|
||||||
|
|
||||||
Returns `boolean` - Whether the window is in fullscreen mode.
|
Returns `boolean` - Whether the window is in fullscreen mode.
|
||||||
|
|
||||||
**Note:** On macOS, fullscreen transitions take place asynchronously. When querying for a BrowserWindow's fullscreen status, you should ensure that either the ['enter-full-screen'](browser-window.md#event-enter-full-screen) or ['leave-full-screen'](browser-window.md#event-leave-full-screen) events have been emitted.
|
> [!NOTE]
|
||||||
|
> On macOS, fullscreen transitions take place asynchronously. When querying for a BrowserWindow's fullscreen status, you should ensure that either the ['enter-full-screen'](browser-window.md#event-enter-full-screen) or ['leave-full-screen'](browser-window.md#event-leave-full-screen) events have been emitted.
|
||||||
|
|
||||||
#### `win.setSimpleFullScreen(flag)` _macOS_
|
#### `win.setSimpleFullScreen(flag)` _macOS_
|
||||||
|
|
||||||
@@ -814,13 +832,15 @@ win.setBounds({ width: 100 })
|
|||||||
console.log(win.getBounds())
|
console.log(win.getBounds())
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** On macOS, the y-coordinate value cannot be smaller than the [Tray](tray.md) height. The tray height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the tray height will result in a window that is flush to the tray.
|
> [!NOTE]
|
||||||
|
> On macOS, the y-coordinate value cannot be smaller than the [Tray](tray.md) height. The tray height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the tray height will result in a window that is flush to the tray.
|
||||||
|
|
||||||
#### `win.getBounds()`
|
#### `win.getBounds()`
|
||||||
|
|
||||||
Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `Object`.
|
Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `Object`.
|
||||||
|
|
||||||
**Note:** On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.
|
> [!NOTE]
|
||||||
|
> On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`.
|
||||||
|
|
||||||
#### `win.getBackgroundColor()`
|
#### `win.getBackgroundColor()`
|
||||||
|
|
||||||
@@ -828,7 +848,8 @@ Returns `string` - Gets the background color of the window in Hex (`#RRGGBB`) fo
|
|||||||
|
|
||||||
See [Setting `backgroundColor`](#setting-the-backgroundcolor-property).
|
See [Setting `backgroundColor`](#setting-the-backgroundcolor-property).
|
||||||
|
|
||||||
**Note:** The alpha value is _not_ returned alongside the red, green, and blue values.
|
> [!NOTE]
|
||||||
|
> The alpha value is _not_ returned alongside the red, green, and blue values.
|
||||||
|
|
||||||
#### `win.setContentBounds(bounds[, animate])`
|
#### `win.setContentBounds(bounds[, animate])`
|
||||||
|
|
||||||
@@ -846,7 +867,8 @@ Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window's cl
|
|||||||
|
|
||||||
Returns [`Rectangle`](structures/rectangle.md) - Contains the window bounds of the normal state
|
Returns [`Rectangle`](structures/rectangle.md) - Contains the window bounds of the normal state
|
||||||
|
|
||||||
**Note:** whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same [`Rectangle`](structures/rectangle.md).
|
> [!NOTE]
|
||||||
|
> Whatever the current state of the window (maximized, minimized or in fullscreen), this function always returns the position and size of the window in normal state. In normal state, `getBounds` and `getNormalBounds` return the same [`Rectangle`](structures/rectangle.md).
|
||||||
|
|
||||||
#### `win.setEnabled(enable)`
|
#### `win.setEnabled(enable)`
|
||||||
|
|
||||||
@@ -1043,8 +1065,9 @@ Changes the title of native window to `title`.
|
|||||||
|
|
||||||
Returns `string` - The title of the native window.
|
Returns `string` - The title of the native window.
|
||||||
|
|
||||||
**Note:** The title of the web page can be different from the title of the native
|
> [!NOTE]
|
||||||
window.
|
> The title of the web page can be different from the title of the native
|
||||||
|
> window.
|
||||||
|
|
||||||
#### `win.setSheetOffset(offsetY[, offsetX])` _macOS_
|
#### `win.setSheetOffset(offsetY[, offsetX])` _macOS_
|
||||||
|
|
||||||
@@ -1403,8 +1426,9 @@ in the taskbar.
|
|||||||
|
|
||||||
Sets the properties for the window's taskbar button.
|
Sets the properties for the window's taskbar button.
|
||||||
|
|
||||||
**Note:** `relaunchCommand` and `relaunchDisplayName` must always be set
|
> [!NOTE]
|
||||||
together. If one of those properties is not set, then neither will be used.
|
> `relaunchCommand` and `relaunchDisplayName` must always be set
|
||||||
|
> together. If one of those properties is not set, then neither will be used.
|
||||||
|
|
||||||
#### `win.showDefinitionForSelection()` _macOS_
|
#### `win.showDefinitionForSelection()` _macOS_
|
||||||
|
|
||||||
@@ -1445,6 +1469,13 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
|||||||
|
|
||||||
Returns `boolean` - Whether the menu bar is visible.
|
Returns `boolean` - Whether the menu bar is visible.
|
||||||
|
|
||||||
|
#### `win.isSnapped()` _Windows_
|
||||||
|
|
||||||
|
Returns `boolean` - whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
|
||||||
|
|
||||||
|
The window is snapped via buttons shown when the mouse is hovered over window
|
||||||
|
maximize button, or by dragging it to the edges of the screen.
|
||||||
|
|
||||||
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
|
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
|
||||||
|
|
||||||
* `visible` boolean
|
* `visible` boolean
|
||||||
@@ -1461,13 +1492,15 @@ Returns `boolean` - Whether the menu bar is visible.
|
|||||||
|
|
||||||
Sets whether the window should be visible on all workspaces.
|
Sets whether the window should be visible on all workspaces.
|
||||||
|
|
||||||
**Note:** This API does nothing on Windows.
|
> [!NOTE]
|
||||||
|
> This API does nothing on Windows.
|
||||||
|
|
||||||
#### `win.isVisibleOnAllWorkspaces()` _macOS_ _Linux_
|
#### `win.isVisibleOnAllWorkspaces()` _macOS_ _Linux_
|
||||||
|
|
||||||
Returns `boolean` - Whether the window is visible on all workspaces.
|
Returns `boolean` - Whether the window is visible on all workspaces.
|
||||||
|
|
||||||
**Note:** This API always returns false on Windows.
|
> [!NOTE]
|
||||||
|
> This API always returns false on Windows.
|
||||||
|
|
||||||
#### `win.setIgnoreMouseEvents(ignore[, options])`
|
#### `win.setIgnoreMouseEvents(ignore[, options])`
|
||||||
|
|
||||||
@@ -1588,7 +1621,8 @@ This method sets the browser window's system-drawn background material, includin
|
|||||||
|
|
||||||
See the [Windows documentation](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type) for more details.
|
See the [Windows documentation](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type) for more details.
|
||||||
|
|
||||||
**Note:** This method is only supported on Windows 11 22H2 and up.
|
> [!NOTE]
|
||||||
|
> This method is only supported on Windows 11 22H2 and up.
|
||||||
|
|
||||||
#### `win.setWindowButtonPosition(position)` _macOS_
|
#### `win.setWindowButtonPosition(position)` _macOS_
|
||||||
|
|
||||||
@@ -1610,8 +1644,9 @@ Sets the touchBar layout for the current window. Specifying `null` or
|
|||||||
`undefined` clears the touch bar. This method only has an effect if the
|
`undefined` clears the touch bar. This method only has an effect if the
|
||||||
machine has a touch bar.
|
machine has a touch bar.
|
||||||
|
|
||||||
**Note:** The TouchBar API is currently experimental and may change or be
|
> [!NOTE]
|
||||||
removed in future Electron releases.
|
> The TouchBar API is currently experimental and may change or be
|
||||||
|
> removed in future Electron releases.
|
||||||
|
|
||||||
#### `win.setBrowserView(browserView)` _Experimental_ _Deprecated_
|
#### `win.setBrowserView(browserView)` _Experimental_ _Deprecated_
|
||||||
|
|
||||||
@@ -1619,7 +1654,7 @@ removed in future Electron releases.
|
|||||||
If there are other `BrowserView`s attached, they will be removed from
|
If there are other `BrowserView`s attached, they will be removed from
|
||||||
this window.
|
this window.
|
||||||
|
|
||||||
> **Note**
|
> [!WARNING]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
@@ -1628,7 +1663,7 @@ this window.
|
|||||||
Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null`
|
Returns `BrowserView | null` - The `BrowserView` attached to `win`. Returns `null`
|
||||||
if one is not attached. Throws an error if multiple `BrowserView`s are attached.
|
if one is not attached. Throws an error if multiple `BrowserView`s are attached.
|
||||||
|
|
||||||
> **Note**
|
> [!WARNING]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
@@ -1638,7 +1673,7 @@ if one is not attached. Throws an error if multiple `BrowserView`s are attached.
|
|||||||
|
|
||||||
Replacement API for setBrowserView supporting work with multi browser views.
|
Replacement API for setBrowserView supporting work with multi browser views.
|
||||||
|
|
||||||
> **Note**
|
> [!WARNING]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
@@ -1646,7 +1681,7 @@ Replacement API for setBrowserView supporting work with multi browser views.
|
|||||||
|
|
||||||
* `browserView` [BrowserView](browser-view.md)
|
* `browserView` [BrowserView](browser-view.md)
|
||||||
|
|
||||||
> **Note**
|
> [!WARNING]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
@@ -1657,7 +1692,7 @@ Replacement API for setBrowserView supporting work with multi browser views.
|
|||||||
Raises `browserView` above other `BrowserView`s attached to `win`.
|
Raises `browserView` above other `BrowserView`s attached to `win`.
|
||||||
Throws an error if `browserView` is not attached to `win`.
|
Throws an error if `browserView` is not attached to `win`.
|
||||||
|
|
||||||
> **Note**
|
> [!WARNING]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
@@ -1666,7 +1701,7 @@ Throws an error if `browserView` is not attached to `win`.
|
|||||||
Returns `BrowserView[]` - a sorted by z-index array of all BrowserViews that have been attached
|
Returns `BrowserView[]` - a sorted by z-index array of all BrowserViews that have been attached
|
||||||
with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.
|
with `addBrowserView` or `setBrowserView`. The top-most BrowserView is the last element of the array.
|
||||||
|
|
||||||
> **Note**
|
> [!WARNING]
|
||||||
> The `BrowserView` class is deprecated, and replaced by the new
|
> The `BrowserView` class is deprecated, and replaced by the new
|
||||||
> [`WebContentsView`](web-contents-view.md) class.
|
> [`WebContentsView`](web-contents-view.md) class.
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ console.log(clipboard.readText('selection'))
|
|||||||
|
|
||||||
The `clipboard` module has the following methods:
|
The `clipboard` module has the following methods:
|
||||||
|
|
||||||
**Note:** Experimental APIs are marked as such and could be removed in future.
|
> [!NOTE]
|
||||||
|
> Experimental APIs are marked as such and could be removed in future.
|
||||||
|
|
||||||
### `clipboard.readText([type])`
|
### `clipboard.readText([type])`
|
||||||
|
|
||||||
@@ -141,9 +142,10 @@ bookmark is unavailable. The `title` value will always be empty on Windows.
|
|||||||
|
|
||||||
Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
|
Writes the `title` (macOS only) and `url` into the clipboard as a bookmark.
|
||||||
|
|
||||||
**Note:** Most apps on Windows don't support pasting bookmarks into them so
|
> [!NOTE]
|
||||||
you can use `clipboard.write` to write both a bookmark and fallback text to the
|
> Most apps on Windows don't support pasting bookmarks into them so
|
||||||
clipboard.
|
> you can use `clipboard.write` to write both a bookmark and fallback text to the
|
||||||
|
> clipboard.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { clipboard } = require('electron')
|
const { clipboard } = require('electron')
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ Passing `--enable-logging=file` will result in logs being saved to the file
|
|||||||
specified by `--log-file=...`, or to `electron_debug.log` in the user-data
|
specified by `--log-file=...`, or to `electron_debug.log` in the user-data
|
||||||
directory if `--log-file` is not specified.
|
directory if `--log-file` is not specified.
|
||||||
|
|
||||||
> **Note:** On Windows, logs from child processes cannot be sent to stderr.
|
> [!NOTE]
|
||||||
|
> On Windows, logs from child processes cannot be sent to stderr.
|
||||||
> Logging to a file is the most reliable way to collect logs on Windows.
|
> Logging to a file is the most reliable way to collect logs on Windows.
|
||||||
|
|
||||||
See also `--log-file`, `--log-level`, `--v`, and `--vmodule`.
|
See also `--log-file`, `--log-level`, `--v`, and `--vmodule`.
|
||||||
@@ -252,9 +253,10 @@ the required version is unavailable. Current default is set to `3`.
|
|||||||
|
|
||||||
Electron supports some of the [CLI flags][node-cli] supported by Node.js.
|
Electron supports some of the [CLI flags][node-cli] supported by Node.js.
|
||||||
|
|
||||||
**Note:** Passing unsupported command line switches to Electron when it is not running in `ELECTRON_RUN_AS_NODE` will have no effect.
|
> [!NOTE]
|
||||||
|
> Passing unsupported command line switches to Electron when it is not running in `ELECTRON_RUN_AS_NODE` will have no effect.
|
||||||
|
|
||||||
### `--inspect-brk\[=\[host:]port]`
|
### `--inspect-brk[=[host:]port]`
|
||||||
|
|
||||||
Activate inspector on host:port and break at start of user script. Default host:port is 127.0.0.1:9229.
|
Activate inspector on host:port and break at start of user script. Default host:port is 127.0.0.1:9229.
|
||||||
|
|
||||||
@@ -266,13 +268,13 @@ Activate inspector on `host:port` and break at start of the first internal
|
|||||||
JavaScript script executed when the inspector is available.
|
JavaScript script executed when the inspector is available.
|
||||||
Default `host:port` is `127.0.0.1:9229`.
|
Default `host:port` is `127.0.0.1:9229`.
|
||||||
|
|
||||||
### `--inspect-port=\[host:]port`
|
### `--inspect-port=[host:]port`
|
||||||
|
|
||||||
Set the `host:port` to be used when the inspector is activated. Useful when activating the inspector by sending the SIGUSR1 signal. Default host is `127.0.0.1`.
|
Set the `host:port` to be used when the inspector is activated. Useful when activating the inspector by sending the SIGUSR1 signal. Default host is `127.0.0.1`.
|
||||||
|
|
||||||
Aliased to `--debug-port=[host:]port`.
|
Aliased to `--debug-port=[host:]port`.
|
||||||
|
|
||||||
### `--inspect\[=\[host:]port]`
|
### `--inspect[=[host:]port]`
|
||||||
|
|
||||||
Activate inspector on `host:port`. Default is `127.0.0.1:9229`.
|
Activate inspector on `host:port`. Default is `127.0.0.1:9229`.
|
||||||
|
|
||||||
@@ -288,6 +290,10 @@ Specify ways of the inspector web socket url exposure.
|
|||||||
|
|
||||||
By default inspector websocket url is available in stderr and under /json/list endpoint on `http://host:port/json/list`.
|
By default inspector websocket url is available in stderr and under /json/list endpoint on `http://host:port/json/list`.
|
||||||
|
|
||||||
|
### `--experimental-network-inspector`
|
||||||
|
|
||||||
|
Enable support for devtools network inspector events, for visibility into requests made by the nodejs `http` and `https` modules.
|
||||||
|
|
||||||
### `--no-deprecation`
|
### `--no-deprecation`
|
||||||
|
|
||||||
Silence deprecation warnings.
|
Silence deprecation warnings.
|
||||||
@@ -313,6 +319,12 @@ Set the default value of the `verbatim` parameter in the Node.js [`dns.lookup()`
|
|||||||
|
|
||||||
The default is `verbatim` and `dns.setDefaultResultOrder()` have higher priority than `--dns-result-order`.
|
The default is `verbatim` and `dns.setDefaultResultOrder()` have higher priority than `--dns-result-order`.
|
||||||
|
|
||||||
|
### `--diagnostic-dir=directory`
|
||||||
|
|
||||||
|
Set the directory to which all Node.js diagnostic output files are written. Defaults to current working directory.
|
||||||
|
|
||||||
|
Affects the default output directory of [v8.setHeapSnapshotNearHeapLimit](https://nodejs.org/docs/latest/api/v8.html#v8setheapsnapshotnearheaplimitlimit).
|
||||||
|
|
||||||
[app]: app.md
|
[app]: app.md
|
||||||
[append-switch]: command-line.md#commandlineappendswitchswitch-value
|
[append-switch]: command-line.md#commandlineappendswitchswitch-value
|
||||||
[debugging-main-process]: ../tutorial/debugging-main-process.md
|
[debugging-main-process]: ../tutorial/debugging-main-process.md
|
||||||
|
|||||||
@@ -20,45 +20,91 @@ document.
|
|||||||
|
|
||||||
#### `commandLine.appendSwitch(switch[, value])`
|
#### `commandLine.appendSwitch(switch[, value])`
|
||||||
|
|
||||||
* `switch` string - A command-line switch, without the leading `--`
|
* `switch` string - A command-line switch, without the leading `--`.
|
||||||
* `value` string (optional) - A value for the given switch
|
* `value` string (optional) - A value for the given switch.
|
||||||
|
|
||||||
Append a switch (with optional `value`) to Chromium's command line.
|
Append a switch (with optional `value`) to Chromium's command line.
|
||||||
|
|
||||||
**Note:** This will not affect `process.argv`. The intended usage of this function is to
|
> [!NOTE]
|
||||||
control Chromium's behavior.
|
> This will not affect `process.argv`. The intended usage of this function is to
|
||||||
|
> control Chromium's behavior.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { app } = require('electron')
|
||||||
|
|
||||||
|
app.commandLine.appendSwitch('remote-debugging-port', '8315')
|
||||||
|
```
|
||||||
|
|
||||||
#### `commandLine.appendArgument(value)`
|
#### `commandLine.appendArgument(value)`
|
||||||
|
|
||||||
* `value` string - The argument to append to the command line
|
* `value` string - The argument to append to the command line.
|
||||||
|
|
||||||
Append an argument to Chromium's command line. The argument will be quoted
|
Append an argument to Chromium's command line. The argument will be quoted
|
||||||
correctly. Switches will precede arguments regardless of appending order.
|
correctly. Switches will precede arguments regardless of appending order.
|
||||||
|
|
||||||
If you're appending an argument like `--switch=value`, consider using `appendSwitch('switch', 'value')` instead.
|
If you're appending an argument like `--switch=value`, consider using `appendSwitch('switch', 'value')` instead.
|
||||||
|
|
||||||
**Note:** This will not affect `process.argv`. The intended usage of this function is to
|
```js
|
||||||
control Chromium's behavior.
|
const { app } = require('electron')
|
||||||
|
|
||||||
|
app.commandLine.appendArgument('--enable-experimental-web-platform-features')
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This will not affect `process.argv`. The intended usage of this function is to
|
||||||
|
> control Chromium's behavior.
|
||||||
|
|
||||||
#### `commandLine.hasSwitch(switch)`
|
#### `commandLine.hasSwitch(switch)`
|
||||||
|
|
||||||
* `switch` string - A command-line switch
|
* `switch` string - A command-line switch.
|
||||||
|
|
||||||
Returns `boolean` - Whether the command-line switch is present.
|
Returns `boolean` - Whether the command-line switch is present.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { app } = require('electron')
|
||||||
|
|
||||||
|
app.commandLine.appendSwitch('remote-debugging-port', '8315')
|
||||||
|
const hasPort = app.commandLine.hasSwitch('remote-debugging-port')
|
||||||
|
console.log(hasPort) // true
|
||||||
|
```
|
||||||
|
|
||||||
#### `commandLine.getSwitchValue(switch)`
|
#### `commandLine.getSwitchValue(switch)`
|
||||||
|
|
||||||
* `switch` string - A command-line switch
|
* `switch` string - A command-line switch.
|
||||||
|
|
||||||
Returns `string` - The command-line switch value.
|
Returns `string` - The command-line switch value.
|
||||||
|
|
||||||
**Note:** When the switch is not present or has no value, it returns empty string.
|
This function is meant to obtain Chromium command line switches. It is not
|
||||||
|
meant to be used for application-specific command line arguments. For the
|
||||||
|
latter, please use `process.argv`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { app } = require('electron')
|
||||||
|
|
||||||
|
app.commandLine.appendSwitch('remote-debugging-port', '8315')
|
||||||
|
const portValue = app.commandLine.getSwitchValue('remote-debugging-port')
|
||||||
|
console.log(portValue) // '8315'
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> When the switch is not present or has no value, it returns empty string.
|
||||||
|
|
||||||
#### `commandLine.removeSwitch(switch)`
|
#### `commandLine.removeSwitch(switch)`
|
||||||
|
|
||||||
* `switch` string - A command-line switch
|
* `switch` string - A command-line switch.
|
||||||
|
|
||||||
Removes the specified switch from Chromium's command line.
|
Removes the specified switch from Chromium's command line.
|
||||||
|
|
||||||
**Note:** This will not affect `process.argv`. The intended usage of this function is to
|
```js
|
||||||
control Chromium's behavior.
|
const { app } = require('electron')
|
||||||
|
|
||||||
|
app.commandLine.appendSwitch('remote-debugging-port', '8315')
|
||||||
|
console.log(app.commandLine.hasSwitch('remote-debugging-port')) // true
|
||||||
|
|
||||||
|
app.commandLine.removeSwitch('remote-debugging-port')
|
||||||
|
console.log(app.commandLine.hasSwitch('remote-debugging-port')) // false
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This will not affect `process.argv`. The intended usage of this function is to
|
||||||
|
> control Chromium's behavior.
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ Process: [Main](../glossary.md#main-process)
|
|||||||
This module does not include a web interface. To view recorded traces, use
|
This module does not include a web interface. To view recorded traces, use
|
||||||
[trace viewer][], available at `chrome://tracing` in Chrome.
|
[trace viewer][], available at `chrome://tracing` in Chrome.
|
||||||
|
|
||||||
**Note:** You should not use this module until the `ready` event of the app
|
> [!NOTE]
|
||||||
module is emitted.
|
> You should not use this module until the `ready` event of the app
|
||||||
|
> module is emitted.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { app, contentTracing } = require('electron')
|
const { app, contentTracing } = require('electron')
|
||||||
|
|||||||
@@ -61,6 +61,20 @@ The `contextBridge` module has the following methods:
|
|||||||
* `apiKey` string - The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.
|
* `apiKey` string - The key to inject the API onto `window` with. The API will be accessible on `window[apiKey]`.
|
||||||
* `api` any - Your API, more information on what this API can be and how it works is available below.
|
* `api` any - Your API, more information on what this API can be and how it works is available below.
|
||||||
|
|
||||||
|
### `contextBridge.executeInMainWorld(executionScript)` _Experimental_
|
||||||
|
|
||||||
|
<!-- TODO(samuelmaddock): add generics to map the `args` types to the `func` params -->
|
||||||
|
|
||||||
|
* `executionScript` Object
|
||||||
|
* `func` (...args: any[]) => any - A JavaScript function to execute. This function will be serialized which means
|
||||||
|
that any bound parameters and execution context will be lost.
|
||||||
|
* `args` any[] (optional) - An array of arguments to pass to the provided function. These
|
||||||
|
arguments will be copied between worlds in accordance with
|
||||||
|
[the table of supported types.](#parameter--error--return-type-support)
|
||||||
|
|
||||||
|
Returns `any` - A copy of the resulting value from executing the function in the main world.
|
||||||
|
[Refer to the table](#parameter--error--return-type-support) on how values are copied between worlds.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|||||||
78
docs/api/corner-smoothing-css.md
Normal file
78
docs/api/corner-smoothing-css.md
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
## CSS Rule: `-electron-corner-smoothing`
|
||||||
|
|
||||||
|
> Smoothes out the corner rounding of the `border-radius` CSS rule.
|
||||||
|
|
||||||
|
The rounded corners of elements with [the `border-radius` CSS rule](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius) can be smoothed out using the `-electron-corner-smoothing` CSS rule. This smoothness is very similar to Apple's "continuous" rounded corners in SwiftUI and Figma's "corner smoothing" control on design elements.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Integrating with the operating system and its design language is important to many desktop applications. The shape of a rounded corner can be a subtle detail to many users. However, aligning closely to the system's design language that users are familiar with makes the application's design feel familiar too. Beyond matching the design language of macOS, designers may decide to use smoother round corners for many other reasons.
|
||||||
|
|
||||||
|
`-electron-corner-smoothing` affects the shape of borders, outlines, and shadows on the target element. Mirroring the behavior of `border-radius`, smoothing will gradually back off if an element's size is too small for the chosen value.
|
||||||
|
|
||||||
|
The `-electron-corner-smoothing` CSS rule is **only implemented for Electron** and has no effect in browsers. Avoid using this rule outside of Electron. This CSS rule is considered experimental and may require migration in the future if replaced by a CSS standard.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
The following example shows the effect of corner smoothing at different percents.
|
||||||
|
|
||||||
|
```css
|
||||||
|
.box {
|
||||||
|
width: 128px;
|
||||||
|
height: 128px;
|
||||||
|
background-color: cornflowerblue;
|
||||||
|
border-radius: 24px;
|
||||||
|
-electron-corner-smoothing: var(--percent); /* Column header in table below. */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 0% | 30% | 60% | 100% |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
|  |  |  |  |
|
||||||
|
|
||||||
|
### Matching the system UI
|
||||||
|
|
||||||
|
Use the `system-ui` keyword to match the smoothness to the OS design language.
|
||||||
|
|
||||||
|
```css
|
||||||
|
.box {
|
||||||
|
width: 128px;
|
||||||
|
height: 128px;
|
||||||
|
background-color: cornflowerblue;
|
||||||
|
border-radius: 24px;
|
||||||
|
-electron-corner-smoothing: system-ui; /* Match the system UI design. */
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| OS: | macOS | Windows, Linux |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Value: | `60%` | `0%` |
|
||||||
|
| Example: |  |  |
|
||||||
|
|
||||||
|
### Controlling availibility
|
||||||
|
|
||||||
|
This CSS rule can be disabled by setting [the `cornerSmoothingCSS` web preference](./structures/web-preferences.md) to `false`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const myWindow = new BrowserWindow({
|
||||||
|
// [...]
|
||||||
|
webPreferences: {
|
||||||
|
enableCornerSmoothingCSS: false // Disables the `-electron-corner-smoothing` CSS rule
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
The CSS rule will still parse, but will have no visual effect.
|
||||||
|
|
||||||
|
### Formal reference
|
||||||
|
|
||||||
|
* **Initial value**: `0%`
|
||||||
|
* **Inherited**: No
|
||||||
|
* **Animatable**: No
|
||||||
|
* **Computed value**: As specified
|
||||||
|
|
||||||
|
```css
|
||||||
|
-electron-corner-smoothing =
|
||||||
|
<percentage [0,100]> |
|
||||||
|
system-ui
|
||||||
|
```
|
||||||
@@ -19,7 +19,8 @@ following projects:
|
|||||||
* [socorro](https://github.com/mozilla-services/socorro)
|
* [socorro](https://github.com/mozilla-services/socorro)
|
||||||
* [mini-breakpad-server](https://github.com/electron/mini-breakpad-server)
|
* [mini-breakpad-server](https://github.com/electron/mini-breakpad-server)
|
||||||
|
|
||||||
> **Note:** Electron uses Crashpad, not Breakpad, to collect and upload
|
> [!NOTE]
|
||||||
|
> Electron uses Crashpad, not Breakpad, to collect and upload
|
||||||
> crashes, but for the time being, the [upload protocol is the same](https://chromium.googlesource.com/crashpad/crashpad/+/HEAD/doc/overview_design.md#Upload-to-collection-server).
|
> crashes, but for the time being, the [upload protocol is the same](https://chromium.googlesource.com/crashpad/crashpad/+/HEAD/doc/overview_design.md#Upload-to-collection-server).
|
||||||
|
|
||||||
Or use a 3rd party hosted solution:
|
Or use a 3rd party hosted solution:
|
||||||
@@ -84,19 +85,23 @@ 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
|
a renderer process is created, then that renderer process will not be monitored
|
||||||
by the crash reporter.
|
by the crash reporter.
|
||||||
|
|
||||||
**Note:** You can test out the crash reporter by generating a crash using
|
> [!NOTE]
|
||||||
`process.crash()`.
|
> You can test out the crash reporter by generating a crash using
|
||||||
|
> `process.crash()`.
|
||||||
|
|
||||||
**Note:** If you need to send additional/updated `extra` parameters after your
|
> [!NOTE]
|
||||||
first call `start` you can call `addExtraParameter`.
|
> 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
|
> [!NOTE]
|
||||||
`addExtraParameter` have limits on the length of the keys and values. Key names
|
> Parameters passed in `extra`, `globalExtra` or set with
|
||||||
must be at most 39 bytes long, and values must be no longer than 127 bytes.
|
> `addExtraParameter` have limits on the length of the keys and values. Key names
|
||||||
Keys with names longer than the maximum will be silently ignored. Key values
|
> must be at most 39 bytes long, and values must be no longer than 127 bytes.
|
||||||
longer than the maximum length will be truncated.
|
> Keys with names longer than the maximum will be silently ignored. Key values
|
||||||
|
> longer than the maximum length will be truncated.
|
||||||
|
|
||||||
**Note:** This method is only available in the main process.
|
> [!NOTE]
|
||||||
|
> This method is only available in the main process.
|
||||||
|
|
||||||
### `crashReporter.getLastCrashReport()`
|
### `crashReporter.getLastCrashReport()`
|
||||||
|
|
||||||
@@ -105,7 +110,8 @@ 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
|
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.
|
uploaded. In the case that there are no uploaded reports, `null` is returned.
|
||||||
|
|
||||||
**Note:** This method is only available in the main process.
|
> [!NOTE]
|
||||||
|
> This method is only available in the main process.
|
||||||
|
|
||||||
### `crashReporter.getUploadedReports()`
|
### `crashReporter.getUploadedReports()`
|
||||||
|
|
||||||
@@ -114,14 +120,16 @@ Returns [`CrashReport[]`](structures/crash-report.md):
|
|||||||
Returns all uploaded crash reports. Each report contains the date and uploaded
|
Returns all uploaded crash reports. Each report contains the date and uploaded
|
||||||
ID.
|
ID.
|
||||||
|
|
||||||
**Note:** This method is only available in the main process.
|
> [!NOTE]
|
||||||
|
> This method is only available in the main process.
|
||||||
|
|
||||||
### `crashReporter.getUploadToServer()`
|
### `crashReporter.getUploadToServer()`
|
||||||
|
|
||||||
Returns `boolean` - Whether reports should be submitted to the server. Set through
|
Returns `boolean` - Whether reports should be submitted to the server. Set through
|
||||||
the `start` method or `setUploadToServer`.
|
the `start` method or `setUploadToServer`.
|
||||||
|
|
||||||
**Note:** This method is only available in the main process.
|
> [!NOTE]
|
||||||
|
> This method is only available in the main process.
|
||||||
|
|
||||||
### `crashReporter.setUploadToServer(uploadToServer)`
|
### `crashReporter.setUploadToServer(uploadToServer)`
|
||||||
|
|
||||||
@@ -130,7 +138,8 @@ the `start` method or `setUploadToServer`.
|
|||||||
This would normally be controlled by user preferences. This has no effect if
|
This would normally be controlled by user preferences. This has no effect if
|
||||||
called before `start` is called.
|
called before `start` is called.
|
||||||
|
|
||||||
**Note:** This method is only available in the main process.
|
> [!NOTE]
|
||||||
|
> This method is only available in the main process.
|
||||||
|
|
||||||
### `crashReporter.addExtraParameter(key, value)`
|
### `crashReporter.addExtraParameter(key, value)`
|
||||||
|
|
||||||
@@ -148,10 +157,11 @@ with crashes from renderer or other child processes. Similarly, adding extra
|
|||||||
parameters in a renderer process will not result in those parameters being sent
|
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.
|
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
|
> [!NOTE]
|
||||||
names must be no longer than 39 bytes, and values must be no longer than 20320
|
> Parameters have limits on the length of the keys and values. Key
|
||||||
bytes. Keys with names longer than the maximum will be silently ignored. Key
|
> names must be no longer than 39 bytes, and values must be no longer than 20320
|
||||||
values longer than the maximum length will be truncated.
|
> 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)`
|
### `crashReporter.removeExtraParameter(key)`
|
||||||
|
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ stopButton.addEventListener('click', () => {
|
|||||||
|
|
||||||
See [`navigator.mediaDevices.getDisplayMedia`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia) for more information.
|
See [`navigator.mediaDevices.getDisplayMedia`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia) for more information.
|
||||||
|
|
||||||
**Note:** `navigator.mediaDevices.getDisplayMedia` does not permit the use of `deviceId` for
|
> [!NOTE]
|
||||||
selection of a source - see [specification](https://w3c.github.io/mediacapture-screen-share/#constraints).
|
> `navigator.mediaDevices.getDisplayMedia` does not permit the use of `deviceId` for
|
||||||
|
> selection of a source - see [specification](https://w3c.github.io/mediacapture-screen-share/#constraints).
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
@@ -92,8 +93,9 @@ The `desktopCapturer` module has the following methods:
|
|||||||
|
|
||||||
Returns `Promise<DesktopCapturerSource[]>` - Resolves with an array of [`DesktopCapturerSource`](structures/desktop-capturer-source.md) objects, each `DesktopCapturerSource` represents a screen or an individual window that can be captured.
|
Returns `Promise<DesktopCapturerSource[]>` - Resolves with an array of [`DesktopCapturerSource`](structures/desktop-capturer-source.md) objects, each `DesktopCapturerSource` represents a screen or an individual window that can be captured.
|
||||||
|
|
||||||
**Note** Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher,
|
> [!NOTE]
|
||||||
which can detected by [`systemPreferences.getMediaAccessStatus`][].
|
> Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher,
|
||||||
|
> which can detected by [`systemPreferences.getMediaAccessStatus`][].
|
||||||
|
|
||||||
[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia
|
[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia
|
||||||
[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-windows-macos
|
[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-windows-macos
|
||||||
|
|||||||
@@ -67,10 +67,11 @@ The `extensions` array should contain extensions without wildcards or dots (e.g.
|
|||||||
`'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
`'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
||||||
`'*'` wildcard (no other wildcard is supported).
|
`'*'` wildcard (no other wildcard is supported).
|
||||||
|
|
||||||
**Note:** On Windows and Linux an open dialog can not be both a file selector
|
> [!NOTE]
|
||||||
and a directory selector, so if you set `properties` to
|
> On Windows and Linux an open dialog can not be both a file selector
|
||||||
`['openFile', 'openDirectory']` on these platforms, a directory selector will be
|
> and a directory selector, so if you set `properties` to
|
||||||
shown.
|
> `['openFile', 'openDirectory']` on these platforms, a directory selector will be
|
||||||
|
> shown.
|
||||||
|
|
||||||
```js @ts-type={mainWindow:Electron.BaseWindow}
|
```js @ts-type={mainWindow:Electron.BaseWindow}
|
||||||
dialog.showOpenDialogSync(mainWindow, {
|
dialog.showOpenDialogSync(mainWindow, {
|
||||||
@@ -78,10 +79,11 @@ dialog.showOpenDialogSync(mainWindow, {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** On Linux `defaultPath` is not supported when using portal file chooser
|
> [!NOTE]
|
||||||
dialogs unless the portal backend is version 4 or higher. You can use `--xdg-portal-required-version`
|
> On Linux `defaultPath` is not supported when using portal file chooser
|
||||||
[command-line switch](./command-line-switches.md#--xdg-portal-required-versionversion)
|
> dialogs unless the portal backend is version 4 or higher. You can use `--xdg-portal-required-version`
|
||||||
to force gtk or kde dialogs.
|
> [command-line switch](./command-line-switches.md#--xdg-portal-required-versionversion)
|
||||||
|
> to force gtk or kde dialogs.
|
||||||
|
|
||||||
### `dialog.showOpenDialog([window, ]options)`
|
### `dialog.showOpenDialog([window, ]options)`
|
||||||
|
|
||||||
@@ -139,10 +141,11 @@ The `extensions` array should contain extensions without wildcards or dots (e.g.
|
|||||||
`'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
`'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
||||||
`'*'` wildcard (no other wildcard is supported).
|
`'*'` wildcard (no other wildcard is supported).
|
||||||
|
|
||||||
**Note:** On Windows and Linux an open dialog can not be both a file selector
|
> [!NOTE]
|
||||||
and a directory selector, so if you set `properties` to
|
> On Windows and Linux an open dialog can not be both a file selector
|
||||||
`['openFile', 'openDirectory']` on these platforms, a directory selector will be
|
> and a directory selector, so if you set `properties` to
|
||||||
shown.
|
> `['openFile', 'openDirectory']` on these platforms, a directory selector will be
|
||||||
|
> shown.
|
||||||
|
|
||||||
```js @ts-type={mainWindow:Electron.BaseWindow}
|
```js @ts-type={mainWindow:Electron.BaseWindow}
|
||||||
dialog.showOpenDialog(mainWindow, {
|
dialog.showOpenDialog(mainWindow, {
|
||||||
@@ -155,10 +158,11 @@ dialog.showOpenDialog(mainWindow, {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** On Linux `defaultPath` is not supported when using portal file chooser
|
> [!NOTE]
|
||||||
dialogs unless the portal backend is version 4 or higher. You can use `--xdg-portal-required-version`
|
> On Linux `defaultPath` is not supported when using portal file chooser
|
||||||
[command-line switch](./command-line-switches.md#--xdg-portal-required-versionversion)
|
> dialogs unless the portal backend is version 4 or higher. You can use `--xdg-portal-required-version`
|
||||||
to force gtk or kde dialogs.
|
> [command-line switch](./command-line-switches.md#--xdg-portal-required-versionversion)
|
||||||
|
> to force gtk or kde dialogs.
|
||||||
|
|
||||||
### `dialog.showSaveDialogSync([window, ]options)`
|
### `dialog.showSaveDialogSync([window, ]options)`
|
||||||
|
|
||||||
@@ -225,10 +229,11 @@ The `window` argument allows the dialog to attach itself to a parent window, mak
|
|||||||
The `filters` specifies an array of file types that can be displayed, see
|
The `filters` specifies an array of file types that can be displayed, see
|
||||||
`dialog.showOpenDialog` for an example.
|
`dialog.showOpenDialog` for an example.
|
||||||
|
|
||||||
**Note:** On macOS, using the asynchronous version is recommended to avoid issues when
|
> [!NOTE]
|
||||||
expanding and collapsing the dialog.
|
> On macOS, using the asynchronous version is recommended to avoid issues when
|
||||||
|
> expanding and collapsing the dialog.
|
||||||
|
|
||||||
### `dialog.showMessageBoxSync([wndow, ]options)`
|
### `dialog.showMessageBoxSync([window, ]options)`
|
||||||
|
|
||||||
* `window` [BaseWindow](base-window.md) (optional)
|
* `window` [BaseWindow](base-window.md) (optional)
|
||||||
* `options` Object
|
* `options` Object
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ The following example shows how to bounce your icon on the dock.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const { app } = require('electron')
|
const { app } = require('electron')
|
||||||
app.dock.bounce()
|
app.dock?.bounce()
|
||||||
```
|
```
|
||||||
|
|
||||||
### Instance Methods
|
### Instance Methods
|
||||||
@@ -28,7 +28,8 @@ When `informational` is passed, the dock icon will bounce for one second.
|
|||||||
However, the request remains active until either the application becomes active
|
However, the request remains active until either the application becomes active
|
||||||
or the request is canceled.
|
or the request is canceled.
|
||||||
|
|
||||||
**Note:** This method can only be used while the app is not focused; when the app is focused it will return -1.
|
> [!NOTE]
|
||||||
|
> This method can only be used while the app is not focused; when the app is focused it will return -1.
|
||||||
|
|
||||||
#### `dock.cancelBounce(id)` _macOS_
|
#### `dock.cancelBounce(id)` _macOS_
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ Returns `boolean` - Whether the download is paused.
|
|||||||
|
|
||||||
Resumes the download that has been paused.
|
Resumes the download that has been paused.
|
||||||
|
|
||||||
**Note:** To enable resumable downloads the server you are downloading from must support range requests and provide both `Last-Modified` and `ETag` header values. Otherwise `resume()` will dismiss previously received bytes and restart the download from the beginning.
|
> [!NOTE]
|
||||||
|
> To enable resumable downloads the server you are downloading from must support range requests and provide both `Last-Modified` and `ETag` header values. Otherwise `resume()` will dismiss previously received bytes and restart the download from the beginning.
|
||||||
|
|
||||||
#### `downloadItem.canResume()`
|
#### `downloadItem.canResume()`
|
||||||
|
|
||||||
@@ -141,9 +142,10 @@ Returns `boolean` - Whether the download has user gesture.
|
|||||||
|
|
||||||
Returns `string` - The file name of the download item.
|
Returns `string` - The file name of the download item.
|
||||||
|
|
||||||
**Note:** The file name is not always the same as the actual one saved in local
|
> [!NOTE]
|
||||||
disk. If user changes the file name in a prompted download saving dialog, the
|
> The file name is not always the same as the actual one saved in local
|
||||||
actual name of saved file will be different.
|
> disk. If user changes the file name in a prompted download saving dialog, the
|
||||||
|
> actual name of saved file will be different.
|
||||||
|
|
||||||
#### `downloadItem.getCurrentBytesPerSecond()`
|
#### `downloadItem.getCurrentBytesPerSecond()`
|
||||||
|
|
||||||
@@ -172,8 +174,9 @@ header.
|
|||||||
|
|
||||||
Returns `string` - The current state. Can be `progressing`, `completed`, `cancelled` or `interrupted`.
|
Returns `string` - The current state. Can be `progressing`, `completed`, `cancelled` or `interrupted`.
|
||||||
|
|
||||||
**Note:** The following methods are useful specifically to resume a
|
> [!NOTE]
|
||||||
`cancelled` item when session is restarted.
|
> The following methods are useful specifically to resume a
|
||||||
|
> `cancelled` item when session is restarted.
|
||||||
|
|
||||||
#### `downloadItem.getURLChain()`
|
#### `downloadItem.getURLChain()`
|
||||||
|
|
||||||
|
|||||||
129
docs/api/extensions-api.md
Normal file
129
docs/api/extensions-api.md
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
## Class: Extensions
|
||||||
|
|
||||||
|
> Load and interact with extensions.
|
||||||
|
|
||||||
|
Process: [Main](../glossary.md#main-process)<br />
|
||||||
|
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||||
|
|
||||||
|
Instances of the `Extensions` class are accessed by using `extensions` property of
|
||||||
|
a `Session`.
|
||||||
|
|
||||||
|
### Instance Events
|
||||||
|
|
||||||
|
The following events are available on instances of `Extensions`:
|
||||||
|
|
||||||
|
#### Event: 'extension-loaded'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
* `extension` [Extension](structures/extension.md)
|
||||||
|
|
||||||
|
Emitted after an extension is loaded. This occurs whenever an extension is
|
||||||
|
added to the "enabled" set of extensions. This includes:
|
||||||
|
|
||||||
|
* Extensions being loaded from `Extensions.loadExtension`.
|
||||||
|
* Extensions being reloaded:
|
||||||
|
* from a crash.
|
||||||
|
* if the extension requested it ([`chrome.runtime.reload()`](https://developer.chrome.com/extensions/runtime#method-reload)).
|
||||||
|
|
||||||
|
#### Event: 'extension-unloaded'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
* `extension` [Extension](structures/extension.md)
|
||||||
|
|
||||||
|
Emitted after an extension is unloaded. This occurs when
|
||||||
|
`Session.removeExtension` is called.
|
||||||
|
|
||||||
|
#### Event: 'extension-ready'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
* `extension` [Extension](structures/extension.md)
|
||||||
|
|
||||||
|
Emitted after an extension is loaded and all necessary browser state is
|
||||||
|
initialized to support the start of the extension's background page.
|
||||||
|
|
||||||
|
### Instance Methods
|
||||||
|
|
||||||
|
The following methods are available on instances of `Extensions`:
|
||||||
|
|
||||||
|
#### `extensions.loadExtension(path[, options])`
|
||||||
|
|
||||||
|
* `path` string - Path to a directory containing an unpacked Chrome extension
|
||||||
|
* `options` Object (optional)
|
||||||
|
* `allowFileAccess` boolean - Whether to allow the extension to read local files over `file://`
|
||||||
|
protocol and inject content scripts into `file://` pages. This is required e.g. for loading
|
||||||
|
devtools extensions on `file://` URLs. Defaults to false.
|
||||||
|
|
||||||
|
Returns `Promise<Extension>` - resolves when the extension is loaded.
|
||||||
|
|
||||||
|
This method will raise an exception if the extension could not be loaded. If
|
||||||
|
there are warnings when installing the extension (e.g. if the extension
|
||||||
|
requests an API that Electron does not support) then they will be logged to the
|
||||||
|
console.
|
||||||
|
|
||||||
|
Note that Electron does not support the full range of Chrome extensions APIs.
|
||||||
|
See [Supported Extensions APIs](extensions.md#supported-extensions-apis) for
|
||||||
|
more details on what is supported.
|
||||||
|
|
||||||
|
Note that in previous versions of Electron, extensions that were loaded would
|
||||||
|
be remembered for future runs of the application. This is no longer the case:
|
||||||
|
`loadExtension` must be called on every boot of your app if you want the
|
||||||
|
extension to be loaded.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { app, session } = require('electron')
|
||||||
|
const path = require('node:path')
|
||||||
|
|
||||||
|
app.whenReady().then(async () => {
|
||||||
|
await session.defaultSession.extensions.loadExtension(
|
||||||
|
path.join(__dirname, 'react-devtools'),
|
||||||
|
// allowFileAccess is required to load the devtools extension on file:// URLs.
|
||||||
|
{ allowFileAccess: true }
|
||||||
|
)
|
||||||
|
// Note that in order to use the React DevTools extension, you'll need to
|
||||||
|
// download and unzip a copy of the extension.
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
This API does not support loading packed (.crx) extensions.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This API cannot be called before the `ready` event of the `app` module
|
||||||
|
> is emitted.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Loading extensions into in-memory (non-persistent) sessions is not
|
||||||
|
> supported and will throw an error.
|
||||||
|
|
||||||
|
#### `extensions.removeExtension(extensionId)`
|
||||||
|
|
||||||
|
* `extensionId` string - ID of extension to remove
|
||||||
|
|
||||||
|
Unloads an extension.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This API cannot be called before the `ready` event of the `app` module
|
||||||
|
> is emitted.
|
||||||
|
|
||||||
|
#### `extensions.getExtension(extensionId)`
|
||||||
|
|
||||||
|
* `extensionId` string - ID of extension to query
|
||||||
|
|
||||||
|
Returns `Extension | null` - The loaded extension with the given ID.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This API cannot be called before the `ready` event of the `app` module
|
||||||
|
> is emitted.
|
||||||
|
|
||||||
|
#### `extensions.getAllExtensions()`
|
||||||
|
|
||||||
|
Returns `Extension[]` - A list of all loaded extensions.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This API cannot be called before the `ready` event of the `app` module
|
||||||
|
> is emitted.
|
||||||
@@ -6,7 +6,8 @@ but it also happens to support some other extension capabilities.
|
|||||||
|
|
||||||
[chrome-extensions-api-index]: https://developer.chrome.com/extensions/api_index
|
[chrome-extensions-api-index]: https://developer.chrome.com/extensions/api_index
|
||||||
|
|
||||||
> **Note:** Electron does not support arbitrary Chrome extensions from the
|
> [!NOTE]
|
||||||
|
> Electron does not support arbitrary Chrome extensions from the
|
||||||
> store, and it is a **non-goal** of the Electron project to be perfectly
|
> store, and it is a **non-goal** of the Electron project to be perfectly
|
||||||
> compatible with Chrome's implementation of Extensions.
|
> compatible with Chrome's implementation of Extensions.
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ but it also happens to support some other extension capabilities.
|
|||||||
|
|
||||||
Electron only supports loading unpacked extensions (i.e., `.crx` files do not
|
Electron only supports loading unpacked extensions (i.e., `.crx` files do not
|
||||||
work). Extensions are installed per-`session`. To load an extension, call
|
work). Extensions are installed per-`session`. To load an extension, call
|
||||||
[`ses.loadExtension`](session.md#sesloadextensionpath-options):
|
[`ses.extensions.loadExtension`](extensions-api.md#extensionsloadextensionpath-options):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { session } = require('electron')
|
const { session } = require('electron')
|
||||||
@@ -160,7 +161,8 @@ The following methods of `chrome.tabs` are supported:
|
|||||||
- `chrome.tabs.update` (partial support)
|
- `chrome.tabs.update` (partial support)
|
||||||
- supported properties: `url`, `muted`.
|
- supported properties: `url`, `muted`.
|
||||||
|
|
||||||
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
|
> [!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
|
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
|
||||||
> supported and will raise an error.
|
> supported and will raise an error.
|
||||||
|
|
||||||
@@ -170,6 +172,7 @@ See [official documentation](https://developer.chrome.com/docs/extensions/refere
|
|||||||
|
|
||||||
All features of this API are supported.
|
All features of this API are supported.
|
||||||
|
|
||||||
> **NOTE:** Electron's [`webRequest`](web-request.md) module takes precedence over `chrome.webRequest` if there are conflicting handlers.
|
> [!NOTE]
|
||||||
|
> Electron's [`webRequest`](web-request.md) module takes precedence over `chrome.webRequest` if there are conflicting handlers.
|
||||||
|
|
||||||
See [official documentation](https://developer.chrome.com/docs/extensions/reference/webRequest) for more information.
|
See [official documentation](https://developer.chrome.com/docs/extensions/reference/webRequest) for more information.
|
||||||
|
|||||||
@@ -8,13 +8,21 @@ The `globalShortcut` module can register/unregister a global keyboard shortcut
|
|||||||
with the operating system so that you can customize the operations for various
|
with the operating system so that you can customize the operations for various
|
||||||
shortcuts.
|
shortcuts.
|
||||||
|
|
||||||
**Note:** The shortcut is global; it will work even if the app does
|
> [!NOTE]
|
||||||
not have the keyboard focus. This module cannot be used before the `ready`
|
> The shortcut is global; it will work even if the app does
|
||||||
event of the app module is emitted.
|
> not have the keyboard focus. This module cannot be used before the `ready`
|
||||||
|
> event of the app module is emitted.
|
||||||
|
> Please also note that it is also possible to use Chromium's
|
||||||
|
> `GlobalShortcutsPortal` implementation, which allows apps to bind global
|
||||||
|
> shortcuts when running within a Wayland session.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { app, globalShortcut } = require('electron')
|
const { app, globalShortcut } = require('electron')
|
||||||
|
|
||||||
|
// Enable usage of Portal's globalShortcuts. This is essential for cases when
|
||||||
|
// the app runs in a Wayland session.
|
||||||
|
app.commandLine.appendSwitch('enable-features', 'GlobalShortcutsPortal')
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
// Register a 'CommandOrControl+X' shortcut listener.
|
// Register a 'CommandOrControl+X' shortcut listener.
|
||||||
const ret = globalShortcut.register('CommandOrControl+X', () => {
|
const ret = globalShortcut.register('CommandOrControl+X', () => {
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ The `inAppPurchase` module emits the following events:
|
|||||||
|
|
||||||
### Event: 'transactions-updated'
|
### Event: 'transactions-updated'
|
||||||
|
|
||||||
Emitted when one or more transactions have been updated.
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
* `event` Event
|
* `event` Event
|
||||||
* `transactions` Transaction[] - Array of [`Transaction`](structures/transaction.md) objects.
|
* `transactions` Transaction[] - Array of [`Transaction`](structures/transaction.md) objects.
|
||||||
|
|
||||||
|
Emitted when one or more transactions have been updated.
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
The `inAppPurchase` module has the following methods:
|
The `inAppPurchase` module has the following methods:
|
||||||
|
|||||||
75
docs/api/ipc-main-service-worker.md
Normal file
75
docs/api/ipc-main-service-worker.md
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
## Class: IpcMainServiceWorker
|
||||||
|
|
||||||
|
> Communicate asynchronously from the main process to service workers.
|
||||||
|
|
||||||
|
Process: [Main](../glossary.md#main-process)
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This API is a subtle variation of [`IpcMain`](ipc-main.md)—targeted for
|
||||||
|
> communicating with service workers. For communicating with web frames,
|
||||||
|
> consult the `IpcMain` documentation.
|
||||||
|
|
||||||
|
<!-- TODO(samuelmaddock): refactor doc gen to allow generics to reduce duplication -->
|
||||||
|
|
||||||
|
### Instance Methods
|
||||||
|
|
||||||
|
#### `ipcMainServiceWorker.on(channel, listener)`
|
||||||
|
|
||||||
|
* `channel` string
|
||||||
|
* `listener` Function
|
||||||
|
* `event` [IpcMainServiceWorkerEvent][ipc-main-service-worker-event]
|
||||||
|
* `...args` any[]
|
||||||
|
|
||||||
|
Listens to `channel`, when a new message arrives `listener` would be called with
|
||||||
|
`listener(event, args...)`.
|
||||||
|
|
||||||
|
#### `ipcMainServiceWorker.once(channel, listener)`
|
||||||
|
|
||||||
|
* `channel` string
|
||||||
|
* `listener` Function
|
||||||
|
* `event` [IpcMainServiceWorkerEvent][ipc-main-service-worker-event]
|
||||||
|
* `...args` any[]
|
||||||
|
|
||||||
|
Adds a one time `listener` function for the event. This `listener` is invoked
|
||||||
|
only the next time a message is sent to `channel`, after which it is removed.
|
||||||
|
|
||||||
|
#### `ipcMainServiceWorker.removeListener(channel, listener)`
|
||||||
|
|
||||||
|
* `channel` string
|
||||||
|
* `listener` Function
|
||||||
|
* `...args` any[]
|
||||||
|
|
||||||
|
Removes the specified `listener` from the listener array for the specified
|
||||||
|
`channel`.
|
||||||
|
|
||||||
|
#### `ipcMainServiceWorker.removeAllListeners([channel])`
|
||||||
|
|
||||||
|
* `channel` string (optional)
|
||||||
|
|
||||||
|
Removes listeners of the specified `channel`.
|
||||||
|
|
||||||
|
#### `ipcMainServiceWorker.handle(channel, listener)`
|
||||||
|
|
||||||
|
* `channel` string
|
||||||
|
* `listener` Function\<Promise\<any\> | any\>
|
||||||
|
* `event` [IpcMainServiceWorkerInvokeEvent][ipc-main-service-worker-invoke-event]
|
||||||
|
* `...args` any[]
|
||||||
|
|
||||||
|
#### `ipcMainServiceWorker.handleOnce(channel, listener)`
|
||||||
|
|
||||||
|
* `channel` string
|
||||||
|
* `listener` Function\<Promise\<any\> | any\>
|
||||||
|
* `event` [IpcMainServiceWorkerInvokeEvent][ipc-main-service-worker-invoke-event]
|
||||||
|
* `...args` any[]
|
||||||
|
|
||||||
|
Handles a single `invoke`able IPC message, then removes the listener. See
|
||||||
|
`ipcMainServiceWorker.handle(channel, listener)`.
|
||||||
|
|
||||||
|
#### `ipcMainServiceWorker.removeHandler(channel)`
|
||||||
|
|
||||||
|
* `channel` string
|
||||||
|
|
||||||
|
Removes any handler for `channel`, if present.
|
||||||
|
|
||||||
|
[ipc-main-service-worker-event]:../api/structures/ipc-main-service-worker-event.md
|
||||||
|
[ipc-main-service-worker-invoke-event]:../api/structures/ipc-main-service-worker-invoke-event.md
|
||||||
@@ -41,6 +41,16 @@ The `ipcRenderer` module has the following method to listen for events and send
|
|||||||
Listens to `channel`, when a new message arrives `listener` would be called with
|
Listens to `channel`, when a new message arrives `listener` would be called with
|
||||||
`listener(event, args...)`.
|
`listener(event, args...)`.
|
||||||
|
|
||||||
|
:::warning
|
||||||
|
Do not expose the `event` argument to the renderer for security reasons! Wrap any
|
||||||
|
callback that you receive from the renderer in another function like this:
|
||||||
|
`ipcRenderer.on('my-channel', (event, ...args) => callback(...args))`.
|
||||||
|
Not wrapping the callback in such a function would expose dangerous Electron APIs
|
||||||
|
to the renderer process. See the
|
||||||
|
[security guide](../tutorial/security.md#20-do-not-expose-electron-apis-to-untrusted-web-content)
|
||||||
|
for more info.
|
||||||
|
:::
|
||||||
|
|
||||||
### `ipcRenderer.off(channel, listener)`
|
### `ipcRenderer.off(channel, listener)`
|
||||||
|
|
||||||
* `channel` string
|
* `channel` string
|
||||||
@@ -146,7 +156,7 @@ If you need to transfer a [`MessagePort`][] to the main process, use [`ipcRender
|
|||||||
|
|
||||||
If you do not need a response to the message, consider using [`ipcRenderer.send`](#ipcrenderersendchannel-args).
|
If you do not need a response to the message, consider using [`ipcRenderer.send`](#ipcrenderersendchannel-args).
|
||||||
|
|
||||||
> **Note**
|
> [!NOTE]
|
||||||
> Sending non-standard JavaScript types such as DOM objects or
|
> Sending non-standard JavaScript types such as DOM objects or
|
||||||
> special Electron objects will throw an exception.
|
> special Electron objects will throw an exception.
|
||||||
>
|
>
|
||||||
@@ -155,7 +165,7 @@ If you do not need a response to the message, consider using [`ipcRenderer.send`
|
|||||||
> Electron's IPC to the main process, as the main process would have no way to decode
|
> Electron's IPC to the main process, as the main process would have no way to decode
|
||||||
> them. Attempting to send such objects over IPC will result in an error.
|
> them. Attempting to send such objects over IPC will result in an error.
|
||||||
|
|
||||||
> **Note**
|
> [!NOTE]
|
||||||
> If the handler in the main process throws an error,
|
> If the handler in the main process throws an error,
|
||||||
> the promise returned by `invoke` will reject.
|
> the promise returned by `invoke` will reject.
|
||||||
> However, the `Error` object in the renderer process
|
> However, the `Error` object in the renderer process
|
||||||
@@ -185,7 +195,8 @@ throw an exception.
|
|||||||
The main process handles it by listening for `channel` with [`ipcMain`](./ipc-main.md) module,
|
The main process handles it by listening for `channel` with [`ipcMain`](./ipc-main.md) module,
|
||||||
and replies by setting `event.returnValue`.
|
and replies by setting `event.returnValue`.
|
||||||
|
|
||||||
> :warning: **WARNING**: Sending a synchronous message will block the whole
|
> [!WARNING]
|
||||||
|
> Sending a synchronous message will block the whole
|
||||||
> renderer process until the reply is received, so use this method only as a
|
> renderer process until the reply is received, so use this method only as a
|
||||||
> last resort. It's much better to use the asynchronous version,
|
> last resort. It's much better to use the asynchronous version,
|
||||||
> [`invoke()`](./ipc-renderer.md#ipcrendererinvokechannel-args).
|
> [`invoke()`](./ipc-renderer.md#ipcrendererinvokechannel-args).
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ See [`Menu`](menu.md) for examples.
|
|||||||
* `type` string (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
|
* `type` string (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
|
||||||
`radio`.
|
`radio`.
|
||||||
* `label` string (optional)
|
* `label` string (optional)
|
||||||
* `sublabel` string (optional)
|
* `sublabel` string (optional) _macOS_ - Available in macOS >= 14.4
|
||||||
* `toolTip` string (optional) _macOS_ - Hover text for this menu item.
|
* `toolTip` string (optional) _macOS_ - Hover text for this menu item.
|
||||||
* `accelerator` [Accelerator](accelerator.md) (optional)
|
* `accelerator` [Accelerator](accelerator.md) (optional)
|
||||||
* `icon` ([NativeImage](native-image.md) | string) (optional)
|
* `icon` ([NativeImage](native-image.md) | string) (optional)
|
||||||
@@ -51,7 +51,8 @@ See [`Menu`](menu.md) for examples.
|
|||||||
the placement of their containing group after the containing group of the item
|
the placement of their containing group after the containing group of the item
|
||||||
with the specified id.
|
with the specified id.
|
||||||
|
|
||||||
**Note:** `acceleratorWorksWhenHidden` is specified as being macOS-only because accelerators always work when items are hidden on Windows and Linux. The option is exposed to users to give them the option to turn it off, as this is possible in native macOS development.
|
> [!NOTE]
|
||||||
|
> `acceleratorWorksWhenHidden` is specified as being macOS-only because accelerators always work when items are hidden on Windows and Linux. The option is exposed to users to give them the option to turn it off, as this is possible in native macOS development.
|
||||||
|
|
||||||
### Roles
|
### Roles
|
||||||
|
|
||||||
@@ -125,7 +126,8 @@ 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.
|
options that will affect the menu item. All other options will be ignored.
|
||||||
Lowercase `role`, e.g. `toggledevtools`, is still supported.
|
Lowercase `role`, e.g. `toggledevtools`, is still supported.
|
||||||
|
|
||||||
**Note:** The `enabled` and `visibility` properties are not available for top-level menu items in the tray on macOS.
|
> [!NOTE]
|
||||||
|
> The `enabled` and `visibility` properties are not available for top-level menu items in the tray on macOS.
|
||||||
|
|
||||||
### Instance Properties
|
### Instance Properties
|
||||||
|
|
||||||
@@ -170,7 +172,8 @@ An `Accelerator` (optional) indicating the item's accelerator, if set.
|
|||||||
|
|
||||||
An `Accelerator | null` indicating the item's [user-assigned accelerator](https://developer.apple.com/documentation/appkit/nsmenuitem/1514850-userkeyequivalent?language=objc) for the menu item.
|
An `Accelerator | null` indicating the item's [user-assigned accelerator](https://developer.apple.com/documentation/appkit/nsmenuitem/1514850-userkeyequivalent?language=objc) for the menu item.
|
||||||
|
|
||||||
**Note:** This property is only initialized after the `MenuItem` has been added to a `Menu`. Either via `Menu.buildFromTemplate` or via `Menu.append()/insert()`. Accessing before initialization will just return `null`.
|
> [!NOTE]
|
||||||
|
> This property is only initialized after the `MenuItem` has been added to a `Menu`. Either via `Menu.buildFromTemplate` or via `Menu.append()/insert()`. Accessing before initialization will just return `null`.
|
||||||
|
|
||||||
#### `menuItem.icon`
|
#### `menuItem.icon`
|
||||||
|
|
||||||
|
|||||||
@@ -32,16 +32,18 @@ In order to escape the `&` character in an item name, add a proceeding `&`. For
|
|||||||
Passing `null` will suppress the default menu. On Windows and Linux,
|
Passing `null` will suppress the default menu. On Windows and Linux,
|
||||||
this has the additional effect of removing the menu bar from the window.
|
this has the additional effect of removing the menu bar from the window.
|
||||||
|
|
||||||
**Note:** The default menu will be created automatically if the app does not set one.
|
> [!NOTE]
|
||||||
It contains standard items such as `File`, `Edit`, `View`, `Window` and `Help`.
|
> The default menu will be created automatically if the app does not set one.
|
||||||
|
> It contains standard items such as `File`, `Edit`, `View`, `Window` and `Help`.
|
||||||
|
|
||||||
#### `Menu.getApplicationMenu()`
|
#### `Menu.getApplicationMenu()`
|
||||||
|
|
||||||
Returns `Menu | null` - The application menu, if set, or `null`, if not set.
|
Returns `Menu | null` - The application menu, if set, or `null`, if not set.
|
||||||
|
|
||||||
**Note:** The returned `Menu` instance doesn't support dynamic addition or
|
> [!NOTE]
|
||||||
removal of menu items. [Instance properties](#instance-properties) can still
|
> The returned `Menu` instance doesn't support dynamic addition or
|
||||||
be dynamically modified.
|
> removal of menu items. [Instance properties](#instance-properties) can still
|
||||||
|
> be dynamically modified.
|
||||||
|
|
||||||
#### `Menu.sendActionToFirstResponder(action)` _macOS_
|
#### `Menu.sendActionToFirstResponder(action)` _macOS_
|
||||||
|
|
||||||
@@ -73,6 +75,8 @@ The `menu` object has the following instance methods:
|
|||||||
|
|
||||||
* `options` Object (optional)
|
* `options` Object (optional)
|
||||||
* `window` [BaseWindow](base-window.md) (optional) - Default is the focused window.
|
* `window` [BaseWindow](base-window.md) (optional) - Default is the focused window.
|
||||||
|
* `frame` [WebFrameMain](web-frame-main.md) (optional) - Provide the relevant frame
|
||||||
|
if you want certain OS-level features such as Writing Tools on macOS to function correctly. Typically, this should be `params.frame` from the [`context-menu` event](web-contents.md#event-context-menu) on a WebContents, or the [`focusedFrame` property](web-contents.md#contentsfocusedframe-readonly) of a WebContents.
|
||||||
* `x` number (optional) - Default is the current mouse cursor position.
|
* `x` number (optional) - Default is the current mouse cursor position.
|
||||||
Must be declared if `y` is declared.
|
Must be declared if `y` is declared.
|
||||||
* `y` number (optional) - Default is the current mouse cursor position.
|
* `y` number (optional) - Default is the current mouse cursor position.
|
||||||
@@ -117,8 +121,9 @@ Inserts the `menuItem` to the `pos` position of the menu.
|
|||||||
|
|
||||||
Objects created with `new Menu` or returned by `Menu.buildFromTemplate` emit the following events:
|
Objects created with `new Menu` or returned by `Menu.buildFromTemplate` emit the following events:
|
||||||
|
|
||||||
**Note:** Some events are only available on specific operating systems and are
|
> [!NOTE]
|
||||||
labeled as such.
|
> Some events are only available on specific operating systems and are
|
||||||
|
> labeled as such.
|
||||||
|
|
||||||
#### Event: 'menu-will-show'
|
#### Event: 'menu-will-show'
|
||||||
|
|
||||||
@@ -327,6 +332,27 @@ name, no matter what label you set. To change it, modify your app bundle's
|
|||||||
[About Information Property List Files][AboutInformationPropertyListFiles]
|
[About Information Property List Files][AboutInformationPropertyListFiles]
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
|
### Menu Sublabels
|
||||||
|
|
||||||
|
Menu sublabels, or [subtitles](https://developer.apple.com/documentation/appkit/nsmenuitem/subtitle?language=objc), can be added to menu items using the `sublabel` option. Below is an example based on the renderer example above:
|
||||||
|
|
||||||
|
```js @ts-expect-error=[12]
|
||||||
|
// main
|
||||||
|
ipcMain.on('show-context-menu', (event) => {
|
||||||
|
const template = [
|
||||||
|
{
|
||||||
|
label: 'Menu Item 1',
|
||||||
|
sublabel: 'Subtitle 1',
|
||||||
|
click: () => { event.sender.send('context-menu-command', 'menu-item-1') }
|
||||||
|
},
|
||||||
|
{ type: 'separator' },
|
||||||
|
{ label: 'Menu Item 2', sublabel: 'Subtitle 2', type: 'checkbox', checked: true }
|
||||||
|
]
|
||||||
|
const menu = Menu.buildFromTemplate(template)
|
||||||
|
menu.popup({ window: BrowserWindow.fromWebContents(event.sender) })
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
## Setting Menu for Specific Browser Window (_Linux_ _Windows_)
|
## Setting Menu for Specific Browser Window (_Linux_ _Windows_)
|
||||||
|
|
||||||
The [`setMenu` method][setMenu] of browser windows can set the menu of certain
|
The [`setMenu` method][setMenu] of browser windows can set the menu of certain
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ Creates an empty `NativeImage` instance.
|
|||||||
|
|
||||||
Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
|
Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
|
||||||
|
|
||||||
Note: The Windows implementation will ignore `size.height` and scale the height according to `size.width`.
|
> [!NOTE]
|
||||||
|
> Windows implementation will ignore `size.height` and scale the height according to `size.width`.
|
||||||
|
|
||||||
### `nativeImage.createFromPath(path)`
|
### `nativeImage.createFromPath(path)`
|
||||||
|
|
||||||
@@ -142,8 +143,8 @@ Note: The Windows implementation will ignore `size.height` and scale the height
|
|||||||
|
|
||||||
Returns `NativeImage`
|
Returns `NativeImage`
|
||||||
|
|
||||||
Creates a new `NativeImage` instance from a file located at `path`. This method
|
Creates a new `NativeImage` instance from an image file (e.g., PNG or JPEG) located at `path`.
|
||||||
returns an empty image if the `path` does not exist, cannot be read, or is not
|
This method returns an empty image if the `path` does not exist, cannot be read, or is not
|
||||||
a valid image.
|
a valid image.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@@ -271,16 +272,12 @@ changes:
|
|||||||
|
|
||||||
Returns `string` - The [Data URL][data-url] of the image.
|
Returns `string` - The [Data URL][data-url] of the image.
|
||||||
|
|
||||||
#### `image.getBitmap([options])`
|
#### `image.getBitmap([options])` _Deprecated_
|
||||||
|
|
||||||
* `options` Object (optional)
|
* `options` Object (optional)
|
||||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||||
|
|
||||||
Returns `Buffer` - A [Buffer][buffer] that contains the image's raw bitmap pixel data.
|
Legacy alias for `image.toBitmap()`.
|
||||||
|
|
||||||
The difference between `getBitmap()` and `toBitmap()` is that `getBitmap()` does not
|
|
||||||
copy the bitmap data, so you have to use the returned Buffer immediately in
|
|
||||||
current event loop tick; otherwise the data might be changed or destroyed.
|
|
||||||
|
|
||||||
#### `image.getNativeHandle()` _macOS_
|
#### `image.getNativeHandle()` _macOS_
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ Your application should then always use `shouldUseDarkColors` to determine what
|
|||||||
A `boolean` for if the OS / Chromium currently has high-contrast mode enabled
|
A `boolean` for if the OS / Chromium currently has high-contrast mode enabled
|
||||||
or is being instructed to show a high-contrast UI.
|
or is being instructed to show a high-contrast UI.
|
||||||
|
|
||||||
|
### `nativeTheme.shouldUseDarkColorsForSystemIntegratedUI` _macOS_ _Windows_ _Readonly_
|
||||||
|
|
||||||
|
A `boolean` property indicating whether or not the system theme has been set to dark or light.
|
||||||
|
|
||||||
|
On Windows this property distinguishes between system and app light/dark theme, returning
|
||||||
|
`true` if the system theme is set to dark theme and `false` otherwise. On macOS the return
|
||||||
|
value will be the same as `nativeTheme.shouldUseDarkColors`.
|
||||||
|
|
||||||
### `nativeTheme.shouldUseInvertedColorScheme` _macOS_ _Windows_ _Readonly_
|
### `nativeTheme.shouldUseInvertedColorScheme` _macOS_ _Windows_ _Readonly_
|
||||||
|
|
||||||
A `boolean` for if the OS / Chromium currently has an inverted color scheme
|
A `boolean` for if the OS / Chromium currently has an inverted color scheme
|
||||||
|
|||||||
@@ -5,7 +5,16 @@
|
|||||||
Process: [Main](../glossary.md#main-process)<br />
|
Process: [Main](../glossary.md#main-process)<br />
|
||||||
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
||||||
|
|
||||||
Each navigation entry corresponds to a specific page. The indexing system follows a sequential order, where the first available navigation entry is at index 0, representing the earliest visited page, and the latest navigation entry is at index N, representing the most recent page. Maintaining this ordered list of navigation entries enables seamless navigation both backward and forward through the user's browsing history.
|
Each [NavigationEntry](./structures/navigation-entry.md) corresponds to a specific visited page.
|
||||||
|
The indexing system follows a sequential order, where the entry for the earliest visited
|
||||||
|
page is at index 0 and the entry for the most recent visited page is at index N.
|
||||||
|
|
||||||
|
Some APIs in this class also accept an _offset_, which is an integer representing the relative
|
||||||
|
position of an index from the current entry according to the above indexing system (i.e. an offset
|
||||||
|
value of `1` would represent going forward in history by one page).
|
||||||
|
|
||||||
|
Maintaining this ordered list of navigation entries enables seamless navigation both backward and
|
||||||
|
forward through the user's browsing history.
|
||||||
|
|
||||||
### Instance Methods
|
### Instance Methods
|
||||||
|
|
||||||
@@ -21,7 +30,7 @@ Returns `boolean` - Whether the browser can go forward to next web page.
|
|||||||
|
|
||||||
* `offset` Integer
|
* `offset` Integer
|
||||||
|
|
||||||
Returns `boolean` - Whether the web page can go to the specified `offset` from the current entry.
|
Returns `boolean` - Whether the web page can go to the specified relative `offset` from the current entry.
|
||||||
|
|
||||||
#### `navigationHistory.clear()`
|
#### `navigationHistory.clear()`
|
||||||
|
|
||||||
@@ -57,7 +66,7 @@ Navigates browser to the specified absolute web page index.
|
|||||||
|
|
||||||
* `offset` Integer
|
* `offset` Integer
|
||||||
|
|
||||||
Navigates to the specified offset from the current entry.
|
Navigates to the specified relative offset from the current entry.
|
||||||
|
|
||||||
#### `navigationHistory.length()`
|
#### `navigationHistory.length()`
|
||||||
|
|
||||||
@@ -74,3 +83,22 @@ Returns `boolean` - Whether the navigation entry was removed from the webContent
|
|||||||
#### `navigationHistory.getAllEntries()`
|
#### `navigationHistory.getAllEntries()`
|
||||||
|
|
||||||
Returns [`NavigationEntry[]`](structures/navigation-entry.md) - WebContents complete history.
|
Returns [`NavigationEntry[]`](structures/navigation-entry.md) - WebContents complete history.
|
||||||
|
|
||||||
|
#### `navigationHistory.restore(options)`
|
||||||
|
|
||||||
|
Restores navigation history and loads the given entry in the in stack. Will make a best effort
|
||||||
|
to restore not just the navigation stack but also the state of the individual pages - for instance
|
||||||
|
including HTML form values or the scroll position. It's recommended to call this API before any
|
||||||
|
navigation entries are created, so ideally before you call `loadURL()` or `loadFile()` on the
|
||||||
|
`webContents` object.
|
||||||
|
|
||||||
|
This API allows you to create common flows that aim to restore, recreate, or clone other webContents.
|
||||||
|
|
||||||
|
* `options` Object
|
||||||
|
* `entries` [NavigationEntry[]](structures/navigation-entry.md) - Result of a prior `getAllEntries()` call
|
||||||
|
* `index` Integer (optional) - Index of the stack that should be loaded. If you set it to `0`, the webContents will load the first (oldest) entry. If you leave it undefined, Electron will automatically load the last (newest) entry.
|
||||||
|
|
||||||
|
Returns `Promise<void>` - the promise will resolve when the page has finished loading the selected navigation entry
|
||||||
|
(see [`did-finish-load`](web-contents.md#event-did-finish-load)), and rejects
|
||||||
|
if the page fails to load (see
|
||||||
|
[`did-fail-load`](web-contents.md#event-did-fail-load)). A noop rejection handler is already attached, which avoids unhandled rejection errors.
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ app.whenReady().then(async () => {
|
|||||||
|
|
||||||
See [`--log-net-log`](command-line-switches.md#--log-net-logpath) to log network events throughout the app's lifecycle.
|
See [`--log-net-log`](command-line-switches.md#--log-net-logpath) to log network events throughout the app's lifecycle.
|
||||||
|
|
||||||
**Note:** All methods unless specified can only be used after the `ready` event
|
> [!NOTE]
|
||||||
of the `app` module gets emitted.
|
> All methods unless specified can only be used after the `ready` event
|
||||||
|
> of the `app` module gets emitted.
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
|||||||
@@ -117,8 +117,9 @@ protocol.handle('https', (req) => {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: in the [utility process](../glossary.md#utility-process) custom protocols
|
> [!NOTE]
|
||||||
are not supported.
|
> In the [utility process](../glossary.md#utility-process), custom protocols
|
||||||
|
> are not supported.
|
||||||
|
|
||||||
### `net.isOnline()`
|
### `net.isOnline()`
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,10 @@ Emitted when system changes to battery power.
|
|||||||
|
|
||||||
### Event: 'thermal-state-change' _macOS_
|
### Event: 'thermal-state-change' _macOS_
|
||||||
|
|
||||||
* `state` string - The system's new thermal state. Can be `unknown`, `nominal`, `fair`, `serious`, `critical`.
|
Returns:
|
||||||
|
|
||||||
|
* `details` Event\<\>
|
||||||
|
* `state` string - The system's new thermal state. Can be `unknown`, `nominal`, `fair`, `serious`, `critical`.
|
||||||
|
|
||||||
Emitted when the thermal state of the system changes. Notification of a change
|
Emitted when the thermal state of the system changes. Notification of a change
|
||||||
in the thermal status of the system, such as entering a critical temperature
|
in the thermal status of the system, such as entering a critical temperature
|
||||||
@@ -44,7 +47,8 @@ See https://developer.apple.com/library/archive/documentation/Performance/Concep
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
* `limit` number - The operating system's advertised speed limit for CPUs, in percent.
|
* `details` Event\<\>
|
||||||
|
* `limit` number - The operating system's advertised speed limit for CPUs, in percent.
|
||||||
|
|
||||||
Notification of a change in the operating system's advertised speed limit for
|
Notification of a change in the operating system's advertised speed limit for
|
||||||
CPUs, in percent. Values below 100 indicate that the system is impairing
|
CPUs, in percent. Values below 100 indicate that the system is impairing
|
||||||
|
|||||||
@@ -33,10 +33,11 @@ Returns `Integer` - The blocker ID that is assigned to this power blocker.
|
|||||||
Starts preventing the system from entering lower-power mode. Returns an integer
|
Starts preventing the system from entering lower-power mode. Returns an integer
|
||||||
identifying the power save blocker.
|
identifying the power save blocker.
|
||||||
|
|
||||||
**Note:** `prevent-display-sleep` has higher precedence over
|
> [!NOTE]
|
||||||
`prevent-app-suspension`. Only the highest precedence type takes effect. In
|
> `prevent-display-sleep` has higher precedence over
|
||||||
other words, `prevent-display-sleep` always takes precedence over
|
> `prevent-app-suspension`. Only the highest precedence type takes effect. In
|
||||||
`prevent-app-suspension`.
|
> other words, `prevent-display-sleep` always takes precedence over
|
||||||
|
> `prevent-app-suspension`.
|
||||||
|
|
||||||
For example, an API calling A requests for `prevent-app-suspension`, and
|
For example, an API calling A requests for `prevent-app-suspension`, and
|
||||||
another calling B requests for `prevent-display-sleep`. `prevent-display-sleep`
|
another calling B requests for `prevent-display-sleep`. `prevent-display-sleep`
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ A `string` representing the current process's type, can be:
|
|||||||
|
|
||||||
* `browser` - The main process
|
* `browser` - The main process
|
||||||
* `renderer` - A renderer process
|
* `renderer` - A renderer process
|
||||||
|
* `service-worker` - In a service worker
|
||||||
* `worker` - In a web worker
|
* `worker` - In a web worker
|
||||||
* `utility` - In a node process launched as a service
|
* `utility` - In a node process launched as a service
|
||||||
|
|
||||||
@@ -232,7 +233,8 @@ console.log(version)
|
|||||||
// On Linux -> '4.15.0-45-generic'
|
// On Linux -> '4.15.0-45-generic'
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** It returns the actual operating system version instead of kernel version on macOS unlike `os.release()`.
|
> [!NOTE]
|
||||||
|
> It returns the actual operating system version instead of kernel version on macOS unlike `os.release()`.
|
||||||
|
|
||||||
### `process.takeHeapSnapshot(filePath)`
|
### `process.takeHeapSnapshot(filePath)`
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ app.whenReady().then(() => {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** All methods unless specified can only be used after the `ready` event
|
> [!NOTE]
|
||||||
of the `app` module gets emitted.
|
> All methods unless specified can only be used after the `ready` event
|
||||||
|
> of the `app` module gets emitted.
|
||||||
|
|
||||||
## Using `protocol` with a custom `partition` or `session`
|
## Using `protocol` with a custom `partition` or `session`
|
||||||
|
|
||||||
@@ -61,8 +62,9 @@ The `protocol` module has the following methods:
|
|||||||
|
|
||||||
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
|
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
|
||||||
|
|
||||||
**Note:** This method can only be used before the `ready` event of the `app`
|
> [!NOTE]
|
||||||
module gets emitted and can be called only once.
|
> This method can only be used before the `ready` event of the `app`
|
||||||
|
> module gets emitted and can be called only once.
|
||||||
|
|
||||||
Registers the `scheme` as standard, secure, bypasses content security policy for
|
Registers the `scheme` as standard, secure, bypasses content security policy for
|
||||||
resources, allows registering ServiceWorker, supports fetch API, streaming
|
resources, allows registering ServiceWorker, supports fetch API, streaming
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user