Good evening everyone ,
I am beginning a chrome extension and in a certain scenario I need to redirect (change URL) of a user's tab .
Here's my code
function changeTabURL(tabName,addr) {
var tabId=parseInt(localStorage.getItem(tabName)); //fetch tab ID
chrome.tabs.update(tabId,{"url":addr});
}
Now here's what's happening , The Chrome:// ... thing is being prepended to my URL ! Say I try to redirect the tab to 'http://www.google.com' , this is what happens :
"No webpage was found for the web address: chrome-extension://oihdngeahhchnacpilhnmaknneooabbc/http://www.google.com"
I can't shake this ! I've tried resetting the URL first
chrome.tabs.get(tabId,function(tab) {
tab.url='';
alert(tab.url);
});
chrome.tabs.update(tabId,{"url":addr});
}
nothing I do shakes this .
Any thoughts?