chrome.windows.create

2

I try to create a popup window from an addon, but the Google 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 execute it, it says:

 Uncaught TypeError: Cannot read property 'create' of undefined

I really do not know where the fault could be.

    
asked by Dealgrat 11.05.2017 в 17:18
source

1 answer

1

You may be trying to call the API from a content script . These can not access most features of the Google APIs, only those listed in the documentation .

p>

One possible solution is to delegate the call to a background script, sending it a message , and let it be the one that executes the action.

    
answered by 22.05.2017 / 18:55
source