Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@javi-moralesf
Last active August 29, 2015 14:19
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 javi-moralesf/8581ec19f58b1c07cb3d to your computer and use it in GitHub Desktop.
Save javi-moralesf/8581ec19f58b1c07cb3d to your computer and use it in GitHub Desktop.
// React when a browser action's icon is clicked.
chrome.browserAction.onClicked.addListener(function(tab) {
var whois_host = "https://who.is/whois/";
var current_host = url_domain(tab.url);
window.location = whois_host + current_host;
});
function url_domain(data) {
var a = document.createElement('a');
a.href = data;
return a.hostname;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment