13 Commits
Author SHA1 Message Date
Samuel Attard 05f60b5068 refactor: remove Node.js shims from sandboxed preload scripts (#53891)
* refactor: remove Node.js shims from sandboxed preload scripts

BREAKING CHANGE. Sandboxed preload scripts and service worker preload
scripts no longer get the `events`, `timers` and `url` module shims from
`require`, and are no longer run with `Buffer`, `setImmediate` and
`clearImmediate` in scope. `require` only loads `electron`; `process` and
`global` are still provided.

These were npm browser polyfills compiled into the bundle that every
sandboxed renderer evaluates, and made up about two thirds of it. With them
gone the preload wrapper's parameter list is fixed again, so the code cache
no longer needs to be keyed on the wrapper shape.

* docs: tabulate the removed preload shims and their replacements
2026-09-17 15:07:37 -07:00
Erick ZhaoandCopilot Autofix powered by AI 6f286c36f1 docs: use Chromium over Chrome (#52426)
* docs: use Chromium over Chrome

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-23 15:14:51 -07:00
TeaveloperandErick Zhao fbfd7c7126 docs: security.md mark 'Enable process sandboxing' as active by defau… (#43247)
* docs: security.md mark 'Enable process sandboxing' as active by default since electron 20

* Adjusted according to feedback

* Updated according to feedback - adjusted sandbox.md

* formatting

* Fixed broken markup

* Implemented docs linting suggestions

* docs: docs/tutorial/sandbox.md - fixed typo

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* docs: web-preferences.md - sandbox: mention default value and relation to nodeIntegration

---------

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2025-10-23 16:11:55 -04:00
Valerius PetriniandKeeley Hammond 1300e83884 docs: fixed typos and grammatical errors (#40966)
* docs: fixed typos

* Update docs/tutorial/performance.md

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

* Update performance.md

---------

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2024-01-19 08:21:42 -06:00
Samuel AttardandPatchUp d6bb9b40b0 feat: add webUtils module with getPathForFile method (#38776)
* feat: add blinkUtils module with getPathForFile method

This is designed to replace the File.path augmentation
we currently have in place to allow apps to get the filesystem
path for a file that blink has a representation of.

File.path is non-standard and messes with certain websites, using
a method like this is effectively 0-cost and removes one of the final
deviations we have with web standards.

* add error

* refactor: update per PR feedback

* chore: update patches

* oops

* chore: update patches

* chore: update patches

* feat: add blinkUtils module with getPathForFile method

This is designed to replace the File.path augmentation
we currently have in place to allow apps to get the filesystem
path for a file that blink has a representation of.

File.path is non-standard and messes with certain websites, using
a method like this is effectively 0-cost and removes one of the final
deviations we have with web standards.

* add error

* refactor: update per PR feedback

* chore: update patches

* oops

* chore: update patches

* chore: update patches

* chore: update patches

* fix: provide isolate to WebBlob::FromV8Value

* chore: add tests

* build: fix depshash mismatch on arm64 macOS

---------

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-11-20 15:59:36 -08:00
Milan Burda 5d123765d9 feat: support node: prefixed requires in sandboxed renderer preloads (#38567)
feat: support node: prefixed requires in sandboxed renderer preloads
2023-06-10 14:36:16 -04:00
Milan Burda 8fdd7de3d2 docs: clarify which electron modules are exposed in sandboxed renderers (#38568) 2023-06-05 15:57:15 +09:00
Peter Xu 1e106c8aa4 docs: fixup incorrect value for disabling sandbox (#37711) 2023-03-27 13:27:55 -04:00
David Sanders a9c03950c0 docs: cleanup reference links (#36659) 2023-01-11 22:16:34 -08:00
Erick Zhao 34cb360730 docs: update sandbox renderer defaults for Electron 20 (#35379)
* docs: update E20 sandbox rendering defaults

* docs: update tutorial

* simplify paragraph

* dont mention context isolation
2022-09-08 13:21:50 -07:00
David Sanders 7acb513ba6 docs: update links to Chromium source (#33309) 2022-03-17 13:45:55 +01:00
Jota 9441ff747d docs: Ffx broken context isolation link in sandbox docs (#30177) 2021-07-19 09:24:27 -07:00
8f8708680f docs: rework sandbox guide (#28978)
* docs: rework sandbox guide

* update doc name

* add missing comment to code sample

* Update docs/tutorial/sandbox.md

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* Update docs/tutorial/sandbox.md

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* Update docs/tutorial/sandbox.md

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>

* load https in the examples

* change `process` docs to Electron's

* remove bit on chrome://sandbox page

* Update docs/tutorial/sandbox.md

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

* Update docs/tutorial/sandbox.md

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

* clarify sandbox default posture

* clarify tasks sandboxed renderers need ipc for

* clarify polyfilled preload environment

* emphasize that --no-sandbox is bad

* clarify preload polyfill `require`

* format markdown references properly

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2021-05-06 20:53:55 +09:00