aboutsummaryrefslogtreecommitdiff
path: root/index.js
blob: eea3425dd3db53b2e4f70dfabc75413419a008ed (plain) (blame)
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
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
})