Potential source of ABP inconsistencies in Android vs Others

Everything about using the stand-alone Adblock Plus app on Android
Post Reply
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Potential source of ABP inconsistencies in Android vs Others

Post by lewisje »

I just decided to look through the ABP for Android source code and found something interesting here: https://hg.adblockplus.org/adblockplusa ... s.java#l56
At this point, there is a series of regexes for guessing request types by filename (which could use some updating for WEBP and WOFF2), because as I expected, a local proxy server does not have the intimate knowledge of request types that an extension making full use of a browser API would have.

This part of the code first checks the accept header (proxy servers can still sniff HTTP headers, even if they can't tell "object" from "other") and then matches against the regexes: https://hg.adblockplus.org/adblockplusa ... .java#l382

The point is that some URLs, in some contexts, are treated very differently in ABP for Android vs. for Firefox or Chrome (there are differences between Firefox and Chrome too, but they're more minor, like Chrome can't distinguish object from object_subrequest), and in particular there appears to be no exception for the top-level or URL bar request (a.k.a. the "document"), leading to problems like the blocking of an hpHosts URL by ABP for Android even though ABP for Firefox or Chrome would not block it.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Potential source of ABP inconsistencies in Android vs Others

Post by mapx »

@lewisje,

You should add your post as comment to the issue opened on the bug tracker:
https://issues.adblockplus.org/ticket/1759
Post Reply