electron中引入flash插件的方法

1、在electron的主程序中輸出

   console.log(111111111111,app.getPath('pepperFlashSystemPlugin'));

獲取pepflashplayer.dll的版本和文件路徑

2、

let plugins = path.join(__dirname,`./libs/flash/pepflashplayer64_32_0_0_255.dll`)
app.commandLine.appendSwitch('ppapi-flash-path',plugins);
app.commandLine.appendSwitch('ppapi-flash-version',`32.0.0.255`);

允許插件運行

  mainWindow = new BrowserWindow({
            width: 980,
            minWidth:980,
            height: 600,
            minHeight:600,
            frame: false,// 設置爲 false 時可以創建一個Frameless Window. 默認值爲 true
            resizable: true,// 窗口是否可以改變尺寸. 默認值爲true.
            maximizable: true,// 窗口是否可以最大化動. 在 Linux 中無效. 默認值爲 true.
            transparent: true,// 使窗口 透明. 默認值爲 false.
            show: false,//  窗口創建的時候是否顯示. 默認值爲true.
            alwaysOnTop: false,// 窗口是否永遠在別的窗口的上面. 默認值爲false.
            webPreferences: {
                nodeIntegration: true,
                allowRunningInsecureContent:true,
                plugins:true
            }
        })

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章