Changes between Version 42 and Version 48 of Ticket #7067


Ignore:
Timestamp:
01/31/2019 05:09:19 AM (19 months ago)
Author:
mjethani
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7067

    • Property Status changed from reviewing to closed
    • Property Resolution changed from to fixed
    • Property Blocking changed from to 7240
  • Ticket #7067 – Description

    v42 v48  
    11=== Background === 
    2 Allow $rewrite to internal resources. 
     2Instead of blocking URLs, we can redirect requests to internal resources built into Adblock Plus, which would have the same effect as blocking the URL but without triggering the `onerror` handlers (avoiding detection and circumvention). 
    33 
    4 This option still take one parameter which is the name of a "resource", prefixed by `abp-resource:`. 
     4Some of the use cases are as follows: 
    55 
    6 Its effect is that the URL rewrite will give the content of the "resource" instead. Resources are built into the WebExtension and cannot be third-party. 
     6 * Serve a useless (no-op) JS script and not trigger the `onerror` handler 
     7 * Neutralize tracking pixels (images) by serving a built-in alternative and never hitting the remote server 
     8 * Serve an empty sound file to replace the one that is unwanted 
    79 
    8 In that case the `$rewrite` option requires that the URL contains a host (`||` or `*`) and also that a `$domain` or `$~third-party` option be present. 
     10To make this work, we could reuse the `$rewrite` filter option, but instead of rewriting to a different URL on the same origin it would rewrite to an internal resource specified using the `abp-resource` protocol identifier. 
    911 
    10 Use case are as follow: 
    11 - send a useless (no-op) JS script and not trigger the onerror handle 
    12 - neutralise tracking pixel/images by providing its own and never hitting the remote server. 
    13 - Send an empty soundfile that will replace one that in unwanted. 
     12=== Specification === 
     13 
     14This `$rewrite` option still takes one parameter, which is the name of a "resource", prefixed with `abp-resource:`. 
     15 
     16Its effect is that the URL rewrite gives the content of the "resource" instead. Resources are built into the WebExtension and cannot be third-party. 
     17 
     18In this case the `$rewrite` option requires that the URL pattern contains a host (starts with `||` or `*`) and also that a domain is present. The domain may be specified using the `$domain` option or, if the URL pattern starts with `||`, the `$~third-party` option. 
     19 
     20=== Examples === 
     21 
     22For the following frame in an HTML document: 
     23 
     24{{{ 
     25<iframe src="https://example.com/foo/bar.html"></iframe> 
     26}}} 
     27 
     28The filter `||/foo/bar.html^$rewrite=abp-resource:blank-html` would serve the content `data:text/html,<!DOCTYPE html><html><head></head><body></body></html>` into the frame instead of fetching the actual content from the remote host. 
    1429 
    1530=== What to change === 
    1631 
    17 - In the file `filterClass.js` modify the support for the `$rewrite` option when  parsing the filters, validating it. 
    18 - Add it to the unit tests. 
    19 - Implement the resource retrieval. 
    20 - Add relevant resources to a separate file like it is done for snippets. 
    21  
    22 No changes need to be done in the WebExtension beside updating the adblockpluscore dependency. 
     32[TBD] 
    2333 
    2434=== Hints for testers === 
  • Ticket #7067 – Review URL(s)

    v42 v48  
    11https://codereview.adblockplus.org/29928557/ 
    2 https://codereview.adblockplus.org/29933567/