-
-
Save dergachev/e216b25d9a144914eae2 to your computer and use it in GitHub Desktop.
chrome.webRequest.onHeadersReceived.addListener( | |
function (details) { | |
for (var i = 0; i < details.responseHeaders.length; ++i) { | |
if (details.responseHeaders[i].name.toLowerCase() == 'x-frame-options') { | |
details.responseHeaders.splice(i, 1); | |
return { | |
responseHeaders: details.responseHeaders | |
}; | |
} | |
} | |
}, { | |
urls: ["<all_urls>"] | |
}, ["blocking", "responseHeaders"]); |
{ | |
"background": { | |
"scripts": [ "background.js" ] | |
}, | |
"description": "Drops X-Frame-Options HTTP response headers, allowing all pages to be iframed.", | |
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDysh7qP/8H9qUMb0R9BZbk2NDirtNgRyo9AEh9C5HFcoMELEzJ/M/sCqn/yDM/Z7GK3t+w02zCeTBknLEUwgFL9kRxVV4s1kfgbijVHTSJkII6OjqiWDPkDeyMJ1oOr156Rct2bp2MAwOf0Tk1bm2UdwNbJxoE5sQFd2Hbu+WFxQIDAQAB", | |
"manifest_version": 2, | |
"name": "Ignore X-Frame headers", | |
"permissions": [ "webRequest", "webRequestBlocking", "\u003Call_urls>" ], | |
"update_url": "http://clients2.google.com/service/update2/crx", | |
"version": "1.0" | |
} |
It works like a charm. Thanks a lot.
Is there any way to "Ignore X-Frame Headers" when using CrossWalk Project? I would like to use IFRAME of various content sources within my CrossWalk powered application.
HII , Can you please provide mi stepwise guide how to add this code into normal html file like..index.html which contain frame
it will be great help
how i can do you import file manifest.json
This doesn't help in case of running headless.
Hi I have a question about your implementation
is a chance that your code will be work when i run scripts via : npm run "scripts" command
it will automatically add ignore addon ?
Regards
For me this no longer works since new permissions were added sometime in chrome. I have created an extension with the new permissions and some more things: https://github.com/chaptergy/webextension-allow-sso-iframes
Recommendations as the "Ignore X-Frame headers" Chrome extension author:
- Do not use the source code above because it is out-of-date e.g. misses fixes for Chrome permission changes.
- Instead, use the official, up-to-date source code repository linked in the extension page: https://github.com/guilryder/chrome-extensions/tree/main/xframe_ignore
Hi all, i'm trying to config a new project with cypress and everything was good until i faced an issue which is :
every time i try to hit a url via cy.visit it stop with an error displayed as 404 even though the url is right
i read about this issue and kind of an issue with same origin policy i'm not sure
can anyone help me please with this issue ?
Hi Alex.
Thank you for this extension, it helped me make a nice presentation with sites in iframes. I made a minor change that strips multiple x-frame-headers. Feel free to pick it up and include it (I cant find a way to make a pull request against a gist).
https://gist.github.com/rhew/9ffa6d4b1b23b162b6ab#file-background-js
Thanks again,
James