QtWebkit 同源策略

发布于 2024-12-15 02:00:07 字数 100 浏览 3 评论 0原文

我将 QtWebkit 移植到基于 Arm 的平台上。我们能够运行 QtTestBrowser。 我想在上面的浏览器中禁用“同源策略”。

如果有人对此有想法,请告诉我。

I have QtWebkit ported on Arm based platform. We are able to run QtTestBrowser.
I wanted to disable "same-origin-policy" in the above browser.

Please let me know if any body has idea on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不乱于心 2024-12-22 02:00:07

我知道这已经过时了,但是您可以通过修改 QWebPage 的设置来做到这一点:

auto settings = page.settings();
settings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true);
settings->setAttribute(QWebSettings::LocalContentCanAccessFileUrls,true);

I know this is old, but you can do this by modifying the QWebPage's settings:

auto settings = page.settings();
settings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true);
settings->setAttribute(QWebSettings::LocalContentCanAccessFileUrls,true);
相思碎 2024-12-22 02:00:07

默认情况下,Qt 不会公开禁用/白名单同源策略的方法。扩展相同的(qwebsecurityorigin.cpp)并能够使其工作。

By default, Qt doesn't expose method to disable / whitelist the same origin policy. Extended the same (qwebsecurityorigin.cpp) and able to get it working.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文