I try to create a new popup-style window from an addon, but Google's documentation seems insufficient.
Code:
var opciones ={
'url': url,
'width':400,
'height':300,
'type': 'popup'
};
chrome.windows.create(opciones, function(window) {
console.log("ventana creada");
});
When I run it, it tells me:
Uncaught TypeError: Cannot read property 'create' of undefined
I really don't know where the error could be.
You may be trying to make the API call from a content script . They cannot access most of the features of the Google APIs, only those listed in the documentation .
A possible solution is to delegate the call to a background script, sending it a message , and let it execute the action.