popup.js chrome.tabs.getSelected(null, function (tab) { // 先获取当前页面的tabID alert(tab.title); alert(tab.url); });