2

我正在尝试为几个站点编写一个特定于站点的浏览器,并且遇到了 webkitgtk 的问题。WebKitGtk 阻止某些跨域请求作为安全措施,并且无法在 WebKitGtk API 中禁用它

Python 简单示例

from gi.repository import Gtk, WebKit
window = Gtk.Window()
webview = WebKit.WebView()
webview.load_uri('http://drive.google.com')
window.add(webview)
window.show_all()
Gtk.main()

输出:

  ** Message: console message:  @0: Unable to post message to https://0.drive.google.com. Recipient has origin https://drive.google.com.
4

2 回答 2

1

目前不可能。错误:https ://bugs.webkit.org/show_bug.cgi?id=58378

于 2012-07-15T17:52:52.963 回答
0

与我相关的唯一设置是enable-xss-auditor

settings = WebKit.WebSettings()
settings.set_property('enable-xss-auditor', False)
webview.set_settings(settings)
于 2012-06-28T20:34:42.137 回答