window.onload=function(){chrome.windows.getCurrent(function(window){chrome.tabs.getSelected(window.id,function(tab){//取域名varhname=tab.url.toLowerCase().replace("http://","").replace("https://","").replace('www.','').split('/')[0];//下面是要进行的操作});});};