Skip to content

Instantly share code, notes, and snippets.

@raicheljohn28
Forked from rhew/background.js
Created March 8, 2019 15:30
Show Gist options
  • Select an option

  • Save raicheljohn28/b995d84aac1c1036ef14cf6d173a25ac to your computer and use it in GitHub Desktop.

Select an option

Save raicheljohn28/b995d84aac1c1036ef14cf6d173a25ac 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
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"]);
{
"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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment