Opened 4 years ago

Last modified 4 years ago

#1759 new defect

ABP (android) blocks download of hosts-file list from hpHosts

Reported by: mapx Assignee:
Priority: Unknown Milestone:
Module: Adblock-Plus-for-Android Keywords:
Cc: Blocked By:
Blocking: Platform: Android
Ready: no Confidential: no
Tester: Verified working:
Review URL(s):

Change History (2)

comment:1 Changed 4 years ago by mapx

  • Description modified (diff)
  • Review URL(s) modified (diff)

comment:2 Changed 4 years ago by lewisje

I recently decided to look through the ABP for Android source code and found something interesting: At this point, there is a series of regexes for guessing request types by filename, 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 and then matches against the regexes.

The point is that some URLs, in some contexts, are treated very differently in ABP for Android vs. for Firefox or Chrome, 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.

In this particular case, the problem is that the hpHosts text file has a URL containing ad_servers: All URLs for downloading the file redirect to http://hosts-file.net/ad_servers.txt and that's problematic; a better idea would be to re-name the file and 301 redirect the old filename to the non-problematic one (maybe use Peter Lowe's idea and call it as.txt).

Note: See TracTickets for help on using tickets.