Skip to content

Instantly share code, notes, and snippets.

@Lordnibbler
Created November 14, 2013 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lordnibbler/2b616adfa4662ece5095 to your computer and use it in GitHub Desktop.
Save Lordnibbler/2b616adfa4662ece5095 to your computer and use it in GitHub Desktop.
chrome.webRequest.onAuthRequired.addListener(function(details, callback) {
if (details.url.match(basic_auth_url)) {
callback({"authCredentials":{"username":basic_auth_username,"password":basic_auth_password}});
chrome.tabs.update(basic_auth_tab_id, {url: basic_auth_redirect_url});
} else {
callback();
}
}, {"urls":["http://*/*", "https://*/*"]},["asyncBlocking"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment