Opened 6 years ago

Last modified 3 years ago

#1564 new change

Fix FilterEngine::Matches for allowing request which is whitelisted in the ascendant node

Reported by: sergz Assignee: sergz
Priority: Unknown Milestone:
Module: Libadblockplus Keywords:
Cc: fhd, oleksandr Blocked By: #1585
Blocking: Platform: Unknown
Ready: no Confidential: no
Tester: Verified working: no
Review URL(s):



Let's say we have page A which loads resource B which loads resource C, thus A->B->C and the filter @@||C$SOME_TYPE,domain=A, where SOME_TYPE is not document. When we load resource C, the referer is B. We should not block C if the type of request for C is SOME_TYPE.

Let's consider the real example, in the method FilterEngine::Matches(url, contentType, documentUrls) the parameters are

url =
documentUrls[0] =
documentUrls[1] =

and filters


BTW, in FF it's not blocked.

What to change

Take a look at FilterEngine::Matches. We need to check whether there is some whitelisting entry for <url, contentType> and any page in the referer chain, thus CheckFilterMatch(url, contentType, documentUrls[i]); and we need to check the whitelisting entry for all CheckFilterMatch(documentUrls[i], "DOCUMENT", documentUrls[j]); where i <= j. It's not strong, i < j, because we also can whitelist the everything from the root page, for example @@||^$document, because document — the page itself.

Change History (5)

comment:1 Changed 6 years ago by sergz

  • Blocking 1565 added

comment:2 Changed 6 years ago by trev

The problem here isn't the matching - that one works correctly, both in Firefox and libadblockplus. It's rather that StandardMediaPlayerChromelessFlash.swf isn't a document - it's merely a Flash object inside a document. So the document URL for SmpAds.swf should still be world-europe-29105979. In other words, libadblockplus wants to get a frame structure - what it gets are referrers however, not quite the same thing...

comment:3 Changed 6 years ago by sergz

  • Blocked By 1585 added

comment:4 Changed 6 years ago by oleksandr

  • Blocking 1565 removed

comment:5 Changed 3 years ago by fhd

  • Cc trev removed
Note: See TracTickets for help on using tickets.