Skip to content

Commit a445826

Browse files
JiaLiPassionmhevery
authored andcommitted
fix(zone.js): handle new api of electron 4 (#31669)
Close #31668 PR Close #31669
1 parent 7f7033b commit a445826

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/zone.js/lib/extra/electron.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Zone.__load_patch('electron', (global: any, Zone: ZoneType, api: _ZonePrivate) =
1111
return delegate && delegate.apply(self, api.bindArguments(args, source));
1212
});
1313
}
14-
const {desktopCapturer, shell, CallbacksRegistry} = require('electron');
14+
const {desktopCapturer, shell, CallbacksRegistry, ipcRenderer} = require('electron');
1515
// patch api in renderer process directly
1616
// desktopCapturer
1717
if (desktopCapturer) {
@@ -24,6 +24,9 @@ Zone.__load_patch('electron', (global: any, Zone: ZoneType, api: _ZonePrivate) =
2424

2525
// patch api in main process through CallbackRegistry
2626
if (!CallbacksRegistry) {
27+
if (ipcRenderer) {
28+
patchArguments(ipcRenderer, 'on', 'ipcRenderer.on');
29+
}
2730
return;
2831
}
2932

0 commit comments

Comments
 (0)