by sri · 16y ago · 0 comments
Its equivalent in Chrome seems to be chrome.tabs.create. But when I tried that, I get this error: "chrome.tabs is not supported in content scripts". It seems that these "content scripts" aren't as powerful as extensions (http://code.google.com/chrome/extensions/content_scripts.htm...). Am I missing something here?
One is content scripts - which don't have access to certain parts of the Chrome api like opening tabs.
However, each extension can have what they call a background page. This is just an html page which is loaded in the background and there can be exactly one for every extension.
So you should be able to have your content script communicate with the background page (there is a mechanism for this) and let the background page open the tab.
For this, you'll have to write a fully-fledged extension though. The greasemonkey scripts probably don't generate a background page when they get converted into an extension at install-time.