Content scripts can't access any extension APIs except for parts of chrome.extension. Instead, use window.open("http://www.google.com") (yes, this does create a new tab in Chrome; no, there aren't any user settings in Chrome that would change that). If you need more access to the extension APIs, you can use message passing to make your background page do things on behalf of the content script.
Read full article from chrome.tabs.create is giving an error - "Uncaught TypeError: Cannot call method 'create' of undefined" - Stack Overflow
No comments:
Post a Comment