From 2d0d99fb779969e2772fc710a14a1814489cc316 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 20 Apr 2025 01:41:37 -0400 Subject: Initial commit --- index.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 index.js (limited to 'index.js') 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 +}) -- cgit v1.2.3