Nifty tip. Let's try it, and see if it works.
Edit: Sorry bud. I gave it a shot, and `activeTab` doesn't allow you to modify the "Referer" header.
Edit: Sorry bud. I gave it a shot, and `activeTab` doesn't allow you to modify the "Referer" header.
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript({
code: 'window.stop(); window.location = "http://www.google.com/badurl/' + encodeURIComponent(tab.url) + '";'
});
});
and then you can have a content script run on "http://www.google.com/badurl/*" which just does: window.location = decodeURIComponent(window.location.pathname.split("/")[2]);
Now that is super brittle compared to your solution, but it does work(for the sites I tried, some may require you to actually fake a search query). It only requires the activeTab permission and content script permissions on one page.