ref/ replace electron.remote (deprecated) by @electron/remote

This commit is contained in:
Maxime GRIS
2021-03-19 19:33:02 +01:00
parent a26d5f1321
commit 8a4b6246e1
4 changed files with 17 additions and 9 deletions

View File

@@ -2,7 +2,8 @@ import { Injectable } from '@angular/core';
// If you import a module but never use any of the imported values other than as TypeScript types,
// the resulting javascript file will look as if you never imported the module at all.
import { ipcRenderer, webFrame, remote } from 'electron';
import { ipcRenderer, webFrame } from 'electron';
import * as remote from '@electron/remote';
import * as childProcess from 'child_process';
import * as fs from 'fs';
@@ -26,8 +27,9 @@ export class ElectronService {
this.ipcRenderer = window.require('electron').ipcRenderer;
this.webFrame = window.require('electron').webFrame;
// If you wan to use remote object, pleanse set enableRemoteModule to true in main.ts
// this.remote = window.require('electron').remote;
// If you want to use remote object in renderer process, please set enableRemoteModule to true in main.ts
// this.remote = window.require('@electron/remote');
// console.log('remote - globalShortcut', this.remote.globalShortcut);
this.childProcess = window.require('child_process');
this.fs = window.require('fs');