首先 按需要下载32位或者64位的 pepflashplayer.dll
将pepflashplayer.dll放到项目中
然后在main.js中注册
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const path = require('path')
let pluginName;
switch (process.platform) {
case 'win32':
pluginName = 'pepflashplayer64_32_0_0_270.dll'
break
case 'darwin':
pluginName = 'PepperFlashPlayer.plugin'
break
case 'linux':
pluginName = 'libpepflashplayer.so'
break
}
let plugins = path.join( __dirname, pluginName);
if (__dirname.includes(".asar")) {
plugins = path.join(process.resourcesPath + '/' + pluginName)
}
app.commandLine.appendSwitch('ppapi-flash-path', plugins)
function createWindow() {
// let img = nativeImage.createFromPath( '512.jpg')
// Create the browser window.
mainW