Compare commits
139 Commits
sam/vitest
...
ci/replace
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
641b98c6ce | ||
|
|
2e07e896ab | ||
|
|
5c81e889ad | ||
|
|
7adb8b0d3f | ||
|
|
24ac4a4ba9 | ||
|
|
f8d041246c | ||
|
|
4f38f357f1 | ||
|
|
aaf328930d | ||
|
|
d0612e2c92 | ||
|
|
8f0f08e818 | ||
|
|
4cad9c868d | ||
|
|
a1d6918b59 | ||
|
|
00f0989f49 | ||
|
|
f6dc41a911 | ||
|
|
edd3b27063 | ||
|
|
212b53c63e | ||
|
|
4e56da6d30 | ||
|
|
d58c5a5562 | ||
|
|
d4e6b41f3d | ||
|
|
cc7ebe542d | ||
|
|
cef313a172 | ||
|
|
1766370311 | ||
|
|
2b341e5e5b | ||
|
|
e235c3fff0 | ||
|
|
bbdeb50405 | ||
|
|
b08931c957 | ||
|
|
3f0c48f567 | ||
|
|
8066df1817 | ||
|
|
69a4fa20e1 | ||
|
|
4b90a3fd78 | ||
|
|
966e932efa | ||
|
|
de8fddcacd | ||
|
|
76c5257fea | ||
|
|
d6888df13b | ||
|
|
6f2e5cd426 | ||
|
|
126a422cfa | ||
|
|
170e07eee8 | ||
|
|
6c49cb3b27 | ||
|
|
002249c0ed | ||
|
|
411e3be571 | ||
|
|
9e7a343f39 | ||
|
|
ccaab437cc | ||
|
|
849485dc33 | ||
|
|
ded39eecc7 | ||
|
|
5af1a06082 | ||
|
|
e52001b0c8 | ||
|
|
44f030f039 | ||
|
|
f6a99d04a4 | ||
|
|
37a81876de | ||
|
|
98e91ca555 | ||
|
|
0960ddc688 | ||
|
|
9f25fc4e06 | ||
|
|
e04ee76c7f | ||
|
|
bd14ed60e0 | ||
|
|
56ac67bf48 | ||
|
|
746b1b2579 | ||
|
|
b93642678c | ||
|
|
7d6227ad86 | ||
|
|
f99a3980e5 | ||
|
|
38cfc66c6f | ||
|
|
099c5c0038 | ||
|
|
2c46abe361 | ||
|
|
05e0cd085c | ||
|
|
7c56577639 | ||
|
|
350de668e2 | ||
|
|
111b6275ee | ||
|
|
54eb30a642 | ||
|
|
71e8a5ca80 | ||
|
|
c74de25b01 | ||
|
|
44e4839580 | ||
|
|
fac0a1624b | ||
|
|
23d95ea9f8 | ||
|
|
89050762c6 | ||
|
|
b8be33814e | ||
|
|
76a03e1010 | ||
|
|
2ba6d28c09 | ||
|
|
5ed6e4bf62 | ||
|
|
4d780c67f9 | ||
|
|
313f8955d1 | ||
|
|
1ad6173286 | ||
|
|
9861250310 | ||
|
|
0396220dce | ||
|
|
a0c3be5656 | ||
|
|
b5c68d13d5 | ||
|
|
f7ba34064e | ||
|
|
61e815c28a | ||
|
|
51c0b025d8 | ||
|
|
bc8ed1808c | ||
|
|
db9bcbd3e4 | ||
|
|
92f0993d94 | ||
|
|
bef68b6bb7 | ||
|
|
0866d39006 | ||
|
|
2e17a57d49 | ||
|
|
0ab23201e7 | ||
|
|
1bea748a45 | ||
|
|
09361b6d7b | ||
|
|
a98d19a3ba | ||
|
|
e2143f5e8e | ||
|
|
a1d28e6764 | ||
|
|
72a168f653 | ||
|
|
f6f71fa787 | ||
|
|
9d77099a8c | ||
|
|
85be1a05e1 | ||
|
|
2f749e24ed | ||
|
|
15ed78d807 | ||
|
|
2fbd11d978 | ||
|
|
d813618538 | ||
|
|
99e8170f3f | ||
|
|
02d90a5ba3 | ||
|
|
3c826c7503 | ||
|
|
f35122b21e | ||
|
|
5523130c92 | ||
|
|
abffba4548 | ||
|
|
d164b7af01 | ||
|
|
2434c5a73c | ||
|
|
cc738f2a6c | ||
|
|
9569c48bfe | ||
|
|
0a80d4d879 | ||
|
|
0227bcfb9f | ||
|
|
0ad0d44b3d | ||
|
|
04b9b7bc22 | ||
|
|
22f15ec476 | ||
|
|
53bf94fdf4 | ||
|
|
21c5e25f04 | ||
|
|
cf2cc4d80f | ||
|
|
8ea3d16ce9 | ||
|
|
c30655785b | ||
|
|
d223ad67ea | ||
|
|
dad4ab658a | ||
|
|
9b85b9c0bc | ||
|
|
abd29a397e | ||
|
|
604e7e82f2 | ||
|
|
2e3da1d079 | ||
|
|
edbff16029 | ||
|
|
b5fbbed4db | ||
|
|
663773a677 | ||
|
|
351f35da8c | ||
|
|
b9e462f397 | ||
|
|
a39108c5a4 |
@@ -11,6 +11,7 @@
|
||||
"Bash(e patches:*)",
|
||||
"Bash(e sync:*)",
|
||||
"Skill(electron-chromium-upgrade)",
|
||||
"Skill(electron-node-upgrade)",
|
||||
"Read(*)",
|
||||
"Bash(echo:*)",
|
||||
"Bash(e build:*)",
|
||||
|
||||
106
.claude/skills/chrome-release-cls/SKILL.md
Normal file
@@ -0,0 +1,106 @@
|
||||
---
|
||||
name: chrome-release-cls
|
||||
description: Given a Chrome Releases blog post URL (chromereleases.googleblog.com), extract every CVE/bug and find the underlying Gerrit CL that fixed it by searching the local Chromium checkout and sub-repos. Use when asked to map Chrome security release notes to fixing CLs, or to find which commits correspond to CVEs in a Chrome stable update.
|
||||
---
|
||||
|
||||
# Chrome Release → Fixing CL Mapper
|
||||
|
||||
Maps every security fix in a Chrome Releases blog post to the Gerrit CL(s) that fixed it.
|
||||
|
||||
## Input
|
||||
|
||||
`$ARGUMENTS` — a `https://chromereleases.googleblog.com/...` URL. If empty, ask the user for one.
|
||||
|
||||
## Procedure
|
||||
|
||||
### 1. Extract CVE → bug ID pairs from the blog post
|
||||
|
||||
The blog HTML buries bug IDs inside `<a>` tags, so strip tags first. Run:
|
||||
|
||||
```bash
|
||||
curl -sL "$URL" | python3 -c '
|
||||
import sys, re, html
|
||||
t = re.sub(r"<[^>]+>", " ", sys.stdin.read())
|
||||
t = re.sub(r"\s+", " ", html.unescape(t))
|
||||
seen = set()
|
||||
for m in re.finditer(r"\[\s*(\d{6,})\s*\]\s*(Critical|High|Medium|Low)\s*(CVE-\d{4}-\d+):\s*([^.]+?)\.", t):
|
||||
if m.group(3) in seen: continue
|
||||
seen.add(m.group(3))
|
||||
print(f"{m.group(3)}|{m.group(1)}|{m.group(2)}|{m.group(4).strip()}")
|
||||
' > /tmp/cve_bugs.txt
|
||||
cat /tmp/cve_bugs.txt
|
||||
```
|
||||
|
||||
If this yields nothing, the page may have changed format — fall back to `grep -oE 'CVE-[0-9]{4}-[0-9]+'` and `grep -oE 'crbug\.com/[0-9]+'` and pair them by order.
|
||||
|
||||
### 2. Find the fixing CL for each bug
|
||||
|
||||
Search git history in the Chromium checkout and relevant sub-repos for commits whose `Bug:` or `Fixed:` footer references the bug ID, then extract the `Reviewed-on:` Gerrit URL.
|
||||
|
||||
Repo selection by component keyword:
|
||||
- ANGLE → `third_party/angle`
|
||||
- Skia, Graphite → `third_party/skia`
|
||||
- PDFium → `third_party/pdfium`
|
||||
- Dawn → `third_party/dawn`
|
||||
- V8, Turbofan, Maglev, Turboshaft → `v8`
|
||||
- everything else → `.` (chromium/src)
|
||||
|
||||
Always also fall back to `.` if the hinted repo has no match.
|
||||
|
||||
```bash
|
||||
cd /root/src/electron/src # chromium root (parent of electron/)
|
||||
|
||||
lookup() {
|
||||
local bug="$1" repos="$2"
|
||||
for repo in $repos . v8 third_party/skia third_party/angle third_party/pdfium third_party/dawn; do
|
||||
local hits
|
||||
hits=$(git -C "$repo" log --all --since='6 months ago' -E \
|
||||
--grep="(Bug|Fixed):.*\\b${bug}\\b" --format='%H' 2>/dev/null | sort -u)
|
||||
[[ -z "$hits" ]] && continue
|
||||
while read -r h; do
|
||||
git -C "$repo" log -1 --format='%B' "$h" | grep '^Reviewed-on:' | sed 's/^/ /'
|
||||
echo " ↳ $(git -C "$repo" log -1 --format='%s' "$h")"
|
||||
done <<<"$hits"
|
||||
return 0
|
||||
done
|
||||
echo " (not found locally)"
|
||||
}
|
||||
```
|
||||
|
||||
Drive it from `/tmp/cve_bugs.txt`. Prefer the **non-`[M1xx]`-prefixed** commit subject as the canonical main CL; the `[M1xx]` ones are branch cherry-picks.
|
||||
|
||||
### 3. Handle misses
|
||||
|
||||
For any bug with no local hit:
|
||||
- `git -C <repo> fetch origin` then re-search `--remotes` (fix may be newer than the checkout).
|
||||
- Query Gerrit directly: `curl -s "https://chromium-review.googlesource.com/changes/?q=bug:${BUG}&n=10" | tail -n +2 | python3 -m json.tool` (also try `skia-review`, `pdfium-review`, `dawn-review`, `aomedia-review`).
|
||||
- **`b/` bug format (Skia, Graphite, Dawn):** These repos reference bugs as `b/<id>` in commit messages rather than `Bug: <id>` footers. The Gerrit `bug:` query will return nothing. Use `message:<id>` search instead:
|
||||
```bash
|
||||
curl -s "https://skia-review.googlesource.com/changes/?q=message:${BUG}&n=5" | tail -n +2
|
||||
```
|
||||
Apply the same pattern for `dawn-review.googlesource.com` when the component is Dawn.
|
||||
- **Tracing main CLs from merges:** When only `[M1xx]` merge CLs are found, query the CL detail for `cherry_pick_of_change` to find the original main CL number:
|
||||
```bash
|
||||
curl -s "https://chromium-review.googlesource.com/changes/${CL_NUM}?o=CURRENT_REVISION" | tail -n +2 | python3 -c "
|
||||
import sys, json
|
||||
d = json.load(sys.stdin)
|
||||
print(d.get('cherry_pick_of_change', 'none'))
|
||||
"
|
||||
```
|
||||
- If still nothing and the bug was reported very recently (especially by "Google Threat Intelligence" or marked in-the-wild), the CL is likely still access-restricted — report it as such rather than guessing.
|
||||
|
||||
### 4. Special cases
|
||||
|
||||
- **Roll CLs — skip and find the upstream fix:** For components whose fixes land in upstream repos (PDFium, Dawn, Skia, Graphite, libaom, libvpx, ffmpeg), the chromium-review hit will be a `Roll src/third_party/...` commit. Do not report the roll CL as the fix. Instead, query the component's own Gerrit instance directly for the actual fixing CL:
|
||||
- PDFium → `pdfium-review.googlesource.com` (use `bug:` or `message:` query)
|
||||
- Dawn → `dawn-review.googlesource.com` (use `message:` query — uses `b/` format)
|
||||
- Skia / Graphite → `skia-review.googlesource.com` (use `message:` query — uses `b/` format)
|
||||
- libaom → `aomedia-review.googlesource.com`
|
||||
|
||||
Only if the upstream Gerrit instance returns no results should you fall back to reporting the roll CL — in that case, include the roll CL and note that the actual fix is upstream but the specific CL could not be identified.
|
||||
- Multiple `Reviewed-on:` lines in one commit body: cherry-picks keep the original line plus a new one. The **first** `Reviewed-on:` is the original CL.
|
||||
- A bug may have multiple distinct fix CLs (fix + follow-up hardening) — list all of them.
|
||||
|
||||
### 5. Output
|
||||
|
||||
Produce a markdown table per severity level: `CVE | Bug | Component | Fix CL (main)`. Link bugs as `https://crbug.com/<id>`. Save raw output (including all branch merges) to `/tmp/cve_cls.txt` and mention the path.
|
||||
123
.claude/skills/chrome-release-verify/SKILL.md
Normal file
@@ -0,0 +1,123 @@
|
||||
---
|
||||
name: chrome-release-verify
|
||||
description: End-to-end Chrome security backport for an Electron release branch. Given a Chrome Releases blog URL and a branch (e.g. 41-x-y), determines which CVE fixes are missing from the *actual synced source*, writes the cherry-pick patches locally, validates them with `e sync --3` + `lint --patches`, then pushes a single PR. Use when asked to backport a Chrome security release to N-x-y, "is CVE-X already in N-x-y?", or to produce/validate the cherry-pick set for a release branch.
|
||||
---
|
||||
|
||||
# Chrome Release → Validated Backport PR
|
||||
|
||||
Input: `$ARGUMENTS` = `<release-branch> <chrome-releases-blog-url>` (e.g. `41-x-y https://chromereleases.googleblog.com/2026/04/stable-channel-update-for-desktop_15.html`). Ask if either is missing.
|
||||
|
||||
The flow is **local-first**: nothing is pushed until every patch applies via `e sync --3` and passes `lint --patches`.
|
||||
|
||||
## 1. Map CVE → bug → fix CL
|
||||
|
||||
Run `/chrome-release-cls <blog-url>` (or its inline procedure) to produce `/tmp/cve_bugs.txt` (`CVE|bug|severity|desc`) and a per-bug canonical fix CL. For each CL also note `repo` (path under `src/`: `.`, `v8`, `third_party/{skia,angle,pdfium,dawn}`, `third_party/libaom/source/libaom`) and `gerrit-host`.
|
||||
|
||||
**Prefer the target-milestone merge CL** if one exists (e.g. on `41-x-y` ≈ M146, prefer the `[M146]` cherry-pick over the main CL) — it's already rebased and far less likely to conflict. Find it via `git log --all --grep` on the Change-Id, or Gerrit `?q=bug:<n>`. If Chrome did *not* merge a fix to the target milestone, that's a strong signal the vulnerable code doesn't exist there — flag it for skip rather than forcing a port.
|
||||
|
||||
## 2. Prepare a synced worktree
|
||||
|
||||
Reuse `bp-<NN>` from `e show configs` if present, else `e worktree add bp-<NN> ~/src/electron-bp-<NN> --source <current> --no-sync`.
|
||||
|
||||
```bash
|
||||
cd <root>/src/electron
|
||||
git fetch origin <branch>
|
||||
git checkout -B security-backport/<branch>/<short-date> origin/<branch>
|
||||
e use bp-<NN>
|
||||
e sync 2>&1 | tee /tmp/bp_sync.log
|
||||
```
|
||||
|
||||
If sync fails with `NotADirectoryError: '<root>/src/.git/objects/info/alternates'`, remove `GIT_CACHE_PATH` from the bp config's `env` and retry.
|
||||
|
||||
## 3. Verify IN-TREE vs NEEDS-BACKPORT
|
||||
|
||||
For each bug, three checks against the **synced** repo:
|
||||
|
||||
1. `git -C "$repo" log HEAD --since='1 year ago' -E --grep="\b${bug}\b" --format='%h %s'`
|
||||
2. Fetch Change-Id from Gerrit, then `git log HEAD --grep="^Change-Id: ${cid}$"`
|
||||
3. `grep -rlE "(\b${bug}\b|${cid})" <root>/src/electron/patches/`
|
||||
|
||||
Any hit ⇒ IN-TREE. All empty ⇒ NEEDS-BACKPORT.
|
||||
|
||||
For each NEEDS-BACKPORT CL, also fetch its file list (`/changes/<proj>~<cl>/revisions/current/files`) and **skip** if every file is under `chrome/browser/`, `chrome/android/`, `ios/`, or `components/**/android/` — Electron doesn't compile those.
|
||||
|
||||
Report the table now (`CVE | Sev | Bug | Component | Verdict | CL`) and the proposed backport set; get user sign-off before continuing.
|
||||
|
||||
## 4. Write patches locally (no push yet)
|
||||
|
||||
For each backport CL, fetch the raw patch and write it into `patches/<dir>/`:
|
||||
|
||||
```bash
|
||||
curl -s "https://${host}.googlesource.com/changes/${proj//\//%2F}~${cl}/revisions/current/patch" \
|
||||
| base64 -d > "patches/${dir}/cherry-pick-${short}.patch"
|
||||
echo "cherry-pick-${short}.patch" >> "patches/${dir}/.patches"
|
||||
```
|
||||
|
||||
For repos with no Gerrit host `e cherry-pick` supports (e.g. **libaom** on aomedia), instead `git cherry-pick` the upstream commits onto the synced sub-repo HEAD and `git format-patch` the result.
|
||||
|
||||
For any newly-created `patches/<dir>/`, append to `patches/config.json` **preserving the compact one-line-per-entry style**:
|
||||
|
||||
```json
|
||||
{ "patch_dir": "src/electron/patches/<dir>", "repo": "src/third_party/<dir-or-nested-path>" }
|
||||
```
|
||||
|
||||
## 5. Validate with `e sync --3`
|
||||
|
||||
```bash
|
||||
e sync --3 2>&1 | tee /tmp/bp_sync3.log
|
||||
```
|
||||
|
||||
On `Patch failed at NNNN <subject>`:
|
||||
|
||||
- `cd` into the failing repo, inspect `git diff` for conflict markers.
|
||||
- **Test-only files** (e.g. `web_tests/VirtualTestSuites`, `*_unittest.cc` context drift): take ours (`git checkout --ours -- <file>`) if the security-relevant hunks merged cleanly.
|
||||
- **Substantive code conflicts**: check whether a target-milestone merge CL exists and swap to it. If none exists upstream and the surrounding code is structurally different, **drop the patch** (delete the file, remove from `.patches` and `config.json`) and note it for a separate manual-port PR — do not improvise security-fix semantics.
|
||||
- After resolving: `git add <files> && git -c commit.gpgsign=false am --continue`, then `e patches <repo>` to export the resolved patch, then re-run `e sync --3`. Repeat until clean.
|
||||
|
||||
## 6. Export → lint → re-apply loop
|
||||
|
||||
```bash
|
||||
e patches all
|
||||
node script/lint.js --patches # must exit 0
|
||||
```
|
||||
|
||||
If lint reports findings (typically trailing whitespace on `+` content lines), fixing them **changes the bytes the patch writes**, which invalidates the `index <old>..<new>` blob hashes that `e patches` baked in. Hand-editing a `.patch` and pushing it as-is will pass lint locally but fail CI's Apply Patches re-export check with a one-line `index` hash diff.
|
||||
|
||||
So whenever lint (or you) modifies any `.patch` file after export, round-trip once more:
|
||||
|
||||
```bash
|
||||
# fix the lint findings in patches/**/*.patch, then:
|
||||
e sync # re-apply the edited patches (no --3 needed; they applied cleanly last time)
|
||||
e patches all # re-export so index blob hashes match the edited content
|
||||
node script/lint.js --patches # must now exit 0
|
||||
git diff --quiet -- patches/ || { echo "patches changed again — repeat the loop"; }
|
||||
```
|
||||
|
||||
Repeat until `lint --patches` exits 0 **and** `git diff -- patches/` is empty after the final `e patches all`. Only then is the patch set CI-stable.
|
||||
|
||||
## 7. Commit, push, PR
|
||||
|
||||
```bash
|
||||
git add patches/
|
||||
git commit -m "chore: cherry-pick <N> changes from <dirs>"
|
||||
git push origin HEAD
|
||||
gh pr create --repo electron/electron --base <branch> --head <this-branch> \
|
||||
--title "chore: cherry-pick <N> changes from <dirs>" \
|
||||
--label "<branch>" --label backport-check-skip --label semver/patch --label "security 🔒" \
|
||||
--body-file /tmp/pr_body.md
|
||||
```
|
||||
|
||||
PR body format:
|
||||
|
||||
```markdown
|
||||
Backports the following changes:
|
||||
|
||||
* [`<shortCommit>`](<gerrit-CL-url>) from <patchDir> — <subject> ([<bug>](https://crbug.com/<bug>), CVE-YYYY-NNNN)
|
||||
* ...
|
||||
|
||||
Notes: Security: backported fixes for CVE-YYYY-NNNN, CVE-YYYY-NNNN, ....
|
||||
```
|
||||
|
||||
Short commit links to the **Gerrit CL**; bug links to `crbug.com`; CVE comes from the blog mapping (the patch's own `Bug:` footer may differ); `Notes:` is the last line. Mention any dropped patches (with reason) above the `Notes:` line.
|
||||
|
||||
Restore `e use <previous>` when done.
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: electron-node-upgrade
|
||||
description: Guide for performing Node.js version upgrades in the Electron project. Use when working on the roller/node/main branch to fix patch conflicts during `e sync --3`. Covers the patch application workflow, conflict resolution, analyzing upstream Node.js changes, and proper commit formatting for patch fixes.
|
||||
description: Guide for performing Node.js version upgrades in the Electron project. Use when working on the roller/node/main branch to fix patch conflicts during `e sync --3`. Covers the patch application workflow, conflict resolution, analyzing upstream Node.js changes, building, running the Node.js test suite, and proper commit formatting for patch fixes.
|
||||
---
|
||||
|
||||
# Electron Node.js Upgrade: Phase One
|
||||
@@ -174,10 +174,127 @@ When the error is in Electron's own source code:
|
||||
1. Edit files directly in the electron repo
|
||||
2. Commit directly (no patch export needed)
|
||||
|
||||
# Electron Node.js Upgrade: Phase Three
|
||||
|
||||
## Summary
|
||||
|
||||
Run the Node.js test suite via `script/node-spec-runner.js`, fix failing tests, and commit fixes until all tests pass. Certain tests are permanently disabled (listed in `script/node-disabled-tests.json`) and should not be run.
|
||||
|
||||
Run Phase Three immediately after Phase Two is complete.
|
||||
|
||||
## Success Criteria
|
||||
|
||||
Phase Three is complete when:
|
||||
- `node script/node-spec-runner.js --default` exits with zero failures
|
||||
- All changes are committed per the commit guidelines
|
||||
|
||||
Do not stop until these criteria are met.
|
||||
|
||||
## Context
|
||||
|
||||
Electron runs a subset of Node.js's upstream test suite using a custom runner (`script/node-spec-runner.js`). Tests are executed with the built Electron binary via `ELECTRON_RUN_AS_NODE=true`. Many tests need adaptation because Electron uses BoringSSL (not OpenSSL) and Chromium's V8 (which may differ from Node.js's bundled V8).
|
||||
|
||||
**Key files:**
|
||||
- `script/node-spec-runner.js` — Test runner script
|
||||
- `script/node-disabled-tests.json` — Permanently disabled tests (do not try to fix these)
|
||||
- `../third_party/electron_node/test/` — Node.js test files (where patches apply)
|
||||
- `patches/node/fix_crypto_tests_to_run_with_bssl.patch` — BoringSSL crypto test adaptations
|
||||
- `patches/node/test_formally_mark_some_tests_as_flaky.patch` — Flaky test list
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Run `node script/node-spec-runner.js --default` from the electron repo
|
||||
2. If all tests pass → Phase Three is complete
|
||||
3. If tests fail:
|
||||
- Identify the failing test file(s) from the output
|
||||
- Analyze each failure (see "Common Failure Patterns" below)
|
||||
- Fix the test in `../third_party/electron_node/test/...`
|
||||
- Re-run the specific failing test to verify: `node script/node-spec-runner.js {test-path}`
|
||||
- The test path is relative to the node `test/` directory, e.g. `test/parallel/test-crypto-key-objects-raw.js`
|
||||
- Do NOT use `--default` when running specific tests — it adds the full suite flags
|
||||
- Do NOT run tests directly with `ELECTRON_RUN_AS_NODE` — the runner handles environment setup (e.g. temporarily switching `package.json` from ESM to CommonJS)
|
||||
- Commit the fix using the fixup workflow and commit guidelines
|
||||
- Return to step 1
|
||||
|
||||
## Commands Reference
|
||||
|
||||
| Command | Purpose |
|
||||
|---------|---------|
|
||||
| `node script/node-spec-runner.js --default` | Run full Node.js test suite |
|
||||
| `node script/node-spec-runner.js test/parallel/test-foo.js` | Run a single test |
|
||||
| `NODE_REGENERATE_SNAPSHOTS=1 node script/node-spec-runner.js test/test-runner/test-foo.mjs` | Regenerate snapshot for a snapshot-based test |
|
||||
|
||||
## Common Failure Patterns
|
||||
|
||||
### BoringSSL incompatibilities
|
||||
|
||||
Electron uses BoringSSL (via Chromium) instead of OpenSSL. Many crypto features are missing or behave differently:
|
||||
|
||||
| Unsupported in BoringSSL | Guard pattern |
|
||||
|--------------------------|---------------|
|
||||
| ChaCha20-Poly1305 | `if (!process.features.openssl_is_boringssl)` |
|
||||
| AES-CCM (aes-128-ccm, aes-256-ccm) | `if (ciphers.includes('aes-128-ccm'))` |
|
||||
| AES-KW (key wrapping) | `if (!process.features.openssl_is_boringssl)` |
|
||||
| DSA keys | `if (!process.features.openssl_is_boringssl)` |
|
||||
| Ed448 / X448 curves | `if (!process.features.openssl_is_boringssl)` |
|
||||
| DH key PEM loading | `if (!process.features.openssl_is_boringssl)` |
|
||||
| PQC algorithms (ML-KEM, ML-DSA, SLH-DSA) | `if (hasOpenSSL(3, 5))` (already guards these) |
|
||||
|
||||
When guarding tests, prefer checking cipher availability (`ciphers.includes(algo)`) over blanket BoringSSL checks where possible, as it's more precise and self-documenting.
|
||||
|
||||
New upstream tests that exercise these features will need guards added to the `fix_crypto_tests_to_run_with_bssl` patch.
|
||||
|
||||
### Snapshot test mismatches
|
||||
|
||||
Some tests compare output against committed `.snapshot` files using `assert.strictEqual` — these are NOT wildcard comparisons. When Chromium's V8 produces different output (e.g. different stack traces due to V8 enhancements), the snapshot must be regenerated:
|
||||
|
||||
```bash
|
||||
NODE_REGENERATE_SNAPSHOTS=1 node script/node-spec-runner.js test/test-runner/test-foo.mjs
|
||||
```
|
||||
|
||||
Then inspect the diff to verify the changes are expected, and commit the updated snapshot into the appropriate patch.
|
||||
|
||||
### V8 behavioral differences
|
||||
|
||||
Chromium's V8 may be ahead of Node.js's bundled V8. This can cause:
|
||||
- Different stack trace formats (e.g. thenable async stack frames)
|
||||
- Different error messages
|
||||
- Features available in Chromium V8 that aren't in stock Node.js V8 (or vice versa)
|
||||
|
||||
## Two Types of Test Fixes
|
||||
|
||||
### A. Patch Fixes (most common for test failures)
|
||||
|
||||
Most test fixes go into existing patches in `patches/node/`. Use the fixup workflow:
|
||||
|
||||
1. Edit the test file in `../third_party/electron_node/test/...`
|
||||
2. Find the relevant patch commit: `git log --oneline | grep -i "keyword"`
|
||||
- Crypto/BoringSSL tests → `fix crypto tests to run with bssl`
|
||||
- Snapshot tests → the specific snapshot patch (e.g. `test: accomodate V8 thenable`)
|
||||
- Flaky tests → `test: formally mark some tests as flaky`
|
||||
3. Create a fixup commit:
|
||||
```bash
|
||||
cd ../third_party/electron_node
|
||||
git add test/path/to/test.js
|
||||
git commit --fixup=<patch-commit-hash>
|
||||
GIT_SEQUENCE_EDITOR=: git rebase --autosquash --autostash -i <commit>^
|
||||
```
|
||||
4. Export: `e patches node`
|
||||
5. **Read `references/phase-three-commit-guidelines.md` NOW**, then commit the updated patch file.
|
||||
|
||||
### B. New Patches (rare)
|
||||
|
||||
Only create a new patch when the fix doesn't belong in any existing patch. The new patch commit in `../third_party/electron_node` must include a description explaining why the patch exists and when it can be removed — the lint check enforces this.
|
||||
|
||||
## Adding to Disabled Tests
|
||||
|
||||
Only add a test to `script/node-disabled-tests.json` as a **last resort** — when the test is fundamentally incompatible with Electron's architecture (not just a BoringSSL difference that can be guarded). Tests disabled here are completely skipped and never run.
|
||||
|
||||
# Critical: Read Before Committing
|
||||
|
||||
- Before ANY Phase One commits: Read `references/phase-one-commit-guidelines.md`
|
||||
- Before ANY Phase Two commits: Read `references/phase-two-commit-guidelines.md`
|
||||
- Before ANY Phase Three commits: Read `references/phase-three-commit-guidelines.md`
|
||||
|
||||
# High-Churn Patches
|
||||
|
||||
@@ -201,5 +318,6 @@ This skill has additional reference files in `references/`:
|
||||
- patch-analysis.md - How to analyze patch failures
|
||||
- phase-one-commit-guidelines.md - Commit format for Phase One
|
||||
- phase-two-commit-guidelines.md - Commit format for Phase Two
|
||||
- phase-three-commit-guidelines.md - Commit format for Phase Three
|
||||
|
||||
Read these when referenced in the workflow steps.
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# Phase Three Commit Guidelines
|
||||
|
||||
Only follow these instructions if there are uncommitted changes after fixing a test failure during Phase Three.
|
||||
|
||||
Ignore other instructions about making commit messages, our guidelines are CRITICALLY IMPORTANT and must be followed.
|
||||
|
||||
## Commit Message Style
|
||||
|
||||
**Titles** follow the 60/80-character guideline: simple changes fit within 60 characters, otherwise the limit is 80 characters.
|
||||
|
||||
Always include a `Co-Authored-By` trailer identifying the AI model that assisted (e.g., `Co-Authored-By: <AI model attribution>`).
|
||||
|
||||
## Commit Types
|
||||
|
||||
### Patch updates (most test fixes)
|
||||
|
||||
Test fixes go into existing patches via the fixup workflow. Use `fix(patch):` prefix with a descriptive topic:
|
||||
|
||||
```
|
||||
fix(patch): {topic headline}
|
||||
|
||||
Ref: {Node.js commit or issue link}
|
||||
|
||||
Co-Authored-By: <AI model attribution>
|
||||
```
|
||||
|
||||
Examples:
|
||||
- `fix(patch): guard DH key test for BoringSSL`
|
||||
- `fix(patch): adapt new crypto tests for BoringSSL`
|
||||
- `fix(patch): correct thenable snapshot for Chromium V8`
|
||||
- `fix(patch): skip AES-KW tests with BoringSSL`
|
||||
|
||||
Group related test fixes into a single commit when they address the same root cause (e.g., multiple crypto tests all needing BoringSSL guards for the same missing cipher). Don't create one commit per test file if they share the same fix pattern.
|
||||
|
||||
### Snapshot regeneration
|
||||
|
||||
When a snapshot test fails because Chromium's V8 produces different output, regenerate it:
|
||||
|
||||
```bash
|
||||
NODE_REGENERATE_SNAPSHOTS=1 node script/node-spec-runner.js test/test-runner/test-foo.mjs
|
||||
```
|
||||
|
||||
Then commit the updated snapshot patch with a title describing what changed:
|
||||
|
||||
```
|
||||
fix(patch): correct {name} snapshot for Chromium V8
|
||||
|
||||
Ref: {V8 CL or issue link if known}
|
||||
|
||||
Co-Authored-By: <AI model attribution>
|
||||
```
|
||||
|
||||
### Trivial patch updates
|
||||
|
||||
After any patch modification, check for dependent patches that only have index/hunk header changes:
|
||||
|
||||
```bash
|
||||
git status
|
||||
# If other .patch files show as modified with only trivial changes:
|
||||
git add patches/
|
||||
git commit -m "chore: update patches (trivial only)"
|
||||
```
|
||||
|
||||
## Finding References
|
||||
|
||||
For BoringSSL-related test fixes, the reference is typically the upstream Node.js PR that added the new test:
|
||||
|
||||
```bash
|
||||
cd ../third_party/electron_node
|
||||
git log --oneline -5 -- test/parallel/test-crypto-foo.js
|
||||
git log -1 <commit> --format="%B" | grep "PR-URL"
|
||||
```
|
||||
|
||||
For V8 behavioral differences, reference the Chromium CL:
|
||||
|
||||
```
|
||||
Ref: https://chromium-review.googlesource.com/c/v8/v8/+/NNNNNNN
|
||||
```
|
||||
|
||||
If no reference found after searching: `Ref: Unable to locate reference`
|
||||
14
.github/ISSUE_TEMPLATE/maintainer_issue.yml
vendored
@@ -1,14 +0,0 @@
|
||||
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
|
||||
14
.github/actions/build-electron/action.yml
vendored
@@ -40,9 +40,15 @@ runs:
|
||||
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
||||
- name: Set GN_EXTRA_ARGS for Windows
|
||||
shell: bash
|
||||
if: ${{inputs.target-arch != 'x64' && inputs.target-platform == 'win' }}
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
run: |
|
||||
GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"${{ inputs.target-arch }}\""
|
||||
# Resolve .obj paths to absolute in linker response files to work
|
||||
# around BindFlt concurrency bug in Windows containers.
|
||||
# https://github.com/microsoft/Windows-Containers/issues/635
|
||||
GN_APPENDED_ARGS="$GN_EXTRA_ARGS win_abs_link_wrapper=\"//electron/build/win/abs_link_wrapper.py\""
|
||||
if [ "${{ inputs.target-arch }}" != "x64" ]; then
|
||||
GN_APPENDED_ARGS="$GN_APPENDED_ARGS target_cpu=\"${{ inputs.target-arch }}\""
|
||||
fi
|
||||
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
||||
- name: Add Clang problem matcher
|
||||
shell: bash
|
||||
@@ -107,6 +113,10 @@ runs:
|
||||
} else {
|
||||
e build --target electron:testing_build
|
||||
}
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "e build failed with exit code $LASTEXITCODE"
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
Copy-Item out\Default\.ninja_log out\electron_ninja_log
|
||||
node electron\script\check-symlinks.js
|
||||
|
||||
|
||||
24
.github/actions/build-image-sha/action.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: 'Build Image SHA'
|
||||
description: 'Single source of truth for the ghcr.io/electron/build image SHA'
|
||||
inputs:
|
||||
override:
|
||||
description: 'Optional override SHA (e.g. from a workflow_dispatch input)'
|
||||
required: false
|
||||
default: ''
|
||||
outputs:
|
||||
build-image-sha:
|
||||
description: 'The electron/build image SHA to use'
|
||||
value: ${{ steps.set.outputs.build-image-sha }}
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- id: set
|
||||
shell: bash
|
||||
env:
|
||||
OVERRIDE: ${{ inputs.override }}
|
||||
run: |
|
||||
if [ -n "$OVERRIDE" ]; then
|
||||
echo "build-image-sha=$OVERRIDE" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "build-image-sha=daad061f4b99a0ae1c841be4aa09188280a9c8a4" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
2
.github/actions/fix-sync/action.yml
vendored
@@ -133,7 +133,7 @@ runs:
|
||||
run : |
|
||||
cd src/third_party/angle
|
||||
rm -f .git/objects/info/alternates
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
git remote set-url origin https://github.com/google/angle.git
|
||||
cp .git/config .git/config.backup
|
||||
git remote remove origin
|
||||
mv .git/config.backup .git/config
|
||||
|
||||
21
.github/actions/install-dependencies/action.yml
vendored
@@ -21,11 +21,28 @@ runs:
|
||||
if [ "$TARGET_ARCH" = "x86" ]; then
|
||||
export npm_config_arch="ia32"
|
||||
fi
|
||||
# if running on linux arm skip yarn Builds
|
||||
ARCH=$(uname -m)
|
||||
node script/yarn.js install --immutable --mode=skip-build
|
||||
# if running on linux arm skip yarn Builds
|
||||
if [ "$ARCH" = "armv7l" ]; then
|
||||
echo "Skipping yarn build on linux arm"
|
||||
node script/yarn.js install --immutable --mode=skip-build
|
||||
else
|
||||
# Pre-seed the node-gyp header cache so the parallel native-addon
|
||||
# builds below don't race on a cold cache. Linux build containers
|
||||
# already ship a warm cache (electron/build-images#68), so only do
|
||||
# this on macOS / Windows runners.
|
||||
if [ "$(uname -s)" != "Linux" ]; then
|
||||
for i in 1 2 3; do
|
||||
if node node_modules/node-gyp/bin/node-gyp.js install; then
|
||||
break
|
||||
fi
|
||||
if [ "$i" = "3" ]; then
|
||||
echo "node-gyp header pre-seed failed after 3 attempts" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "node-gyp header pre-seed failed (attempt $i), retrying in 5s..." >&2
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
node script/yarn.js install --immutable
|
||||
fi
|
||||
|
||||
2
.github/copilot-instructions.md
vendored
@@ -81,7 +81,7 @@ When working on the `roller/chromium/main` branch for Chromium upgrades, use `e
|
||||
|
||||
- JS/TS files: kebab-case (`file-name.ts`)
|
||||
- C++ files: snake_case with `electron_api_` prefix (`electron_api_safe_storage.cc`)
|
||||
- Test files: `api-{module-name}.spec.ts` in `spec/`
|
||||
- Test files: `api-{module-name}-spec.ts` in `spec/`
|
||||
- Source file lists are maintained in `filenames.gni` (with platform-specific sections)
|
||||
|
||||
### JavaScript/TypeScript
|
||||
|
||||
47
.github/siso-patches/0001-siso-reuse-the-outer-os.File-for-chunked-ReadAt-in-f.patch
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
From aab86e682d6f40e110700f36c9c37f6655fb14f1 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sam@electronjs.org>
|
||||
Date: Wed, 8 Apr 2026 23:24:15 -0700
|
||||
Subject: [PATCH] siso: reuse the outer *os.File for chunked ReadAt in
|
||||
fileParser.readFile
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The per-chunk goroutine currently re-opens fname to get its own handle
|
||||
for ReadAt. (*os.File).ReadAt is documented as safe for concurrent
|
||||
calls on the same File (on Windows it is ReadFile with an OVERLAPPED
|
||||
offset, so there is no shared seek state), so the extra open is
|
||||
redundant — the goroutines can share the outer f.
|
||||
|
||||
Besides halving the CreateFileW calls per subninja, this avoids an
|
||||
intermittent 'The parameter is incorrect.' (ERROR_INVALID_PARAMETER)
|
||||
from bindflt.sys when out/ is a mapped directory inside a Windows
|
||||
container: bindflt's handle-relative NtCreateFile path races when a
|
||||
second relative open arrives while the first handle to the same target
|
||||
is still being set up. Absolute paths and single opens do not trigger
|
||||
it; see microsoft/Windows-Containers#<tbd>.
|
||||
---
|
||||
siso/toolsupport/ninjautil/file_parser.go | 7 -------
|
||||
1 file changed, 7 deletions(-)
|
||||
|
||||
diff --git a/siso/toolsupport/ninjautil/file_parser.go b/siso/toolsupport/ninjautil/file_parser.go
|
||||
index f8c7eff..75b1d6e 100644
|
||||
--- a/siso/toolsupport/ninjautil/file_parser.go
|
||||
+++ b/siso/toolsupport/ninjautil/file_parser.go
|
||||
@@ -128,13 +128,6 @@ func (p *fileParser) readFile(ctx context.Context, fname string) ([]byte, error)
|
||||
eg.Go(func() error {
|
||||
p.sema <- struct{}{}
|
||||
defer func() { <-p.sema }()
|
||||
- f, err := os.Open(fname)
|
||||
- if err != nil {
|
||||
- return err
|
||||
- }
|
||||
- defer func() {
|
||||
- _ = f.Close()
|
||||
- }()
|
||||
for len(chunkBuf) > 0 {
|
||||
n, err := f.ReadAt(chunkBuf, pos)
|
||||
if err != nil {
|
||||
--
|
||||
2.52.0
|
||||
|
||||
132
.github/siso-patches/0002-siso-retry-transient-ERROR_INVALID_PARAMETER-when-op.patch
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
From 1786f2266cba6a66343e5af2b724214930c8292f Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sam@electronjs.org>
|
||||
Date: Wed, 22 Apr 2026 16:27:51 -0700
|
||||
Subject: [PATCH] siso: retry transient ERROR_INVALID_PARAMETER when opening
|
||||
ninja files on Windows
|
||||
|
||||
ManifestParser.Load fans out across all subninja files (~90k in a
|
||||
Chromium build) at NumCPU parallelism. On Windows builders where out/
|
||||
is served through a filesystem filter driver (e.g. bindflt/wcifs for
|
||||
container bind mounts), CreateFileW can intermittently return
|
||||
ERROR_INVALID_PARAMETER under this concurrent open burst. The previous
|
||||
patch removes the redundant per-chunk re-open, but the single remaining
|
||||
open per file can still hit the race; without a retry a single transient
|
||||
failure aborts the entire manifest load.
|
||||
|
||||
Wrap the remaining os.Open call in readFile in a small Windows-only
|
||||
retry for ERROR_INVALID_PARAMETER (5 attempts, 5-80ms backoff). Each
|
||||
retry is logged via clog.Warningf and also written to stderr so it is
|
||||
visible in CI step output where glog warnings are file-only by default.
|
||||
Other platforms keep the direct os.Open path.
|
||||
---
|
||||
siso/toolsupport/ninjautil/file_parser.go | 3 +-
|
||||
siso/toolsupport/ninjautil/openfile_other.go | 18 +++++++
|
||||
.../toolsupport/ninjautil/openfile_windows.go | 50 +++++++++++++++++++
|
||||
3 files changed, 69 insertions(+), 2 deletions(-)
|
||||
create mode 100644 siso/toolsupport/ninjautil/openfile_other.go
|
||||
create mode 100644 siso/toolsupport/ninjautil/openfile_windows.go
|
||||
|
||||
diff --git a/siso/toolsupport/ninjautil/file_parser.go b/siso/toolsupport/ninjautil/file_parser.go
|
||||
index 75b1d6e..4a3e639 100644
|
||||
--- a/siso/toolsupport/ninjautil/file_parser.go
|
||||
+++ b/siso/toolsupport/ninjautil/file_parser.go
|
||||
@@ -7,7 +7,6 @@ package ninjautil
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
- "os"
|
||||
"path/filepath"
|
||||
"runtime/trace"
|
||||
"sync"
|
||||
@@ -108,7 +107,7 @@ func (p *fileParser) parseFile(ctx context.Context, fname string) error {
|
||||
// readFile reads a file of fname in parallel.
|
||||
func (p *fileParser) readFile(ctx context.Context, fname string) ([]byte, error) {
|
||||
defer trace.StartRegion(ctx, "ninja.read").End()
|
||||
- f, err := os.Open(fname)
|
||||
+ f, err := openFile(ctx, fname)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
diff --git a/siso/toolsupport/ninjautil/openfile_other.go b/siso/toolsupport/ninjautil/openfile_other.go
|
||||
new file mode 100644
|
||||
index 0000000..9fca690
|
||||
--- /dev/null
|
||||
+++ b/siso/toolsupport/ninjautil/openfile_other.go
|
||||
@@ -0,0 +1,18 @@
|
||||
+// Copyright 2026 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+//go:build !windows
|
||||
+
|
||||
+package ninjautil
|
||||
+
|
||||
+import (
|
||||
+ "context"
|
||||
+ "os"
|
||||
+)
|
||||
+
|
||||
+// openFile opens fname for reading.
|
||||
+// See openfile_windows.go for the Windows variant with transient-error retry.
|
||||
+func openFile(ctx context.Context, fname string) (*os.File, error) {
|
||||
+ return os.Open(fname)
|
||||
+}
|
||||
diff --git a/siso/toolsupport/ninjautil/openfile_windows.go b/siso/toolsupport/ninjautil/openfile_windows.go
|
||||
new file mode 100644
|
||||
index 0000000..f9d8e9d
|
||||
--- /dev/null
|
||||
+++ b/siso/toolsupport/ninjautil/openfile_windows.go
|
||||
@@ -0,0 +1,50 @@
|
||||
+// Copyright 2026 The Chromium Authors
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+//go:build windows
|
||||
+
|
||||
+package ninjautil
|
||||
+
|
||||
+import (
|
||||
+ "context"
|
||||
+ "errors"
|
||||
+ "fmt"
|
||||
+ "os"
|
||||
+ "time"
|
||||
+
|
||||
+ "golang.org/x/sys/windows"
|
||||
+
|
||||
+ "go.chromium.org/build/siso/o11y/clog"
|
||||
+)
|
||||
+
|
||||
+// openFile opens fname for reading, retrying transient
|
||||
+// ERROR_INVALID_PARAMETER failures.
|
||||
+//
|
||||
+// On Windows, CreateFileW can intermittently return
|
||||
+// ERROR_INVALID_PARAMETER when the target lives behind a filesystem
|
||||
+// filter driver (e.g. bindflt/wcifs for container bind mounts) under
|
||||
+// highly concurrent opens. loadFile fans out across ~90k subninja
|
||||
+// files at NumCPU parallelism, so a single transient failure would
|
||||
+// otherwise abort the whole manifest load.
|
||||
+func openFile(ctx context.Context, fname string) (*os.File, error) {
|
||||
+ const maxAttempts = 5
|
||||
+ delay := 5 * time.Millisecond
|
||||
+ for i := 0; ; i++ {
|
||||
+ f, err := os.Open(fname)
|
||||
+ if err == nil {
|
||||
+ return f, nil
|
||||
+ }
|
||||
+ if i+1 >= maxAttempts || !errors.Is(err, windows.ERROR_INVALID_PARAMETER) {
|
||||
+ return nil, err
|
||||
+ }
|
||||
+ clog.Warningf(ctx, "open %s: %v; retrying (%d/%d) after %s", fname, err, i+1, maxAttempts, delay)
|
||||
+ fmt.Fprintf(os.Stderr, "siso: open %s: %v; retrying (%d/%d) after %s\n", fname, err, i+1, maxAttempts, delay)
|
||||
+ select {
|
||||
+ case <-time.After(delay):
|
||||
+ case <-ctx.Done():
|
||||
+ return nil, context.Cause(ctx)
|
||||
+ }
|
||||
+ delay *= 2
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.52.0
|
||||
|
||||
19
.github/workflows/apply-patches.yml
vendored
@@ -18,6 +18,8 @@ jobs:
|
||||
pull-requests: read
|
||||
outputs:
|
||||
has-patches: ${{ steps.filter.outputs.patches }}
|
||||
has-siso-patches: ${{ steps.filter.outputs.siso-patches }}
|
||||
build-image-sha: ${{ steps.build-image-sha.outputs.build-image-sha }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
with:
|
||||
@@ -33,6 +35,12 @@ jobs:
|
||||
patches:
|
||||
- DEPS
|
||||
- 'patches/**'
|
||||
siso-patches:
|
||||
- DEPS
|
||||
- '.github/siso-patches/**'
|
||||
- name: Set Build Image SHA
|
||||
id: build-image-sha
|
||||
uses: ./.github/actions/build-image-sha
|
||||
|
||||
apply-patches:
|
||||
needs: setup
|
||||
@@ -41,7 +49,7 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
container:
|
||||
image: ghcr.io/electron/build:eac3529546ea8f3aa356d31e345715eef342233b
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
@@ -73,9 +81,16 @@ jobs:
|
||||
target-platform: linux
|
||||
- name: Upload Patch Conflict Fix
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: update-patches
|
||||
path: patches/update-patches.patch
|
||||
if-no-files-found: ignore
|
||||
archive: false
|
||||
|
||||
build-siso:
|
||||
needs: setup
|
||||
if: ${{ needs.setup.outputs.has-siso-patches == 'true' }}
|
||||
uses: ./.github/workflows/pipeline-segment-build-siso-windows.yml
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
4
.github/workflows/archaeologist-dig.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js/npm
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
|
||||
with:
|
||||
node-version: 24.12.x
|
||||
- name: Setting Up Dig Site
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
sha-file: .dig-old
|
||||
filename: electron.old.d.ts
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #v7.0.0
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
||||
with:
|
||||
name: artifacts
|
||||
path: electron/artifacts
|
||||
|
||||
6
.github/workflows/audit-branch-ci.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
node-version: 22.17.x
|
||||
- name: Sparse checkout repository
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
.github
|
||||
.yarn
|
||||
- run: yarn workspaces focus @electron/gha-workflows
|
||||
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
id: audit-errors
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -157,7 +157,7 @@ jobs:
|
||||
await core.summary.write();
|
||||
- name: Send Slack message if errors
|
||||
if: ${{ always() && steps.audit-errors.outputs.errorsFound && github.ref == 'refs/heads/main' }}
|
||||
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
|
||||
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # v3.0.2
|
||||
with:
|
||||
payload: |
|
||||
link: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
|
||||
64
.github/workflows/branch-created.yml
vendored
@@ -98,14 +98,14 @@ jobs:
|
||||
done
|
||||
- name: Generate GitHub App token
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Generate Release Project Board Metadata
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
id: generate-project-metadata
|
||||
env:
|
||||
MAJOR: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
@@ -157,7 +157,7 @@ jobs:
|
||||
}))
|
||||
- name: Create Release Project Board
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: dsanders11/project-actions/copy-project@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/copy-project@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
id: create-release-board
|
||||
with:
|
||||
drafts: true
|
||||
@@ -170,6 +170,60 @@ jobs:
|
||||
template-view: ${{ steps.generate-project-metadata.outputs.template-view }}
|
||||
title: ${{ steps.generate-project-metadata.outputs.major }}-x-y
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: Randomly Assign Draft Issues to Release WG Members
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: dsanders11/project-actions/github-script@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
env:
|
||||
PROJECT_ID: ${{ steps.create-release-board.outputs.id }}
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
script: |
|
||||
const { data: members } = await github.rest.teams.listMembersInOrg({
|
||||
org: 'electron',
|
||||
team_slug: 'wg-releases',
|
||||
});
|
||||
|
||||
const excludedLogins = ['nikwen'];
|
||||
const memberLogins = new Set(members.map(m => m.login));
|
||||
for (const login of excludedLogins) {
|
||||
if (!memberLogins.has(login)) {
|
||||
core.warning(`Excluded member "${login}" is not in @electron/wg-releases`);
|
||||
}
|
||||
}
|
||||
|
||||
const eligible = members.filter(m => !excludedLogins.includes(m.login));
|
||||
|
||||
if (eligible.length === 0) {
|
||||
core.warning('No eligible members found in @electron/wg-releases team');
|
||||
return;
|
||||
}
|
||||
|
||||
const projectId = process.env.PROJECT_ID;
|
||||
const draftIssues = await actions.getDraftIssues(projectId);
|
||||
|
||||
if (draftIssues.length === 0) {
|
||||
core.info('No draft issues found in the project');
|
||||
return;
|
||||
}
|
||||
|
||||
// Fisher-Yates shuffle for uniform random assignment
|
||||
const shuffled = [...eligible];
|
||||
for (let i = shuffled.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
|
||||
}
|
||||
|
||||
// Assign draft issues round-robin across team members
|
||||
for (let i = 0; i < draftIssues.length; i++) {
|
||||
const member = shuffled[i % shuffled.length];
|
||||
const draftIssue = draftIssues[i];
|
||||
core.info(`Assigning "${draftIssue.content.title}" to ${member.login}`);
|
||||
await actions.editItem(projectId, draftIssue.content.id, {
|
||||
assignees: [member.login],
|
||||
});
|
||||
}
|
||||
|
||||
core.info(`Assigned ${draftIssues.length} draft issues to ${eligible.length} team members`);
|
||||
- name: Dump Release Project Board Contents
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
run: gh project item-list ${{ steps.create-release-board.outputs.number }} --owner electron --format json | jq
|
||||
@@ -177,7 +231,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
- name: Find Previous Release Project Board
|
||||
if: ${{ steps.check-major-version.outputs.MAJOR }}
|
||||
uses: dsanders11/project-actions/find-project@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/find-project@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
id: find-prev-release-board
|
||||
with:
|
||||
fail-if-project-not-found: false
|
||||
@@ -185,7 +239,7 @@ jobs:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: Close Previous Release Project Board
|
||||
if: ${{ steps.find-prev-release-board.outputs.number }}
|
||||
uses: dsanders11/project-actions/close-project@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/close-project@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
project-number: ${{ steps.find-prev-release-board.outputs.number }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
|
||||
34
.github/workflows/build-git-cache.yml
vendored
@@ -2,25 +2,38 @@ name: Build Git Cache
|
||||
# This workflow updates git cache on the cross-instance cache volumes
|
||||
# It runs daily at midnight.
|
||||
|
||||
on:
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build-git-cache-linux:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
build-image-sha: ${{ steps.build-image-sha.outputs.build-image-sha }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
- name: Set Build Image SHA
|
||||
id: build-image-sha
|
||||
uses: ./.github/actions/build-image-sha
|
||||
|
||||
build-git-cache-linux:
|
||||
needs: setup
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
container:
|
||||
image: ghcr.io/electron/build:eac3529546ea8f3aa356d31e345715eef342233b
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
@@ -34,12 +47,12 @@ jobs:
|
||||
target-platform: linux
|
||||
|
||||
build-git-cache-windows:
|
||||
if: github.repository == 'electron/electron'
|
||||
needs: setup
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
container:
|
||||
image: ghcr.io/electron/build:eac3529546ea8f3aa356d31e345715eef342233b
|
||||
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
|
||||
@@ -59,14 +72,13 @@ jobs:
|
||||
target-platform: win
|
||||
|
||||
build-git-cache-macos:
|
||||
if: github.repository == 'electron/electron'
|
||||
# This job updates the same git cache as linux, so it needs to run after the linux one.
|
||||
needs: [setup, build-git-cache-linux]
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
# This job updates the same git cache as linux, so it needs to run after the linux one.
|
||||
needs: build-git-cache-linux
|
||||
container:
|
||||
image: ghcr.io/electron/build:eac3529546ea8f3aa356d31e345715eef342233b
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
@@ -82,4 +94,4 @@ jobs:
|
||||
- name: Build Git Cache
|
||||
uses: ./src/electron/.github/actions/build-git-cache
|
||||
with:
|
||||
target-platform: macos
|
||||
target-platform: macos
|
||||
|
||||
58
.github/workflows/build.yml
vendored
@@ -6,8 +6,8 @@ on:
|
||||
build-image-sha:
|
||||
type: string
|
||||
description: 'SHA for electron/build image'
|
||||
default: 'eac3529546ea8f3aa356d31e345715eef342233b'
|
||||
required: true
|
||||
default: ''
|
||||
required: false
|
||||
skip-macos:
|
||||
type: boolean
|
||||
description: 'Skip macOS builds'
|
||||
@@ -48,14 +48,14 @@ permissions: {}
|
||||
jobs:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
outputs:
|
||||
docs: ${{ steps.filter.outputs.docs }}
|
||||
src: ${{ steps.filter.outputs.src }}
|
||||
build-image-sha: ${{ steps.set-output.outputs.build-image-sha }}
|
||||
build-image-sha: ${{ steps.build-image-sha.outputs.build-image-sha }}
|
||||
docs-only: ${{ steps.set-output.outputs.docs-only }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
@@ -67,20 +67,21 @@ jobs:
|
||||
filters: |
|
||||
docs:
|
||||
- 'docs/**'
|
||||
- '.claude/**'
|
||||
- README.md
|
||||
- SECURITY.md
|
||||
- CONTRIBUTING.md
|
||||
- CODE_OF_CONDUCT.md
|
||||
src:
|
||||
- '!docs/**'
|
||||
- name: Set Outputs for Build Image SHA & Docs Only
|
||||
- '!{docs,.claude}/**'
|
||||
- name: Set Build Image SHA
|
||||
id: build-image-sha
|
||||
uses: ./.github/actions/build-image-sha
|
||||
with:
|
||||
override: ${{ inputs.build-image-sha }}
|
||||
- name: Set Docs Only
|
||||
id: set-output
|
||||
run: |
|
||||
if [ -z "${{ inputs.build-image-sha }}" ]; then
|
||||
echo "build-image-sha=eac3529546ea8f3aa356d31e345715eef342233b" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "docs-only=${{ steps.filter.outputs.docs == 'true' && steps.filter.outputs.src == 'false' }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Lint Jobs
|
||||
@@ -200,6 +201,15 @@ jobs:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: win
|
||||
|
||||
# Build a patched siso binary for Windows CI in parallel with checkout-windows.
|
||||
# The Windows build jobs download the resulting artifact and use it via SISO_PATH.
|
||||
build-siso-windows:
|
||||
needs: setup
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
uses: ./.github/workflows/pipeline-segment-build-siso-windows.yml
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# GN Check Jobs
|
||||
macos-gn-check:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
|
||||
@@ -265,11 +275,12 @@ jobs:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-tidy-and-test.yml
|
||||
needs: checkout-macos
|
||||
with:
|
||||
build-runs-on: macos-15-xlarge
|
||||
test-runs-on: macos-15-xlarge
|
||||
clang-tidy-runs-on: macos-15-large
|
||||
test-runs-on: macos-15
|
||||
target-platform: macos
|
||||
target-arch: arm64
|
||||
is-release: false
|
||||
@@ -290,7 +301,7 @@ jobs:
|
||||
with:
|
||||
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
clang-tidy-runs-on: electron-arc-centralus-linux-amd64-8core
|
||||
test-runs-on: electron-arc-centralus-linux-amd64-8core
|
||||
test-runs-on: electron-arc-centralus-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"]}'
|
||||
clang-tidy-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"}'
|
||||
@@ -312,7 +323,7 @@ jobs:
|
||||
if: ${{ needs.setup.outputs.src == 'true' }}
|
||||
with:
|
||||
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
test-runs-on: electron-arc-centralus-linux-amd64-8core
|
||||
test-runs-on: electron-arc-centralus-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"]}'
|
||||
test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
|
||||
target-platform: linux
|
||||
@@ -383,12 +394,14 @@ jobs:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: checkout-windows
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-tidy-and-test.yml
|
||||
needs: [checkout-windows, build-siso-windows]
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
||||
clang-tidy-runs-on: electron-arc-centralus-linux-amd64-8core
|
||||
test-runs-on: windows-latest
|
||||
clang-tidy-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"]}'
|
||||
target-platform: win
|
||||
target-arch: x64
|
||||
is-release: false
|
||||
@@ -403,7 +416,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: checkout-windows
|
||||
needs: [checkout-windows, build-siso-windows]
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
||||
@@ -422,7 +435,7 @@ jobs:
|
||||
issues: read
|
||||
pull-requests: read
|
||||
uses: ./.github/workflows/pipeline-electron-build-and-test.yml
|
||||
needs: checkout-windows
|
||||
needs: [checkout-windows, build-siso-windows]
|
||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||
with:
|
||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
||||
@@ -440,9 +453,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64, windows-x64, windows-x86, windows-arm64]
|
||||
if: always() && github.repository == 'electron/electron' && !contains(needs.*.result, 'failure')
|
||||
needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64, build-siso-windows, windows-x64, windows-x86, windows-arm64]
|
||||
if: always() && github.repository == 'electron/electron'
|
||||
steps:
|
||||
- name: Fail if any needed job failed or was cancelled
|
||||
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
|
||||
run: exit 1
|
||||
- name: GitHub Actions Jobs Done
|
||||
run: |
|
||||
echo "All GitHub Actions Jobs are done"
|
||||
|
||||
@@ -13,13 +13,26 @@ on:
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
clean-orphaned-uploads:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
build-image-sha: ${{ steps.build-image-sha.outputs.build-image-sha }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
- name: Set Build Image SHA
|
||||
id: build-image-sha
|
||||
uses: ./.github/actions/build-image-sha
|
||||
|
||||
clean-orphaned-uploads:
|
||||
needs: setup
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
container:
|
||||
image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
|
||||
17
.github/workflows/clean-src-cache.yml
vendored
@@ -12,15 +12,28 @@ on:
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
clean-src-cache:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
build-image-sha: ${{ steps.build-image-sha.outputs.build-image-sha }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
- name: Set Build Image SHA
|
||||
id: build-image-sha
|
||||
uses: ./.github/actions/build-image-sha
|
||||
|
||||
clean-src-cache:
|
||||
needs: setup
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
DD_API_KEY: ${{ secrets.DD_API_KEY }}
|
||||
container:
|
||||
image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
|
||||
4
.github/workflows/issue-commented.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
AUTHOR_ASSOCIATION=$(gh api /repos/electron/electron/issues/comments/${{ github.event.comment.id }} --jq '.author_association')
|
||||
echo "author_association=$AUTHOR_ASSOCIATION" >> "$GITHUB_OUTPUT"
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
if: ${{ !contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), steps.get-author-association.outputs.author_association) }}
|
||||
id: generate-token
|
||||
with:
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: *get-author-association
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
if: ${{ contains(fromJSON('["MEMBER", "OWNER"]'), steps.get-author-association.outputs.author_association) }}
|
||||
id: generate-token
|
||||
with:
|
||||
|
||||
34
.github/workflows/issue-labeled.yml
vendored
@@ -15,13 +15,13 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
uses: dsanders11/project-actions/edit-item@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/edit-item@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
@@ -36,13 +36,13 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
uses: dsanders11/project-actions/edit-item@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/edit-item@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
name: blocked/need-repro label added
|
||||
if: github.event.label.name == 'blocked/need-repro'
|
||||
permissions:
|
||||
issues: write # for actions-cool/issues-helper to update issues
|
||||
issues: write # for gh issue comment to update issues
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if comment needed
|
||||
@@ -70,23 +70,25 @@ jobs:
|
||||
fi
|
||||
- name: Generate GitHub App token
|
||||
if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
- name: Create comment
|
||||
if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
|
||||
uses: actions-cool/issues-helper@200c78641dbf33838311e5a1e0c31bbdb92d7cf0 # v3.8.0
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
body: |
|
||||
<!-- blocked/need-repro -->
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
GH_REPO: electron/electron
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
gh issue comment "$ISSUE_NUMBER" --body-file - <<'EOF'
|
||||
<!-- blocked/need-repro -->
|
||||
|
||||
Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
|
||||
Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
|
||||
|
||||
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small test cases and makes it easy to publish your test case to a [gist](https://gist.github.com) that Electron maintainers can use.
|
||||
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small test cases and makes it easy to publish your test case to a [gist](https://gist.github.com) that Electron maintainers can use.
|
||||
|
||||
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
|
||||
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
|
||||
|
||||
Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
|
||||
Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
|
||||
EOF
|
||||
|
||||
30
.github/workflows/issue-opened.yml
vendored
@@ -14,13 +14,13 @@ jobs:
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Add to Issue Triage
|
||||
uses: dsanders11/project-actions/add-item@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/add-item@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
field: Reporter
|
||||
field-value: ${{ github.event.issue.user.login }}
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
.yarn
|
||||
- run: yarn workspaces focus @electron/gha-workflows
|
||||
- name: Add labels
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
id: add-labels
|
||||
env:
|
||||
ISSUE_BODY: ${{ github.event.issue.body }}
|
||||
@@ -146,15 +146,17 @@ jobs:
|
||||
}
|
||||
- name: Create unsupported major comment
|
||||
if: ${{ steps.add-labels.outputs.unsupportedMajor }}
|
||||
uses: actions-cool/issues-helper@200c78641dbf33838311e5a1e0c31bbdb92d7cf0 # v3.8.0
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
body: |
|
||||
<!-- end-of-life -->
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
GH_REPO: electron/electron
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
run: |
|
||||
gh issue comment "$ISSUE_NUMBER" --body-file - <<'EOF'
|
||||
<!-- end-of-life -->
|
||||
|
||||
Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
|
||||
|
||||
The version of Electron reported in this issue has reached end-of-life and is [no longer supported](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline). If you're still experiencing this issue on a [supported version](https://www.electronjs.org/releases/stable) of Electron, please update this issue to reflect that version of Electron.
|
||||
Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
|
||||
|
||||
Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-info%20%E2%9D%8C label for this reason. This issue will be closed in 10 days if the above is not addressed.
|
||||
The version of Electron reported in this issue has reached end-of-life and is [no longer supported](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline). If you're still experiencing this issue on a [supported version](https://www.electronjs.org/releases/stable) of Electron, please update this issue to reflect that version of Electron.
|
||||
|
||||
Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-info%20%E2%9D%8C label for this reason. This issue will be closed in 10 days if the above is not addressed.
|
||||
EOF
|
||||
|
||||
4
.github/workflows/issue-transferred.yml
vendored
@@ -14,13 +14,13 @@ jobs:
|
||||
if: ${{ !github.event.changes.new_repository.private }}
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Remove from issue triage
|
||||
uses: dsanders11/project-actions/delete-item@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/delete-item@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
|
||||
4
.github/workflows/issue-unlabeled.yml
vendored
@@ -26,14 +26,14 @@ jobs:
|
||||
fi
|
||||
- name: Generate GitHub App token
|
||||
if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
|
||||
uses: dsanders11/project-actions/edit-item@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/edit-item@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 90
|
||||
|
||||
34
.github/workflows/linux-publish.yml
vendored
@@ -6,7 +6,8 @@ on:
|
||||
build-image-sha:
|
||||
type: string
|
||||
description: 'SHA for electron/build image'
|
||||
default: 'eac3529546ea8f3aa356d31e345715eef342233b'
|
||||
default: ''
|
||||
required: false
|
||||
upload-to-storage:
|
||||
description: 'Uploads to Azure storage'
|
||||
required: false
|
||||
@@ -20,13 +21,28 @@ on:
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
checkout-linux:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
build-image-sha: ${{ steps.build-image-sha.outputs.build-image-sha }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
- name: Set Build Image SHA
|
||||
id: build-image-sha
|
||||
uses: ./.github/actions/build-image-sha
|
||||
with:
|
||||
override: ${{ inputs.build-image-sha }}
|
||||
|
||||
checkout-linux:
|
||||
needs: setup
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
container:
|
||||
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
@@ -50,11 +66,11 @@ jobs:
|
||||
attestations: write
|
||||
contents: read
|
||||
id-token: write
|
||||
needs: checkout-linux
|
||||
needs: [setup, checkout-linux]
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
target-platform: linux
|
||||
target-arch: x64
|
||||
is-release: true
|
||||
@@ -70,11 +86,11 @@ jobs:
|
||||
attestations: write
|
||||
contents: read
|
||||
id-token: write
|
||||
needs: checkout-linux
|
||||
needs: [setup, checkout-linux]
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
target-platform: linux
|
||||
target-arch: arm
|
||||
is-release: true
|
||||
@@ -90,11 +106,11 @@ jobs:
|
||||
attestations: write
|
||||
contents: read
|
||||
id-token: write
|
||||
needs: checkout-linux
|
||||
needs: [setup, checkout-linux]
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
build-container: '{"image":"ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
|
||||
target-platform: linux
|
||||
target-arch: arm64
|
||||
is-release: true
|
||||
|
||||
23
.github/workflows/macos-publish.yml
vendored
@@ -6,8 +6,8 @@ on:
|
||||
build-image-sha:
|
||||
type: string
|
||||
description: 'SHA for electron/build image'
|
||||
default: 'eac3529546ea8f3aa356d31e345715eef342233b'
|
||||
required: true
|
||||
default: ''
|
||||
required: false
|
||||
upload-to-storage:
|
||||
description: 'Uploads to Azure storage'
|
||||
required: false
|
||||
@@ -21,13 +21,28 @@ on:
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
checkout-macos:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
build-image-sha: ${{ steps.build-image-sha.outputs.build-image-sha }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
- name: Set Build Image SHA
|
||||
id: build-image-sha
|
||||
uses: ./.github/actions/build-image-sha
|
||||
with:
|
||||
override: ${{ inputs.build-image-sha }}
|
||||
|
||||
checkout-macos:
|
||||
needs: setup
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
container:
|
||||
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||
image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
|
||||
options: --user root
|
||||
volumes:
|
||||
- /mnt/cross-instance-cache:/mnt/cross-instance-cache
|
||||
|
||||
98
.github/workflows/pipeline-segment-build-siso-windows.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
name: Pipeline Segment - Build Siso (Windows)
|
||||
|
||||
# Builds a patched siso binary for Windows CI. Reads the siso revision from
|
||||
# the Chromium DEPS file at the pinned chromium_version, shallow-clones
|
||||
# chromium.googlesource.com/build at that revision, applies the patches under
|
||||
# .github/siso-patches/, cross-compiles siso.exe for windows/amd64, and
|
||||
# publishes it as the `siso-windows-amd64` artifact. The Windows build jobs
|
||||
# download it and use it via SISO_PATH. The built binary is cached keyed on
|
||||
# the siso revision + sha256 of the patch contents, so subsequent runs just
|
||||
# restore it.
|
||||
|
||||
on:
|
||||
workflow_call: {}
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout Electron
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
sparse-checkout: |
|
||||
DEPS
|
||||
.github/siso-patches
|
||||
- name: Resolve siso revision from Chromium DEPS
|
||||
id: resolve
|
||||
run: |
|
||||
set -euo pipefail
|
||||
CHROMIUM_VERSION=$(python3 -c "import re; print(re.search(r\"'chromium_version':\s*\n\s*'([^']+)'\", open('DEPS').read()).group(1))")
|
||||
if ! [[ "$CHROMIUM_VERSION" =~ ^[0-9]+(\.[0-9]+){1,3}$ ]]; then
|
||||
echo "error: unexpected chromium_version format: $CHROMIUM_VERSION" >&2
|
||||
exit 1
|
||||
fi
|
||||
curl -sfL "https://raw.githubusercontent.com/chromium/chromium/${CHROMIUM_VERSION}/DEPS" -o /tmp/chromium-DEPS
|
||||
SISO_SHA=$(python3 -c "import re; print(re.search(r\"'siso_version':\s*'git_revision:([0-9a-f]+)'\", open('/tmp/chromium-DEPS').read()).group(1))")
|
||||
if ! [[ "$SISO_SHA" =~ ^[0-9a-f]{40}$ ]]; then
|
||||
echo "error: unexpected siso_version SHA: $SISO_SHA" >&2
|
||||
exit 1
|
||||
fi
|
||||
PATCHES_HASH=$(find .github/siso-patches -type f -name '*.patch' | sort | xargs sha256sum | sha256sum | awk '{print $1}')
|
||||
echo "siso-sha=${SISO_SHA}" >> "$GITHUB_OUTPUT"
|
||||
echo "patches-hash=${PATCHES_HASH}" >> "$GITHUB_OUTPUT"
|
||||
echo "Chromium ${CHROMIUM_VERSION} pins siso at ${SISO_SHA}"
|
||||
echo "Patches hash: ${PATCHES_HASH}"
|
||||
- name: Restore cached siso binary
|
||||
id: cache-siso
|
||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||||
with:
|
||||
path: siso-out/siso.exe
|
||||
key: siso-windows-amd64-${{ steps.resolve.outputs.siso-sha }}-${{ steps.resolve.outputs.patches-hash }}
|
||||
- name: Shallow clone chromium build repo at pinned revision
|
||||
if: steps.cache-siso.outputs.cache-hit != 'true'
|
||||
env:
|
||||
SISO_SHA: ${{ steps.resolve.outputs.siso-sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir chromium-build
|
||||
cd chromium-build
|
||||
git init -q
|
||||
git remote add origin https://chromium.googlesource.com/build
|
||||
git -c protocol.version=2 fetch --depth=1 origin "$SISO_SHA"
|
||||
git checkout --detach FETCH_HEAD
|
||||
- name: Apply in-tree siso patches
|
||||
if: steps.cache-siso.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd chromium-build
|
||||
git -c user.name=electron-ci -c user.email=ci@electronjs.org \
|
||||
am --3way "${GITHUB_WORKSPACE}/.github/siso-patches"/*.patch
|
||||
- name: Set up Go
|
||||
if: steps.cache-siso.outputs.cache-hit != 'true'
|
||||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
||||
with:
|
||||
go-version-file: chromium-build/siso/go.mod
|
||||
cache: false
|
||||
- name: Build siso (windows/amd64)
|
||||
if: steps.cache-siso.outputs.cache-hit != 'true'
|
||||
working-directory: chromium-build/siso
|
||||
env:
|
||||
CGO_ENABLED: '0'
|
||||
GOOS: windows
|
||||
GOARCH: amd64
|
||||
run: |
|
||||
mkdir -p "${GITHUB_WORKSPACE}/siso-out"
|
||||
go build -trimpath -o "${GITHUB_WORKSPACE}/siso-out/siso.exe" .
|
||||
- name: Upload siso artifact
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: siso-windows-amd64
|
||||
path: siso-out/siso.exe
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
@@ -77,7 +77,6 @@ env:
|
||||
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
||||
SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
|
||||
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
|
||||
ACTIONS_STEP_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
|
||||
@@ -124,7 +123,7 @@ jobs:
|
||||
run: df -h
|
||||
- name: Setup Node.js/npm
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
|
||||
with:
|
||||
node-version: 22.21.x
|
||||
cache: yarn
|
||||
@@ -195,6 +194,22 @@ jobs:
|
||||
- name: Free up space (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/free-space-macos
|
||||
- name: Download custom siso binary (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: siso-windows-amd64
|
||||
path: ${{ runner.temp }}/siso
|
||||
- name: Set SISO_PATH (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
run: |
|
||||
SISO_BIN="${RUNNER_TEMP}/siso/siso.exe"
|
||||
if [ ! -f "$SISO_BIN" ]; then
|
||||
echo "error: expected siso binary at $SISO_BIN" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "SISO_PATH=$SISO_BIN" >> "$GITHUB_ENV"
|
||||
echo "Using custom siso binary at $SISO_BIN"
|
||||
- name: Build Electron
|
||||
if: ${{ inputs.target-platform != 'macos' || (inputs.target-variant == 'all' || inputs.target-variant == 'darwin') }}
|
||||
uses: ./src/electron/.github/actions/build-electron
|
||||
|
||||
@@ -135,15 +135,34 @@ jobs:
|
||||
run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
|
||||
- name: Run Clang-Tidy
|
||||
run: |
|
||||
e init -f --root=$(pwd) --out=${ELECTRON_OUT_DIR} testing --target-cpu ${TARGET_ARCH}
|
||||
e init -f --root=$(pwd) --out=${ELECTRON_OUT_DIR} testing --target-cpu ${TARGET_ARCH} --remote-build none
|
||||
|
||||
export GN_EXTRA_ARGS="target_cpu=\"${TARGET_ARCH}\""
|
||||
# For macOS use_remoteexec=false will cause GN errors, so even though we're doing no remote build, set it
|
||||
export GN_EXTRA_ARGS="use_remoteexec=true target_cpu=\"${TARGET_ARCH}\""
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
export GN_EXTRA_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
|
||||
fi
|
||||
|
||||
e build --only-gen
|
||||
|
||||
# Copy macOS framework headers so clang-tidy can find them via -F.
|
||||
# This must happen after e build --only-gen since e init -f may
|
||||
# recreate the output directory.
|
||||
if [ "${{ inputs.target-platform }}" = "macos" ]; then
|
||||
OUT=src/out/${ELECTRON_OUT_DIR}
|
||||
SQRL=src/third_party/squirrel.mac
|
||||
|
||||
mkdir -p ${OUT}/{ReactiveObjC,Squirrel,Mantle}.framework/Headers
|
||||
|
||||
cp ${SQRL}/vendor/ReactiveObjC/ReactiveObjC/*.h ${OUT}/ReactiveObjC.framework/Headers/
|
||||
cp ${SQRL}/vendor/ReactiveObjC/ReactiveObjC/extobjc/*.h ${OUT}/ReactiveObjC.framework/Headers/
|
||||
|
||||
cp ${SQRL}/Squirrel/*.h ${OUT}/Squirrel.framework/Headers/
|
||||
|
||||
cp ${SQRL}/vendor/Mantle/Mantle/include/*.h ${OUT}/Mantle.framework/Headers/
|
||||
cp ${SQRL}/vendor/Mantle/Mantle/extobjc/include/*.h ${OUT}/Mantle.framework/Headers/
|
||||
fi
|
||||
|
||||
cd src/electron
|
||||
node script/yarn.js lint:clang-tidy --jobs 8 --out-dir ../out/${ELECTRON_OUT_DIR}
|
||||
- name: Remove Clang problem matcher
|
||||
|
||||
@@ -130,7 +130,7 @@ jobs:
|
||||
run: |
|
||||
for target_cpu in ${{ inputs.target-archs }}
|
||||
do
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu $target_cpu
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu $target_cpu --remote-build none
|
||||
cd src
|
||||
export GN_EXTRA_ARGS="target_cpu=\"$target_cpu\""
|
||||
if [ "${{ inputs.target-platform }}" = "linux" ]; then
|
||||
|
||||
@@ -79,7 +79,6 @@ env:
|
||||
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
||||
SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
|
||||
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' ||
|
||||
@@ -132,7 +131,7 @@ jobs:
|
||||
run: df -h
|
||||
- name: Setup Node.js/npm
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
|
||||
with:
|
||||
node-version: 22.21.x
|
||||
cache: yarn
|
||||
@@ -208,6 +207,22 @@ jobs:
|
||||
- name: Free up space (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/free-space-macos
|
||||
- name: Download custom siso binary (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
|
||||
with:
|
||||
name: siso-windows-amd64
|
||||
path: ${{ runner.temp }}/siso
|
||||
- name: Set SISO_PATH (Windows)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
run: |
|
||||
SISO_BIN="${RUNNER_TEMP}/siso/siso.exe"
|
||||
if [ ! -f "$SISO_BIN" ]; then
|
||||
echo "error: expected siso binary at $SISO_BIN" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "SISO_PATH=$SISO_BIN" >> "$GITHUB_ENV"
|
||||
echo "Using custom siso binary at $SISO_BIN"
|
||||
- name: Build Electron
|
||||
if: ${{ inputs.target-platform != 'macos' || (inputs.target-variant == 'all' ||
|
||||
inputs.target-variant == 'darwin') }}
|
||||
|
||||
@@ -57,6 +57,8 @@ jobs:
|
||||
- name: Run Electron Tests in QEMU 64k Container
|
||||
shell: bash
|
||||
env:
|
||||
MOCHA_REPORTER: mocha-multi-reporters
|
||||
MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
|
||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
||||
DISPLAY: ':99.0'
|
||||
run: |
|
||||
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'win' && fromJSON('["win"]') || fromJSON('["linux"]')) }}
|
||||
shard: ${{ case(inputs.display-server == 'wayland', fromJSON('[1]'), inputs.is-asan == true, fromJSON('[1, 2]'), inputs.target-platform == 'linux', fromJSON('[1]'), fromJSON('[1, 2]')) }}
|
||||
shard: ${{ case(inputs.display-server == 'wayland', fromJSON('[1]'), inputs.target-platform == 'linux', fromJSON('[1, 2, 3]'), inputs.target-platform == 'macos' && inputs.target-arch == 'x64', fromJSON('[1, 2, 3]'), fromJSON('[1, 2]')) }}
|
||||
env:
|
||||
BUILD_TYPE: ${{ matrix.build-type }}
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
cp $(which node) /mnt/runner-externals/node24/bin/
|
||||
- name: Setup Node.js/npm
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
|
||||
with:
|
||||
node-version: 22.21.x
|
||||
- name: Add TCC permissions on macOS
|
||||
@@ -218,15 +218,16 @@ jobs:
|
||||
shell: bash
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
MOCHA_REPORTER: mocha-multi-reporters
|
||||
MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
|
||||
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
|
||||
DISPLAY: ':99.0'
|
||||
NPM_CONFIG_MSVS_VERSION: '2022'
|
||||
run: |
|
||||
cd src/electron
|
||||
export ELECTRON_EXTRA_ARGS="--trace-uncaught --enable-logging"
|
||||
JUNIT_ARGS="--reporter=default --reporter=junit --outputFile.junit=junit/test-results-main.xml"
|
||||
export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit
|
||||
# Get which tests are on this shard
|
||||
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ case(inputs.display-server == 'wayland', 1, inputs.is-asan == true, 2, inputs.target-platform == 'linux', 1, 2) }})
|
||||
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ case(inputs.display-server == 'wayland', 1, inputs.target-platform == 'linux', 3, inputs.target-platform == 'macos' && inputs.target-arch == 'x64', 3, 2) }})
|
||||
if [ "${{ inputs.display-server }}" = "wayland" ]; then
|
||||
allowlist_file=script/wayland-test-allowlist.txt
|
||||
filtered_tests=""
|
||||
@@ -250,8 +251,11 @@ jobs:
|
||||
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.js test $JUNIT_ARGS $tests_files
|
||||
node script/yarn.js test --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files
|
||||
else
|
||||
chown :builduser .. && chmod g+w ..
|
||||
chown -R :builduser . && chmod -R g+w .
|
||||
@@ -265,19 +269,21 @@ jobs:
|
||||
export NSS_DISABLE_ARENA_FREE_LIST=1
|
||||
export NSS_DISABLE_UNLOAD=1
|
||||
export LLVM_SYMBOLIZER_PATH=$PWD/third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer
|
||||
export MOCHA_TIMEOUT=180000
|
||||
echo "Piping output to ASAN_SYMBOLIZE ($ASAN_SYMBOLIZE)"
|
||||
cd electron
|
||||
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --testTimeout=180000 $JUNIT_ARGS $tests_files | $ASAN_SYMBOLIZE
|
||||
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --runners=main --trace-uncaught --enable-logging --files $tests_files | $ASAN_SYMBOLIZE
|
||||
else
|
||||
if [ "${{ inputs.target-arch }}" = "arm" ]; then
|
||||
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --skipYarnInstall $JUNIT_ARGS $tests_files
|
||||
else
|
||||
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --skipYarnInstall --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files
|
||||
else
|
||||
if [ "${{ inputs.display-server }}" = "wayland" ]; then
|
||||
runuser -u builduser -- script/actions/run-tests-wayland.sh script/yarn.js test $JUNIT_ARGS $tests_files
|
||||
runuser -u builduser -- script/actions/run-tests-wayland.sh script/yarn.js test --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files
|
||||
else
|
||||
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test $JUNIT_ARGS $tests_files
|
||||
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
- name: Take screenshot on timeout or cancellation
|
||||
@@ -309,7 +315,7 @@ jobs:
|
||||
if: always() && !cancelled()
|
||||
- name: Upload Test Artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #v7.0.0
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
||||
with:
|
||||
name: ${{ inputs.target-platform == 'linux' && format('test_artifacts_{0}_{1}_{2}', env.ARTIFACT_KEY, inputs.display-server, matrix.shard) || format('test_artifacts_{0}_{1}', env.ARTIFACT_KEY, matrix.shard) }}
|
||||
path: src/electron/spec/artifacts
|
||||
|
||||
8
.github/workflows/pr-template-check.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
sparse-checkout: .github/PULL_REQUEST_TEMPLATE.md
|
||||
sparse-checkout-cone-mode: false
|
||||
- name: Check for required sections
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
@@ -38,6 +38,12 @@ jobs:
|
||||
return;
|
||||
}
|
||||
const body = context.payload.pull_request.body || '';
|
||||
// Allow through if body contains a valid backport line
|
||||
const backportRegex = /Backport of (?:#|https:\/\/github.com\/electron\/electron\/pull\/)\d+/i;
|
||||
if (backportRegex.test(body)) {
|
||||
console.log('Backport PR detected, skipping required section check.');
|
||||
return;
|
||||
}
|
||||
const missingSections = requiredSections.filter(
|
||||
(section) => !body.includes(section),
|
||||
);
|
||||
|
||||
14
.github/workflows/pr-triage-automation.yml
vendored
@@ -31,13 +31,23 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Get project item status
|
||||
uses: dsanders11/project-actions/get-item@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
id: get-item
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 118
|
||||
fail-if-item-not-found: false
|
||||
- name: Set status to Needs Review
|
||||
uses: dsanders11/project-actions/edit-item@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
if: >-
|
||||
(steps.get-item.outputs.field-status == '🛑 Needs Submitter Response'
|
||||
|| steps.get-item.outputs.field-status == '🟡 WIP')
|
||||
uses: dsanders11/project-actions/edit-item@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 118
|
||||
|
||||
33
.github/workflows/pull-request-labeled.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Trigger Slack workflow
|
||||
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
|
||||
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # v3.0.2
|
||||
with:
|
||||
webhook: ${{ secrets.BACKPORT_REQUESTED_SLACK_WEBHOOK_URL }}
|
||||
webhook-type: webhook-trigger
|
||||
@@ -36,13 +36,13 @@ jobs:
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
|
||||
org: electron
|
||||
- name: Set status
|
||||
uses: dsanders11/project-actions/edit-item@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/edit-item@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
project-number: 94
|
||||
@@ -55,28 +55,23 @@ jobs:
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@200c78641dbf33838311e5a1e0c31bbdb92d7cf0 # v3.8.0
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
<!-- ai-pr -->
|
||||
|
||||
*AI PR Detected*
|
||||
|
||||
Hello @${{ github.event.pull_request.user.login }}. Due to the high amount of AI spam PRs we receive, if a PR is detected to be majority AI-generated without disclosure and untested, we will automatically close the PR.
|
||||
|
||||
We welcome the use of AI tools, as long as the PR meets our quality standards and has clearly been built and tested. If you believe your PR was closed in error, we welcome you to resubmit. However, please read our [CONTRIBUTING.md](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) and [AI Tool Policy](https://github.com/electron/governance/blob/main/policy/ai.md) carefully before reopening. Thanks for your contribution.
|
||||
- name: Close the pull request
|
||||
- name: Comment and close the pull request
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
GH_REPO: electron/electron
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
gh pr comment "$PR_NUMBER" --body-file - <<'EOF'
|
||||
<!-- ai-pr -->
|
||||
|
||||
*AI PR Detected*
|
||||
|
||||
Hello @${{ github.event.pull_request.user.login }}. Due to the high amount of AI spam PRs we receive, if a PR is detected to be majority AI-generated without disclosure and untested, we will automatically close the PR.
|
||||
|
||||
We welcome the use of AI tools, as long as the PR meets our quality standards and has clearly been built and tested. If you believe your PR was closed in error, we welcome you to resubmit. However, please read our [CONTRIBUTING.md](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) and [AI Tool Policy](https://github.com/electron/governance/blob/main/policy/ai.md) carefully before reopening. Thanks for your contribution.
|
||||
EOF
|
||||
gh pr close "$PR_NUMBER"
|
||||
|
||||
1
.github/workflows/rerun-apply-patches.yml
vendored
@@ -8,6 +8,7 @@ on:
|
||||
paths:
|
||||
- 'DEPS'
|
||||
- 'patches/**'
|
||||
- '.github/siso-patches/**'
|
||||
|
||||
permissions: {}
|
||||
|
||||
|
||||
4
.github/workflows/scorecards.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
@@ -51,6 +51,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.5
|
||||
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v3.29.5
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
4
.github/workflows/stable-prep-items.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
|
||||
@@ -29,7 +29,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')
|
||||
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_OUTPUT"
|
||||
- name: Update Completed Stable Prep Items
|
||||
uses: dsanders11/project-actions/completed-by@5767984408ccc6742f83acc8b8d8ea5e09f329af # v2.0.0
|
||||
uses: dsanders11/project-actions/completed-by@4b06452b0128cf601dac14399aa668a8eed2d684 # v2.0.1
|
||||
with:
|
||||
field: Prep Status
|
||||
field-value: ✅ Complete
|
||||
|
||||
4
.github/workflows/stale.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
needs: stale
|
||||
steps:
|
||||
- name: Generate GitHub App token
|
||||
uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
|
||||
uses: electron/github-app-auth-action@5f70a3726af01b612f29aac96d05aa524389c9e9 # v2.1.0
|
||||
id: generate-token
|
||||
with:
|
||||
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
|
||||
|
||||
39
.github/workflows/windows-publish.yml
vendored
@@ -6,8 +6,8 @@ on:
|
||||
build-image-sha:
|
||||
type: string
|
||||
description: 'SHA for electron/build image'
|
||||
default: 'eac3529546ea8f3aa356d31e345715eef342233b'
|
||||
required: true
|
||||
default: ''
|
||||
required: false
|
||||
upload-to-storage:
|
||||
description: 'Uploads to Azure storage'
|
||||
required: false
|
||||
@@ -21,13 +21,28 @@ on:
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
checkout-windows:
|
||||
setup:
|
||||
if: github.repository == 'electron/electron'
|
||||
runs-on: ubuntu-slim
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
build-image-sha: ${{ steps.build-image-sha.outputs.build-image-sha }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
- name: Set Build Image SHA
|
||||
id: build-image-sha
|
||||
uses: ./.github/actions/build-image-sha
|
||||
with:
|
||||
override: ${{ inputs.build-image-sha }}
|
||||
|
||||
checkout-windows:
|
||||
needs: setup
|
||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||
permissions:
|
||||
contents: read
|
||||
container:
|
||||
image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
|
||||
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
|
||||
@@ -37,8 +52,6 @@ jobs:
|
||||
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd
|
||||
@@ -51,6 +64,14 @@ jobs:
|
||||
generate-sas-token: 'true'
|
||||
target-platform: win
|
||||
|
||||
# Build the patched siso binary in parallel with checkout-windows; the
|
||||
# publish-*-win jobs consume it via SISO_PATH.
|
||||
build-siso-windows:
|
||||
needs: setup
|
||||
uses: ./.github/workflows/pipeline-segment-build-siso-windows.yml
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
publish-x64-win:
|
||||
uses: ./.github/workflows/pipeline-segment-electron-publish.yml
|
||||
permissions:
|
||||
@@ -58,7 +79,7 @@ jobs:
|
||||
attestations: write
|
||||
contents: read
|
||||
id-token: write
|
||||
needs: checkout-windows
|
||||
needs: [checkout-windows, build-siso-windows]
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
||||
@@ -77,7 +98,7 @@ jobs:
|
||||
attestations: write
|
||||
contents: read
|
||||
id-token: write
|
||||
needs: checkout-windows
|
||||
needs: [checkout-windows, build-siso-windows]
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
||||
@@ -96,7 +117,7 @@ jobs:
|
||||
attestations: write
|
||||
contents: read
|
||||
id-token: write
|
||||
needs: checkout-windows
|
||||
needs: [checkout-windows, build-siso-windows]
|
||||
with:
|
||||
environment: production-release
|
||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
||||
|
||||
@@ -11,18 +11,6 @@
|
||||
{
|
||||
"name": "no-only-tests",
|
||||
"specifier": "./script/lint-plugins/no-only-tests.mjs"
|
||||
},
|
||||
{
|
||||
"name": "remote-tools-imports",
|
||||
"specifier": "./script/lint-plugins/remote-tools-imports.mjs"
|
||||
},
|
||||
{
|
||||
"name": "no-nested-tests",
|
||||
"specifier": "./script/lint-plugins/no-nested-tests.mjs"
|
||||
},
|
||||
{
|
||||
"name": "no-unawaited-load",
|
||||
"specifier": "./script/lint-plugins/no-unawaited-load.mjs"
|
||||
}
|
||||
],
|
||||
"categories": {
|
||||
@@ -327,18 +315,7 @@
|
||||
{
|
||||
"files": ["spec/**/*.ts", "spec/**/*.js", "spec/**/*.mjs"],
|
||||
"rules": {
|
||||
"no-only-tests/no-only-tests": "error",
|
||||
"remote-tools-imports/no-foreign-imports-in-remote-closure": "error",
|
||||
"no-nested-tests/no-nested-tests": "error",
|
||||
"no-unawaited-load/no-unawaited-load": "warn"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["spec/fixtures/**"],
|
||||
"rules": {
|
||||
"no-unawaited-load/no-unawaited-load": "off",
|
||||
"remote-tools-imports/no-foreign-imports-in-remote-closure": "off",
|
||||
"no-nested-tests/no-nested-tests": "off"
|
||||
"no-only-tests/no-only-tests": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
82
.yarn/README.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# Vendored Yarn release
|
||||
|
||||
This directory holds the Yarn release used by this repo (`yarnPath` in
|
||||
`.yarnrc.yml`). The release file is checked in so every contributor and CI job
|
||||
runs the exact same Yarn, and so we can carry small local patches when needed.
|
||||
|
||||
`releases/yarn-4.12.0.cjs` currently carries one such patch, described below.
|
||||
If you bump the Yarn version, read the **Upgrading Yarn** section first.
|
||||
|
||||
## Patch: use `JsZipImpl` for the node-modules link step
|
||||
|
||||
### What changed
|
||||
|
||||
Two call sites in `releases/yarn-4.12.0.cjs` are modified so the
|
||||
`node-modules` linker (and the `pnpm`-loose linker) construct their read-only
|
||||
`ZipOpenFS` with `customZipImplementation: ST` — Yarn's pure-JS `JsZipImpl` —
|
||||
instead of falling through to the default WASM-backed `LibZipImpl`:
|
||||
|
||||
```text
|
||||
new $f({maxOpenFiles:80,readOnlyArchives:!0})
|
||||
→ new $f({maxOpenFiles:80,readOnlyArchives:!0,customZipImplementation:ST})
|
||||
```
|
||||
|
||||
A comment block at the top of the `.cjs` file marks the file as patched and
|
||||
points back here.
|
||||
|
||||
### Why
|
||||
|
||||
On the `linux-arm` CI test shards we run a 32-bit `arm32v7` container. During
|
||||
`yarn install`'s **Link step**, Yarn opens up to 80 cache zips concurrently.
|
||||
With `LibZipImpl`, each open zip is `readFileSync`'d into a Node `Buffer`
|
||||
**and copied again into the WASM linear memory**, and every file read does a
|
||||
WASM `_malloc(size)` for the entry. The WASM heap has to grow as a single
|
||||
contiguous region of the 32-bit address space; once enough zips are resident,
|
||||
the `_malloc` for a large entry — most often `typescript/lib/typescript.js`
|
||||
(~9 MB inside a ~22 MB zip) — fails.
|
||||
|
||||
Yarn's cross-FS `copyFilePromise` swallows the underlying error and re-throws
|
||||
a generic one, so CI shows:
|
||||
|
||||
```text
|
||||
YN0001: While persisting .../typescript-patch-...zip/node_modules/typescript/
|
||||
EINVAL: invalid argument, copyfile '/node_modules/typescript/lib/typescript.js' -> '...'
|
||||
```
|
||||
|
||||
The unmasked form (occasionally seen on `pdfjs-dist`) is the WASM-heap failure
|
||||
string `Couldn't allocate enough memory`. This started failing ~1-in-3
|
||||
`linux-arm / test` shards at **Install Dependencies** on 2026-04-13, after
|
||||
[#50692](https://github.com/electron/electron/pull/50692) grew the cache enough
|
||||
to push the 32-bit process over the edge nondeterministically — e.g.
|
||||
[run 24739817558](https://github.com/electron/electron/actions/runs/24739817558/job/72380803746).
|
||||
|
||||
`JsZipImpl` avoids the problem entirely: it opens the zip by file descriptor,
|
||||
reads only the central directory into memory, and `readSync`s individual
|
||||
entries into ordinary Node `Buffer`s — **no WASM heap involved**. It is
|
||||
read-only and path-based, which is exactly how the linker uses these archives.
|
||||
|
||||
There is no `.yarnrc.yml` setting or environment variable to select the zip
|
||||
implementation (verified against the bundle), so editing the vendored release
|
||||
is the only way to switch it short of re-implementing the linker in a plugin.
|
||||
|
||||
Upstream references:
|
||||
[yarnpkg/berry#3972](https://github.com/yarnpkg/berry/issues/3972),
|
||||
[yarnpkg/berry#6722](https://github.com/yarnpkg/berry/issues/6722),
|
||||
[yarnpkg/berry#6550](https://github.com/yarnpkg/berry/issues/6550).
|
||||
|
||||
### Upgrading Yarn
|
||||
|
||||
When bumping `releases/yarn-*.cjs`:
|
||||
|
||||
1. Check whether upstream now defaults `readOnlyArchives` opens to `JsZipImpl`,
|
||||
or exposes a config knob for the zip implementation. If so, drop this patch.
|
||||
2. Otherwise, re-apply: search the new bundle for
|
||||
`maxOpenFiles:80,readOnlyArchives:!0` (the surrounding minified identifiers
|
||||
will differ) and add `,customZipImplementation:<JsZipImpl symbol>` — that
|
||||
symbol is whatever the new bundle exports as `JsZipImpl` from
|
||||
`@yarnpkg/libzip`.
|
||||
3. Re-add the header comment pointing back to this README.
|
||||
4. Verify with
|
||||
`rm -rf node_modules spec/node_modules && node script/yarn.js install --immutable --mode=skip-build`
|
||||
and confirm `node_modules/typescript/lib/typescript.js` is byte-identical to
|
||||
an unpatched install.
|
||||
7
.yarn/releases/yarn-4.12.0.cjs
vendored
25
BUILD.gn
@@ -105,21 +105,25 @@ electron_mac_bundle_id = branding.mac_bundle_id
|
||||
if (override_electron_version != "") {
|
||||
electron_version = override_electron_version
|
||||
} else {
|
||||
# When building from source code tarball there is no git tag available and
|
||||
# When building from a source code tarball there is no git tag available and
|
||||
# builders must explicitly pass override_electron_version in gn args.
|
||||
#
|
||||
# Resolve the real locations of packed-refs and HEAD via git so that this
|
||||
# also works when electron/ is a `git worktree` (where .git is a file, not a
|
||||
# directory, and GN's read_file cannot follow the gitdir indirection).
|
||||
electron_git_ref_paths =
|
||||
exec_script("script/get-git-ref-paths.py", [], "list lines")
|
||||
|
||||
# This read_file call will assert if there is no git information, without it
|
||||
# gn will generate a malformed build configuration and ninja will get into
|
||||
# infinite loop.
|
||||
read_file(".git/packed-refs", "string")
|
||||
read_file(electron_git_ref_paths[0], "string")
|
||||
|
||||
# Set electron version from git tag.
|
||||
electron_version = exec_script("script/get-git-version.py",
|
||||
[],
|
||||
"trim string",
|
||||
[
|
||||
".git/packed-refs",
|
||||
".git/HEAD",
|
||||
])
|
||||
electron_git_ref_paths)
|
||||
}
|
||||
|
||||
if (is_mas_build) {
|
||||
@@ -495,8 +499,10 @@ source_set("electron_lib") {
|
||||
"//components/certificate_transparency",
|
||||
"//components/compose:buildflags",
|
||||
"//components/embedder_support:user_agent",
|
||||
"//components/heap_profiling/multi_process",
|
||||
"//components/input",
|
||||
"//components/language/core/browser",
|
||||
"//components/memory_system",
|
||||
"//components/net_log",
|
||||
"//components/network_hints/browser",
|
||||
"//components/network_hints/common:mojo_bindings",
|
||||
@@ -509,6 +515,7 @@ source_set("electron_lib") {
|
||||
"//components/pref_registry",
|
||||
"//components/prefs",
|
||||
"//components/security_state/content",
|
||||
"//components/tracing:tracing_metrics",
|
||||
"//components/upload_list",
|
||||
"//components/user_prefs",
|
||||
"//components/viz/host",
|
||||
@@ -521,6 +528,7 @@ source_set("electron_lib") {
|
||||
"//content/public/utility",
|
||||
"//device/bluetooth",
|
||||
"//device/bluetooth/public/cpp",
|
||||
"//device/fido",
|
||||
"//gin",
|
||||
"//gpu/ipc/client",
|
||||
"//media/capture/mojom:video_capture",
|
||||
@@ -794,7 +802,7 @@ source_set("electron_lib") {
|
||||
"//components/zoom",
|
||||
"//extensions/browser",
|
||||
"//extensions/browser/api:api_provider",
|
||||
"//extensions/browser/mime_handler:stream_info",
|
||||
"//extensions/browser/mime_handler",
|
||||
"//extensions/browser/updater",
|
||||
"//extensions/common",
|
||||
"//extensions/common:core_api_provider",
|
||||
@@ -1663,8 +1671,9 @@ action("node_version_header") {
|
||||
action("generate_node_headers") {
|
||||
deps = [ ":generate_config_gypi" ]
|
||||
script = "script/node/generate_node_headers.py"
|
||||
args = [ rebase_path("$root_gen_dir") ]
|
||||
inputs = auto_filenames.node_header_sources
|
||||
outputs = [ "$root_gen_dir/node_headers.json" ]
|
||||
args = [ rebase_path("$root_gen_dir") ]
|
||||
}
|
||||
|
||||
action("tar_node_headers") {
|
||||
|
||||
4
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'148.0.7778.0',
|
||||
'149.0.7817.0',
|
||||
'node_version':
|
||||
'v24.14.1',
|
||||
'v24.15.0',
|
||||
'nan_version':
|
||||
'675cefebca42410733da8a454c8d9391fcebfbc2',
|
||||
'squirrel.mac_version':
|
||||
|
||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
||||
root_extra_deps = [ "//electron" ]
|
||||
|
||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
|
||||
node_module_version = 146
|
||||
node_module_version = 148
|
||||
|
||||
v8_promise_internal_field_count = 1
|
||||
v8_embedder_string = "-electron.0"
|
||||
@@ -63,10 +63,6 @@ v8_enable_private_mapping_fork_optimization = true
|
||||
# Expose public V8 symbols for native modules.
|
||||
v8_expose_public_symbols = true
|
||||
|
||||
# Disable snapshotting a page when printing for its content to be analyzed for
|
||||
# sensitive content by enterprise users.
|
||||
enterprise_cloud_content_analysis = false
|
||||
|
||||
# We don't use anything from here, and it causes target collisions
|
||||
enable_linux_installer = false
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ template("electron_extra_paks") {
|
||||
"$root_gen_dir/net/net_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/strings/permission_element_generated_strings.pak",
|
||||
"$target_gen_dir/electron_resources.pak",
|
||||
]
|
||||
deps = [
|
||||
@@ -83,6 +84,7 @@ template("electron_extra_paks") {
|
||||
"//net:net_resources",
|
||||
"//third_party/blink/public:devtools_inspector_resources",
|
||||
"//third_party/blink/public:resources",
|
||||
"//third_party/blink/public/strings:permission_element_generated_strings",
|
||||
"//ui/webui/resources",
|
||||
]
|
||||
if (defined(invoker.deps)) {
|
||||
@@ -187,6 +189,7 @@ template("electron_paks") {
|
||||
"${root_gen_dir}/extensions/strings/extensions_strings_",
|
||||
"${root_gen_dir}/services/strings/services_strings_",
|
||||
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_",
|
||||
"${root_gen_dir}/third_party/blink/public/strings/permission_element_strings_",
|
||||
"${root_gen_dir}/ui/strings/app_locale_settings_",
|
||||
"${root_gen_dir}/ui/strings/auto_image_annotation_strings_",
|
||||
"${root_gen_dir}/ui/strings/ax_strings_",
|
||||
@@ -204,6 +207,7 @@ template("electron_paks") {
|
||||
"//extensions/strings",
|
||||
"//services/strings",
|
||||
"//third_party/blink/public/strings",
|
||||
"//third_party/blink/public/strings:permission_element_strings",
|
||||
"//ui/strings:app_locale_settings",
|
||||
"//ui/strings:auto_image_annotation_strings",
|
||||
"//ui/strings:ax_strings",
|
||||
|
||||
87
build/win/abs_link_wrapper.py
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (c) 2026 GitHub, Inc.
|
||||
# Use of this source code is governed by the MIT license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
"""Wrapper for lld-link that resolves relative paths to absolute.
|
||||
|
||||
Usage: abs_link_wrapper.py <lld-link> <args...>
|
||||
|
||||
The first argument is the real linker executable. The script resolves
|
||||
relative .obj/.rlib/.res/.lib paths in both @rspfile contents and direct
|
||||
command-line arguments to absolute paths, then invokes the real linker.
|
||||
"""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def _is_file_path(token):
|
||||
"""Check if a token looks like a relative file path (not a flag or bare lib name)."""
|
||||
# Strip surrounding quotes
|
||||
t = token.strip('"')
|
||||
# Linker flags start with / or -
|
||||
if t.startswith('/') or t.startswith('-'):
|
||||
return False
|
||||
# Must contain a directory separator to be a relative path.
|
||||
# Bare names like "advapi32.lib" are system libraries resolved via
|
||||
# -libpath: or /winsysroot and must not be turned into absolute paths.
|
||||
if '/' not in t and '\\' not in t:
|
||||
return False
|
||||
# File extensions we care about
|
||||
return t.endswith(('.obj', '.res', '.lib', '.a', '.o', '.rlib'))
|
||||
|
||||
|
||||
def _resolve_rsp(rsp_path):
|
||||
"""Rewrite relative file paths in the rsp file to absolute paths."""
|
||||
with open(rsp_path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
lines = []
|
||||
changed = False
|
||||
for line in content.splitlines():
|
||||
tokens = []
|
||||
for token in line.split():
|
||||
stripped = token.strip('"')
|
||||
if _is_file_path(token) and not os.path.isabs(stripped):
|
||||
abs_path = os.path.abspath(stripped)
|
||||
tokens.append('"' + abs_path + '"')
|
||||
changed = True
|
||||
else:
|
||||
tokens.append(token)
|
||||
lines.append(' '.join(tokens))
|
||||
|
||||
if not changed:
|
||||
return rsp_path
|
||||
|
||||
abs_rsp = rsp_path + '.abs'
|
||||
with open(abs_rsp, 'w') as f:
|
||||
f.write('\n'.join(lines))
|
||||
return abs_rsp
|
||||
|
||||
|
||||
def _resolve_arg(arg):
|
||||
"""Resolve a single command-line argument if it's a relative file path."""
|
||||
stripped = arg.strip('"')
|
||||
if _is_file_path(arg) and not os.path.isabs(stripped):
|
||||
return os.path.abspath(stripped)
|
||||
return arg
|
||||
|
||||
|
||||
def main():
|
||||
args = []
|
||||
for arg in sys.argv[1:]:
|
||||
if arg.startswith('@'):
|
||||
rsp_path = arg[1:].strip('"')
|
||||
resolved = _resolve_rsp(rsp_path)
|
||||
args.append('@' + resolved)
|
||||
else:
|
||||
args.append(_resolve_arg(arg))
|
||||
|
||||
return subprocess.call(args)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
@@ -21,6 +21,8 @@ static_library("chrome") {
|
||||
"//chrome/browser/browser_features.h",
|
||||
"//chrome/browser/browser_process.cc",
|
||||
"//chrome/browser/browser_process.h",
|
||||
"//chrome/browser/device_notifications/device_connection_tracker.h",
|
||||
"//chrome/browser/device_notifications/device_system_tray_icon.h",
|
||||
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
|
||||
"//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
|
||||
"//chrome/browser/devtools/devtools_dispatch_http_request_params.cc",
|
||||
@@ -38,6 +40,7 @@ static_library("chrome") {
|
||||
"//chrome/browser/devtools/visual_logging.h",
|
||||
"//chrome/browser/file_system_access/file_system_access_features.cc",
|
||||
"//chrome/browser/file_system_access/file_system_access_features.h",
|
||||
"//chrome/browser/hid/hid_system_tray_icon.h",
|
||||
"//chrome/browser/icon_loader.cc",
|
||||
"//chrome/browser/icon_loader.h",
|
||||
"//chrome/browser/icon_manager.cc",
|
||||
@@ -156,6 +159,7 @@ static_library("chrome") {
|
||||
"//chrome/browser/ui/webui/accessibility/accessibility_ui.h",
|
||||
"//chrome/browser/usb/usb_blocklist.cc",
|
||||
"//chrome/browser/usb/usb_blocklist.h",
|
||||
"//chrome/browser/usb/usb_system_tray_icon.h",
|
||||
"//extensions/browser/app_window/size_constraints.cc",
|
||||
"//extensions/browser/app_window/size_constraints.h",
|
||||
"//ui/base/accelerators/global_accelerator_listener/global_accelerator_listener.cc",
|
||||
@@ -247,10 +251,6 @@ static_library("chrome") {
|
||||
"//chrome/browser/ui/views/dark_mode_manager_linux.cc",
|
||||
"//chrome/browser/ui/views/dark_mode_manager_linux.h",
|
||||
]
|
||||
sources += [
|
||||
"//chrome/browser/ui/views/frame/browser_frame_view_paint_utils_linux.cc",
|
||||
"//chrome/browser/ui/views/frame/browser_frame_view_paint_utils_linux.h",
|
||||
]
|
||||
public_deps += [ "//components/dbus" ]
|
||||
}
|
||||
|
||||
@@ -389,16 +389,17 @@ static_library("chrome") {
|
||||
"//chrome/browser/pdf/chrome_pdf_stream_delegate.h",
|
||||
"//chrome/browser/pdf/pdf_extension_util.cc",
|
||||
"//chrome/browser/pdf/pdf_extension_util.h",
|
||||
"//chrome/browser/pdf/pdf_handler_stream_delegate.cc",
|
||||
"//chrome/browser/pdf/pdf_handler_stream_delegate.h",
|
||||
"//chrome/browser/pdf/pdf_help_bubble_handler_factory.cc",
|
||||
"//chrome/browser/pdf/pdf_help_bubble_handler_factory.h",
|
||||
"//chrome/browser/pdf/pdf_viewer_stream_manager.cc",
|
||||
"//chrome/browser/pdf/pdf_viewer_stream_manager.h",
|
||||
"//chrome/browser/plugins/pdf_iframe_navigation_throttle.cc",
|
||||
"//chrome/browser/plugins/pdf_iframe_navigation_throttle.h",
|
||||
]
|
||||
deps += [
|
||||
"//components/pdf/browser",
|
||||
"//components/pdf/renderer",
|
||||
"//components/zoom",
|
||||
"//ui/base/interaction",
|
||||
"//ui/webui/resources/cr_components/help_bubble:mojo_bindings",
|
||||
]
|
||||
|
||||
@@ -882,7 +882,7 @@ Returns `string` - Name of the application handling the protocol, or an empty
|
||||
This method returns the application name of the default handler for the protocol
|
||||
(aka URI scheme) of a URL.
|
||||
|
||||
### `app.getApplicationInfoForProtocol(url)` _macOS_ _Windows_
|
||||
### `app.getApplicationInfoForProtocol(url)`
|
||||
|
||||
* `url` string - a URL with the protocol name to check. Unlike the other
|
||||
methods in this family, this accepts an entire URL, including `://` at a
|
||||
@@ -1233,6 +1233,51 @@ This API must be called after the `ready` event is emitted.
|
||||
[doh-providers]: https://source.chromium.org/chromium/chromium/src/+/main:net/dns/public/doh_provider_entry.cc;l=31?q=%22DohProviderEntry::GetList()%22&ss=chromium%2Fchromium%2Fsrc
|
||||
[RFC8484 § 3]: https://datatracker.ietf.org/doc/html/rfc8484#section-3
|
||||
|
||||
### `app.configureWebAuthn(options)` _macOS_
|
||||
|
||||
* `options` Object
|
||||
* `touchID` Object (optional) - Enables the Touch ID / Secure Enclave platform
|
||||
authenticator for [Web Authentication](https://www.w3.org/TR/webauthn-2/)
|
||||
requests.
|
||||
* `keychainAccessGroup` string - The keychain access group that WebAuthn
|
||||
credentials will be stored under. This value **must** also be present in
|
||||
your app's `keychain-access-groups` code-signing entitlement, and is
|
||||
typically of the form `<TEAM_ID>.<BUNDLE_ID>.webauthn`.
|
||||
|
||||
Configures platform authenticators for the Web Authentication API
|
||||
(`navigator.credentials.create()` / `navigator.credentials.get()`). Until this
|
||||
is called, `PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()`
|
||||
resolves to `false` and platform-authenticator requests are not serviced.
|
||||
|
||||
When `touchID` is provided, WebAuthn credentials are stored in the macOS
|
||||
keychain and bound to this device's Secure Enclave. Electron automatically
|
||||
generates and persists a per-[`session`](session.md) metadata secret so that
|
||||
credentials created in one partition are not visible to another.
|
||||
|
||||
```js
|
||||
const { app } = require('electron')
|
||||
|
||||
app.configureWebAuthn({
|
||||
touchID: {
|
||||
keychainAccessGroup: 'A1B2C3D4E5.com.example.app.webauthn'
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
With the matching entitlement in your app's `entitlements.plist`:
|
||||
|
||||
```xml
|
||||
<key>keychain-access-groups</key>
|
||||
<array>
|
||||
<string>A1B2C3D4E5.com.example.app.webauthn</string>
|
||||
</array>
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Touch ID WebAuthn credentials are device-bound and are not synced via iCloud
|
||||
> Keychain. They are only available on Macs with a Secure Enclave (Apple
|
||||
> silicon, or Intel Macs with a T2 chip).
|
||||
|
||||
### `app.disableHardwareAcceleration()`
|
||||
|
||||
Disables hardware acceleration for current app.
|
||||
|
||||
@@ -319,6 +319,17 @@ By default inspector websocket url is available in stderr and under /json/list e
|
||||
|
||||
Enable support for DevTools network inspector events, for visibility into requests made by the nodejs `http` and `https` modules.
|
||||
|
||||
### `--experimental-inspector-network-resource`
|
||||
|
||||
Enable support for resolving source maps over the network when using the Node.js inspector.
|
||||
|
||||
When enabled, DevTools can retrieve remote source maps for main and utility
|
||||
process scripts via the Node.js inspector.
|
||||
|
||||
**Note:** When enabled, the Node.js inspector will make network requests to
|
||||
URLs specified in source maps. Be mindful of this in environments where the
|
||||
process has access to internal networks.
|
||||
|
||||
### `--no-deprecation`
|
||||
|
||||
Silence deprecation warnings.
|
||||
|
||||
@@ -124,4 +124,65 @@ Returns `Promise<Object>` - Resolves with an object containing the `value` and `
|
||||
Get the maximum usage across processes of trace buffer as a percentage of the
|
||||
full state.
|
||||
|
||||
### `contentTracing.enableHeapProfiling([options])` _Experimental_
|
||||
|
||||
<!--
|
||||
```YAML history
|
||||
added:
|
||||
- pr-url: https://github.com/electron/electron/pull/50826
|
||||
```
|
||||
-->
|
||||
|
||||
* `options` ([EnableHeapProfilingOptions](structures/enable-heap-profiling-options.md)) (optional)
|
||||
|
||||
Returns `Promise<void>` - Resolves once heap profiling has been enabled.
|
||||
|
||||
Enable [heap profiling](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/memory-infra/heap_profiler.md)
|
||||
for MemoryInfra traces. Equivalent to the `--memlog` switch in Chrome.
|
||||
|
||||
Only takes effect if the `disabled-by-default-memory-infra` category is included.
|
||||
|
||||
Needs to be called before `contentTracing.startRecording()`.
|
||||
|
||||
Usage:
|
||||
|
||||
```js
|
||||
const { contentTracing } = require('electron')
|
||||
|
||||
async function recordTrace () {
|
||||
await contentTracing.enableHeapProfiling()
|
||||
await contentTracing.startRecording({
|
||||
included_categories: ['disabled-by-default-memory-infra'],
|
||||
excluded_categories: ['*'],
|
||||
memory_dump_config: {
|
||||
triggers: [
|
||||
{ mode: 'detailed', periodic_interval_ms: 1000 }
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 5000))
|
||||
|
||||
const filePath = await contentTracing.stopRecording()
|
||||
}
|
||||
```
|
||||
|
||||
To view the recorded heap dumps:
|
||||
|
||||
1. Download the breakpad symbols for your Electron version from the Electron GitHub
|
||||
[releases](https://github.com/electron/electron/releases)
|
||||
2. Clone the [Electron source code](../development/build-instructions-gn.md)
|
||||
3. In your Chromium checkout for Electron, run this command to symbolicate the heap dump:
|
||||
|
||||
```bash
|
||||
python3 third_party/catapult/tracing/bin/symbolize_trace --use-breakpad-symbols --breakpad-symbols-directory /path/to/breakpad_symbols /path/to/trace.json
|
||||
```
|
||||
|
||||
4. Open the symbolicated trace in `chrome://tracing` (the Perfetto UI does not support memory dumps
|
||||
yet)
|
||||
5. Click on one of the `M` symbols
|
||||
6. Click on a `☰` triple bar icon (e.g., in the `malloc` column)
|
||||
|
||||
<img src="../images/viewing-heap-dumps.png" alt="Screenshot showing how to view a heapdump in Chromium's tracing view" />
|
||||
|
||||
[trace viewer]: https://chromium.googlesource.com/catapult/+/HEAD/tracing/README.md
|
||||
|
||||
@@ -203,13 +203,22 @@ the one downloaded by `npm install`. Usage:
|
||||
export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Testing
|
||||
```
|
||||
|
||||
### `ELECTRON_SKIP_BINARY_DOWNLOAD`
|
||||
### `ELECTRON_INSTALL_PLATFORM`
|
||||
|
||||
If you want to install your project's dependencies but don't need to use Electron functionality,
|
||||
you can set the `ELECTRON_SKIP_BINARY_DOWNLOAD` environment variable to prevent the binary from being
|
||||
downloaded. For instance, this feature can be useful in continuous integration environments when
|
||||
running unit tests that mock out the `electron` module.
|
||||
Manually overrides platform used by `electron` package during an install.
|
||||
This can be useful if you are on one platform (e.g macOS) but want to
|
||||
download binaries for another platform (e.g Windows or Linux). Usage:
|
||||
|
||||
```sh
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install
|
||||
ELECTRON_INSTALL_PLATFORM=darwin npm install
|
||||
```
|
||||
|
||||
### `ELECTRON_INSTALL_ARCH`
|
||||
|
||||
Manually overrides architecture used by `electron` package during an install.
|
||||
This can be useful if you are on one arch (e.g `arm64`) but want to download
|
||||
binaries meant for another arch. Note that this will not work under Rosetta. Usage:
|
||||
|
||||
```sh
|
||||
ELECTRON_INSTALL_ARCH=arm64 npm install
|
||||
```
|
||||
|
||||
@@ -31,6 +31,7 @@ See [`Menu`](menu.md) for examples.
|
||||
* `header` - Only available on macOS 14 and up.
|
||||
* `palette` - Only available on macOS 14 and up.
|
||||
* `label` string (optional)
|
||||
* `accessibilityLabel` string (optional) _macOS_
|
||||
* `sublabel` string (optional) _macOS_ - Available in macOS >= 14.4
|
||||
* `toolTip` string (optional) _macOS_ - Hover text for this menu item.
|
||||
* `accelerator` string (optional) - An [Accelerator](../tutorial/keyboard-shortcuts.md#accelerators) string.
|
||||
@@ -83,6 +84,12 @@ A `string` indicating the item's visible label.
|
||||
|
||||
This property can be dynamically changed.
|
||||
|
||||
#### `menuItem.accessibilityLabel` _macOS_
|
||||
|
||||
A `string` indicating the item's accessibility label (used by assistive technology), if set.
|
||||
|
||||
This property can be dynamically changed.
|
||||
|
||||
#### `menuItem.click`
|
||||
|
||||
A `Function` that is fired when the MenuItem receives a click event.
|
||||
|
||||
@@ -76,6 +76,45 @@ app.whenReady().then(() => {
|
||||
})
|
||||
```
|
||||
|
||||
#### `Notification.getHistory()` _macOS_
|
||||
|
||||
Returns `Promise<Notification[]>` - Resolves with an array of `Notification` objects representing all delivered notifications still present in Notification Center.
|
||||
|
||||
Each returned `Notification` is a live object connected to the corresponding delivered notification. Interaction events (`click`, `reply`, `action`, `close`) will fire on these objects when the user interacts with the notification in Notification Center. This is useful after an app restart to re-attach event handlers to notifications from a previous session.
|
||||
|
||||
The returned notifications have their `id`, `groupId`, `title`, `subtitle`, and `body` properties populated from information available in the Notification Center. Other properties (e.g., `actions`, `silent`, `icon`) are not available from delivered notifications and will have default values.
|
||||
|
||||
> [!NOTE]
|
||||
> Like all macOS notification APIs, this method requires the application to be
|
||||
> code-signed. In unsigned development builds, notifications are not delivered
|
||||
> to Notification Center and this method will resolve with an empty array.
|
||||
|
||||
> [!NOTE]
|
||||
> Unlike notifications created with `new Notification()`, notifications returned
|
||||
> by `getHistory()` will remain visible in Notification Center when the object
|
||||
> is garbage collected. Calling `show()` on a restored notification will remove
|
||||
> the original from Notification Center and post a new one with the same
|
||||
> properties.
|
||||
|
||||
```js
|
||||
const { Notification, app } = require('electron')
|
||||
|
||||
app.whenReady().then(async () => {
|
||||
// Restore notifications from a previous session
|
||||
const notifications = await Notification.getHistory()
|
||||
for (const n of notifications) {
|
||||
console.log(`Found delivered notification: ${n.id} - ${n.title}`)
|
||||
n.on('click', () => {
|
||||
console.log(`User clicked: ${n.id}`)
|
||||
})
|
||||
n.on('reply', (event) => {
|
||||
console.log(`User replied to ${n.id}: ${event.reply}`)
|
||||
})
|
||||
}
|
||||
// Keep references so events continue to fire
|
||||
})
|
||||
```
|
||||
|
||||
### `new Notification([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
@@ -292,6 +331,10 @@ call this method before the OS will display it.
|
||||
If the notification has been shown before, this method will dismiss the previously
|
||||
shown notification and create a new one with identical properties.
|
||||
|
||||
On macOS, calling `show()` on a notification returned by `Notification.getHistory()` will
|
||||
remove the original notification from Notification Center and post a new one with the same
|
||||
properties.
|
||||
|
||||
```js
|
||||
const { Notification, app } = require('electron')
|
||||
|
||||
|
||||
@@ -629,6 +629,54 @@ Emitted after `USBDevice.forget()` has been called. This event can be used
|
||||
to help maintain persistent storage of permissions when
|
||||
`setDevicePermissionHandler` is used.
|
||||
|
||||
#### Event: 'select-webauthn-account'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `details` Object
|
||||
* `relyingPartyId` string - The relying party identifier from the WebAuthn request.
|
||||
* `accounts` [WebAuthnAccount[]](structures/webauthn-account.md)
|
||||
* `frame` [WebFrameMain](web-frame-main.md) | null - The frame initiating this event.
|
||||
May be `null` if accessed after the frame has either navigated or been destroyed.
|
||||
* `callback` Function
|
||||
* `credentialId` string | null (optional)
|
||||
|
||||
Emitted when a call to `navigator.credentials.get()` resolves multiple
|
||||
discoverable WebAuthn credentials and the user must choose one. `callback`
|
||||
should be called with the `credentialId` of the selected account; passing no
|
||||
arguments — or a `credentialId` that does not match one of the provided
|
||||
accounts — will cancel the request and the page will receive a
|
||||
`NotAllowedError`. If no listener is registered for this event, the request is
|
||||
cancelled with the same error. The credential request remains pending until
|
||||
the listener invokes the callback, so always invoke it exactly once — typically
|
||||
from a `try { … } finally { callback(…) }` block.
|
||||
|
||||
On macOS, the Touch ID platform authenticator surfaces accounts via this event
|
||||
once it has been configured with
|
||||
[`app.configureWebAuthn`](app.md#appconfigurewebauthnoptions-macos). The event
|
||||
may also fire on other platforms when a roaming FIDO2 authenticator returns
|
||||
multiple discoverable credentials.
|
||||
|
||||
```js
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
let win = null
|
||||
|
||||
app.whenReady().then(() => {
|
||||
app.configureWebAuthn({
|
||||
touchID: { keychainAccessGroup: 'A1B2C3D4E5.com.example.app.webauthn' }
|
||||
})
|
||||
|
||||
win = new BrowserWindow()
|
||||
|
||||
win.webContents.session.on('select-webauthn-account', (event, details, callback) => {
|
||||
const selected = details.accounts.find((a) => a.name === 'alice@example.com')
|
||||
callback(selected?.credentialId)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
### Instance Methods
|
||||
|
||||
The following methods are available on instances of `Session`:
|
||||
@@ -650,7 +698,7 @@ Clears the session’s HTTP cache.
|
||||
`scheme://host:port`.
|
||||
* `storages` string[] (optional) - The types of storages to clear, can be
|
||||
`cookies`, `filesystem`, `indexdb`, `localstorage`,
|
||||
`shadercache`, `websql`, `serviceworkers`, `cachestorage`. If not
|
||||
`shadercache`, `serviceworkers`, `cachestorage`. If not
|
||||
specified, clear all storage types.
|
||||
|
||||
Returns `Promise<void>` - resolves when the storage data has been cleared.
|
||||
|
||||
26
docs/api/structures/enable-heap-profiling-options.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# EnableHeapProfilingOptions Object
|
||||
|
||||
* `mode` string (optional) - Controls which processes are profiled. Equivalent to `--memlog` in
|
||||
Chrome. Default is `all`.
|
||||
* `all` - Profile all processes.
|
||||
* `browser` - Profile only the browser process.
|
||||
* `gpu` - Profile only the GPU process.
|
||||
* `minimal` - Profile only the browser and GPU processes.
|
||||
* `renderer-sampling` - Profile at most 1 renderer process. Each renderer process has a fixed
|
||||
probability of being profiled when the renderer process is started or, for existing processes,
|
||||
when heap profiling is enabled.
|
||||
* `all-renderers` - Profile all renderer processes.
|
||||
* `utility-sampling` - Each utility process has a fixed probability of being profiled.
|
||||
* `all-utilities` - Profile all utility processes.
|
||||
* `utility-and-browser` - Profile all utility processes and the browser process.
|
||||
* `samplingRate` number (optional) - Controls the sampling interval in bytes. The lower the
|
||||
interval, the more precise the profile is. However it comes at the cost of performance. Default
|
||||
is `100000` (100KB). That is enough to observe allocation sites that make allocations >500KB
|
||||
total, where total equals to a single allocation size times the number of such allocations at the
|
||||
same call site. Equivalent to `--memlog-sampling-rate` in Chrome. Must be an integer between
|
||||
`1000` and `10000000`.
|
||||
* `stackMode` string (optional) - Controls the type of metadata recorded for each allocation.
|
||||
Equivalent to `--memlog-stack-mode` in Chrome. Default is `native`.
|
||||
* `native` - Instruction addresses from unwinding the stack.
|
||||
* `native-with-thread-names` - Instruction addresses from unwinding the stack. Includes the thread
|
||||
name as the first frame.
|
||||
@@ -5,6 +5,7 @@
|
||||
* `rgba` - 32bpp RGBA (byte-order), 1 plane.
|
||||
* `rgbaf16` - Half float RGBA, 1 plane.
|
||||
* `nv12` - 12bpp with Y plane followed by a 2x2 interleaved UV plane.
|
||||
* `nv16` - 16bpp with Y plane followed by a 2x1 interleaved UV plane.
|
||||
* `p010le` - 4:2:0 10-bit YUV (little-endian), Y plane followed by a 2x2 interleaved UV plane.
|
||||
* `colorSpace` [ColorSpace](color-space.md) (optional) - The color space of the texture.
|
||||
* `codedSize` [Size](size.md) - The full dimensions of the shared texture.
|
||||
|
||||
9
docs/api/structures/webauthn-account.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# WebAuthnAccount Object
|
||||
|
||||
* `credentialId` string - URL-safe base64-encoded (no padding) credential ID of
|
||||
the discoverable credential. Matches `PublicKeyCredential.id` returned by
|
||||
`navigator.credentials.get()` in the renderer.
|
||||
* `userHandle` string (optional) - URL-safe base64-encoded (no padding) user
|
||||
handle (`user.id`) that was provided when the credential was created.
|
||||
* `name` string (optional) - Human-palatable identifier for the account (for example, an email address or username).
|
||||
* `displayName` string (optional) - Human-palatable name for the account, intended for display.
|
||||
@@ -17,6 +17,16 @@ Process: [Main](../glossary.md#main-process)<br />
|
||||
* `env` Object (optional) - Environment key-value pairs. Default is `process.env`.
|
||||
* `execArgv` string[] (optional) - List of string arguments passed to the executable.
|
||||
* `cwd` string (optional) - Current working directory of the child process.
|
||||
* `session` [Session](session.md) (optional) - Sets the session used by the process for network
|
||||
requests. By default, network requests from the utility process will use the system network
|
||||
context which does not have HTTP cache support. Setting a session enables HTTP caching and
|
||||
other session-specific network features. See [session](session.md) for more information.
|
||||
* `partition` string (optional) - Sets the session used by the process according to the
|
||||
session's partition string. If `partition` starts with `persist:`, the process will use a
|
||||
persistent session available to all pages in the app with the same `partition`. If there is
|
||||
no `persist:` prefix, the process will use an in-memory session. By assigning the same
|
||||
`partition`, multiple processes can share the same session. If the `session` option is set,
|
||||
this option is ignored.
|
||||
* `stdio` (string[] | string) (optional) - Allows configuring the mode for `stdout` and `stderr`
|
||||
of the child process. Default is `inherit`.
|
||||
String value can be one of `pipe`, `ignore`, `inherit`, for more details on these values you can refer to
|
||||
@@ -44,7 +54,9 @@ Process: [Main](../glossary.md#main-process)<br />
|
||||
that run third-party or otherwise untrusted code. Default is `false`.
|
||||
* `respondToAuthRequestsFromMainProcess` boolean (optional) - With this flag, all HTTP 401 and 407 network
|
||||
requests created via the [net module](net.md) will allow responding to them via the
|
||||
[`app#login`](app.md#event-login) event in the main process instead of the default
|
||||
[`login`](#event-login) event on the `UtilityProcess` instance when a `session` is provided, or via
|
||||
the [`app#login`](app.md#event-login) event in the main process when using the default system network
|
||||
context. Without this flag, auth challenges are handled by the default
|
||||
[`login`](client-request.md#event-login) event on the [`ClientRequest`](client-request.md) object. Default is
|
||||
`false`.
|
||||
|
||||
@@ -176,6 +188,45 @@ Returns:
|
||||
|
||||
Emitted when the child process sends a message using [`process.parentPort.postMessage()`](process.md#processparentport).
|
||||
|
||||
#### Event: 'login'
|
||||
|
||||
Returns:
|
||||
|
||||
* `authenticationResponseDetails` Object
|
||||
* `url` URL
|
||||
* `pid` number
|
||||
* `authInfo` Object
|
||||
* `isProxy` boolean
|
||||
* `scheme` string
|
||||
* `host` string
|
||||
* `port` Integer
|
||||
* `realm` string
|
||||
* `callback` Function
|
||||
* `username` string (optional)
|
||||
* `password` string (optional)
|
||||
|
||||
Emitted when the utility process encounters an HTTP 401 or 407 authentication challenge, if the
|
||||
process was created with both `respondToAuthRequestsFromMainProcess: true` and a `session` option.
|
||||
The `callback` should be called with credentials to respond to the challenge. Calling `callback`
|
||||
without arguments will cancel the request.
|
||||
|
||||
This behaves the same as the [`login` event on `app`](app.md#event-login) but is scoped to the
|
||||
individual utility process instance.
|
||||
|
||||
```js
|
||||
const { session, utilityProcess } = require('electron')
|
||||
|
||||
const ses = session.defaultSession
|
||||
const child = utilityProcess.fork('./worker.js', [], {
|
||||
session: ses,
|
||||
respondToAuthRequestsFromMainProcess: true
|
||||
})
|
||||
|
||||
child.on('login', (authenticationResponseDetails, authInfo, callback) => {
|
||||
callback('username', 'password')
|
||||
})
|
||||
```
|
||||
|
||||
[`child_process.fork`]: https://nodejs.org/dist/latest-v16.x/docs/api/child_process.html#child_processforkmodulepath-args-options
|
||||
[Services API]: https://chromium.googlesource.com/chromium/src/+/main/docs/mojo_and_services.md
|
||||
[stdio]: https://nodejs.org/dist/latest/docs/api/child_process.html#optionsstdio
|
||||
|
||||
@@ -117,6 +117,13 @@ Examples of valid `color` values:
|
||||
> [!NOTE]
|
||||
> The area cutout of the view's border still captures clicks.
|
||||
|
||||
#### `view.setBackgroundBlur(blurRadius)`
|
||||
|
||||
* `blurRadius` Integer - The radius of the background blur effect (in pixels).
|
||||
|
||||
> [!NOTE]
|
||||
> You must set a background color with an alpha channel (e.g. `#80ffffff`) in order for the blur effect to be visible.
|
||||
|
||||
#### `view.setVisible(visible)`
|
||||
|
||||
* `visible` boolean - If false, the view will be hidden from display.
|
||||
|
||||
@@ -226,7 +226,16 @@ Returns:
|
||||
Only defined when the window is being created by a form that set
|
||||
`target=_blank`.
|
||||
* `disposition` string - Can be `default`, `foreground-tab`,
|
||||
`background-tab`, `new-window` or `other`.
|
||||
`background-tab`, `new-window` or `other`. Corresponds to the manner
|
||||
an associated link was clicked. See Chromium's
|
||||
[WindowOpenDisposition](https://source.chromium.org/chromium/chromium/src/+/main:ui/base/window_open_disposition.h).
|
||||
* `default` - Indicates Chromium deems in-window navigation valid
|
||||
for a window open call.
|
||||
* `foreground-tab` - Corresponds to a left click or shift + middle click.
|
||||
* `background-tab` - Corresponds to a middle click or ctrl/cmd + click.
|
||||
* `new-window` - Corresponds to a shift + left click.
|
||||
* `other` - A catch-all for the remaining Chromium dispositions not
|
||||
handled by Electron.
|
||||
|
||||
Emitted _after_ successful creation of a window via `window.open` in the renderer.
|
||||
Not emitted if the creation of the window is canceled from
|
||||
@@ -1449,8 +1458,17 @@ Ignore application menu shortcuts while this web contents is focused.
|
||||
* `url` string - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
|
||||
* `frameName` string - Name of the window provided in `window.open()`
|
||||
* `features` string - Comma separated list of window features provided to `window.open()`.
|
||||
* `disposition` string - Can be `default`, `foreground-tab`, `background-tab`,
|
||||
`new-window` or `other`.
|
||||
* `disposition` string - Can be `default`, `foreground-tab`,
|
||||
`background-tab`, `new-window` or `other`. Corresponds to the manner
|
||||
an associated link was clicked. See Chromium's
|
||||
[WindowOpenDisposition](https://source.chromium.org/chromium/chromium/src/+/main:ui/base/window_open_disposition.h).
|
||||
* `default` - Indicates Chromium deems in-window navigation valid
|
||||
for a window open call.
|
||||
* `foreground-tab` - Corresponds to a left click or shift + middle click.
|
||||
* `background-tab` - Corresponds to a middle click or ctrl/cmd + click.
|
||||
* `new-window` - Corresponds to a shift + left click.
|
||||
* `other` - A catch-all for the remaining Chromium dispositions not
|
||||
handled by Electron.
|
||||
* `referrer` [Referrer](structures/referrer.md) - The referrer that will be
|
||||
passed to the new window. May or may not result in the `Referer` header being
|
||||
sent, depending on the referrer policy.
|
||||
@@ -2275,6 +2293,20 @@ Returns `Integer` - The Chromium internal `pid` of the associated renderer. Can
|
||||
be compared to the `frameProcessId` passed by frame specific navigation events
|
||||
(e.g. `did-frame-navigate`)
|
||||
|
||||
#### `contents.clone()`
|
||||
|
||||
Returns `WebContents` - A cloned WebContents instance. This method creates a copy
|
||||
of the WebContents with the following attributes:
|
||||
|
||||
* **WebPreferences** - All preferences from the original WebContents are copied
|
||||
* **SiteInstance** - Uses the same SiteInstance as the original. This means the cloned WebContents will reuse the same render process as the original when loading same-origin pages, and only spawn a new render process for cross-origin navigations. This process allocation behavior is consistent with window.open and tab duplication in Chromium. For more details, see [Chromium's Site Isolation](https://www.chromium.org/developers/design-documents/site-isolation/) design document.
|
||||
* **Opener relationship** - Inherits the opener (window.opener) relationship
|
||||
* **Navigation state** - Copies the navigation history and controller state
|
||||
|
||||
The cloned WebContents is an independent instance with its own lifecycle that can be destroyed separately and will not contain any open web pages.
|
||||
|
||||
This API is useful for use cases where you want to create a new WebContents that shares the same render process with the original for same-origin content, while maintaining full lifecycle independence. Additionally, reusing the existing render process can help optimize memory usage and page load speed to a certain extent, as it eliminates the overhead of spawning and initializing a new render process from scratch.
|
||||
|
||||
#### `contents.takeHeapSnapshot(filePath)`
|
||||
|
||||
* `filePath` string - Path to the output file.
|
||||
|
||||
@@ -14,6 +14,17 @@ This document uses the following convention to categorize breaking changes:
|
||||
|
||||
## Planned Breaking API Changes (43.0)
|
||||
|
||||
### Behavior Changed: `chrome.scripting` CSS injection matches more fallback frames
|
||||
|
||||
Extensions using `chrome.scripting.insertCSS()` or `chrome.scripting.removeCSS()`
|
||||
now follow Chrome's behavior when Electron cannot match a frame's URL directly,
|
||||
such as with `about:blank` or `data:` frames. If the extension has access to the
|
||||
page that created the frame, CSS may now be inserted into or removed from those
|
||||
fallback frames as well.
|
||||
|
||||
Apps or extensions that relied on Electron skipping those frames should narrow their
|
||||
injection target, frame IDs, or match patterns.
|
||||
|
||||
### Behavior Changed: Dialog methods default to Downloads directory
|
||||
|
||||
The `defaultPath` option for the following methods now defaults to the user's Downloads folder (or their home directory if Downloads doesn't exist) when not explicitly provided:
|
||||
@@ -123,6 +134,12 @@ When a cookie is deleted, the change cause remains `explicit`.
|
||||
When the cookie being set is identical to an existing one (same name, domain, path, and value, with no actual changes), the change cause is `inserted-no-change-overwrite`.
|
||||
When the value of the cookie being set remains unchanged but some of its attributes are updated, such as the expiration attribute, the change cause will be `inserted-no-value-change-overwrite`.
|
||||
|
||||
### Deprecated: `showHiddenFiles` in Dialogs on Linux
|
||||
|
||||
This property will still be honored on macOS and Windows, but support on Linux
|
||||
will be removed in Electron 42. GTK intends for this to be a user choice rather
|
||||
than an app choice and has removed the API to do this programmatically.
|
||||
|
||||
## Planned Breaking API Changes (40.0)
|
||||
|
||||
### Deprecated: `clipboard` API access from renderer processes
|
||||
@@ -136,12 +153,6 @@ your preload script and expose it using the [contextBridge](https://www.electron
|
||||
Debug symbols for MacOS (dSYM) now use xz compression in order to handle larger file sizes. `dsym.zip` files are now
|
||||
`dsym.tar.xz` files. End users using debug symbols may need to update their zip utilities.
|
||||
|
||||
### Deprecated: `showHiddenFiles` in Dialogs on Linux
|
||||
|
||||
This property will still be honored on macOS and Windows, but support on Linux
|
||||
will be removed in Electron 42. GTK intends for this to be a user choice rather
|
||||
than an app choice and has removed the API to do this programmatically.
|
||||
|
||||
## Planned Breaking API Changes (39.0)
|
||||
|
||||
### Deprecated: `--host-rules` command line switch
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 46 KiB |
BIN
docs/images/viewing-heap-dumps.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
@@ -2,28 +2,53 @@
|
||||
|
||||
Electron frequently releases major versions alongside every other Chromium release.
|
||||
This document focuses on the release cadence and version support policy.
|
||||
For a more in-depth guide on our git branches and how Electron uses semantic versions,
|
||||
check out our [Electron Versioning](./electron-versioning.md) doc.
|
||||
|
||||
> [!TIP]
|
||||
> See the [Electron Versioning](./electron-versioning.md) document for more details
|
||||
> on how Electron is versioned.
|
||||
|
||||
## Timeline
|
||||
|
||||
[Electron's Release Schedule](https://releases.electronjs.org/schedule) lists a schedule of Electron major releases showing key milestones including alpha, beta, and stable release dates, as well as end-of-life dates and dependency versions.
|
||||
|
||||
:::info Official support dates may change
|
||||
> [!IMPORTANT]
|
||||
> Electron's official support policy is the latest 3 stable releases. Our stable
|
||||
> release and end-of-life dates are determined by Chromium, and may be subject to
|
||||
> change. While we try to keep our planned release and end-of-life dates frequently
|
||||
> updated here, future dates may change if affected by upstream scheduling changes,
|
||||
> and may not always be accurately reflected.
|
||||
>
|
||||
> See [Chromium's public release schedule](https://chromiumdash.appspot.com/schedule) for
|
||||
> definitive information about Chromium's scheduled release dates.
|
||||
|
||||
Electron's official support policy is the latest 3 stable releases. Our stable
|
||||
release and end-of-life dates are determined by Chromium, and may be subject to
|
||||
change. While we try to keep our planned release and end-of-life dates frequently
|
||||
updated here, future dates may change if affected by upstream scheduling changes,
|
||||
and may not always be accurately reflected.
|
||||
Electron's cadence between major version releases is 8 weeks long. Before each major
|
||||
version hits stable, it goes through a four-week **alpha** phase and a four-week
|
||||
**beta** phase.
|
||||
|
||||
See [Chromium's public release schedule](https://chromiumdash.appspot.com/schedule) for
|
||||
definitive information about Chromium's scheduled release dates.
|
||||
|
||||
:::
|
||||
```mermaid
|
||||
gantt
|
||||
title Electron release cycle
|
||||
dateFormat YYYY-MM-DD
|
||||
axisFormat Week %W
|
||||
todayMarker off
|
||||
section v41
|
||||
Alpha phase :a1, 2026-01-19, 4w
|
||||
M146 enters Chrome beta :milestone, bm1, after a1, 0d
|
||||
Beta phase :b1, after a1, 4w
|
||||
M146 enters Chrome stable :milestone, s1, after b1, 0d
|
||||
Supported until v44 release :active, after b1, 12w
|
||||
section v42
|
||||
Alpha phase :a2, after b1, 4w
|
||||
M148 enters Chrome beta :milestone, bm2, after a2, 0d
|
||||
Beta phase :b2, after a2, 4w
|
||||
M148 enters Chrome stable :milestone, s2, after b2, 0d
|
||||
Supported until v45 release :active, after b2, 4w
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
|
||||
* Alphas are generally less stable than beta releases. The cutoff between the two
|
||||
corresponds to when the underlying Chromium version enters Chrome's Beta channel.
|
||||
* The `-alpha.1`, `-beta.1`, and `stable` dates are our solid release dates.
|
||||
* We strive for weekly alpha/beta releases, but we often release more than scheduled.
|
||||
* All dates are our goals but there may be reasons for adjusting the stable deadline, such as security bugs.
|
||||
@@ -38,10 +63,11 @@ and may not always be accurately reflected.
|
||||
## Version support policy
|
||||
|
||||
The latest three _stable_ major versions are supported by the Electron team.
|
||||
For example, if the latest release is 6.1.x, then the 5.0.x as well
|
||||
as the 4.2.x series are supported. We only support the latest minor release
|
||||
|
||||
For example, if the latest release is 42.1.x, then the 41.0.x as well
|
||||
as the 40.2.x series are supported. We only support the latest minor release
|
||||
for each stable release series. This means that in the case of a security fix,
|
||||
6.1.x will receive the fix, but we will not release a new version of 6.0.x.
|
||||
42.1.x will receive the fix, but we will not release a new version of 42.0.x.
|
||||
|
||||
The latest stable release unilaterally receives all fixes from `main`,
|
||||
and the version prior to that receives the vast majority of those fixes
|
||||
@@ -50,11 +76,8 @@ only security fixes directly.
|
||||
|
||||
### Chromium version support
|
||||
|
||||
:::info Chromium release schedule
|
||||
|
||||
Chromium's public release schedule is [here](https://chromiumdash.appspot.com/schedule).
|
||||
|
||||
:::
|
||||
> [!TIP]
|
||||
> Chromium's public release schedule is [here](https://chromiumdash.appspot.com/schedule).
|
||||
|
||||
Electron targets Chromium even-number versions, releasing every 8 weeks in concert
|
||||
with Chromium's 4-week release schedule. For example, Electron 26 uses Chromium 116, while Electron 27 uses Chromium 118.
|
||||
@@ -82,3 +105,7 @@ and that number is reduced to two in major version 10, the three-argument versio
|
||||
continue to work until, at minimum, major version 12. Past the minimum two-version
|
||||
threshold, we will attempt to support backwards compatibility beyond two versions
|
||||
until the maintainers feel the maintenance burden is too high to continue doing so.
|
||||
|
||||
> [!TIP]
|
||||
> For a canonical list of breaking changes, see the [Breaking Changes](../breaking-changes.md)
|
||||
> document.
|
||||
|
||||
@@ -14,18 +14,6 @@ To update an existing project to use the latest stable version:
|
||||
npm install --save-dev electron@latest
|
||||
```
|
||||
|
||||
## Versioning scheme
|
||||
|
||||
There are several major changes from our 1.x strategy outlined below. Each change is intended to satisfy the needs and priorities of developers/maintainers and app developers.
|
||||
|
||||
1. Strict use of the [SemVer](#semver) spec
|
||||
2. Introduction of semver-compliant `-beta` tags
|
||||
3. Introduction of [conventional commit messages](https://conventionalcommits.org/)
|
||||
4. Well-defined stabilization branches
|
||||
5. The `main` branch is versionless; only stabilization branches contain version information
|
||||
|
||||
We will cover in detail how git branching works, how npm tagging works, what developers should expect to see, and how one can backport changes.
|
||||
|
||||
## SemVer
|
||||
|
||||
Below is a table explicitly mapping types of changes to their corresponding category of SemVer (e.g. Major, Minor, Patch).
|
||||
@@ -34,7 +22,7 @@ Below is a table explicitly mapping types of changes to their corresponding cate
|
||||
| ------------------------------- | ---------------------------------- | ----------------------------- |
|
||||
| Electron breaking API changes | Electron non-breaking API changes | Electron bug fixes |
|
||||
| Node.js major version updates | Node.js minor version updates | Node.js patch version updates |
|
||||
| Chromium version updates | | fix-related chromium patches |
|
||||
| Chromium version updates | | fix-related Chromium patches |
|
||||
|
||||
For more information, see the [Semantic Versioning 2.0.0](https://semver.org/) spec.
|
||||
|
||||
@@ -44,68 +32,189 @@ Note that most Chromium updates will be considered breaking. Fixes that can be b
|
||||
|
||||
Stabilization branches are branches that run parallel to `main`, taking in only cherry-picked commits that are related to security or stability. These branches are never merged back to `main`.
|
||||
|
||||

|
||||
|
||||
Since Electron 8, stabilization branches are always **major** version lines, and named against the following template `$MAJOR-x-y` e.g. `8-x-y`. Prior to that we used **minor** version lines and named them as `$MAJOR-$MINOR-x` e.g. `2-0-x`.
|
||||
|
||||
We allow for multiple stabilization branches to exist simultaneously, one for each supported version. For more details on which versions are supported, see our [Electron Releases](./electron-timelines.md) doc.
|
||||
|
||||

|
||||
|
||||
Older lines will not be supported by the Electron project, but other groups can take ownership and backport stability and security fixes on their own. We discourage this, but recognize that it makes life easier for many app developers.
|
||||
|
||||
## Beta releases and bug fixes
|
||||
|
||||
Developers want to know which releases are _safe_ to use. Even seemingly innocent features can introduce regressions in complex applications. At the same time, locking to a fixed version is dangerous because you’re ignoring security patches and bug fixes that may have come out since your version. Our goal is to allow the following standard semver ranges in `package.json` :
|
||||
|
||||
* Use `~2.0.0` to admit only stability or security related fixes to your `2.0.0` release.
|
||||
* Use `^2.0.0` to admit non-breaking _reasonably stable_ feature work as well as security and bug fixes.
|
||||
|
||||
What’s important about the second point is that apps using `^` should still be able to expect a reasonable level of stability. To accomplish this, SemVer allows for a _pre-release identifier_ to indicate a particular version is not yet _safe_ or _stable_.
|
||||
|
||||
Whatever you choose, you will periodically have to bump the version in your `package.json` as breaking changes are a fact of Chromium life.
|
||||
|
||||
The process is as follows:
|
||||
|
||||
1. All new major and minor releases lines begin with a beta series indicated by SemVer prerelease tags of `beta.N`, e.g. `2.0.0-beta.1`. After the first beta, subsequent beta releases must meet all of the following conditions:
|
||||
1. The change is backwards API-compatible (deprecations are allowed)
|
||||
2. The risk to meeting our stability timeline must be low.
|
||||
2. If allowed changes need to be made once a release is beta, they are applied and the prerelease tag is incremented, e.g. `2.0.0-beta.2`.
|
||||
3. If a particular beta release is _generally regarded_ as stable, it will be re-released as a stable build, changing only the version information. e.g. `2.0.0`. After the first stable, all changes must be backwards-compatible bug or security fixes.
|
||||
4. If future bug fixes or security patches need to be made once a release is stable, they are applied and the _patch_ version is incremented
|
||||
e.g. `2.0.1`.
|
||||
|
||||
Specifically, the above means:
|
||||
|
||||
1. Admitting non-breaking-API changes before Week 3 in the beta cycle is okay, even if those changes have the potential to cause moderate side-effects.
|
||||
2. Admitting feature-flagged changes, that do not otherwise alter existing code paths, at most points in the beta cycle is okay. Users can explicitly enable those flags in their apps.
|
||||
3. Admitting features of any sort after Week 3 in the beta cycle is 👎 without a very good reason.
|
||||
|
||||
For each major and minor bump, you should expect to see something like the following:
|
||||
|
||||
```plaintext
|
||||
2.0.0-beta.1
|
||||
2.0.0-beta.2
|
||||
2.0.0-beta.3
|
||||
2.0.0
|
||||
2.0.1
|
||||
2.0.2
|
||||
```mermaid
|
||||
gitGraph
|
||||
commit
|
||||
commit
|
||||
branch N-x-y
|
||||
checkout main
|
||||
commit id:"fix-1"
|
||||
checkout N-x-y
|
||||
cherry-pick id:"fix-1"
|
||||
checkout main
|
||||
commit id:"fix-2"
|
||||
checkout N-x-y
|
||||
cherry-pick id:"fix-2"
|
||||
checkout main
|
||||
commit
|
||||
commit
|
||||
```
|
||||
|
||||
An example lifecycle in pictures:
|
||||
Since Electron 8, stabilization branches are always **major** version lines, and named against the following template `$MAJOR-x-y` e.g. `8-x-y`. (Prior to that, we used **minor** version lines and named them as `$MAJOR-$MINOR-x` e.g. `2-0-x`.)
|
||||
|
||||
* A new release branch is created that includes the latest set of features. It is published as `2.0.0-beta.1`.
|
||||

|
||||
* A bug fix comes into master that can be backported to the release branch. The patch is applied, and a new beta is published as `2.0.0-beta.2`.
|
||||

|
||||
* The beta is considered _generally stable_ and it is published again as a non-beta under `2.0.0`.
|
||||

|
||||
* Later, a zero-day exploit is revealed and a fix is applied to master. We backport the fix to the `2-0-x` line and release `2.0.1`.
|
||||

|
||||
We allow for multiple stabilization branches to exist simultaneously, one for each supported version.
|
||||
|
||||
A few examples of how various SemVer ranges will pick up new releases:
|
||||
> [!TIP]
|
||||
> For more details on which versions are supported, see our [Electron Releases](./electron-timelines.md) doc.
|
||||
|
||||

|
||||
```mermaid
|
||||
gitGraph
|
||||
commit
|
||||
branch "41-x-y"
|
||||
checkout main
|
||||
commit
|
||||
commit
|
||||
commit id:"fix-a"
|
||||
checkout "41-x-y"
|
||||
cherry-pick id:"fix-a"
|
||||
checkout main
|
||||
commit
|
||||
commit id:"fix-b"
|
||||
checkout "41-x-y"
|
||||
cherry-pick id:"fix-b"
|
||||
checkout main
|
||||
commit
|
||||
branch "42-x-y"
|
||||
checkout main
|
||||
commit
|
||||
commit id:"fix-c"
|
||||
checkout "41-x-y"
|
||||
cherry-pick id:"fix-c"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"fix-c"
|
||||
checkout main
|
||||
commit
|
||||
commit id:"fix-d"
|
||||
checkout "41-x-y"
|
||||
cherry-pick id:"fix-d"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"fix-d"
|
||||
checkout main
|
||||
commit
|
||||
```
|
||||
|
||||
Older lines will not be supported by the Electron project.
|
||||
|
||||
## Release cycle
|
||||
|
||||
Electron follows an **8-week regular release cycle** where key milestones correspond to
|
||||
matching dates in the Chromium release cycle.
|
||||
|
||||
```mermaid
|
||||
gantt
|
||||
title Electron release cycle
|
||||
dateFormat YYYY-MM-DD
|
||||
axisFormat Week %W
|
||||
todayMarker off
|
||||
section v41
|
||||
Alpha phase :a1, 2026-01-19, 4w
|
||||
M146 enters Chrome beta :milestone, bm1, after a1, 0d
|
||||
Beta phase :b1, after a1, 4w
|
||||
M146 enters Chrome stable :milestone, s1, after b1, 0d
|
||||
Supported until v44 release :active, after b1, 12w
|
||||
section v42
|
||||
Alpha phase :a2, after b1, 4w
|
||||
M148 enters Chrome beta :milestone, bm2, after a2, 0d
|
||||
Beta phase :b2, after a2, 4w
|
||||
M148 enters Chrome stable :milestone, s2, after b2, 0d
|
||||
Supported until v45 release :active, after b2, 4w
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
When Electron 41 hits its stable release, the release line for Electron 42 is branched off of `main`.
|
||||
Its first alpha release is created with all the changes contained on `main`:
|
||||
|
||||
```mermaid
|
||||
gitGraph
|
||||
commit
|
||||
commit
|
||||
commit
|
||||
branch "42-x-y"
|
||||
checkout "42-x-y"
|
||||
commit tag:"v42.0.0-alpha.1"
|
||||
```
|
||||
|
||||
A bug fix comes into `main` that can be backported to the release branch. The patch is applied,
|
||||
and it is published in the next `v42.0.0-alpha.2` release.
|
||||
|
||||
```mermaid
|
||||
gitGraph
|
||||
commit
|
||||
commit
|
||||
commit
|
||||
branch "42-x-y"
|
||||
checkout "42-x-y"
|
||||
commit id:"42.0.0-alpha.1" tag:"v42.0.0-alpha.1"
|
||||
checkout "main"
|
||||
commit
|
||||
commit id:"fix-1"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"fix-1" tag:"v42.0.0-alpha.2"
|
||||
```
|
||||
|
||||
The version of Chromium that powers Electron 42 hits Chrome's beta channel. The `alpha` line is
|
||||
promoted to `beta`.
|
||||
|
||||
```mermaid
|
||||
gitGraph
|
||||
commit
|
||||
commit
|
||||
commit
|
||||
branch "42-x-y"
|
||||
checkout "42-x-y"
|
||||
commit id:"42.0.0-alpha.1" tag:"v42.0.0-alpha.1"
|
||||
checkout "main"
|
||||
commit
|
||||
commit id:"fix-1"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"fix-1" tag:"v42.0.0-alpha.2"
|
||||
checkout "main"
|
||||
commit
|
||||
commit
|
||||
commit id:"fix-2"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"fix-2" tag:"v42.0.0-beta.1"
|
||||
```
|
||||
|
||||
Beta releases continue weekly until Electron 42 is promoted to stable and the same cycle starts again
|
||||
with `43-x-y`. Later, a zero-day exploit is revealed and a fix is applied to `main`. We backport the
|
||||
fix to the `42-x-y` line and release `42.0.1`.
|
||||
|
||||
```mermaid
|
||||
gitGraph
|
||||
commit
|
||||
commit
|
||||
commit
|
||||
branch "42-x-y"
|
||||
checkout "42-x-y"
|
||||
commit id:"42.0.0-alpha.1" tag:"v42.0.0-alpha.1"
|
||||
checkout "main"
|
||||
commit
|
||||
commit id:"fix-1"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"fix-1" tag:"v42.0.0-alpha.2"
|
||||
checkout "main"
|
||||
commit
|
||||
commit
|
||||
commit id:"fix-2"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"fix-2" tag:"v42.0.0-beta.1"
|
||||
checkout "main"
|
||||
commit id:"fix-3"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"fix-3" tag:"v42.0.0"
|
||||
checkout "main"
|
||||
branch "43-x-y"
|
||||
checkout "43-x-y"
|
||||
commit id:"43.0.0-alpha.1" tag:"v43.0.0-alpha.1"
|
||||
checkout "main"
|
||||
commit id:"security-fix"
|
||||
checkout "42-x-y"
|
||||
cherry-pick id:"security-fix" tag:"v42.0.1"
|
||||
checkout "43-x-y"
|
||||
cherry-pick id:"security-fix" tag:"v43.0.0-alpha.2"
|
||||
```
|
||||
|
||||
### Backport request process
|
||||
|
||||
@@ -136,10 +245,11 @@ The `electron/electron` repository also enforces squash merging, so you only nee
|
||||
|
||||
## Versioned `main` branch
|
||||
|
||||
* The `main` branch will always contain the next major version `X.0.0-nightly.DATE` in its `package.json`.
|
||||
* The `main` branch always corresponds to the major version above the current pre-release line.
|
||||
* Unstable nightly releases of `main` are released under the [`electron-nightly`](https://www.npmjs.com/package/electron-nightly)
|
||||
package on npm.
|
||||
* Release branches are never merged back to `main`.
|
||||
* Release branches _do_ contain the correct version in their `package.json`.
|
||||
* As soon as a release branch is cut for a major, `main` must be bumped to the next major (i.e. `main` is always versioned as the next theoretical release branch).
|
||||
* All `package.json` values are fixed at `0.0.0-development`.
|
||||
|
||||
## Historical versioning (Electron 1.X)
|
||||
|
||||
@@ -147,6 +257,29 @@ Electron versions _< 2.0_ did not conform to the [SemVer](https://semver.org) sp
|
||||
|
||||
Here is an example of the 1.x strategy:
|
||||
|
||||

|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
gitGraph:
|
||||
mainBranchName: 'master'
|
||||
---
|
||||
gitGraph
|
||||
commit
|
||||
branch "bugfix-1"
|
||||
checkout "bugfix-1"
|
||||
commit
|
||||
checkout master
|
||||
merge "bugfix-1" tag:"1.8.1"
|
||||
branch "feature"
|
||||
checkout "feature"
|
||||
commit
|
||||
checkout master
|
||||
merge "feature" tag:"1.8.2"
|
||||
branch "bugfix-2"
|
||||
checkout "bugfix-2"
|
||||
commit
|
||||
checkout master
|
||||
merge "bugfix-2" tag:"1.8.3"
|
||||
```
|
||||
|
||||
An app developed with `1.8.1` cannot take the `1.8.3` bug fix without either absorbing the `1.8.2` feature, or by backporting the fix and maintaining a new release line.
|
||||
|
||||
@@ -25,6 +25,27 @@ included in the `electron` package:
|
||||
npx install-electron --no
|
||||
```
|
||||
|
||||
## Installing prereleases
|
||||
|
||||
Electron [distributes experimental releases of future major versions](./electron-timelines.md)
|
||||
via npm as well.
|
||||
|
||||
Nightly builds contain the latest changes from the `main` branch:
|
||||
|
||||
```sh
|
||||
npm install electron-nightly --save-dev
|
||||
```
|
||||
|
||||
Alpha and beta builds contain changes slated for the next major version:
|
||||
|
||||
```sh
|
||||
npm install electron@alpha --save-dev
|
||||
npm install electron@beta --save-dev
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> For more information on available Electron releases, see the [Release Status dashboard](https://releases.electronjs.org).
|
||||
|
||||
## Running Electron ad-hoc
|
||||
|
||||
If you're in a pinch and would prefer to not use `npm install` in your local
|
||||
|
||||
@@ -107,7 +107,7 @@ When signing the app with `@electron/osx-sign`, it will automatically add the
|
||||
necessary entitlements to your app's entitlements.
|
||||
|
||||
<details>
|
||||
<summary>Extra steps without `electron-osx-sign`</summary>
|
||||
<summary>Extra steps without `@electron/osx-sign`</summary>
|
||||
|
||||
If you are signing your app without using `@electron/osx-sign`, you must ensure
|
||||
the app bundle's entitlements have at least following keys:
|
||||
|
||||
@@ -91,6 +91,7 @@ auto_filenames = {
|
||||
"docs/api/structures/custom-scheme.md",
|
||||
"docs/api/structures/desktop-capturer-source.md",
|
||||
"docs/api/structures/display.md",
|
||||
"docs/api/structures/enable-heap-profiling-options.md",
|
||||
"docs/api/structures/extension-info.md",
|
||||
"docs/api/structures/extension.md",
|
||||
"docs/api/structures/file-filter.md",
|
||||
@@ -170,10 +171,349 @@ auto_filenames = {
|
||||
"docs/api/structures/web-preferences.md",
|
||||
"docs/api/structures/web-request-filter.md",
|
||||
"docs/api/structures/web-source.md",
|
||||
"docs/api/structures/webauthn-account.md",
|
||||
"docs/api/structures/window-open-handler-response.md",
|
||||
"docs/api/structures/window-session-end-event.md",
|
||||
]
|
||||
|
||||
node_header_sources = [
|
||||
"../third_party/electron_node/src/acorn_version.h",
|
||||
"../third_party/electron_node/src/aliased_buffer-inl.h",
|
||||
"../third_party/electron_node/src/aliased_buffer.h",
|
||||
"../third_party/electron_node/src/aliased_struct-inl.h",
|
||||
"../third_party/electron_node/src/aliased_struct.h",
|
||||
"../third_party/electron_node/src/amaro_version.h",
|
||||
"../third_party/electron_node/src/async_context_frame.h",
|
||||
"../third_party/electron_node/src/async_wrap-inl.h",
|
||||
"../third_party/electron_node/src/async_wrap.h",
|
||||
"../third_party/electron_node/src/base_object-inl.h",
|
||||
"../third_party/electron_node/src/base_object.h",
|
||||
"../third_party/electron_node/src/base_object_types.h",
|
||||
"../third_party/electron_node/src/blob_serializer_deserializer-inl.h",
|
||||
"../third_party/electron_node/src/blob_serializer_deserializer.h",
|
||||
"../third_party/electron_node/src/callback_queue-inl.h",
|
||||
"../third_party/electron_node/src/callback_queue.h",
|
||||
"../third_party/electron_node/src/cares_wrap.h",
|
||||
"../third_party/electron_node/src/cleanup_queue-inl.h",
|
||||
"../third_party/electron_node/src/cleanup_queue.h",
|
||||
"../third_party/electron_node/src/compile_cache.h",
|
||||
"../third_party/electron_node/src/connect_wrap.h",
|
||||
"../third_party/electron_node/src/connection_wrap.h",
|
||||
"../third_party/electron_node/src/cppgc_helpers-inl.h",
|
||||
"../third_party/electron_node/src/cppgc_helpers.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_aes.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_argon2.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_bio.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_chacha20_poly1305.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_cipher.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_clienthello-inl.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_clienthello.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_common.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_context.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_dh.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_dsa.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_ec.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_hash.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_hkdf.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_hmac.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_kem.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_keygen.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_keys.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_kmac.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_ml_dsa.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_pbkdf2.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_random.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_rsa.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_scrypt.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_sig.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_spkac.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_timing.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_tls.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_util.h",
|
||||
"../third_party/electron_node/src/crypto/crypto_x509.h",
|
||||
"../third_party/electron_node/src/dataqueue/queue.h",
|
||||
"../third_party/electron_node/src/debug_utils-inl.h",
|
||||
"../third_party/electron_node/src/debug_utils.h",
|
||||
"../third_party/electron_node/src/diagnosticfilename-inl.h",
|
||||
"../third_party/electron_node/src/embedded_data.h",
|
||||
"../third_party/electron_node/src/encoding_binding.h",
|
||||
"../third_party/electron_node/src/env-inl.h",
|
||||
"../third_party/electron_node/src/env.h",
|
||||
"../third_party/electron_node/src/env_properties.h",
|
||||
"../third_party/electron_node/src/handle_wrap.h",
|
||||
"../third_party/electron_node/src/histogram-inl.h",
|
||||
"../third_party/electron_node/src/histogram.h",
|
||||
"../third_party/electron_node/src/inspector/io_agent.h",
|
||||
"../third_party/electron_node/src/inspector/main_thread_interface.h",
|
||||
"../third_party/electron_node/src/inspector/network_agent.h",
|
||||
"../third_party/electron_node/src/inspector/network_inspector.h",
|
||||
"../third_party/electron_node/src/inspector/network_requests_buffer.h",
|
||||
"../third_party/electron_node/src/inspector/network_resource_manager.h",
|
||||
"../third_party/electron_node/src/inspector/node_json.h",
|
||||
"../third_party/electron_node/src/inspector/node_string.h",
|
||||
"../third_party/electron_node/src/inspector/protocol_helper.h",
|
||||
"../third_party/electron_node/src/inspector/runtime_agent.h",
|
||||
"../third_party/electron_node/src/inspector/target_agent.h",
|
||||
"../third_party/electron_node/src/inspector/tracing_agent.h",
|
||||
"../third_party/electron_node/src/inspector/worker_agent.h",
|
||||
"../third_party/electron_node/src/inspector/worker_inspector.h",
|
||||
"../third_party/electron_node/src/inspector_agent.h",
|
||||
"../third_party/electron_node/src/inspector_io.h",
|
||||
"../third_party/electron_node/src/inspector_profiler.h",
|
||||
"../third_party/electron_node/src/inspector_socket.h",
|
||||
"../third_party/electron_node/src/inspector_socket_server.h",
|
||||
"../third_party/electron_node/src/js_native_api.h",
|
||||
"../third_party/electron_node/src/js_native_api_types.h",
|
||||
"../third_party/electron_node/src/js_native_api_v8.h",
|
||||
"../third_party/electron_node/src/js_native_api_v8_internals.h",
|
||||
"../third_party/electron_node/src/js_stream.h",
|
||||
"../third_party/electron_node/src/json_utils.h",
|
||||
"../third_party/electron_node/src/large_pages/node_large_page.h",
|
||||
"../third_party/electron_node/src/lru_cache-inl.h",
|
||||
"../third_party/electron_node/src/memory_tracker-inl.h",
|
||||
"../third_party/electron_node/src/memory_tracker.h",
|
||||
"../third_party/electron_node/src/module_wrap.h",
|
||||
"../third_party/electron_node/src/node.h",
|
||||
"../third_party/electron_node/src/node_api.h",
|
||||
"../third_party/electron_node/src/node_api_internals.h",
|
||||
"../third_party/electron_node/src/node_api_types.h",
|
||||
"../third_party/electron_node/src/node_binding.h",
|
||||
"../third_party/electron_node/src/node_blob.h",
|
||||
"../third_party/electron_node/src/node_bob-inl.h",
|
||||
"../third_party/electron_node/src/node_bob.h",
|
||||
"../third_party/electron_node/src/node_buffer.h",
|
||||
"../third_party/electron_node/src/node_builtins.h",
|
||||
"../third_party/electron_node/src/node_config_file.h",
|
||||
"../third_party/electron_node/src/node_constants.h",
|
||||
"../third_party/electron_node/src/node_context_data.h",
|
||||
"../third_party/electron_node/src/node_contextify.h",
|
||||
"../third_party/electron_node/src/node_crypto.h",
|
||||
"../third_party/electron_node/src/node_debug.h",
|
||||
"../third_party/electron_node/src/node_dir.h",
|
||||
"../third_party/electron_node/src/node_dotenv.h",
|
||||
"../third_party/electron_node/src/node_errors.h",
|
||||
"../third_party/electron_node/src/node_exit_code.h",
|
||||
"../third_party/electron_node/src/node_external_reference.h",
|
||||
"../third_party/electron_node/src/node_file-inl.h",
|
||||
"../third_party/electron_node/src/node_file.h",
|
||||
"../third_party/electron_node/src/node_http2.h",
|
||||
"../third_party/electron_node/src/node_http2_state.h",
|
||||
"../third_party/electron_node/src/node_http_common-inl.h",
|
||||
"../third_party/electron_node/src/node_http_common.h",
|
||||
"../third_party/electron_node/src/node_i18n.h",
|
||||
"../third_party/electron_node/src/node_internals.h",
|
||||
"../third_party/electron_node/src/node_locks.h",
|
||||
"../third_party/electron_node/src/node_main_instance.h",
|
||||
"../third_party/electron_node/src/node_mem-inl.h",
|
||||
"../third_party/electron_node/src/node_mem.h",
|
||||
"../third_party/electron_node/src/node_messaging.h",
|
||||
"../third_party/electron_node/src/node_metadata.h",
|
||||
"../third_party/electron_node/src/node_modules.h",
|
||||
"../third_party/electron_node/src/node_mutex.h",
|
||||
"../third_party/electron_node/src/node_object_wrap.h",
|
||||
"../third_party/electron_node/src/node_options-inl.h",
|
||||
"../third_party/electron_node/src/node_options.h",
|
||||
"../third_party/electron_node/src/node_perf.h",
|
||||
"../third_party/electron_node/src/node_perf_common.h",
|
||||
"../third_party/electron_node/src/node_platform.h",
|
||||
"../third_party/electron_node/src/node_process-inl.h",
|
||||
"../third_party/electron_node/src/node_process.h",
|
||||
"../third_party/electron_node/src/node_realm-inl.h",
|
||||
"../third_party/electron_node/src/node_realm.h",
|
||||
"../third_party/electron_node/src/node_report.h",
|
||||
"../third_party/electron_node/src/node_revert.h",
|
||||
"../third_party/electron_node/src/node_root_certs.h",
|
||||
"../third_party/electron_node/src/node_sea.h",
|
||||
"../third_party/electron_node/src/node_shadow_realm.h",
|
||||
"../third_party/electron_node/src/node_snapshot_builder.h",
|
||||
"../third_party/electron_node/src/node_snapshotable.h",
|
||||
"../third_party/electron_node/src/node_sockaddr-inl.h",
|
||||
"../third_party/electron_node/src/node_sockaddr.h",
|
||||
"../third_party/electron_node/src/node_sqlite.h",
|
||||
"../third_party/electron_node/src/node_stat_watcher.h",
|
||||
"../third_party/electron_node/src/node_task_runner.h",
|
||||
"../third_party/electron_node/src/node_threadsafe_cow-inl.h",
|
||||
"../third_party/electron_node/src/node_threadsafe_cow.h",
|
||||
"../third_party/electron_node/src/node_union_bytes.h",
|
||||
"../third_party/electron_node/src/node_url.h",
|
||||
"../third_party/electron_node/src/node_url_pattern.h",
|
||||
"../third_party/electron_node/src/node_v8.h",
|
||||
"../third_party/electron_node/src/node_v8_platform-inl.h",
|
||||
"../third_party/electron_node/src/node_version.h",
|
||||
"../third_party/electron_node/src/node_wasi.h",
|
||||
"../third_party/electron_node/src/node_wasm_web_api.h",
|
||||
"../third_party/electron_node/src/node_watchdog.h",
|
||||
"../third_party/electron_node/src/node_webstorage.h",
|
||||
"../third_party/electron_node/src/node_worker.h",
|
||||
"../third_party/electron_node/src/path.h",
|
||||
"../third_party/electron_node/src/permission/addon_permission.h",
|
||||
"../third_party/electron_node/src/permission/child_process_permission.h",
|
||||
"../third_party/electron_node/src/permission/fs_permission.h",
|
||||
"../third_party/electron_node/src/permission/inspector_permission.h",
|
||||
"../third_party/electron_node/src/permission/permission.h",
|
||||
"../third_party/electron_node/src/permission/permission_base.h",
|
||||
"../third_party/electron_node/src/permission/wasi_permission.h",
|
||||
"../third_party/electron_node/src/permission/worker_permission.h",
|
||||
"../third_party/electron_node/src/pipe_wrap.h",
|
||||
"../third_party/electron_node/src/quic/application.h",
|
||||
"../third_party/electron_node/src/quic/bindingdata.h",
|
||||
"../third_party/electron_node/src/quic/cid.h",
|
||||
"../third_party/electron_node/src/quic/data.h",
|
||||
"../third_party/electron_node/src/quic/defs.h",
|
||||
"../third_party/electron_node/src/quic/endpoint.h",
|
||||
"../third_party/electron_node/src/quic/http3.h",
|
||||
"../third_party/electron_node/src/quic/logstream.h",
|
||||
"../third_party/electron_node/src/quic/packet.h",
|
||||
"../third_party/electron_node/src/quic/preferredaddress.h",
|
||||
"../third_party/electron_node/src/quic/session.h",
|
||||
"../third_party/electron_node/src/quic/sessionticket.h",
|
||||
"../third_party/electron_node/src/quic/streams.h",
|
||||
"../third_party/electron_node/src/quic/tlscontext.h",
|
||||
"../third_party/electron_node/src/quic/tokens.h",
|
||||
"../third_party/electron_node/src/quic/transportparams.h",
|
||||
"../third_party/electron_node/src/req_wrap-inl.h",
|
||||
"../third_party/electron_node/src/req_wrap.h",
|
||||
"../third_party/electron_node/src/spawn_sync.h",
|
||||
"../third_party/electron_node/src/stream_base-inl.h",
|
||||
"../third_party/electron_node/src/stream_base.h",
|
||||
"../third_party/electron_node/src/stream_pipe.h",
|
||||
"../third_party/electron_node/src/stream_wrap.h",
|
||||
"../third_party/electron_node/src/string_bytes.h",
|
||||
"../third_party/electron_node/src/string_decoder-inl.h",
|
||||
"../third_party/electron_node/src/string_decoder.h",
|
||||
"../third_party/electron_node/src/tcp_wrap.h",
|
||||
"../third_party/electron_node/src/threadpoolwork-inl.h",
|
||||
"../third_party/electron_node/src/timer_wrap-inl.h",
|
||||
"../third_party/electron_node/src/timer_wrap.h",
|
||||
"../third_party/electron_node/src/timers.h",
|
||||
"../third_party/electron_node/src/tracing/agent.h",
|
||||
"../third_party/electron_node/src/tracing/node_trace_buffer.h",
|
||||
"../third_party/electron_node/src/tracing/node_trace_writer.h",
|
||||
"../third_party/electron_node/src/tracing/trace_categories.h",
|
||||
"../third_party/electron_node/src/tracing/trace_event.h",
|
||||
"../third_party/electron_node/src/tracing/trace_event_common.h",
|
||||
"../third_party/electron_node/src/tracing/traced_value.h",
|
||||
"../third_party/electron_node/src/tty_wrap.h",
|
||||
"../third_party/electron_node/src/udp_wrap.h",
|
||||
"../third_party/electron_node/src/undici_version.h",
|
||||
"../third_party/electron_node/src/util-inl.h",
|
||||
"../third_party/electron_node/src/util.h",
|
||||
"../third_party/electron_node/src/zlib_version.h",
|
||||
"../third_party/electron_node/tools/install.py",
|
||||
"../v8/include/cppgc/allocation.h",
|
||||
"../v8/include/cppgc/common.h",
|
||||
"../v8/include/cppgc/cross-thread-persistent.h",
|
||||
"../v8/include/cppgc/custom-space.h",
|
||||
"../v8/include/cppgc/default-platform.h",
|
||||
"../v8/include/cppgc/explicit-management.h",
|
||||
"../v8/include/cppgc/garbage-collected.h",
|
||||
"../v8/include/cppgc/heap-consistency.h",
|
||||
"../v8/include/cppgc/heap-handle.h",
|
||||
"../v8/include/cppgc/heap-state.h",
|
||||
"../v8/include/cppgc/heap-statistics.h",
|
||||
"../v8/include/cppgc/heap.h",
|
||||
"../v8/include/cppgc/internal/api-constants.h",
|
||||
"../v8/include/cppgc/internal/atomic-entry-flag.h",
|
||||
"../v8/include/cppgc/internal/base-page-handle.h",
|
||||
"../v8/include/cppgc/internal/caged-heap-local-data.h",
|
||||
"../v8/include/cppgc/internal/caged-heap.h",
|
||||
"../v8/include/cppgc/internal/compiler-specific.h",
|
||||
"../v8/include/cppgc/internal/conditional-stack-allocated.h",
|
||||
"../v8/include/cppgc/internal/finalizer-trait.h",
|
||||
"../v8/include/cppgc/internal/gc-info.h",
|
||||
"../v8/include/cppgc/internal/logging.h",
|
||||
"../v8/include/cppgc/internal/member-storage.h",
|
||||
"../v8/include/cppgc/internal/name-trait.h",
|
||||
"../v8/include/cppgc/internal/persistent-node.h",
|
||||
"../v8/include/cppgc/internal/pointer-policies.h",
|
||||
"../v8/include/cppgc/internal/write-barrier.h",
|
||||
"../v8/include/cppgc/liveness-broker.h",
|
||||
"../v8/include/cppgc/macros.h",
|
||||
"../v8/include/cppgc/member.h",
|
||||
"../v8/include/cppgc/name-provider.h",
|
||||
"../v8/include/cppgc/object-size-trait.h",
|
||||
"../v8/include/cppgc/persistent.h",
|
||||
"../v8/include/cppgc/platform.h",
|
||||
"../v8/include/cppgc/prefinalizer.h",
|
||||
"../v8/include/cppgc/process-heap-statistics.h",
|
||||
"../v8/include/cppgc/sentinel-pointer.h",
|
||||
"../v8/include/cppgc/source-location.h",
|
||||
"../v8/include/cppgc/tagged-member.h",
|
||||
"../v8/include/cppgc/testing.h",
|
||||
"../v8/include/cppgc/trace-trait.h",
|
||||
"../v8/include/cppgc/type-traits.h",
|
||||
"../v8/include/cppgc/visitor.h",
|
||||
"../v8/include/libplatform/libplatform-export.h",
|
||||
"../v8/include/libplatform/libplatform.h",
|
||||
"../v8/include/libplatform/v8-tracing.h",
|
||||
"../v8/include/v8-array-buffer.h",
|
||||
"../v8/include/v8-callbacks.h",
|
||||
"../v8/include/v8-container.h",
|
||||
"../v8/include/v8-context.h",
|
||||
"../v8/include/v8-cpp-heap-external.h",
|
||||
"../v8/include/v8-cppgc.h",
|
||||
"../v8/include/v8-data.h",
|
||||
"../v8/include/v8-date.h",
|
||||
"../v8/include/v8-debug.h",
|
||||
"../v8/include/v8-embedder-heap.h",
|
||||
"../v8/include/v8-embedder-state-scope.h",
|
||||
"../v8/include/v8-exception.h",
|
||||
"../v8/include/v8-extension.h",
|
||||
"../v8/include/v8-external-memory-accounter.h",
|
||||
"../v8/include/v8-external.h",
|
||||
"../v8/include/v8-fast-api-calls.h",
|
||||
"../v8/include/v8-forward.h",
|
||||
"../v8/include/v8-function-callback.h",
|
||||
"../v8/include/v8-function.h",
|
||||
"../v8/include/v8-handle-base.h",
|
||||
"../v8/include/v8-initialization.h",
|
||||
"../v8/include/v8-inspector-protocol.h",
|
||||
"../v8/include/v8-inspector.h",
|
||||
"../v8/include/v8-internal.h",
|
||||
"../v8/include/v8-isolate.h",
|
||||
"../v8/include/v8-json.h",
|
||||
"../v8/include/v8-local-handle.h",
|
||||
"../v8/include/v8-locker.h",
|
||||
"../v8/include/v8-maybe.h",
|
||||
"../v8/include/v8-memory-span.h",
|
||||
"../v8/include/v8-message.h",
|
||||
"../v8/include/v8-metrics.h",
|
||||
"../v8/include/v8-microtask-queue.h",
|
||||
"../v8/include/v8-microtask.h",
|
||||
"../v8/include/v8-object.h",
|
||||
"../v8/include/v8-persistent-handle.h",
|
||||
"../v8/include/v8-platform.h",
|
||||
"../v8/include/v8-primitive-object.h",
|
||||
"../v8/include/v8-primitive.h",
|
||||
"../v8/include/v8-profiler.h",
|
||||
"../v8/include/v8-promise.h",
|
||||
"../v8/include/v8-proxy.h",
|
||||
"../v8/include/v8-regexp.h",
|
||||
"../v8/include/v8-sandbox.h",
|
||||
"../v8/include/v8-script.h",
|
||||
"../v8/include/v8-snapshot.h",
|
||||
"../v8/include/v8-source-location.h",
|
||||
"../v8/include/v8-statistics.h",
|
||||
"../v8/include/v8-template.h",
|
||||
"../v8/include/v8-trace-categories.h",
|
||||
"../v8/include/v8-traced-handle.h",
|
||||
"../v8/include/v8-typed-array.h",
|
||||
"../v8/include/v8-unwinder-state.h",
|
||||
"../v8/include/v8-unwinder.h",
|
||||
"../v8/include/v8-util.h",
|
||||
"../v8/include/v8-value-serializer-version.h",
|
||||
"../v8/include/v8-value-serializer.h",
|
||||
"../v8/include/v8-value.h",
|
||||
"../v8/include/v8-version-string.h",
|
||||
"../v8/include/v8-version.h",
|
||||
"../v8/include/v8-wasm-trap-handler-posix.h",
|
||||
"../v8/include/v8-wasm-trap-handler-win.h",
|
||||
"../v8/include/v8-wasm.h",
|
||||
"../v8/include/v8-weak-callback-info.h",
|
||||
"../v8/include/v8.h",
|
||||
"../v8/include/v8config.h",
|
||||
]
|
||||
|
||||
sandbox_bundle_deps = [
|
||||
"lib/common/api/native-image.ts",
|
||||
"lib/common/define-properties.ts",
|
||||
|
||||
@@ -48,8 +48,8 @@ filenames = {
|
||||
"shell/browser/ui/views/opaque_frame_view.h",
|
||||
"shell/browser/ui/views/caption_button_placeholder_container.cc",
|
||||
"shell/browser/ui/views/caption_button_placeholder_container.h",
|
||||
"shell/browser/ui/views/client_frame_view_linux.cc",
|
||||
"shell/browser/ui/views/client_frame_view_linux.h",
|
||||
"shell/browser/ui/views/native_frame_view_linux.cc",
|
||||
"shell/browser/ui/views/native_frame_view_linux.h",
|
||||
"shell/browser/ui/views/linux_frame_layout.cc",
|
||||
"shell/browser/ui/views/linux_frame_layout.h",
|
||||
"shell/common/application_info_linux.cc",
|
||||
@@ -432,12 +432,14 @@ filenames = {
|
||||
"shell/browser/media/media_capture_devices_dispatcher.h",
|
||||
"shell/browser/media/media_device_id_salt.cc",
|
||||
"shell/browser/media/media_device_id_salt.h",
|
||||
"shell/browser/metrics/electron_metrics_log_uploader.cc",
|
||||
"shell/browser/metrics/electron_metrics_log_uploader.h",
|
||||
"shell/browser/metrics/electron_metrics_service_client.cc",
|
||||
"shell/browser/metrics/electron_metrics_service_client.h",
|
||||
"shell/browser/microtasks_runner.cc",
|
||||
"shell/browser/microtasks_runner.h",
|
||||
"shell/browser/native_window.cc",
|
||||
"shell/browser/native_window.h",
|
||||
"shell/browser/native_window_features.cc",
|
||||
"shell/browser/native_window_features.h",
|
||||
"shell/browser/native_window_observer.h",
|
||||
"shell/browser/net/asar/asar_file_validator.cc",
|
||||
"shell/browser/net/asar/asar_file_validator.h",
|
||||
@@ -508,6 +510,10 @@ filenames = {
|
||||
"shell/browser/session_preferences.h",
|
||||
"shell/browser/special_storage_policy.cc",
|
||||
"shell/browser/special_storage_policy.h",
|
||||
"shell/browser/tracing/electron_background_tracing_metrics_provider.cc",
|
||||
"shell/browser/tracing/electron_background_tracing_metrics_provider.h",
|
||||
"shell/browser/tracing/electron_tracing_delegate.cc",
|
||||
"shell/browser/tracing/electron_tracing_delegate.h",
|
||||
"shell/browser/ui/accelerator_util.cc",
|
||||
"shell/browser/ui/accelerator_util.h",
|
||||
"shell/browser/ui/autofill_popup.cc",
|
||||
@@ -558,6 +564,8 @@ filenames = {
|
||||
"shell/browser/web_view_guest_delegate.h",
|
||||
"shell/browser/web_view_manager.cc",
|
||||
"shell/browser/web_view_manager.h",
|
||||
"shell/browser/webauthn/electron_authenticator_request_client_delegate.cc",
|
||||
"shell/browser/webauthn/electron_authenticator_request_client_delegate.h",
|
||||
"shell/browser/webauthn/electron_authenticator_request_delegate.cc",
|
||||
"shell/browser/webauthn/electron_authenticator_request_delegate.h",
|
||||
"shell/browser/window_list.cc",
|
||||
@@ -766,8 +774,6 @@ filenames = {
|
||||
"shell/browser/extensions/api/resources_private/resources_private_api.h",
|
||||
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc",
|
||||
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h",
|
||||
"shell/browser/extensions/api/scripting/scripting_api.cc",
|
||||
"shell/browser/extensions/api/scripting/scripting_api.h",
|
||||
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
|
||||
"shell/browser/extensions/api/streams_private/streams_private_api.h",
|
||||
"shell/browser/extensions/api/tabs/tabs_api.cc",
|
||||
|
||||
@@ -158,6 +158,8 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__algorithm/ranges_set_intersection.h",
|
||||
"//third_party/libc++/src/include/__algorithm/ranges_set_symmetric_difference.h",
|
||||
"//third_party/libc++/src/include/__algorithm/ranges_set_union.h",
|
||||
"//third_party/libc++/src/include/__algorithm/ranges_shift_left.h",
|
||||
"//third_party/libc++/src/include/__algorithm/ranges_shift_right.h",
|
||||
"//third_party/libc++/src/include/__algorithm/ranges_shuffle.h",
|
||||
"//third_party/libc++/src/include/__algorithm/ranges_sort.h",
|
||||
"//third_party/libc++/src/include/__algorithm/ranges_sort_heap.h",
|
||||
@@ -215,6 +217,8 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__atomic/atomic_lock_free.h",
|
||||
"//third_party/libc++/src/include/__atomic/atomic_ref.h",
|
||||
"//third_party/libc++/src/include/__atomic/atomic_sync.h",
|
||||
"//third_party/libc++/src/include/__atomic/atomic_sync_timed.h",
|
||||
"//third_party/libc++/src/include/__atomic/atomic_waitable_traits.h",
|
||||
"//third_party/libc++/src/include/__atomic/check_memory_order.h",
|
||||
"//third_party/libc++/src/include/__atomic/contention_t.h",
|
||||
"//third_party/libc++/src/include/__atomic/fence.h",
|
||||
@@ -330,11 +334,14 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__config",
|
||||
"//third_party/libc++/src/include/__config_site.in",
|
||||
"//third_party/libc++/src/include/__configuration/abi.h",
|
||||
"//third_party/libc++/src/include/__configuration/attributes.h",
|
||||
"//third_party/libc++/src/include/__configuration/availability.h",
|
||||
"//third_party/libc++/src/include/__configuration/compiler.h",
|
||||
"//third_party/libc++/src/include/__configuration/diagnostic_suppression.h",
|
||||
"//third_party/libc++/src/include/__configuration/experimental.h",
|
||||
"//third_party/libc++/src/include/__configuration/hardening.h",
|
||||
"//third_party/libc++/src/include/__configuration/language.h",
|
||||
"//third_party/libc++/src/include/__configuration/namespace.h",
|
||||
"//third_party/libc++/src/include/__configuration/platform.h",
|
||||
"//third_party/libc++/src/include/__coroutine/coroutine_handle.h",
|
||||
"//third_party/libc++/src/include/__coroutine/coroutine_traits.h",
|
||||
@@ -975,6 +982,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__format/format_to_n_result.h",
|
||||
"//third_party/libc++/src/include/__format/formatter.h",
|
||||
"//third_party/libc++/src/include/__format/formatter_bool.h",
|
||||
"//third_party/libc++/src/include/__format/formatter_bool_impl.h",
|
||||
"//third_party/libc++/src/include/__format/formatter_char.h",
|
||||
"//third_party/libc++/src/include/__format/formatter_floating_point.h",
|
||||
"//third_party/libc++/src/include/__format/formatter_integer.h",
|
||||
@@ -1052,6 +1060,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__iterator/aliasing_iterator.h",
|
||||
"//third_party/libc++/src/include/__iterator/back_insert_iterator.h",
|
||||
"//third_party/libc++/src/include/__iterator/bounded_iter.h",
|
||||
"//third_party/libc++/src/include/__iterator/capacity_aware_iterator.h",
|
||||
"//third_party/libc++/src/include/__iterator/common_iterator.h",
|
||||
"//third_party/libc++/src/include/__iterator/concepts.h",
|
||||
"//third_party/libc++/src/include/__iterator/counted_iterator.h",
|
||||
@@ -1182,6 +1191,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__memory/unique_temporary_buffer.h",
|
||||
"//third_party/libc++/src/include/__memory/uses_allocator.h",
|
||||
"//third_party/libc++/src/include/__memory/uses_allocator_construction.h",
|
||||
"//third_party/libc++/src/include/__memory/valid_range.h",
|
||||
"//third_party/libc++/src/include/__memory_resource/memory_resource.h",
|
||||
"//third_party/libc++/src/include/__memory_resource/monotonic_buffer_resource.h",
|
||||
"//third_party/libc++/src/include/__memory_resource/polymorphic_allocator.h",
|
||||
@@ -1297,6 +1307,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__ranges/empty_view.h",
|
||||
"//third_party/libc++/src/include/__ranges/enable_borrowed_range.h",
|
||||
"//third_party/libc++/src/include/__ranges/enable_view.h",
|
||||
"//third_party/libc++/src/include/__ranges/enumerate_view.h",
|
||||
"//third_party/libc++/src/include/__ranges/filter_view.h",
|
||||
"//third_party/libc++/src/include/__ranges/from_range.h",
|
||||
"//third_party/libc++/src/include/__ranges/iota_view.h",
|
||||
@@ -1316,6 +1327,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__ranges/single_view.h",
|
||||
"//third_party/libc++/src/include/__ranges/size.h",
|
||||
"//third_party/libc++/src/include/__ranges/split_view.h",
|
||||
"//third_party/libc++/src/include/__ranges/stride_view.h",
|
||||
"//third_party/libc++/src/include/__ranges/subrange.h",
|
||||
"//third_party/libc++/src/include/__ranges/take_view.h",
|
||||
"//third_party/libc++/src/include/__ranges/take_while_view.h",
|
||||
@@ -1340,7 +1352,6 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__support/ibm/gettod_zos.h",
|
||||
"//third_party/libc++/src/include/__support/ibm/locale_mgmt_zos.h",
|
||||
"//third_party/libc++/src/include/__support/ibm/nanosleep.h",
|
||||
"//third_party/libc++/src/include/__support/xlocale/__nop_locale_mgmt.h",
|
||||
"//third_party/libc++/src/include/__support/xlocale/__posix_l_fallback.h",
|
||||
"//third_party/libc++/src/include/__support/xlocale/__strtonum_fallback.h",
|
||||
"//third_party/libc++/src/include/__system_error/errc.h",
|
||||
@@ -1494,6 +1505,7 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__utility/as_lvalue.h",
|
||||
"//third_party/libc++/src/include/__utility/auto_cast.h",
|
||||
"//third_party/libc++/src/include/__utility/cmp.h",
|
||||
"//third_party/libc++/src/include/__utility/constant_wrapper.h",
|
||||
"//third_party/libc++/src/include/__utility/convert_to_integral.h",
|
||||
"//third_party/libc++/src/include/__utility/declval.h",
|
||||
"//third_party/libc++/src/include/__utility/default_three_way_comparator.h",
|
||||
@@ -1506,7 +1518,6 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/__utility/in_place.h",
|
||||
"//third_party/libc++/src/include/__utility/integer_sequence.h",
|
||||
"//third_party/libc++/src/include/__utility/is_pointer_in_range.h",
|
||||
"//third_party/libc++/src/include/__utility/is_valid_range.h",
|
||||
"//third_party/libc++/src/include/__utility/lazy_synth_three_way_comparator.h",
|
||||
"//third_party/libc++/src/include/__utility/move.h",
|
||||
"//third_party/libc++/src/include/__utility/no_destroy.h",
|
||||
@@ -1602,7 +1613,6 @@ libcxx_headers = [
|
||||
"//third_party/libc++/src/include/filesystem",
|
||||
"//third_party/libc++/src/include/flat_map",
|
||||
"//third_party/libc++/src/include/flat_set",
|
||||
"//third_party/libc++/src/include/float.h",
|
||||
"//third_party/libc++/src/include/format",
|
||||
"//third_party/libc++/src/include/forward_list",
|
||||
"//third_party/libc++/src/include/fstream",
|
||||
|
||||
@@ -53,45 +53,50 @@ export async function getSources(args: Electron.SourcesOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
let resolveGetSources!: (value: ElectronInternal.GetSourcesResult[]) => void;
|
||||
let rejectGetSources!: (reason?: any) => void;
|
||||
|
||||
const getSources = new Promise<ElectronInternal.GetSourcesResult[]>((resolve, reject) => {
|
||||
let capturer: ElectronInternal.DesktopCapturer | null = createDesktopCapturer();
|
||||
resolveGetSources = resolve;
|
||||
rejectGetSources = reject;
|
||||
});
|
||||
|
||||
const stopRunning = () => {
|
||||
if (capturer) {
|
||||
delete capturer._onerror;
|
||||
delete capturer._onfinished;
|
||||
capturer = null;
|
||||
// Register in currentlyRunning BEFORE startHandling so that synchronous
|
||||
// completion (e.g. when no capturers are created) can properly clean up.
|
||||
currentlyRunning.push({ options, getSources });
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
for (const win of BrowserWindow.getAllWindows()) {
|
||||
if (resizableValues.has(win.id)) {
|
||||
win.resizable = resizableValues.get(win.id);
|
||||
}
|
||||
let capturer: ElectronInternal.DesktopCapturer | null = createDesktopCapturer();
|
||||
|
||||
const stopRunning = () => {
|
||||
if (capturer) {
|
||||
delete capturer._onerror;
|
||||
delete capturer._onfinished;
|
||||
capturer = null;
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
for (const win of BrowserWindow.getAllWindows()) {
|
||||
if (resizableValues.has(win.id)) {
|
||||
win.resizable = resizableValues.get(win.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Remove from currentlyRunning once we resolve or reject
|
||||
currentlyRunning = currentlyRunning.filter((running) => running.options !== options);
|
||||
};
|
||||
}
|
||||
// Remove from currentlyRunning once we resolve or reject
|
||||
currentlyRunning = currentlyRunning.filter((running) => running.options !== options);
|
||||
};
|
||||
|
||||
capturer._onerror = (error: string) => {
|
||||
stopRunning();
|
||||
// eslint-disable-next-line prefer-promise-reject-errors
|
||||
reject(error);
|
||||
};
|
||||
capturer._onerror = (error: string) => {
|
||||
stopRunning();
|
||||
// eslint-disable-next-line prefer-promise-reject-errors
|
||||
rejectGetSources(error);
|
||||
};
|
||||
|
||||
capturer._onfinished = (sources: Electron.DesktopCapturerSource[]) => {
|
||||
stopRunning();
|
||||
resolve(sources);
|
||||
};
|
||||
capturer._onfinished = (sources: Electron.DesktopCapturerSource[]) => {
|
||||
stopRunning();
|
||||
resolveGetSources(sources);
|
||||
};
|
||||
|
||||
capturer.startHandling(captureWindow, captureScreen, thumbnailSize, fetchWindowIcons);
|
||||
});
|
||||
|
||||
currentlyRunning.push({
|
||||
options,
|
||||
getSources
|
||||
});
|
||||
capturer.startHandling(captureWindow, captureScreen, thumbnailSize, fetchWindowIcons);
|
||||
|
||||
return getSources;
|
||||
}
|
||||
|
||||
@@ -1,2 +1,39 @@
|
||||
const { globalShortcut } = process._linkedBinding('electron_browser_global_shortcut');
|
||||
export default globalShortcut;
|
||||
const { createGlobalShortcut } = process._linkedBinding('electron_browser_global_shortcut');
|
||||
|
||||
let globalShortcut: Electron.GlobalShortcut;
|
||||
|
||||
const createGlobalShortcutIfNeeded = () => {
|
||||
if (globalShortcut === undefined) {
|
||||
globalShortcut = createGlobalShortcut();
|
||||
}
|
||||
};
|
||||
|
||||
export default new Proxy(
|
||||
{},
|
||||
{
|
||||
get: (_target, property: keyof Electron.GlobalShortcut) => {
|
||||
createGlobalShortcutIfNeeded();
|
||||
const value = globalShortcut[property];
|
||||
if (typeof value === 'function') {
|
||||
return value.bind(globalShortcut);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
set: (_target, property: string, value: unknown) => {
|
||||
createGlobalShortcutIfNeeded();
|
||||
return Reflect.set(globalShortcut, property, value);
|
||||
},
|
||||
ownKeys: () => {
|
||||
createGlobalShortcutIfNeeded();
|
||||
return Reflect.ownKeys(globalShortcut);
|
||||
},
|
||||
has: (_target, property: string) => {
|
||||
createGlobalShortcutIfNeeded();
|
||||
return property in globalShortcut;
|
||||
},
|
||||
getOwnPropertyDescriptor: (_target, property: string) => {
|
||||
createGlobalShortcutIfNeeded();
|
||||
return Reflect.getOwnPropertyDescriptor(globalShortcut, property);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -30,6 +30,7 @@ const MenuItem = function (this: any, options: any) {
|
||||
|
||||
this.overrideProperty('icon');
|
||||
this.overrideProperty('label', roles.getDefaultLabel(this.role));
|
||||
this.overrideProperty('accessibilityLabel', '');
|
||||
this.overrideProperty('sublabel', '');
|
||||
this.overrideProperty('toolTip', '');
|
||||
this.overrideProperty('enabled', true);
|
||||
|
||||
@@ -57,6 +57,10 @@ Menu.prototype._getLabelForCommandId = function (id) {
|
||||
return this.commandsMap[id]?.label ?? '';
|
||||
};
|
||||
|
||||
Menu.prototype._getAccessibilityLabelForCommandId = function (id) {
|
||||
return this.commandsMap[id]?.accessibilityLabel ?? '';
|
||||
};
|
||||
|
||||
Menu.prototype._getSecondaryLabelForCommandId = function (id) {
|
||||
return this.commandsMap[id]?.sublabel ?? '';
|
||||
};
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
const { createPair } = process._linkedBinding('electron_browser_message_port');
|
||||
|
||||
export default class MessageChannelMain extends EventEmitter implements Electron.MessageChannelMain {
|
||||
export default class MessageChannelMain implements Electron.MessageChannelMain {
|
||||
port1: MessagePortMain;
|
||||
port2: MessagePortMain;
|
||||
constructor() {
|
||||
super();
|
||||
const { port1, port2 } = createPair();
|
||||
this.port1 = new MessagePortMain(port1);
|
||||
this.port2 = new MessagePortMain(port2);
|
||||
|
||||
@@ -2,6 +2,7 @@ const binding = process._linkedBinding('electron_browser_notification');
|
||||
|
||||
const ElectronNotification = binding.Notification;
|
||||
ElectronNotification.isSupported = binding.isSupported;
|
||||
ElectronNotification.getHistory = binding.getHistory;
|
||||
|
||||
if (process.platform === 'win32' && binding.handleActivation) {
|
||||
ElectronNotification.handleActivation = binding.handleActivation;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { BrowserWindow, Menu, SharingItem, PopupOptions } from 'electron/main';
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
class ShareMenu extends EventEmitter implements Electron.ShareMenu {
|
||||
class ShareMenu implements Electron.ShareMenu {
|
||||
private menu: Menu;
|
||||
|
||||
constructor(sharingItem: SharingItem) {
|
||||
super();
|
||||
this.menu = new (Menu as any)({ sharingItem });
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ function parsePageSize(pageSize: string | ElectronInternal.PageSize) {
|
||||
|
||||
// Translate the options of printToPDF.
|
||||
|
||||
let pendingPromise: Promise<any> | undefined;
|
||||
const printToPDFQueues = new WeakMap<Electron.WebContents, Promise<unknown>>();
|
||||
WebContents.prototype.printToPDF = async function (options) {
|
||||
const margins = checkType(options.margins ?? {}, 'object', 'margins');
|
||||
const pageSize = parsePageSize(options.pageSize ?? 'letter');
|
||||
@@ -261,16 +261,19 @@ WebContents.prototype.printToPDF = async function (options) {
|
||||
...pageSize
|
||||
};
|
||||
|
||||
if (this._printToPDF) {
|
||||
if (pendingPromise) {
|
||||
pendingPromise = pendingPromise.then(() => this._printToPDF(printSettings));
|
||||
} else {
|
||||
pendingPromise = this._printToPDF(printSettings);
|
||||
}
|
||||
return pendingPromise;
|
||||
} else {
|
||||
if (!this._printToPDF) {
|
||||
throw new Error('Printing feature is disabled');
|
||||
}
|
||||
|
||||
const prev = printToPDFQueues.get(this) ?? Promise.resolve();
|
||||
const next = prev.catch(() => {}).then(() => this._printToPDF(printSettings));
|
||||
printToPDFQueues.set(this, next);
|
||||
next
|
||||
.finally(() => {
|
||||
if (printToPDFQueues.get(this) === next) printToPDFQueues.delete(this);
|
||||
})
|
||||
.catch(() => {});
|
||||
return next;
|
||||
};
|
||||
|
||||
// TODO(codebytere): deduplicate argument sanitization by moving rest of
|
||||
|
||||
@@ -56,7 +56,7 @@ export function removeFunction<T extends Function>(fn: T, removedName: string):
|
||||
const warn = warnOnce(`${fn.name} function`);
|
||||
return function (this: any) {
|
||||
warn();
|
||||
fn.apply(this, arguments);
|
||||
return fn.apply(this, arguments);
|
||||
} as unknown as typeof fn;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ function extractFile(zipPath) {
|
||||
}
|
||||
|
||||
function getPlatformPath() {
|
||||
const platform = process.env.npm_config_platform || os.platform();
|
||||
const platform = process.env.ELECTRON_INSTALL_PLATFORM || process.env.npm_config_platform || os.platform();
|
||||
|
||||
switch (platform) {
|
||||
case 'mas':
|
||||
|
||||
@@ -5,12 +5,22 @@
|
||||
"electron": "cli.js",
|
||||
"install-electron": "install.js"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"abi_version",
|
||||
"checksums.json",
|
||||
"cli.js",
|
||||
"electron.d.ts",
|
||||
"index.js",
|
||||
"install.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@electron/get": "^4.0.3",
|
||||
"@electron/get": "^5.0.0",
|
||||
"@types/node": "^24.9.0",
|
||||
"extract-zip": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12.20.55"
|
||||
"node": ">= 22.12.0"
|
||||
}
|
||||
}
|
||||
|
||||
10
package.json
@@ -8,6 +8,7 @@
|
||||
"@datadog/datadog-ci": "^5.9.1",
|
||||
"@electron/asar": "^4.0.1",
|
||||
"@electron/docs-parser": "^2.0.0",
|
||||
"@electron/fiddle-core": "^1.3.4",
|
||||
"@electron/github-app-auth": "^3.2.0",
|
||||
"@electron/lint-roller": "^3.2.0",
|
||||
"@electron/typescript-definitions": "^9.1.5",
|
||||
@@ -20,10 +21,12 @@
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/stream-json": "^1.7.8",
|
||||
"@types/temp": "^0.9.4",
|
||||
"@xmldom/xmldom": "^0.8.13",
|
||||
"buffer": "^6.0.3",
|
||||
"chalk": "^4.1.0",
|
||||
"check-for-leaks": "^1.2.1",
|
||||
"events": "^3.2.0",
|
||||
"folder-hash": "^4.1.2",
|
||||
"got": "^11.8.5",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.1.0",
|
||||
@@ -43,7 +46,6 @@
|
||||
"ts-node": "6.2.0",
|
||||
"typescript": "^5.8.3",
|
||||
"url": "^0.11.4",
|
||||
"vitest": "^4.1.2",
|
||||
"webpack": "^5.104.1",
|
||||
"webpack-cli": "^6.0.1",
|
||||
"wrapper-webpack-plugin": "^2.2.0",
|
||||
@@ -76,7 +78,7 @@
|
||||
"gn-typescript-definitions": "npm run create-typescript-definitions && node script/cp.mjs electron.d.ts",
|
||||
"pre-flight": "pre-flight",
|
||||
"gn-check": "node ./script/gn-check.js",
|
||||
"gn-format": "python3 script/run-gn-format.py",
|
||||
"gn-format": "node ./script/lint.js --gn --fix",
|
||||
"precommit": "lint-staged",
|
||||
"preinstall": "node -e 'process.exit(0)'",
|
||||
"pretest": "npm run create-typescript-definitions",
|
||||
@@ -84,7 +86,7 @@
|
||||
"prepare": "husky",
|
||||
"repl": "node ./script/start.js --interactive",
|
||||
"start": "node ./script/start.js",
|
||||
"test": "node ./spec/_vitest_runner/run.js",
|
||||
"test": "node ./script/spec-runner.js",
|
||||
"tsc": "tsc",
|
||||
"webpack": "webpack"
|
||||
},
|
||||
@@ -115,7 +117,7 @@
|
||||
],
|
||||
"*.{gn,gni}": [
|
||||
"npm run gn-check",
|
||||
"npm run gn-format"
|
||||
"node ./script/lint.js --gn --fix --only --"
|
||||
],
|
||||
"*.py": [
|
||||
"node script/lint.js --py --fix --only --"
|
||||
|
||||
@@ -12,6 +12,7 @@ boringssl_build_gn.patch
|
||||
gtk_visibility.patch
|
||||
resource_file_conflict.patch
|
||||
scroll_bounce_flag.patch
|
||||
revert_oscrypt_remove_sync_backend.patch
|
||||
mas_avoid_private_macos_api_usage.patch.patch
|
||||
add_didinstallconditionalfeatures.patch
|
||||
desktop_media_list.patch
|
||||
@@ -103,7 +104,6 @@ chore_remove_check_is_test_on_script_injection_tracker.patch
|
||||
fix_restore_original_resize_performance_on_macos.patch
|
||||
feat_allow_code_cache_in_custom_schemes.patch
|
||||
build_run_reclient_cfg_generator_after_chrome.patch
|
||||
fix_add_support_for_skipping_first_2_no-op_refreshes_in_thumb_cap.patch
|
||||
refactor_expose_file_system_access_blocklist.patch
|
||||
feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch
|
||||
feat_enable_passing_exit_code_on_service_process_crash.patch
|
||||
@@ -141,7 +141,6 @@ patch_osr_control_screen_info.patch
|
||||
refactor_allow_customizing_config_in_freedesktopsecretkeyprovider.patch
|
||||
fix_wayland_test_crash_on_teardown.patch
|
||||
fix_set_correct_app_id_on_linux.patch
|
||||
fix_pass_trigger_for_global_shortcuts_on_wayland.patch
|
||||
feat_plumb_node_integration_in_worker_through_workersettings.patch
|
||||
fix_restore_sdk_inputs_cross-toolchain_deps_for_macos.patch
|
||||
fix_use_fresh_lazynow_for_onendworkitemimpl_after_didruntask.patch
|
||||
@@ -150,4 +149,8 @@ fix_fire_menu_popup_start_for_dynamically_created_aria_menus.patch
|
||||
feat_allow_enabling_extensions_on_custom_protocols.patch
|
||||
fix_initialize_com_on_desktopmedialistcapturethread_on_windows.patch
|
||||
chore_register_node_as_a_dynamic_trace_category_prefix.patch
|
||||
gin_mark_argumentholder_as_cppgc_stack_allocated.patch
|
||||
fix_make_macos_text_replacement_work_on_contenteditable.patch
|
||||
fix_allow_reentrancy_on_downloadmanagerimpl_observer_list.patch
|
||||
build_gn_arg_to_support_linker_wrapper_script_on_windows.patch
|
||||
fix_use_bundled_devtools_frontend_url_for_remote_debugging.patch
|
||||
fix_constrain_allowuniversalaccessfromfileurls_to_file_origins_in.patch
|
||||
|
||||
@@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the
|
||||
context, which can cause some preload scripts to trip.
|
||||
|
||||
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
|
||||
index 3f8cf4edc7448e6b584adae8fcbb872d27377126..1d03dc809d4c18f24314d94811e0bf527aa7b5b4 100644
|
||||
index 2c07b4f604cfc06d5fbfb3f0969ee37ea2f9dc85..1b8541bfa56a7e53c8396c29ea45a0b5af89ef81 100644
|
||||
--- a/content/public/renderer/render_frame_observer.h
|
||||
+++ b/content/public/renderer/render_frame_observer.h
|
||||
@@ -141,6 +141,8 @@ class CONTENT_EXPORT RenderFrameObserver {
|
||||
@@ -23,10 +23,10 @@ index 3f8cf4edc7448e6b584adae8fcbb872d27377126..1d03dc809d4c18f24314d94811e0bf52
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index ab959e66f8841d7367863bb13d6c7a0854d0df23..5279ba15f45bd7634b5f24553ad64c0069318cc0 100644
|
||||
index d5c655a204e5faacfcbc7a127fd95e8f227860c7..2507db2a4b8fd5763f81e7c6ca7dbbb2af919aa8 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4733,6 +4733,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4736,6 +4736,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index ab959e66f8841d7367863bb13d6c7a0854d0df23..5279ba15f45bd7634b5f24553ad64c00
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index 1733f28e69b331b33f36084391f1d3ddb47c8e14..2ce05bce0a02338aba018c18f0a808a4eb392ff4 100644
|
||||
index c0961551b19c40f449da0922bcbad49bd7d70710..a6abdca5a4fd91afa7af007e4c595fe69bbf8821 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -607,6 +607,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -605,6 +605,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
void DidObserveLayoutShift(double score, bool after_input_or_scroll) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index 1733f28e69b331b33f36084391f1d3ddb47c8e14..2ce05bce0a02338aba018c18f0a808a4
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index 0f218d3f96f0c3a3a5773937e50ba9e8d7df0498..27b21f02d2dbfd60cb64f09be393b0e50928756f 100644
|
||||
index 7d3c4b9bc955873ad67e5ab00406d884d77d3f57..222278059beb1681c1d8e2a93e33279d4194227b 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -675,6 +675,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -670,6 +670,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -67,7 +67,7 @@ index 0f218d3f96f0c3a3a5773937e50ba9e8d7df0498..27b21f02d2dbfd60cb64f09be393b0e5
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index d293c49e6774de889fa9959234c82b41a4b1efe1..0787bc8a602c60e5b42933813baa6b9d923c9823 100644
|
||||
index a3f5649de4219168d5924b5a20ad84f59f16eecc..1316e7116c691030b3c764546c2f71fe61dde592 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -216,6 +216,7 @@ void LocalWindowProxy::Initialize() {
|
||||
@@ -79,10 +79,10 @@ index d293c49e6774de889fa9959234c82b41a4b1efe1..0787bc8a602c60e5b42933813baa6b9d
|
||||
if (World().IsMainWorld()) {
|
||||
probe::DidCreateMainWorldContext(GetFrame());
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
index a68832975b5d359f7eddaf2326bd47ff1e7e18df..ae565a4d3fdc2d02e2c7a27312d8296bbdf61e0b 100644
|
||||
index 8497afc3eccd6270839a0ab8b7e8441b4ce09ee3..bc8850ea6d8b18d7cbf33bdfda66530cf6a5d1b2 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
@@ -310,6 +310,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
@@ -311,6 +311,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
@@ -92,7 +92,7 @@ index a68832975b5d359f7eddaf2326bd47ff1e7e18df..ae565a4d3fdc2d02e2c7a27312d8296b
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
index 5e5e43e204f006989a859a6077dcb56c81a08e60..aaf03855e53d5529bb51d70cd9b4355d68fed48c 100644
|
||||
index 10c6f66543bfd993ede93a857830f504dcd64a73..b2df880309120ba650c18b5718fe22739aed3373 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
@@ -301,6 +301,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -110,7 +110,7 @@ index 5e5e43e204f006989a859a6077dcb56c81a08e60..aaf03855e53d5529bb51d70cd9b4355d
|
||||
v8::Local<v8::Context> context,
|
||||
int32_t world_id) {
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
index b00211cf215fb820b3fe49139b8ef95be6a10d21..cc593168947e469b599794260692e1deb9b5f1a5 100644
|
||||
index eda52e671ae638dffe23d125571e6013ca2fdb2c..4f225120efa4e149cac9d23761fa3842f15dc162 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
@@ -78,6 +78,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
|
||||
@@ -123,10 +123,10 @@ index b00211cf215fb820b3fe49139b8ef95be6a10d21..cc593168947e469b599794260692e1de
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
index bcdcc5f04edaf06d89375b05eb2d5f6bfa3d3237..5a0f42b4b7e5eb67d476c948caa201ee6fc7b3ca 100644
|
||||
index 86172d090065051f4d3a640fa6cb9f182f4972e6..24b317ef1f5df5999e6c2f4e456ba3ab81c5b3c6 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -425,6 +425,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
@@ -426,6 +426,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
|
||||
@@ -7,7 +7,7 @@ Ensure that licenses for the dependencies introduced by Electron
|
||||
are included in `LICENSES.chromium.html`
|
||||
|
||||
diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py
|
||||
index 4272e2ab96c64b1970e1cf035a3385893b1f2f0c..387fa19ca4ea8aace08bfef67d4b7c0870ad1d23 100755
|
||||
index 5cd3128beeac4072723d99d75cae7435a3511f97..19f535f2e7975cd45a535d7032e416435df790c6 100755
|
||||
--- a/tools/licenses/licenses.py
|
||||
+++ b/tools/licenses/licenses.py
|
||||
@@ -354,6 +354,31 @@ SPECIAL_CASES = {
|
||||
|
||||
@@ -6,12 +6,12 @@ Subject: allow disabling blink scheduler throttling per RenderView
|
||||
This allows us to disable throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
index f5a6ffc61f6cdff3897a97003b74838aac27e2a1..9b10aeb457a010db0ab89211610ea97b1a364453 100644
|
||||
index bdbcb809c4d0081aca93c4ed92912604abbf62bc..8c70713583e8a37201b6e037dae2e89838d382a6 100644
|
||||
--- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
+++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
|
||||
@@ -168,6 +168,12 @@ class MockPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
(bool supports_draggable_regions),
|
||||
(override));
|
||||
@@ -170,6 +170,12 @@ class MockPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
|
||||
MOCK_METHOD(void, UpgradePrerenderUntilScriptToFullPrerender, (), (override));
|
||||
|
||||
+ MOCK_METHOD(
|
||||
+ void,
|
||||
@@ -23,10 +23,10 @@ index f5a6ffc61f6cdff3897a97003b74838aac27e2a1..9b10aeb457a010db0ab89211610ea97b
|
||||
return receiver_.BindNewEndpointAndPassDedicatedRemote();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
index 6b881f610932eacd5412accd61431e6a59124e71..999022342a06592cc1bc7838b49afddaed1f9995 100644
|
||||
index f9fc11dae7e4abce612e58bad459f26f0deb1d51..b914fafb539c1913652b80c6ecf19f25399ff663 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -761,6 +761,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -745,6 +745,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ index 6b881f610932eacd5412accd61431e6a59124e71..999022342a06592cc1bc7838b49afdda
|
||||
return is_active();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
|
||||
index 89fed16c112d55c13a9f23695e2898d630f7d815..b7f486337f46daac015644525c9870f54e03bb46 100644
|
||||
index 55277d9fd7b4e3d09805615eba262f4b8c8a8685..39d3a3e107799d656d12150577eb457ad658790a 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -134,6 +134,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -51,7 +51,7 @@ index 89fed16c112d55c13a9f23695e2898d630f7d815..b7f486337f46daac015644525c9870f5
|
||||
void SendRendererPreferencesToRenderer(
|
||||
const blink::RendererPreferences& preferences);
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 53ec5cd693539d74424c683f78e953e85c13c098..ccfe78580c2acb9a3afa43d246e1a83cc0e28598 100644
|
||||
index 74f987e8aa28a78dc5f67999e940b1ee5ce49da7..ff9ad46805b722fb9c93c901a56096e9c4bf8c99 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -655,8 +655,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
|
||||
@@ -80,10 +80,10 @@ index 782bed0fdc08d57eceb059f398f253fab9233b1b..f1ab5b981ea68af1b11313e67f2c5060
|
||||
// This interface should only be implemented inside content.
|
||||
friend class RenderViewHostImpl;
|
||||
diff --git a/content/test/test_page_broadcast.h b/content/test/test_page_broadcast.h
|
||||
index 4c8d44cdb2fde8e174b78aee7defb980651da18e..f8bf421b5b32af4cd197cbf23f4bd281c3a12514 100644
|
||||
index 7f6223791c492d56412df57639ef988001b313fe..c6abcd08228a4fb0d9bc1bd4e7738864a281dd2c 100644
|
||||
--- a/content/test/test_page_broadcast.h
|
||||
+++ b/content/test/test_page_broadcast.h
|
||||
@@ -52,6 +52,7 @@ class TestPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
@@ -53,6 +53,7 @@ class TestPageBroadcast : public blink::mojom::PageBroadcast {
|
||||
void UpdateColorProviders(
|
||||
const blink::ColorProviderColorMaps& color_provider_colors) override;
|
||||
void SetSupportsDraggableRegions(bool supports_draggable_regions) override;
|
||||
@@ -92,10 +92,10 @@ index 4c8d44cdb2fde8e174b78aee7defb980651da18e..f8bf421b5b32af4cd197cbf23f4bd281
|
||||
mojo::AssociatedReceiver<blink::mojom::PageBroadcast> receiver_;
|
||||
};
|
||||
diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
|
||||
index b00bc8a8a5044fbf46f627f9db56cea7f09d7ef6..114c3a4522d11c1348f681af500c487ccd97eea9 100644
|
||||
index de0291118714296eb3a3114478fa4dbef15be06c..6c7012c00df45fb057113501b756ef3a57ee0c38 100644
|
||||
--- a/third_party/blink/public/mojom/page/page.mojom
|
||||
+++ b/third_party/blink/public/mojom/page/page.mojom
|
||||
@@ -180,4 +180,7 @@ interface PageBroadcast {
|
||||
@@ -186,4 +186,7 @@ interface PageBroadcast {
|
||||
// Indicates that the page's main frame should collect draggable regions set
|
||||
// using the app-region CSS property.
|
||||
SetSupportsDraggableRegions(bool supports_draggable_regions);
|
||||
@@ -116,10 +116,10 @@ index 932658273154ef2e022358e493a8e7c00c86e732..57bbfb5cde62c9496c351c861880a189
|
||||
// Visibility -----------------------------------------------------------
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index b5a7e1b177f031837f670c26bff7394315eb6ea5..ed63aa041733e2fb09d77a219c93c322985cc81e 100644
|
||||
index 0a7b21d77c115eb18c6a63c74358befc0f0ff1c1..ff29fd30758340a8a8daf7740deead59f112c259 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -2471,6 +2471,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
@@ -2468,6 +2468,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
|
||||
TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal",
|
||||
"old_state", old_state, "new_state", new_state);
|
||||
|
||||
@@ -130,7 +130,7 @@ index b5a7e1b177f031837f670c26bff7394315eb6ea5..ed63aa041733e2fb09d77a219c93c322
|
||||
bool storing_in_bfcache = new_state->is_in_back_forward_cache &&
|
||||
!old_state->is_in_back_forward_cache;
|
||||
bool restoring_from_bfcache = !new_state->is_in_back_forward_cache &&
|
||||
@@ -4170,10 +4174,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -4021,10 +4025,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
@@ -155,10 +155,10 @@ index b5a7e1b177f031837f670c26bff7394315eb6ea5..ed63aa041733e2fb09d77a219c93c322
|
||||
// Do not throttle if the page should be painting.
|
||||
bool is_visible =
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
index b2ad789e53146b06e0e416f2dcf384cf7e9c17ae..838c67ac5b02c427858febbfbddf25fb03632b37 100644
|
||||
index 20212a57bb4dc13d9e384dffa5c564ed64655574..dd9e21d3e73f6ff14659b1e1fe7d837c5410695d 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
@@ -446,6 +446,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -438,6 +438,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
LocalDOMWindow* PagePopupWindow() const;
|
||||
|
||||
PageScheduler* Scheduler() const override;
|
||||
@@ -166,7 +166,7 @@ index b2ad789e53146b06e0e416f2dcf384cf7e9c17ae..838c67ac5b02c427858febbfbddf25fb
|
||||
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) override;
|
||||
mojom::blink::PageVisibilityState GetVisibilityState() override;
|
||||
@@ -957,6 +958,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -928,6 +929,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
// If true, we send IPC messages when |preferred_size_| changes.
|
||||
bool send_preferred_size_changes_ = false;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ so we can remove this patch once we migrate our code to use
|
||||
os_crypt async.
|
||||
|
||||
diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn
|
||||
index 3b1c34e213b0990b8f0823228a1a02c5bf0c7198..ea48241edef8eaf7bfc8285d7cbbea567d3a7cbb 100644
|
||||
index e90e275b33bb88c6b1e8a7044ca6eb382460b467..6a2266a01a6283bf239001dbd21e638bf62e10d5 100644
|
||||
--- a/components/os_crypt/sync/BUILD.gn
|
||||
+++ b/components/os_crypt/sync/BUILD.gn
|
||||
@@ -10,6 +10,7 @@ import("//components/os_crypt/sync/features.gni")
|
||||
@@ -19,5 +19,5 @@ index 3b1c34e213b0990b8f0823228a1a02c5bf0c7198..ea48241edef8eaf7bfc8285d7cbbea56
|
||||
visibility = [
|
||||
+ "//electron:*",
|
||||
"//chrome/browser",
|
||||
"//chrome/browser/net:impl",
|
||||
"//chrome/test:test_support",
|
||||
"//components/os_crypt/async/browser:dpapi_key_provider",
|
||||
|
||||
@@ -8,10 +8,10 @@ WebPreferences of in-process child windows, rather than relying on
|
||||
process-level command line switches, as before.
|
||||
|
||||
diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
index 9ab1b47509c8b72b7844e83f1d69499d13e26837..8fe07713a01123cc21d2649f8a3e9347a49a2bb8 100644
|
||||
index 6f8c4ba8b32b5c9fb9bca783ef720e0102c827e6..430d6bab3fb20866af6bf5af8515c3900a0d7ede 100644
|
||||
--- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
+++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
@@ -149,6 +149,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -150,6 +150,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
out->v8_cache_options = data.v8_cache_options();
|
||||
out->record_whole_document = data.record_whole_document();
|
||||
out->stylus_handwriting_enabled = data.stylus_handwriting_enabled();
|
||||
@@ -32,7 +32,7 @@ index 9ab1b47509c8b72b7844e83f1d69499d13e26837..8fe07713a01123cc21d2649f8a3e9347
|
||||
out->accelerated_video_decode_enabled =
|
||||
data.accelerated_video_decode_enabled();
|
||||
diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
index efcb7d9457045c2d58ecec4b68d7c4547cb5d08a..e37fa2e8cb0896e61ef11259df13d97b8fbff548 100644
|
||||
index dbff6419e64087a39a906f6cb7df63e2d56c099f..2e03035a0533b39caaa1f50b7605b59b2ae325de 100644
|
||||
--- a/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
+++ b/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
@@ -10,6 +10,7 @@
|
||||
@@ -43,9 +43,9 @@ index efcb7d9457045c2d58ecec4b68d7c4547cb5d08a..e37fa2e8cb0896e61ef11259df13d97b
|
||||
#include "build/build_config.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -481,6 +482,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
bool should_screenshot_on_mainframe_same_doc_navigation = true;
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
@@ -492,6 +493,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
|
||||
// Consumed only in chrome/renderer/ (not by Blink).
|
||||
bool is_indigo_onboarding = false;
|
||||
|
||||
+ // Begin Electron-specific WebPreferences.
|
||||
+ bool context_isolation = false;
|
||||
@@ -64,7 +64,7 @@ index efcb7d9457045c2d58ecec4b68d7c4547cb5d08a..e37fa2e8cb0896e61ef11259df13d97b
|
||||
// chrome, except for the cases where it would require lots of extra work for
|
||||
// the embedder to use the same default value.
|
||||
diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
index fade1dd1310d8339fff45b9ae74ebff4673eec37..ea3f8f3e30f76ebf71ed470f43e4f61995829932 100644
|
||||
index 2b8ad78d33a3cfc810e280db7a8f1b5aa1e1cc83..4f9793d751ba3d7796111a641411c74a797797d7 100644
|
||||
--- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
+++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
@@ -8,6 +8,7 @@
|
||||
@@ -75,7 +75,7 @@ index fade1dd1310d8339fff45b9ae74ebff4673eec37..ea3f8f3e30f76ebf71ed470f43e4f619
|
||||
#include "mojo/public/cpp/bindings/struct_traits.h"
|
||||
#include "net/nqe/effective_connection_type.h"
|
||||
#include "third_party/blink/public/common/common_export.h"
|
||||
@@ -440,6 +441,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
@@ -444,6 +445,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
|
||||
return r.stylus_handwriting_enabled;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ index fade1dd1310d8339fff45b9ae74ebff4673eec37..ea3f8f3e30f76ebf71ed470f43e4f619
|
||||
return r.cookie_enabled;
|
||||
}
|
||||
diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
index c637783517d250b7aa6f34af11fd3ca804a2a705..0268d33da3150a37ca8206695a5f324d8fde22e6 100644
|
||||
index 3003eff973c9323a427b9ddddcd1f445223cd383..83e360b74fbe7d8ef922f023ebc319e891059c3f 100644
|
||||
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
@@ -4,6 +4,7 @@
|
||||
@@ -140,7 +140,7 @@ index c637783517d250b7aa6f34af11fd3ca804a2a705..0268d33da3150a37ca8206695a5f324d
|
||||
import "mojo/public/mojom/base/string16.mojom";
|
||||
import "mojo/public/mojom/base/time.mojom";
|
||||
import "skia/public/mojom/skcolor.mojom";
|
||||
@@ -222,6 +223,19 @@ struct WebPreferences {
|
||||
@@ -223,6 +224,19 @@ struct WebPreferences {
|
||||
// If true, stylus handwriting recognition to text input will be available in
|
||||
// editable input fields which are non-password type.
|
||||
bool stylus_handwriting_enabled;
|
||||
|
||||