I'm discovering how to develop a Chrome extension and I can't find actually how to change the active url. I would like to get informations from websites and pack them.
Actually the first lines of this code work. I've tried different ways to change the url, can't find the right one...
$("body").css('background-color', 'pink');
$("body").html('COUCOU');
setTimeout(function(){
var myNewUrl = "http://www.google.com";
chrome.tabs.update(active, {url: myNewUrl});
}, 2000);;
My manifest is :
{
"name": "A browser action with a popup that changes the page color",
"description": "Change the current page color",
"version": "1.0",
"permissions": [
"activeTab", "tabs"
],
"browser_action": {
"default_title": "Set this page's color.",
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"content_scripts": [ {
"js": [ "jquery.js", "background.js" ],
"matches": [ "http://*/*", "https://*/*"]
}],
"manifest_version": 2,
"content_security_policy": "script-src 'self' https://ajax.googleapis.com; object-src 'self'"
}
Can someone help me?