aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..eea3425
--- /dev/null
+++ b/index.js
@@ -0,0 +1,32 @@
+const { app, BrowserWindow } = require('electron')
+const path = require('path')
+
+// Specify flash path, supposing it is placed in the same directory with main.js.
+let pluginName
+switch (process.platform) {
+ case 'win32':
+ pluginName = 'plugin/pepflashplayer.dll'
+ break
+ case 'darwin':
+ pluginName = 'plugin/PepperFlashPlayer.plugin'
+ break
+ case 'linux':
+ pluginName = 'plugin/libpepflashplayer.so'
+ break
+}
+app.commandLine.appendSwitch('ppapi-flash-path', path.join(__dirname, pluginName))
+
+// Optional: Specify flash version, for example, v17.0.0.169
+app.commandLine.appendSwitch('ppapi-flash-version', '17.0.0.169')
+
+app.whenReady().then(() => {
+ const win = new BrowserWindow({
+ width: 800,
+ height: 600,
+ webPreferences: {
+ plugins: true
+ }
+
+ win.loadURL(`https://${__dirname}`)
+ // Something else
+})