First, you've to set the permissions for the tab API :
And to store the URL :
"permissions": [
"tabs"
]
And to store the URL :
chrome.tabs.getSelected(null,function(tab) {
var tablink = tab.url;
});