Commit graph

30 commits

Author SHA1 Message Date
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
David Sanders
3d2a754531
chore: extend linting of code blocks in the docs (#40245)
* chore: extend linting of code blocks in the docs

* chore: combine lint:markdownlint and lint:markdown scripts
2023-11-21 16:50:08 +09:00
David Sanders
905aad9cb6
chore: type check JS in docs (#38423)
* build(deps): update @electron/lint-roller

* chore: type check JS in docs

* docs: add @ts-check and @ts-expect-error to code blocks

* chore: fix type check errors in docs

* chore: add ts-type to blocks
2023-06-05 16:26:26 +09:00
David Sanders
eeb1e7d499
chore: fix lint:js-in-markdown script (#38260) 2023-05-15 09:58:35 +02:00
Jeremy Rose
fda8ea9277
feat: add protocol.handle (#36674) 2023-03-27 10:00:55 -07:00
Jeremy Rose
872d1fe05a
feat: implement net.fetch (#36733) 2023-02-20 12:57:38 -08:00
David Sanders
7acb513ba6
docs: update links to Chromium source (#33309) 2022-03-17 13:45:55 +01:00
Milan Burda
e6b1d95a1c
docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
Samuel Attard
81795744cf
fix: ensure the typescript definitions only export correct value types (#28712)
* fix: ensure the typescript definitions only export correct value types

In typescript there are two main types of "types" you can export, value types (class, const) and definition types (type, interface).  The typescript compiler will let anything declared via const or class be used as a value.  Unfortunately we were exporting a bunch of things (see the diff) as class/const when they weren't actually exported values. This lead to typescript being happy but the runtime throwing errors (not something we want).

This change passes "exported-in" context through our docs, to the parser and then to the definitions generator to ensure we only mark things as exported in the ts defs that we actually export.

Fixes #22167

* chore: update typescript-defs

* chore: update typescript-defs

* chore: fix bad typescript in IPC test

* docs: test rendering of new syntax

* chore: update per feedback, use same syntax but with 'this is not exportedd' line
2021-06-15 13:50:31 -07:00
David Sanders
bb6903543c
docs: link to IncomingMessage (#29457) 2021-06-03 14:54:33 +09:00
LuoJinghua
e1cc78f275
feat: allow setting the Origin header and Sec-Fetch-* headers in net.request() (#26135) 2020-11-17 14:25:41 -08:00
David Sanders
43dbd1bdf8
chore: cleanup whitespace in docs (#26356) 2020-11-05 14:12:43 -08:00
Jeremy Rose
0e7d59dd79
feat: [net] add "credentials" option to net.request (#25284)
* feat: [net] add "credentials" option to net.request

* remove debugging log

* add tests
2020-09-29 12:03:33 -04:00
Keeley Hammond
7704954505
docs: add restricted header info to ClientRequest docs (#25075)
* docs: add restricted header info to docs

* docs: clarify header language

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

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2020-08-25 20:29:58 +09:00
Samuel Attard
60bd52880f
feat: add support for net requests to use the session cookie store (#22704) 2020-03-20 15:56:02 -07:00
Jeremy Apthorp
d25256dcf5
refactor: rewrite the net module to simplify state tracking (#21244) 2019-11-26 17:01:13 -08:00
Jeremy Apthorp
4f1536479e
fix: implement 'login' event for net.ClientRequest (#21096) 2019-11-14 10:01:18 -08:00
Samuel Attard
cfd230d7f1
docs: remove implicit 'any' and 'Object' types from the docs (#19585)
* docs: remove implicit 'any' and 'Object' types from the docs

* docs: more docs improvements, remove all remaining empty interfaces

* chore: update tests for better types
2019-08-05 10:45:58 -07:00
Shelley Vohr
3395a1d4db
doc: improve EventEmitter md formatting (#19345) 2019-07-22 08:20:43 -07:00
Charles Kerr
792f6b246c
docs: fix spelling and grammar errors (#18910) 2019-06-21 16:19:21 -05:00
Samuel Attard
4b3011f3e8 feat: add getUploadProgress API to the net API (#13783) 2018-07-27 07:15:48 -07:00
Aleš Pergl
c49cb29ddf Disallow launching unknown apps via browser client.
CVE-2018-1000006
2018-01-22 16:49:30 -06:00
Toinane
323ea2b27b
fix(docs): fix all missing dots and add some links 2017-11-29 11:38:35 +01:00
Fabian Zeindl
5db02ffaa9 updates to the docs 2017-07-24 10:29:45 +02:00
Kevin Sawicki
b9a25113a6 Add backticks to Object 2017-05-26 14:04:28 -07:00
Thiago de Arruda
b3cf00a19a Fix net module to accept non-string header values
This is required to be compatible with node.js http module.
2017-03-30 16:01:40 -03:00
deepak1556
8db1eacd1c [skip ci] add docs 2017-03-28 18:46:21 +05:30
Samuel Attard
aa5c778ca2
Generic doc fixes 2017-03-25 12:37:07 +11:00
Zeke Sikelianos
e57cb713b2 link process annotations to glossary 2016-12-21 13:47:40 -08:00
Zeke Sikelianos
b084dc29ea move each API doc into its own file 2016-11-16 09:02:49 -08:00