My .json manifest contains
"content_scripts": [
{
"matches": ["http://www.facebook.com/*","https://www.facebook.com/*"],
"js": ["js/jquery-1.7.2.min.js", "js/jquery.livequery.min.js", "js/script.js"]
}
]
and the contents of script.js
$("#FB_HiddenContainer").livequery(function(){
chrome.tabs.create({"url":"http://www.google.com"});
});
When I open facebook, the console reports an error
Uncaught TypeError: unable to call "create" method from undefined
at
chrome extension: //whateveristhisweirdcode/JS/script.js: 2
How can I open a new tab?
source
share