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.
The APIs are now synchronous and the optional callback is no longer needed.
// Deprecated
protocol.unregisterProtocol(scheme, () => { /* ... */ })
// Replace with
protocol.unregisterProtocol(scheme)
The APIs are now synchronous and the optional callback is no longer needed.
// 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.
This API is deprecated and users should use protocol.isProtocolRegistered
and protocol.isProtocolIntercepted
instead.
// Deprecated
protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
// Replace with
const isRegistered = protocol.isProtocolRegistered(scheme)
const isIntercepted = protocol.isProtocolIntercepted(scheme)