Last active
August 29, 2015 14:19
-
-
Save javi-moralesf/8581ec19f58b1c07cb3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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