Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var active = false;
function changeRefer(details) {
if (!active) return;
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'Referer') {
details.requestHeaders[i].value = 'http://www.google.com/';
break;
}
}
active = false;
return {requestHeaders: details.requestHeaders};
}
chrome.webRequest.onBeforeSendHeaders.addListener(changeRefer, {
urls: ["<all_urls>"],
types: ["main_frame"],
}, ["requestHeaders", "blocking"]);
chrome.browserAction.onClicked.addListener(function(tab) {
active = true;
chrome.tabs.executeScript({
code: 'window.stop(); window.location.reload();'
});
});
@lookfirst

This comment has been minimized.

Copy link

lookfirst commented May 12, 2015

👍

@willlma

This comment has been minimized.

Copy link

willlma commented Nov 23, 2015

I see this has been taken down from the store. Any reason? It failed on me for this ft blog post, though going through Google does work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.