New issue
Advanced search Search tips

Issue 801228 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Chrome popup blocking multiple urls opened at the same time

Project Member Reported by jkadams@google.com, Jan 11 2018

Issue description

This is probably working as intended, but did popup blocking get more restrictive in the last release or two?

For example, running this JS will only open the first window, and the second window will be blocked (depending on the site you execute the JS on), and Chrome silently shows a tiny popup blocked icon.

Basically, we have a feature that opens a list of links each in a new tab, and users have started complaining within the last week that it doesn't work any more. Maybe before it was more obvious that a popup was blocked?

// Prevent referrer leaking
openUrl = function(url, target) {
  newWin = window.open('', target, '');
  if (newWin) {
    newWin.opener = null;
    var html = '<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url=' + url + '">';
    newWin.document.write(html);
    newWin.document.close();
  }
}

newWindow = function(url) {
  openUrl(url, Math.random()+'');
}

newWindow('https://www.google.com');
newWindow('https://www.yahoo.com'); // this doesn't open

// You could also just use window.open and it'd still be blocked, but when you do it this way (to prevent referrer leaking) it shows about:blank in the popup blocked list and clicking on it just opens a blank tab.

For reference, I'm on 63.0.3239.132 Linux.
 
Cc: a...@chromium.org
Components: UI>Browser>PopupBlocker
At first glance this seems to be WAI, and I'm surprised this used to work. Usually Chrome tries to block all subsequent popups after the first one, unless there is a user gesture in between.

cc avi, any ideas on what could have changed here in M63?
I just went back and tested it on a random build in Chrome 54 and I could still repro. My repro file is just calling your "newWindow" function twice in the document's click handler.

So I'm a bit stumped on what the actual issue or change is.

Comment 3 by jkadams@google.com, Jan 16 2018

What about this:

1. Open this sheet
https://docs.google.com/spreadsheets/d/1xMAQh5mlF12aEhAh4uZNx41PAzSA6U8fDTFNhgIMFxg/edit#gid=0
2. Click and drag to select cells C2 and C3
3. Right click and select "Open all links", and see if that works in old Chrome?
Yeah I just tested using the same M54 build and only one popup goes through.

Comment 5 by a...@chromium.org, Jan 21 2018

I can't think of anything that would have changed here in 63.

Sign in to add a comment