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
            }
        })

 

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值