Commit graph

624 commits

Author SHA1 Message Date
Cheng Zhao
db2bf1a0d1
fix: apply module search paths restriction on worker and child process (#41118) 2024-01-26 17:29:04 +09:00
Shelley Vohr
6803624576
fix: check for Node.js-created module when contextIsolation disabled (#40993) 2024-01-16 14:29:00 +01:00
Brandon Fowler
5086071294
feat: add transparent webpreference to webview (#40301)
* feat: add transparent option to WebContents

* feat: add transparent attribute to webview

* test: add tests for webview transparent attribute

* docs: add transparent attribute to webview docs

* fix: run tests on macOS only

* refactor: remove unneeded html tag

* fix: only apply transparent option to guests

* refactor: correct comment

* refactor: use opaque instead

Retains current webview behaviour by default.

* fix: correct variable name to guest_opaque_

* refactor: use transparent webpreference

* docs: remove unused web preference

* fix: uncomment condition for transparency test

* docs: converted to list format and linked to MDN

* fix: make webviews transparent by default again

* fix: rebase error

---------

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2024-01-05 13:00:27 +09:00
Devraj Mehta
8c71e2adc9
feat: add net module to utility process (#40017)
* chore: initial prototype of net api from utility process

* chore: update url loader to work on both browser and utility processes

* chore: add net files to utility process bundle

* chore: re-add app ready check but only on main process

* chore: replace browser thread dcheck's with sequence checker

* refactor: move url loader from browser to common

* refactor: move net-client-request.ts from browser to common

* docs: add utility process to net api docs

* refactor: move net module app ready check to browser only

* refactor: switch import from main to common after moving to common

* test: add basic net module test for utility process

* refactor: switch browser pid with utility pid

* refactor: move electron_api_net from browser to common

* chore: add fetch to utility net module

* chore: add isOnline and online to utility net module

* refactor: move net spec helpers into helper file

* refactor: break apart net module tests

Adds two additional net module test files: `api-net-session-spec.ts` for
tests that depend on a session being available (aka depend on running on
the main process) and `api-net-custom-protocols-spec.ts` for custom
protocol tests. This enables running `api-net-spec.ts` in the utility
process.

* test: add utility process mocha runner to run net module tests

* docs: add utility process to net module classes

* refactor: update imports in lib/utility to use electron/utility

* chore: check browser context before using in main process

Since the browser context supplied to the SimpleURLLoaderWrapper can now
be null for use in the UtilityProcess, adding a null check for the main
process before use to get a more sensible error if something goes wrong.

Co-authored-by: Cheng Zhao <github@zcbenz.com>

* chore: remove test debugging

* chore: remove unnecessary header include

* docs: add utility process net module limitations

* test: run net module tests in utility process individually

* refactor: clean up prior utility process net tests

* chore: add resolveHost to utility process net module

* chore: replace resolve host dcheck with sequence checker

* test: add net module tests for net.resolveHost

* docs: remove utility process limitation for resolveHost

---------

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2024-01-04 16:20:37 -05:00
Cheng Zhao
dfce1a9eb4
fix: ignore all NODE_ envs from foreign parent in node process (#40770)
* fix: ignore all NODE_ envs from foreign parent

* fix: recognize ad-hoc signed binary
2024-01-04 16:34:08 +09:00
Jeremy Rose
be4e4ff11b
fix: make grant_file_protocol_extra_privileges fuse also block CORS fetches (#40801) 2024-01-02 13:06:33 -08:00
Jeremy Rose
15c6014324
feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
Cheng Zhao
cb0da6ff34
fix: prevent node mode to be used as script runner by other apps (#40579) 2023-12-06 11:23:54 +09:00
Cheng Zhao
9aa73abe78
feat: enable code cache for custom protocols (#40544) 2023-12-06 11:22:41 +09:00
Shelley Vohr
10a165a9ff
fix: webview zoom level persistence on navigation (#40650) 2023-12-04 10:39:20 -05:00
Samuel Attard
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
Shelley Vohr
7981d955b8
fix: chrome.action API registration (#40500) 2023-11-13 08:27:18 +01:00
Samuel Attard
83892ab995
refactor: ensure IpcRenderer is not bridgable (#40330)
* refactor: ensure IpcRenderer is not bridgable

* chore: add notes to breaking-changes

* spec: fix test that bridged ipcrenderer
2023-10-31 17:29:40 -04:00
Shelley Vohr
fcdd5cba71
fix: navigator.keyboard.lock() fullscreen exit handling (#40365)
fix: navigator.keyboard.lock() fullscreen exit handling
2023-10-31 11:59:39 -04:00
Shelley Vohr
5643e86956
chore: update extensions url handling to match upstream (#40038)
- https://chromium-review.googlesource.com/c/chromium/src/+/4772028
- https://chromium-review.googlesource.com/c/chromium/src/+/4264656
- https://chromium-review.googlesource.com/c/chromium/src/+/4712150
2023-10-02 10:35:00 +02:00
Samuel Attard
371e83a8d2
fix: support esm entrypoint to utility process (#40047) 2023-09-29 14:38:37 -07:00
Shelley Vohr
ec9c8476fe
fix: keyCodes being incorrectly converted in webContents.sendInputEvent() (#39776)
fix: sendInputEvent keyCodes being incorrectly converted
2023-09-12 11:28:45 +02:00
Samuel Attard
5bff0fe342
feat: add new ElectronSquirrelPreventDowngrades flag (#38625)
* sketch

* feat: add new ElectronSquirrelPreventDowngrades flag

* test: remove only

* chore: fix lint
2023-09-11 11:54:51 -07:00
Milan Burda
0b0707145b
refactor: replace .forEach() with for-of (#39691)
* refactor: replace `.forEach()` with `for-of`

* refactor docs/fiddles/features/web-hid/renderer.js
2023-08-31 23:36:43 +09:00
Samuel Attard
ac031bf8de
feat: I guess it's esm (#37535)
* fix: allow ESM loads from within ASAR files

* fix: ensure that ESM entry points finish loading before app ready

* fix: allow loading ESM entrypoints via default_app

* fix: allow ESM loading for renderer preloads

* docs: document current known limitations of esm

* chore: add patches to support blending esm handlers

* refactor: use SetDefersLoading instead of JoinAppCode in renderers

Blink has it's own event loop so pumping the uv loop in the renderer is not enough, luckily in blink we can suspend the loading of the frame while we do additional work.

* chore: add patch to expose SetDefersLoading

* fix: use fileURLToPath instead of pathname

* chore: update per PR feedback

* fix: fs.exists/existsSync should never throw

* fix: convert path to file url before importing

* fix: oops

* fix: oops

* Update docs/tutorial/esm-limitations.md

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* windows...

* windows...

* chore: update patches

* spec: fix tests and document empty body edge case

* Apply suggestions from code review

Co-authored-by: Daniel Scalzi <d_scalzi@yahoo.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* spec: add tests for esm

* spec: windows

* chore: update per PR feedback

* chore: update patches

* Update shell/common/node_bindings.h

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* chore: update patches

* rebase

* use cjs loader by default for preload scripts

* chore: fix lint

* chore: update patches

* chore: update patches

* chore: fix patches

* build: debug depshash

* ?

* Revert "build: debug depshash"

This reverts commit 0de82523fb93f475226356b37418ce4b69acdcdf.

* chore: allow electron as builtin protocol in esm loader

* Revert "Revert "build: debug depshash""

This reverts commit ff86b1243ca6d05c9b3b38e0a6d717fb380343a4.

* chore: fix esm doc

* chore: update node patches

---------

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: electron-patch-conflict-fixer[bot] <83340002+electron-patch-conflict-fixer[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Daniel Scalzi <d_scalzi@yahoo.com>
2023-08-30 17:38:07 -07:00
Tomasz
f30fbebb98
fix: promise resolved to early when browser initiated in-page navigation v2 (#39597) 2023-08-28 12:37:28 -04:00
Shelley Vohr
f0ad357af2
feat: support chrome.scripting extension APIs (#39395)
feat: support chrome.scripting extension  APIs
2023-08-28 10:39:28 -04:00
Milan Burda
5078cae861
chore: remove deprecated ipcRenderer.sendTo() (#39087)
chore: remove deprecated ipcRenderer.sendTo()
2023-08-28 10:29:27 -04:00
Shelley Vohr
f369b144d6
feat: add more extensions manifest key options (#39599)
feat: add more manifest key options
2023-08-28 10:02:22 -04:00
Shelley Vohr
e1d63794e5
fix: chrome.tabs 'url' and 'title' are privileged information (#39595)
fix: tabs url and title are privileged information
2023-08-22 14:56:58 +02:00
Milan Burda
3102a257af
feat: expose dummy module.exports to the sandboxed preload scripts (#39484) 2023-08-22 13:43:08 +09:00
Robo
bee5d94886
feat: support dns-result-order Node.js cli flag (#39376)
* feat: support dns-result-order Node.js cli flag

* chore: update docs

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

* chore: remove patch

---------

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2023-08-15 12:19:45 +02:00
Shelley Vohr
117d5310f5
revert: promise resolved too early when browser initiates in-page navigation (#39481)
This reverts commit a0effaf9b8.
2023-08-14 13:13:15 +09:00
Tomasz
a0effaf9b8
fix: promise resolved to early when browser initiated in-page navigation (#39260) 2023-08-09 16:06:39 +02:00
Shelley Vohr
d9329042e2
feat: add support for chrome.tabs.query (#39330)
* feat: add support for tabs.query

* fix: scope to webContents in current session

* test: add test for session behavior
2023-08-09 14:47:19 +02:00
Shelley Vohr
67523a47b4
fix: chrome.tabs.update return value (#39365)
fix: chrome.tabs.update return value
2023-08-07 10:03:45 +02:00
Shelley Vohr
6d0e8044eb
fix: update chrome.tabs for Manifest v3 (#39317) 2023-08-03 18:34:02 +02:00
Shelley Vohr
f8b05bc127
feat: support minimum_chrome_version manifest key (#39256)
feat: support minimum_chrome_version extension key
2023-08-03 11:38:31 -04:00
Shelley Vohr
303b707fbf
fix: update chrome.i18n for Manifest v3 (#39291)
fix: update chrome.i18n for Manifest v3
2023-08-02 11:02:16 +02:00
Shelley Vohr
c8f7a0e052
fix: Chrome Extensions service worker host registration (#39290) 2023-08-01 15:04:38 +09:00
Shelley Vohr
6df392162f
fix: pageVisibility state when backgroundThrottling disabled (#39223)
fix: pageVisibility state when backgroundThrottling disabled
2023-07-28 10:48:25 +02:00
Milan Burda
c9bae5da8e
refactor: use optional catch binding (#39232) 2023-07-27 10:53:45 -04:00
Shelley Vohr
1231f0a734
docs: document idleDetector permissions (#39180)
doc: document idleDetector permissions
2023-07-24 14:57:41 -04:00
Milan Burda
3df6d337f3
feat: add senderIsMainFrame to messages sent via ipcRenderer.sendTo() (#38868)
* feat: add isMainFrame to events emitted via ipcRenderer.sendTo()

* chore: rename isMainFrame to senderIsMainFrame
2023-07-24 14:27:30 +02:00
Robo
34e7c3696a
feat: expose safestorage backend information on linux (#38873)
* feat: expose safestorage backend information on linux

* Remove gnome-keyring

Refs https://chromium-review.googlesource.com/c/chromium/src/+/4609704
2023-07-13 11:14:33 +02:00
Shelley Vohr
c7a64ab994
fix: webview crash when removing in close event (#38996) 2023-07-06 10:20:34 +02:00
Milan Burda
ef6569b7d3
chore: cleanup unusued variables + enable linting (#38898) 2023-06-26 02:51:54 -07:00
Milan Burda
d78f37ec8f
refactor: use node scheme imports in spec (#38487)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-06-15 10:42:27 -04: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
82af000a37
chore: cleanup eslint suppressions (#38417)
* chore: cleanup eslint suppressions

* address feedback

* revert script/lib/azput.js

* revert spec/fixtures/apps/remote-control/main.js

* address feedback

* revert typings/internal-ambient.d.ts
2023-05-25 10:09:17 +09:00
Shelley Vohr
0212c264ca
build: fix CRLF endings in messages.json (#38212) 2023-05-08 14:51:24 -04:00
Robo
0240f6664e
fix: crash in utilityProcess when generating code from strings (#38014) 2023-04-20 09:27:02 +09:00
Shelley Vohr
251e567eff
fix: don't emit did-fail-load for MediaDocuments (#37824)
* fix: don't emit did-fail-load for MediaDocuments

* spec: add test
2023-04-06 10:23:34 +02:00
John Kleinschmidt
8f3ef39f1e
chore: update line endings on HTML files (#37755) 2023-03-29 15:02:13 -04:00
Will Anderson
2b9dae4b06
feat: add will-frame-navigate event (#34418)
* feat: add will-navigate-in-frame event to webContents

* docs: add documentation for webview will-frame-navigate event

* feat: Eliminate isInPlace argument from will-frame-navigate event

* fix: Fire will-frame-navigate before will-navigate

* feat: send will-frame-navigate with a WebFrameMain in the event details

* docs: Update WebContents docs for new API signature

* feat: Add custom event forwarding for <webview> will-frame-navigate

* fix: wrap WebFrameMain so it can be sent as an event

* test: update webContents and <webview> tests to match new signatures

* chore: undo unnecessary change

* fix: don't switch will-navigate to use EmitNavigationEventDetails

* test: clean up will-navigate and will-frame-navigate tests for <webview>

* chore: apply lint fixes

* chore: move GetRenderFrameHost helper into anonymous namespace

* docs: auto-generate WillFrameNavigateDetails rather than defining it manually

* test: Update <webview> tests to actually pass under new spec runner

* docs: Add section explaining relationship between various nav events

* test: Add some tests to ensure navigation event order doesn't silently change

* test: Always monitor all nav events to ensure unexpected ones don't fire

* test: Add test to verify in-page navigation event order

* feat: Change to new style where extra params are exposed as event props

* fix: Remove unused EmitNavigationEventDetails

* fix: Update tests to use new async helpers

* docs: Rename and reorder sections documenting navigation events

---------

Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-03-28 10:55:41 -04:00