我需要将网址从特定网站更改为另一个网站。
我manifest.json中包含的代码是
{
"name": "SafeTick",
"version": "0.1",
"manifest_version": 2,
"description": "Browse safely",
"browser_action": {
"default_icon": "icon.png",
"default_title": "SafeTick",
"default_popup": "extention.html"
},
"permissions":[
"tabs"
],
"icons": {
"128": "icon.png"
},
"content_scripts":[
{
"matches":[
"https://saac.instructure.com/*"
],
"js": ["content.js"]
}
]
}
我尝试使用chrome.tabs.update(undefined, {url: 'http://google.com'});
,但说
Uncaught TypeError: Cannot read property 'update' of undefined
at content.js:3
先谢谢了。