Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Use Try Catch For PPAPI Flash Path Append #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ const installExtensions = async () => {
};

// Try to append Pepper flash. See https://github.com/electron/electron/blob/master/docs/tutorial/using-pepper-flash-plugin.md
if (process.platform === 'darwin' && app.getPath("pepperFlashSystemPlugin")) {
try {
app.commandLine.appendSwitch(
"ppapi-flash-path",
app.getPath("pepperFlashSystemPlugin")
);
} catch (err) {
// Handling Non Flash Errors
}
Copy link
Owner

@phobal phobal Jan 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对于 Windows 平台加载 flash 插件的情况比较复杂,有一个比较 hack 的方式就是将 Windows 系统里面的 flash.dll 文件 copy 到项目中来,这里 app.getPath(path) ,path 就指向存放 dll 的目录

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对,其实就是一个dll,但是这么做应该会有license问题?可以在catch里面做提示用户自行前往flash官网下载新版flash的逻辑?现在windows的QQ最新版就会这样,会提示跳转去flash官网下载flash,而不是内置,应该是QQ现在也是使用了webkit来做ui了,



Expand Down