You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 20:56:06