无法 运行 WebView 上的 WebGL 内容
Cannot run WebGL content on WebView
我正在尝试打开一个包含来自 wxPython WebView 的 WebGL 内容的网页。 WebView 使用的引擎 webkit
支持 WebGL。
如何在 WebView 中呈现 WebGL 内容?
我使用的完整代码:
import wx
import wx.html2
class MyBrowser(wx.Frame):
def __init__(self, *args, **kwds):
wx.Frame.__init__(self, *args, **kwds)
sizer = wx.BoxSizer(wx.VERTICAL)
self.browser = wx.html2.WebView.New(self)
sizer.Add(self.browser, 1, wx.EXPAND, 10)
self.SetSizer(sizer)
self.Maximize()
if __name__ == '__main__':
app = wx.App()
dialog = MyBrowser(None, -1)
dialog.browser.LoadURL("https://get.webgl.org/")
dialog.Show()
app.MainLoop()
给出以下屏幕
另外,打开https://whatsmybrowser.org from the WebView identifies the browser as Safari (while using Ubuntu). See full description here: https://whatsmybrowser.org/b/X43YSDV。
我在 wxpython webview 中找不到对 webGL 的支持。
我的解决方案是使用 cefpython. cefpython embeds full chromium browser inside python applications. Here's an example of wxpython using cefpython: https://github.com/cztomczak/cefpython/blob/master/examples/wxpython.py。
我正在尝试打开一个包含来自 wxPython WebView 的 WebGL 内容的网页。 WebView 使用的引擎 webkit
支持 WebGL。
如何在 WebView 中呈现 WebGL 内容?
我使用的完整代码:
import wx
import wx.html2
class MyBrowser(wx.Frame):
def __init__(self, *args, **kwds):
wx.Frame.__init__(self, *args, **kwds)
sizer = wx.BoxSizer(wx.VERTICAL)
self.browser = wx.html2.WebView.New(self)
sizer.Add(self.browser, 1, wx.EXPAND, 10)
self.SetSizer(sizer)
self.Maximize()
if __name__ == '__main__':
app = wx.App()
dialog = MyBrowser(None, -1)
dialog.browser.LoadURL("https://get.webgl.org/")
dialog.Show()
app.MainLoop()
给出以下屏幕
另外,打开https://whatsmybrowser.org from the WebView identifies the browser as Safari (while using Ubuntu). See full description here: https://whatsmybrowser.org/b/X43YSDV。
我在 wxpython webview 中找不到对 webGL 的支持。
我的解决方案是使用 cefpython. cefpython embeds full chromium browser inside python applications. Here's an example of wxpython using cefpython: https://github.com/cztomczak/cefpython/blob/master/examples/wxpython.py。