Google Chrome Extension get page information
问题 I'm making a google chrome extension, and I need to get the current page URL and title. How can I achieve this? 回答1: chrome.tabs.getSelected(null, function(tab) { //<-- "tab" has all the information console.log(tab.url); //returns the url console.log(tab.title); //returns the title }); For more please read chrome.tabs. About the tab object, read here. Note: chrome.tabs.getSelected has been deprecated since Chrome 16. As the documentation has suggested, chrome.tabs.query() should be used along