QtWebkit Same-Origin-policy

我的未来我决定 提交于 2019-12-07 06:47:35

问题


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.


回答1:


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);



回答2:


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.



来源:https://stackoverflow.com/questions/8090462/qtwebkit-same-origin-policy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!