summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.com>2018-09-05 21:46:55 +0300
committerEvgeny Zinoviev <me@ch1p.com>2018-09-05 21:46:55 +0300
commit9fcc074af39f0c88313179eacc3b2a8dd32e94f3 (patch)
treed7422e669f584414f2d9274745206141fb93272d /main.js
initial
Diffstat (limited to 'main.js')
-rw-r--r--main.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/main.js b/main.js
new file mode 100644
index 0000000..e5d1880
--- /dev/null
+++ b/main.js
@@ -0,0 +1,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');
+});