Skip to content

Instantly share code, notes, and snippets.

@kyo-ago
Created July 28, 2013 13:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyo-ago/6098551 to your computer and use it in GitHub Desktop.
Save kyo-ago/6098551 to your computer and use it in GitHub Desktop.
githubのCSPを消すbackground.js
chrome.webRequest.onHeadersReceived.addListener(function (details) {
for (var i = 0, l = details.responseHeaders.length; i < l; i++) {
var res = details.responseHeaders[i];
if (res.name.toLowerCase() !== 'content-security-policy')
continue;
res.value = '';
}
return {
'responseHeaders': details.responseHeaders
};
}, {
'urls': ['https://github.com/*'],
'types': ['main_frame']
}, [
'blocking',
'responseHeaders'
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment