Luis Cuende
Luis Cuende

Reputation: 371

How to disable X-Frame-Options in QtWebKit

I have a problem regarding the security of QtWebKit, I wanna disable X-Frame-Options so I can embed sites such as facebook.com in iframes inside my app.

I know that can be made using WebCore API (isWebSecurityEnabled switch, http://trac.webkit.org/wiki/ConfigurableFeatures) but I didn't found any way of doing it with QtWebKit.

Thank you!

Upvotes: 4

Views: 916

Answers (1)

Pedro Vargas
Pedro Vargas

Reputation: 169

I had the same problem (but applied to command-line-browser phantonjs with the rendering engine QtWebKit) and the only option after analyzing the issue, is modifying the behavior of rendering of QtWebKit.

The good, the change is very small, we just change the function FrameLoader :: shouldInterruptLoadForXFrameOptions to return false in any condition (https://github.com/deerme/phantomjs/blob/master/src/qt/qtwebkit/Source/WebCore/loader/FrameLoader.cpp#L2986).

In my particular case I did a fork of the phantonjs repository with this small change in QtWebKit (https://github.com/deerme/phantomjs).

So, in your particular case, you should download the source code of QtWebEngine and make the change and finally you can use the QtWebEngine modified in your Qt application.

Upvotes: 1

Related Questions