From a445826dad43c8b8101a62c8c73c39227f0ca437 Mon Sep 17 00:00:00 2001 From: JiaLiPassion Date: Sat, 20 Jul 2019 19:55:13 +0900 Subject: [PATCH] fix(zone.js): handle new api of electron 4 (#31669) Close #31668 PR Close #31669 --- packages/zone.js/lib/extra/electron.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/zone.js/lib/extra/electron.ts b/packages/zone.js/lib/extra/electron.ts index 73693eaab7..3d0230bc59 100644 --- a/packages/zone.js/lib/extra/electron.ts +++ b/packages/zone.js/lib/extra/electron.ts @@ -11,7 +11,7 @@ Zone.__load_patch('electron', (global: any, Zone: ZoneType, api: _ZonePrivate) = return delegate && delegate.apply(self, api.bindArguments(args, source)); }); } - const {desktopCapturer, shell, CallbacksRegistry} = require('electron'); + const {desktopCapturer, shell, CallbacksRegistry, ipcRenderer} = require('electron'); // patch api in renderer process directly // desktopCapturer if (desktopCapturer) { @@ -24,6 +24,9 @@ Zone.__load_patch('electron', (global: any, Zone: ZoneType, api: _ZonePrivate) = // patch api in main process through CallbackRegistry if (!CallbacksRegistry) { + if (ipcRenderer) { + patchArguments(ipcRenderer, 'on', 'ipcRenderer.on'); + } return; }