使用Go语言Energy框架+CEF加载Flash插件时出现白屏问题
问题:Energy框架中CEF启用Flash后加载特定网页白屏
我正在使用Energy(一款基于LCL和CEF(Chromium Embedded Framework)的Go语言GUI框架,用于开发Windows、macOS、Linux跨平台桌面应用)开发桌面应用。当我在CEF中启用Flash插件并加载使用Flash的网页时,出现了白屏现象。
以下是我的代码实现:
cef.GlobalInit(nil, nil) cefApp := cef.NewApplication() cef.BrowserWindow.Config.Url = "http://seer.61.com/play.shtml" config := cef.NewChromiumConfig() config.SetEnableMenu(false) config.SetEnableDevTools(false) config.SetEnabledJavascript(true) cef.BrowserWindow.Config.SetChromiumConfig(config) eh := os.Getenv("ENERGY_HOME") if eh == "" { eh = consts.ExeDir } cefApp.AddCustomCommandLine("ppapi-flash-path", filepath.Join(eh, "pepflashplayer.dll")) cefApp.AddCustomCommandLine("ppapi-flash-version", "99.0.0.000") cefApp.AddCustomCommandLine("allow-outdated-plugins", "") cefApp.AddCustomCommandLine("disable-gpu", "") cefApp.SetOnBeforeChildProcessLaunch(func(commandLine *cef.ICefCommandLine) { commandLine.AppendSwitch("--allow-outdated-plugins") commandLine.AppendSwitch("--disable-web-security") commandLine.AppendSwitch("enable-system-flash") })
值得注意的是,使用相同参数和Flash插件DLL访问部分需要Flash支持的网页时运行正常。我怀疑可能是Energy框架存在问题,但尝试使用cefpython时也遇到了相同的白屏问题,不过使用Electron加载同一个pepflashplayer时却没有问题。
请问如何解决Energy框架中的白屏问题?如果需要进一步协助或我提供更结构化的问题排查步骤,请告知!
内容的提问来源于stack exchange,提问作者matchman33
相关产品推荐
相关产品推荐

