Opened on 09/27/2016 at 11:41:01 AM

Closed on 09/29/2016 at 07:31:30 AM

#4473 closed defect (invalid)

AA is hidden with elemhide selectors

Reported by: asmirnov Assignee:
Priority: P2 Milestone:
Module: Core Keywords:
Cc: sergz Blocked By:
Blocking: #4399 Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by asmirnov)


I've found this while testing AdblockWebView component for Android that inherits Android WebView class and adds ad-filtering (both filtering resource loading using filterEngine.matches(..) and element hiding using filterEngine.getElementHidingSelectors(..)). I'm configuring AA by adding/removing subscription to (actually it's filterEngine.getPref("subscriptions_exceptionsurl")).

How to reproduce

  1. disable AA exceptions subscription (the link above)
  2. invoke filterEngine.getElementHidingSelectors(..) for "" and get 17387 selectors. make sure ads is NOT shown for "iphone 6 plus" request in
  3. enable AA by adding subscription (the link above)
  4. invoke filterEngine.getElementHidingSelectors(..) for "" and get 17388 selectors. make sure ads is NOT shown for the request above.

I've expected selectors count to be significantly lower or modified while AA enabled but in fact the lists are pretty equal. Note that the lists have the same items but the order is different. This may (but less likely) be affected by previous loading (i'm typing "" then it's redirected to "", then to "".


Observed behaviour

AA banners are NOT shown in both cases. More: i can see the resources are loaded and shown for a short period of time and then hidden. It's flickering because DOM "DOMContentLoaded" event is fired not immediately and then hiding rules are applied and the banners are hidden.

Expected behaviour

AA banners ARE shown when subscribed to exceptions subscription.


Testing with the latest libadblockplus (hg revision 96e9bae77a24) - recompiled for x86 and testing with android emulator on mac.
"patterns.ini" looks ok and the subscription is downloaded (see attached archive)
Log file attached.

Attachments (3) (3.7 MB) - added by asmirnov on 09/27/2016 at 11:41:27 AM.
app fs dump
aa.log (7.1 KB) - added by asmirnov on 09/27/2016 at 11:41:40 AM.
app log file
Снимок экрана 2016-09-27 в 16.59.56.png (116.9 KB) - added by asmirnov on 09/27/2016 at 11:59:49 AM.
app scr

Download all attachments as: .zip

Change History (11)

Changed on 09/27/2016 at 11:41:27 AM by asmirnov

app fs dump

Changed on 09/27/2016 at 11:41:40 AM by asmirnov

app log file

comment:1 Changed on 09/27/2016 at 11:42:20 AM by asmirnov

  • Summary changed from AA is filtered out to AA is hidden with elemhide selectors

comment:2 Changed on 09/27/2016 at 11:44:28 AM by asmirnov

  • Description modified (diff)

comment:3 Changed on 09/27/2016 at 11:45:48 AM by asmirnov

  • Cc sergz added

comment:4 Changed on 09/27/2016 at 11:49:14 AM by asmirnov

  • Description modified (diff)

comment:5 Changed on 09/27/2016 at 11:51:08 AM by asmirnov

  • Description modified (diff)

Changed on 09/27/2016 at 11:59:49 AM by asmirnov

app scr

comment:6 Changed on 09/27/2016 at 12:21:18 PM by asmirnov

  • Description modified (diff)

comment:7 Changed on 09/29/2016 at 07:27:30 AM by asmirnov

i've continued the research and found that referrers makes sense in this particular case.

A brief note: Android does not provide referrer until Android 21 since, android.webkit.WebResourceRequest) is available starting Android 21 only.

So filterEngine.isElemhideWhitelisted(url, null) was used instead of passing referrers list.

I've modified the sources to use Android API 21 and used request header "Referer" to get referer and trying filterEngine.isElemhideWhitelisted(url, new String[] { referer }).


filterEngine.isElemhideWhitelisted(url, referers);
returns true

filterEngine.isElemhideWhitelisted(url, null)
returns false

So now it's working as expected - AA banners are not hidden if AA checkbox is checked.

comment:8 Changed on 09/29/2016 at 07:31:30 AM by asmirnov

  • Resolution set to invalid
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none).
Note: See TracTickets for help on using tickets.