Skip to content

Commit

Permalink
provide webFrame access
Browse files Browse the repository at this point in the history
  • Loading branch information
whyboris committed Apr 7, 2018
1 parent 05a2500 commit 6bd044e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/providers/electron.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ 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 } from 'electron';
import { ipcRenderer, webFrame } from 'electron';
import * as childProcess from 'child_process';

@Injectable()
export class ElectronService {

ipcRenderer: typeof ipcRenderer;
childProcess: typeof childProcess;
webFrame: typeof webFrame;

constructor() {
// Conditional imports
if (this.isElectron()) {
this.ipcRenderer = window.require('electron').ipcRenderer;
this.childProcess = window.require('child_process');
this.webFrame = window.require('electron').webFrame;
}
}

Expand Down

0 comments on commit 6bd044e

Please sign in to comment.