mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +00:00
fix(electron): retain wrapped protocol handler registrations
This commit is contained in:
1 parent
8c857ce56c
commit
c28d47bf13
4 files changed
+180
-4
No files matched your search
@@ -87,7 +87,12 @@ export const inspectElectronProtocolNode = (
|
||||
: INTERCEPTORS.has(target.api)
|
||||
? "interceptor"
|
||||
: undefined;
|
||||
if (role !== undefined && !handlerKnownMissing(node))
|
||||
// handle installs its own native callback and invokes the supplied handler
|
||||
// only when a request arrives; a missing handler does not prevent registration.
|
||||
if (
|
||||
role !== undefined &&
|
||||
(target.api === "handle" || !handlerKnownMissing(node))
|
||||
)
|
||||
addProtocol(context, {
|
||||
node,
|
||||
api: target.api,
|
||||
@@ -97,7 +102,7 @@ export const inspectElectronProtocolNode = (
|
||||
});
|
||||
};
|
||||
|
||||
/** Electron requires the callback, so a call without one installs nothing. */
|
||||
/** Legacy native registration APIs require a callback before installing it. */
|
||||
const handlerKnownMissing = (
|
||||
node: t.CallExpression | t.OptionalCallExpression,
|
||||
): boolean => {
|
||||
|
||||
Reference in new issue
Block a user