-
-
Save rhew/9ffa6d4b1b23b162b6ab to your computer and use it in GitHub Desktop.
Source code for "Ignore X-Frame headers" chrome extension; see https://chrome.google.com/webstore/detail/ignore-x-frame-headers/gleekbfjekiniecknbkamfmkohkpodhe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.webRequest.onHeadersReceived.addListener( | |
function (details) { | |
return { | |
responseHeaders: details.responseHeaders.filter(function(header) { | |
return (header.name.toLowerCase() !== 'x-frame-options'); | |
}) | |
}; | |
}, { | |
urls: ["<all_urls>"] | |
}, ["blocking", "responseHeaders"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} |
Heads up there's a formatting error. "\u0003Call_urls"
should be "<all_urls>"
Hi Can i get a suggestion as how to use this into my code?
This used to work but not anymore. Could it be that Chrome changed their security policy or API?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I was trying to implement same but could not do it. Is there any steps which I can follow and implement it?
Where do i add this code? (On page where iFrame tag implemented or the source page)
Many thanks in advance!