Chrome.tabs.create gives an error message - "Uncaught TypeError: cannot call the create method from undefined"

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?

+5
source share
1 answer

API ; , docs. window.open ( " http://www.google.com ") (, Chrome, , Chrome - , ). API , , - script.

+18

All Articles