[6a3a178] | 1 | 'use strict';
|
---|
| 2 | /**
|
---|
| 3 | * @license Angular v12.0.0-next.0
|
---|
| 4 | * (c) 2010-2020 Google LLC. https://angular.io/
|
---|
| 5 | * License: MIT
|
---|
| 6 | */
|
---|
| 7 | (function (factory) {
|
---|
| 8 | typeof define === 'function' && define.amd ? define(factory) :
|
---|
| 9 | factory();
|
---|
| 10 | }((function () {
|
---|
| 11 | 'use strict';
|
---|
| 12 | /**
|
---|
| 13 | * @license
|
---|
| 14 | * Copyright Google LLC All Rights Reserved.
|
---|
| 15 | *
|
---|
| 16 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 17 | * found in the LICENSE file at https://angular.io/license
|
---|
| 18 | */
|
---|
| 19 | Zone.__load_patch('electron', function (global, Zone, api) {
|
---|
| 20 | function patchArguments(target, name, source) {
|
---|
| 21 | return api.patchMethod(target, name, function (delegate) { return function (self, args) {
|
---|
| 22 | return delegate && delegate.apply(self, api.bindArguments(args, source));
|
---|
| 23 | }; });
|
---|
| 24 | }
|
---|
| 25 | var _a = require('electron'), desktopCapturer = _a.desktopCapturer, shell = _a.shell, CallbacksRegistry = _a.CallbacksRegistry, ipcRenderer = _a.ipcRenderer;
|
---|
| 26 | // patch api in renderer process directly
|
---|
| 27 | // desktopCapturer
|
---|
| 28 | if (desktopCapturer) {
|
---|
| 29 | patchArguments(desktopCapturer, 'getSources', 'electron.desktopCapturer.getSources');
|
---|
| 30 | }
|
---|
| 31 | // shell
|
---|
| 32 | if (shell) {
|
---|
| 33 | patchArguments(shell, 'openExternal', 'electron.shell.openExternal');
|
---|
| 34 | }
|
---|
| 35 | // patch api in main process through CallbackRegistry
|
---|
| 36 | if (!CallbacksRegistry) {
|
---|
| 37 | if (ipcRenderer) {
|
---|
| 38 | patchArguments(ipcRenderer, 'on', 'ipcRenderer.on');
|
---|
| 39 | }
|
---|
| 40 | return;
|
---|
| 41 | }
|
---|
| 42 | patchArguments(CallbacksRegistry.prototype, 'add', 'CallbackRegistry.add');
|
---|
| 43 | });
|
---|
| 44 | })));
|
---|