Opened 7 months ago

Closed 7 months ago

Last modified 5 months ago

#4386 closed defect (fixed)

Document domain determined incorrectly after a redirect

Reported by: mapx Assignee: trev
Priority: P2 Milestone: Adblock-Plus-1.12.4-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: trev, kzar, sebastian, greiner Blocked By:
Blocking: Platform: Chrome
Ready: yes Confidential: no
Tester: Unknown Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29350357/
https://codereview.adblockplus.org/29350379/

Description (last modified by trev)

Environment

windows 10
chrome 53
ABP 1.12.2

How to reproduce

Observed behaviour

  • the page is not whitelisted

Expected behaviour

  • the page should be whitelisted, the ads visible, should be exactly as in ABP for firefox

If I remove theatlantic.com from whitelisted domains and add theatln.tc
the landing page: http://www.theatlantic.com/business/archive/2016/08/californias-smart-new-retirement-plan-and-the-industry-that-opposes-it/498038/?utm_source=atlfb

...will be whitelisted !

on forum: https://adblockplus.org/forum/viewtopic.php?f=10&t=48270

Background

chrome.webNavigation.onBeforeNavigate isn't being triggered after the redirect, it's merely being triggered for the original URL. It seems that we are using the wrong callback here - we shouldn't get the original URL in the first place because there is no document associated with it. Also, I suspect that onBeforeNavigate doesn't actually mean that the previous document is unloaded or that the navigation will definitely occur.

What to change

The chrome.webNavigation.onCommitted callback seems more appropriate here, as this one will only fire when the current document is replaced - which is what we need.

Change History (8)

comment:1 Changed 7 months ago by trev

  • Priority changed from Unknown to P1
  • Ready set
  • Summary changed from different behaviour in ABP firefox / chrome regarding whitelisting domains to Document domain determined incorrectly after a redirect

I can confirm this, seems to be a timing issue. The requests are being attributed to the wrong document URL, also visible in our Developer Tools panel (document domain is being shown as theatln.tc) - but only if I open Developer Tools when the page is loading already, having it open from the start makes things work correctly.

comment:2 Changed 7 months ago by trev

For reference, I reproduced this with the latest repository state on Chrome 52 and Mac OS X. I cannot really imagine this not being a regression however, probably caused by some internal Chrome change.

comment:3 Changed 7 months ago by trev

  • Description modified (diff)
  • Owner set to trev

comment:4 Changed 7 months ago by kzar

  • Review URL(s) modified (diff)

comment:6 Changed 7 months ago by trev

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

comment:7 Changed 5 months ago by sebastian

  • Priority changed from P1 to P2

comment:8 Changed 5 months ago by rraceanu

  • Verified working set

Issue no longer occurs, domains are whitelisted after redirect, verified on ABP version 1.12.2.1670, Chrome 41,45,51,53,54.

Note: See TracTickets for help on using tickets.