19 | | [TBD] |
| 19 | The signature of the `matches()` public method of the `RegExpFilter` class has now changed: |
| 20 | |
| 21 | {{{ |
| 22 | - matches(location, typeMask, docDomain, thirdParty, sitekey) |
| 23 | + matches(request, typeMask, sitekey) |
| 24 | }}} |
| 25 | |
| 26 | The first argument `request` should of type `URLRequest`, which is exported from `lib/url.js`. |
| 27 | |
| 28 | For example, the following call: |
| 29 | |
| 30 | {{{ |
| 31 | filter.matches("https://example.com/image.png", RegExpFilter.typeMap.IMAGE, |
| 32 | "example.com", false, null) |
| 33 | }}} |
| 34 | |
| 35 | It should now look like this: |
| 36 | |
| 37 | {{{ |
| 38 | filter.matches(URLRequest.from("https://example.com/image.png", "example.com"), |
| 39 | RegExpFilter.typeMap.IMAGE, null) |
| 40 | }}} |
| 41 | |
| 42 | The JSDoc for the `URLRequest` class incorrectly [https://hg.adblockplus.org/adblockpluscore/rev/cee47bcf494e#l3.42 marks it as @package]. Please ignore this, it is public, but there may be further changes to it. |