mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
docs: move breaking-changes-ns.md contents to breaking-changes.md (#25946)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
@@ -1,61 +0,0 @@
|
|||||||
# Breaking changes (NetworkService) (Draft)
|
|
||||||
|
|
||||||
This document describes changes to Electron APIs after migrating network code
|
|
||||||
to NetworkService API.
|
|
||||||
|
|
||||||
We don't currently have an estimate of when we will enable `NetworkService` by
|
|
||||||
default in Electron, but as Chromium is already removing non-`NetworkService`
|
|
||||||
code, we might switch before Electron 10.
|
|
||||||
|
|
||||||
The content of this document should be moved to `breaking-changes.md` once we have
|
|
||||||
determined when to enable `NetworkService` in Electron.
|
|
||||||
|
|
||||||
## Planned Breaking API Changes
|
|
||||||
|
|
||||||
### `protocol.unregisterProtocol`
|
|
||||||
### `protocol.uninterceptProtocol`
|
|
||||||
|
|
||||||
The APIs are now synchronous and the optional callback is no longer needed.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Deprecated
|
|
||||||
protocol.unregisterProtocol(scheme, () => { /* ... */ })
|
|
||||||
// Replace with
|
|
||||||
protocol.unregisterProtocol(scheme)
|
|
||||||
```
|
|
||||||
|
|
||||||
### `protocol.registerFileProtocol`
|
|
||||||
### `protocol.registerBufferProtocol`
|
|
||||||
### `protocol.registerStringProtocol`
|
|
||||||
### `protocol.registerHttpProtocol`
|
|
||||||
### `protocol.registerStreamProtocol`
|
|
||||||
### `protocol.interceptFileProtocol`
|
|
||||||
### `protocol.interceptStringProtocol`
|
|
||||||
### `protocol.interceptBufferProtocol`
|
|
||||||
### `protocol.interceptHttpProtocol`
|
|
||||||
### `protocol.interceptStreamProtocol`
|
|
||||||
|
|
||||||
The APIs are now synchronous and the optional callback is no longer needed.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Deprecated
|
|
||||||
protocol.registerFileProtocol(scheme, handler, () => { /* ... */ })
|
|
||||||
// Replace with
|
|
||||||
protocol.registerFileProtocol(scheme, handler)
|
|
||||||
```
|
|
||||||
|
|
||||||
The registered or intercepted protocol does not have effect on current page
|
|
||||||
until navigation happens.
|
|
||||||
|
|
||||||
### `protocol.isProtocolHandled`
|
|
||||||
|
|
||||||
This API is deprecated and users should use `protocol.isProtocolRegistered`
|
|
||||||
and `protocol.isProtocolIntercepted` instead.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Deprecated
|
|
||||||
protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
|
|
||||||
// Replace with
|
|
||||||
const isRegistered = protocol.isProtocolRegistered(scheme)
|
|
||||||
const isIntercepted = protocol.isProtocolIntercepted(scheme)
|
|
||||||
```
|
|
||||||
@@ -124,6 +124,54 @@ const w = new BrowserWindow({
|
|||||||
We [recommend moving away from the remote
|
We [recommend moving away from the remote
|
||||||
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
|
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
|
||||||
|
|
||||||
|
### `protocol.unregisterProtocol`
|
||||||
|
### `protocol.uninterceptProtocol`
|
||||||
|
|
||||||
|
The APIs are now synchronous and the optional callback is no longer needed.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Deprecated
|
||||||
|
protocol.unregisterProtocol(scheme, () => { /* ... */ })
|
||||||
|
// Replace with
|
||||||
|
protocol.unregisterProtocol(scheme)
|
||||||
|
```
|
||||||
|
|
||||||
|
### `protocol.registerFileProtocol`
|
||||||
|
### `protocol.registerBufferProtocol`
|
||||||
|
### `protocol.registerStringProtocol`
|
||||||
|
### `protocol.registerHttpProtocol`
|
||||||
|
### `protocol.registerStreamProtocol`
|
||||||
|
### `protocol.interceptFileProtocol`
|
||||||
|
### `protocol.interceptStringProtocol`
|
||||||
|
### `protocol.interceptBufferProtocol`
|
||||||
|
### `protocol.interceptHttpProtocol`
|
||||||
|
### `protocol.interceptStreamProtocol`
|
||||||
|
|
||||||
|
The APIs are now synchronous and the optional callback is no longer needed.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Deprecated
|
||||||
|
protocol.registerFileProtocol(scheme, handler, () => { /* ... */ })
|
||||||
|
// Replace with
|
||||||
|
protocol.registerFileProtocol(scheme, handler)
|
||||||
|
```
|
||||||
|
|
||||||
|
The registered or intercepted protocol does not have effect on current page
|
||||||
|
until navigation happens.
|
||||||
|
|
||||||
|
### `protocol.isProtocolHandled`
|
||||||
|
|
||||||
|
This API is deprecated and users should use `protocol.isProtocolRegistered`
|
||||||
|
and `protocol.isProtocolIntercepted` instead.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Deprecated
|
||||||
|
protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
|
||||||
|
// Replace with
|
||||||
|
const isRegistered = protocol.isProtocolRegistered(scheme)
|
||||||
|
const isIntercepted = protocol.isProtocolIntercepted(scheme)
|
||||||
|
```
|
||||||
|
|
||||||
## Planned Breaking API Changes (9.0)
|
## Planned Breaking API Changes (9.0)
|
||||||
|
|
||||||
### Default Changed: Loading non-context-aware native modules in the renderer process is disabled by default
|
### Default Changed: Loading non-context-aware native modules in the renderer process is disabled by default
|
||||||
|
|||||||
Reference in New Issue
Block a user