Hello,
I got a question about opening a new window and additional tabs in that window. What I want to do is that when the extension icon is clicked, a small popup is presented, where a link is shown. When the link is clicked, open multiple URLs in a new window. Here is my code:
When the "Click me" is clicked, a new window is opened showing only cnn page, not any more tabs, although showing yahoo page is expected.Code:<script type="text/javascript"> function call1(){ chrome.windows.create({url:"http://www.cnn.com"}, function (win1){ console.log("message1"); chrome.tabs.create({url:"http://www.yahoo.com/", windowId:win1.id}); }); console.log("message2"); } </script> <body> <a href="javascript:call1();">Click me</a><br> </body>
An interesting point is that when I run the same thing under debug mode, it works as I wanted (also putting the two messages out well).
Could anybody help me to figure this out?


LinkBack URL
About LinkBacks



Reply With Quote
