0

I had tried to open a page in a new window with

goog.window.open('/urlToOpen', {
      "location": false,
      "menubar": false,
      "statusbar": false
  });

However, Google Chrome's popup blocker prevented me from doing so when this code executed.

Google docs open in new tabs for editing. Can I similarly open a new tab with Closure?

John
  • 5,443
  • 15
  • 21
dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206

1 Answers1

0

Have you tried executing your code as a callback to a user-driven browser event e.g. a button click? Chrome suppresses the opening of new windows/tabs otherwise.

<a class="link" href="#">Some link</a>

Try it out in this jsfiddle.

$('.link').click(function() {
  goog.window.open('/urlToOpen', {
    "location": false,
    "menubar": false,
    "statusbar": false
  });
});
MADgood
  • 143
  • 1
  • 1
  • 8