Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#3568 closed defect (fixed)

"window.location is null" error prevents blocking pop-ups

Reported by: SMed79 Assignee: trev
Priority: P3 Milestone: Adblock-Plus-2.7.2-for-Firefox
Module: Adblock-Plus-for-Firefox Keywords:
Cc: trev, erikvold, mapx, sebastian, greiner, arthur Blocked By: #4335
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29336233/

Description (last modified by trev)

Environment

OS: Manjaro Linux
Firefox 43.0.4
Adblock Plus 2.7.1

How to reproduce

1- Go to http://delishows.to/show/chicago-med/season/1/episode/6
2- Click anywhere.

Observed behaviour

A pop-up opens: http://fabolele.com:8098/api/v1/cspop redirecting to http://zeroredirect1.com/delishows.to redirecting to http://www.tradeadexchange.com/a/display.php. Blockable items list doesn't show a pop-up. Message "window.location is null" shows up in Error Console pointing to lib/child/utils.js line 64 (function getWindowLocation).

Expected behaviour

Pop-up should be blocked by filter ||zeroredirect1.com^$popup,third-party in EasyList, no error messages.

Background

This site hides the opener of the window using the following code:

var wnd1 = window.open("http://www.google.com/");
var wnd2 = wnd1.open();
setTimeout(function(){
  wnd2.location = "http://zeroredirect1.com";
  wnd1.close();
}, 100);

So the actual target is being opened via an intermediate window which is immediately closed. The intermediate window being gone makes it impossible for us to retrieve the pop-up's opener, instead we get a dummy window which doesn't have a location.

Change History (20)

comment:1 Changed 4 years ago by mapx

  • Cc trev erikvold mapx added
  • Component changed from Unknown to Adblock-Plus-for-Firefox

comment:2 Changed 4 years ago by mapx

could be the same issue ? ==> https://issues.adblockplus.org/ticket/2095

comment:3 Changed 4 years ago by mapx

  • Cc sebastian greiner added

comment:4 Changed 4 years ago by mapx

ublock has already a $popunder feature blocking this sort of ads

comment:5 Changed 4 years ago by SMed79

another example open an popup in newtab redirect to zeroredirect1.com
http://neodrive.co/embed/QDHS20ASC0DUDU4YDWG3J6EEQ (same click anywhere).

comment:6 Changed 4 years ago by sebastian

If I understand the issue correctly, this isn't a regression as implied by the title, but refers to the technique that websites deploy to circumvent popup blocking by loading the actual content in the new document, while navigating the current document to a page showing advertisement. It seems that uBlock introduced a $popunder filter option to block this behavior, which seems reasonable and worth consideration.

comment:7 Changed 4 years ago by Compuitguy

Yeah

It is an old issue that is being discussed here

#2095 (Prevent background redirects)

comment:8 Changed 4 years ago by trev

  • Description modified (diff)
  • Priority changed from Unknown to P1
  • Ready set
  • Summary changed from popup blocking broke [ABP 2.7.1] to "window.location is null" error prevents blocking pop-ups

No, this has nothing to do with background redirects, not sure where you've got it from. Both sites open regular pop-ups, triggered by click. The problem is that our code fails to see the location of the pop-up window for some reason. I updated the description and title accordingly.

comment:9 Changed 4 years ago by trev

Looking at http://hg.mozilla.org/mozilla-central/file/7042e8a19f94/dom/base/nsGlobalWindow.cpp#l9411, window.location can only be null for a window without a docshell. To my knowledge that's supposed to be an impossible situation for Gecko, but maybe something changed...

comment:10 Changed 4 years ago by trev

I verified that the issue is reproducible in Firefox 38, 44 and 47 - so clearly nothing relevant changed Gecko-wise.

comment:11 Changed 4 years ago by trev

  • Description modified (diff)

comment:12 Changed 4 years ago by Compuitguy

My comment wasn't related to this issue.

It was a response to the the previous comments about background redirects.

comment:13 Changed 4 years ago by trev

  • Owner set to trev

comment:14 Changed 4 years ago by trev

  • Priority changed from P1 to P3
  • Review URL(s) modified (diff)

Decreased priority given that this doesn't appear to be a regression - rather the website messing with us.

comment:15 Changed 4 years ago by trev

  • Milestone set to Adblock-Plus-for-Firefox-next
  • Resolution set to fixed
  • Status changed from new to closed

comment:16 Changed 4 years ago by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Fixed. The popup tab is opened for a split second, then it is closed.

ABP 2.7.2
Firefox 38.0 / Firefox 43.0.1 / Ubuntu 14.04 x64

comment:17 Changed 4 years ago by SMed79

Some one can investigate if the data: URI popup can be handled/blocked by ABP on www.jeux.com

Last edited 4 years ago by SMed79 (previous) (diff)

comment:18 Changed 4 years ago by arthur

I checked it with the latest dev build on http://neodrive.co/embed/QDHS20ASC0DUDU4YDWG3J6EEQ but it's not working. It does in Chrome though.

comment:19 Changed 4 years ago by arthur

  • Cc arthur added

comment:20 Changed 3 years ago by trev

  • Blocked By 4335 added
Note: See TracTickets for help on using tickets.