provide webFrame access

This commit is contained in:
whyboris
2018-04-07 14:24:39 -04:00
parent 05a25004a5
commit 6bd044e459

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
// If you import a module but never use any of the imported values other than as TypeScript types, // 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. // the resulting javascript file will look as if you never imported the module at all.
import { ipcRenderer } from 'electron'; import { ipcRenderer, webFrame } from 'electron';
import * as childProcess from 'child_process'; import * as childProcess from 'child_process';
@Injectable() @Injectable()
@@ -10,12 +10,14 @@ export class ElectronService {
ipcRenderer: typeof ipcRenderer; ipcRenderer: typeof ipcRenderer;
childProcess: typeof childProcess; childProcess: typeof childProcess;
webFrame: typeof webFrame;
constructor() { constructor() {
// Conditional imports // Conditional imports
if (this.isElectron()) { if (this.isElectron()) {
this.ipcRenderer = window.require('electron').ipcRenderer; this.ipcRenderer = window.require('electron').ipcRenderer;
this.childProcess = window.require('child_process'); this.childProcess = window.require('child_process');
this.webFrame = window.require('electron').webFrame;
} }
} }