summaryrefslogtreecommitdiff
path: root/main.js
blob: e5d18807d862692156e5bc327091fa6732f2e73f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var {app, BrowserWindow} = require('electron');
var path = require('path')

var mainWindow = null;
var lib
if (process.platform != 'win32') {
	lib = path.join(__dirname, 'libppapi_hello.so')
} else {
	lib = path.join(__dirname, 'libppapi_hello')
	if (process.arch == 'x64') {
		lib = path.join(lib, 'x64')
	}
	lib = path.join(lib, 'Release', 'libppapi_hello.dll')
}

var plugin = lib + ';application/x-hello'
console.log(plugin)

app.commandLine.appendSwitch('register-pepper-plugins', plugin)
app.commandLine.appendSwitch('vmodule', '=ppb*=4')
app.commandLine.appendSwitch('enable-logging', 'stderr')

app.on('ready', function() {
  mainWindow = new BrowserWindow({
    height: 800,
    width: 1024,
    title: 'electron',
    webPreferences : {
      'plugins': true,
      devTools: true,
    }
  });

  mainWindow.loadURL('file://' + __dirname + '/nacl.html');
});