Skip to content

Instantly share code, notes, and snippets.

@nealjin
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save nealjin/f6118ab083f03d54525a to your computer and use it in GitHub Desktop.

Select an option

Save nealjin/f6118ab083f03d54525a to your computer and use it in GitHub Desktop.
Google Chrome: Redirect URL
chrome.webRequest.onBeforeRequest.addListener(function(details){
var redirect_url = details.url.replace("googleapis.com", "useso.com");
if(redirect_url != details.url) {
console.log([details.url,redirect_url].join(' => '));
}
return {redirectUrl: redirect_url};
},
{ urls : ["http://ajax.googleapis.com/*", "http://fonts.googleapis.com/*"] },
["blocking"]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment