electron/docs/api
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
..
structures feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
accelerator.md docs: note accelerator case insensitivity (#40783) 2024-01-04 10:06:12 -05:00
app.md docs: update references to Electron Packager (#40480) 2023-11-09 11:15:32 -08:00
auto-updater.md docs: update github.com links (#37958) 2023-04-15 21:20:59 -07:00
base-window.md feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
browser-view.md feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
browser-window.md feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
client-request.md feat: add net module to utility process (#40017) 2024-01-04 16:20:37 -05:00
clipboard.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
command-line-switches.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
command-line.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
content-tracing.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
context-bridge.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
cookies.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
crash-reporter.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
debugger.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
desktop-capturer.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
dialog.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
dock.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
download-item.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
environment-variables.md feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
extensions.md feat: support chrome.scripting extension APIs (#39395) 2023-08-28 10:39:28 -04:00
file-object.md feat: add webUtils module with getPathForFile method (#38776) 2023-11-20 15:59:36 -08:00
global-shortcut.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
in-app-purchase.md feat: added username to IAP purchaseProduct method (#35902) 2022-12-12 10:11:48 -08:00
incoming-message.md feat: add net module to utility process (#40017) 2024-01-04 16:20:37 -05:00
ipc-main.md docs: fix return type for ipcMain handle functions (#39237) 2023-08-01 10:02:20 +02:00
ipc-renderer.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
menu-item.md feat: add BrowserWindow.showAllTabs() for macOS (#38965) 2023-07-10 10:43:37 +02:00
menu.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
message-channel-main.md chore: type check JS in docs (#38423) 2023-06-05 16:26:26 +09:00
message-port-main.md docs: fix broken links (#36519) 2022-12-05 13:18:57 -05:00
native-image.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
native-theme.md feat: add nativeTheme.inForcedColorsMode (#32956) 2022-03-21 10:30:02 +01:00
net-log.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
net.md feat: add net module to utility process (#40017) 2024-01-04 16:20:37 -05:00
notification.md fix: Windows Toast notification dismissal from Action Center (#40197) 2023-10-17 19:33:00 -04:00
parent-port.md docs: fix broken links (#36519) 2022-12-05 13:18:57 -05:00
power-monitor.md feat: add thermal states to powerMonitor (#37935) 2023-04-19 11:46:55 +02:00
power-save-blocker.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
process.md docs: fixed a typo in process.defaultApp doc (#37342) 2023-02-20 13:06:19 +01:00
protocol.md feat: enable code cache for custom protocols (#40544) 2023-12-06 11:22:41 +09:00
push-notifications.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
safe-storage.md feat: expose safestorage backend information on linux (#38873) 2023-07-13 11:14:33 +02:00
screen.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
service-workers.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
session.md feat: enable code cache for custom protocols (#40544) 2023-12-06 11:22:41 +09:00
share-menu.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
shell.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
system-preferences.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
touch-bar-button.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-color-picker.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-group.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-label.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-other-items-proxy.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-popover.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-scrubber.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-segmented-control.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-slider.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-spacer.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
tray.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
utility-process.md docs: add reference to app.getAppMetrics() in serviceName for utilityProcess (#40338) 2023-10-30 10:07:23 -04:00
view.md feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
web-contents-view.md feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
web-contents.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
web-frame-main.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
web-frame.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
web-request.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00
web-utils.md feat: add webUtils module with getPathForFile method (#38776) 2023-11-20 15:59:36 -08:00
webview-tag.md feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00
window-open.md chore: extend linting of code blocks in the docs (#40245) 2023-11-21 16:50:08 +09:00