The webRequest API may be what you need. This code is on your background page:
chrome.webRequest.onBeforeRequest.addListener( function(details) { if( details.url == "http://www.google.com/" ) return {redirectUrl: "http://www.google.com/?q=defaultquery" }; }, {urls: ["http://www.google.com/*"]}, ["blocking"]);
This is an extremely specific rule that redirects visits to http://www.google.com/ using http://www.google.com/?q=defaultquery , but I think you can see how to expand it to add more functionality.
Please note that this redirects all attempts to reach http://www.google.com/ , including Ajax and iframes requests.
In the documentation, you will need to add the webRequest and webRequestBlocking , as well as the host permissions for each host that you plan to intercept:
"permissions": [ "webRequest", "webRequestBlocking", "*://*.google.com/", ... ],
apsillers
source share