Opened on 01/07/2015 at 10:48:25 AM
Last modified on 01/24/2015 at 08:30:46 AM
#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): |
Description (last modified by mapx)
Environment
abp for android
How to reproduce
a user reported the download of some files is blocked:
http://hosts-file.net/ad_servers.asp
http://updates.it-mate.co.uk/hphosts/ad_servers.asp
http://hosts-file.net/abp.php
from:
https://adblockplus.org/forum/viewtopic.php?p=114128#p114128
Attachments (0)
Change History (2)
Note: See
TracTickets for help on using
tickets.
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).