DescriptionThe trouble is that we are manually crafting the filter text from the current URL. As result for the URL http://www.fotor.com/some-path we get '@@||www.fotor.com^$document' and we cannot remove filter '@@||fotor.com^$document' because it's different. The solution to merely always remove 'www.' does not fit either because it's possible to create '@@||www.fotor.com^$document' filter by adding 'www.fotor.com' via settings.
There is also another way (BTW, which is used by our extension for Google Chrome) to find the exception filter and remove it, which I propose to have now. I guess it's closer to the user's intention, he does not care whether the web site is whitelisted by domain or by using another exception filter.
# Actually I would like to have such functionality in the core to avoid any different behaviour on different platforms but it's not easy/fast process to make changes in the core and pull them here.
# See https://issues.adblockplus.org/ticket/2031
BTW, Chrome removes "www." prefix when the user disables ABP on the particular web site, so I've added it as well. As well as I propose to do it even when the domain is being added through the settings page. So, if user added www.some-domain.com and visit some-domain.com it's whitelisted. Even more, here it's possible to enter http://www.some-domain.com/some-path (we had already received some complains from the users that they are doing it and it does not work) and get some-domain.com to be whitelisted.
Additional technical details:
- PROC_ADD_FILTER and PROC_REMOVE_FILTER are renamed to PROC_ADD_WHITELSITED_DOMAIN and PROC_REMOVE_WHITELSITED_DOMAIN, respectively because they don't expect a filter text any more but expect the actual domain.
- PROC_TOGGLE_WHITELISTING is introduced to reduce the number of trips to the engine as well as to move the logic closer to the libadblockplus.
# I hope eventually such functionality will be in the core and it seems quite straightforward to get rid of it in favour of the using API of libadblockplus.
- [Utils] ReplaceString is a template function, so we can use it either with std::wstring or std::string.
- [Utils] move ASCIIStringToLower to Utils, because we need it also in the engine.
# Again, core library normalizes the URL and, as far as I know, supports unicode, so it's yet one reason to share such logic among all platforms rather than implement it in each extension.
- [Utils] add BeginsWith. I've seen we use it in some other parts, however I've not touched them because they are not relevant to the current change.
Patch Set 1 #
Total comments: 16
MessagesTotal messages: 11
|