Pepper Flash loads in webview, but not elsewhere


I am currently trying to get Pepper flash to load a local swf. I have copied the PepperFlashPlayer.plugin from Chrome into my project and referenced it in the code.

However, the main renderer can not load a swf, but a webview is able to load swfs (by loading the Adobe Flash about page).

When I check the debugger, I am able to see the plug is loaded via navigator.plugins If I comment out the app.commandLine.appendSwitch lines, the webview will also not load SWFs.


const electron = require('electron');
const {app} = electron;
const {BrowserWindow} = electron;
const path = require('path');

let win;

function createWindow() {
  win = new BrowserWindow({
    width: 800,
    height: 600,
    resizable: true,
      'web-preferences': {
        plugins: true

  win.loadURL('file://' + path.join(__dirname, 'index.html'));

  win.on('closed', () => {
    win = null;

let ppapi_flash_path;

// Specify flash path.
// On Windows, it might be /path/to/pepflashplayer.dll
// On OS X, /path/to/PepperFlashPlayer.plugin
// On Linux, /path/to/
if(process.platform  == 'win32'){
  // Not on Windows atm, don't care
  ppapi_flash_path = path.join(__dirname, 'pepflashplayer.dll');
} else if (process.platform == 'linux') {
  // Not on Linux atm, don't care
  ppapi_flash_path = path.join(__dirname, '');
} else if (process.platform == 'darwin') {
  ppapi_flash_path = path.join(__dirname, 'PepperFlashPlayer.plugin');
app.commandLine.appendSwitch('ppapi-flash-path', ppapi_flash_path);
app.commandLine.appendSwitch('ppapi-flash-version', '');

app.on('ready', createWindow);

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {

app.on('activate', () => {
  if (win === null) {


<!DOCTYPE html>
    <meta charset="UTF-8">
    <title>Pepper, Where are you!</title>
    <embed src="king-of-the-hill.swf">

    <webview src="" style="display:inline-flex; width:800px; height:480px" plugins></webview>


You didn’t specify which version of Electron you’re using, but the option names for BrowserWindow were converted to camel case a while back, so try specifying webPreferences: { plugins: true } when creating the window.


That was it, thanks!