I am working on an extension called Web Panel (actually it's an Opera extension, but the API is the same as the one in Chrome). Basically it allows the user to view a web page in an iframe. The problem is that many sites don't want this to happen, for example with x-frame-options. I already use this workaround: Getting around X-Frame-Options DENY in a Chrome extension?, but the problem is that it doesn't work on all sites, for example facebook. I have tried to remove the content-security-policy header as well, which actually made it work on github, but still not on facebook.
So, my three thoughts are:
- What header should i remove to make it work?
- Now I'm using chrome.webRequest.onHeadersReceived. Can it be that I have to use chrome.webRequest.onBeforeSendHeaders for example to remove any header?
- Or is facebook using some other method for doing this? I know they simply can check if the window is top level by doing
window == window.top
, and then perhaps load content based on the condition. Can I modify the window variable somehow?