Chrome Extension: Open New Popup Window -


could shed light on code incorrect please

<script>     chrome.browseraction.onclicked.addlistener(function(window) {         chrome.windows.oncreated.addlistener(function(enumerated string ["popup"]) {             chrome.windows.create({'url': chrome.extension.geturl('redirect.html')}, function(window) {             });         });     }); </script> 

i'm trying achieve when extension clicked on new popup window load.

you don't need listener, create right away:

chrome.browseraction.onclicked.addlistener(function() {    chrome.windows.create({'url': 'redirect.html', 'type': 'popup'}, function(window) {    }); }); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -