x-frame-options CefSharp

Viewed 448

I need to be able to remove the x-frame-options response header in order to embed an external page into an iFrame, is this possible? I've seen various things about whether or not this is possible as well as some examples but I can't seem to get anything to work. I've tried updating the ResponseHeaders object in several places but it's not updating:

public IResponseFilter GetResourceResponseFilter(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response)
        {
            var headers = response.ResponseHeaders;
            headers.Remove("x-frame-options");
            response.ResponseHeaders = headers;

When I check the ResponseHeaders object after setting it to headers, it appears nothing changed. I've also tried removing this header from OnResourceResponse and OnResourceLoadComplete just for kicks and it responds the same way.

I should note that I am disabling web security in CefSettings but that doesn't change anything either:

CefSettings settings = new CefSettings() {...}
settings.CefCommandLineArgs["disable-web-security"] = "1";

Any suggestions?

Thank you!

0 Answers
Related