Changes between Initial Version and Version 1 of Ticket #6667


Ignore:
Timestamp:
05/13/2018 01:54:26 PM (2 years ago)
Author:
mjethani
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6667 – Description

    initial v1  
    11=== Background === 
    2 In the initial implementation of Snippets (see #6538), we use the same logic as `ElemHideEmulation` for lookup up scripts for a given domain. We go through all the snippet filters and check if the filter applies on the domain. This should be OK when the list of filters is small, but it will likely not be good enough once we start using Snippets aggressively. 
     2In the initial implementation of Snippets (see #6538), we use the same logic as `ElemHideEmulation` for looking up scripts for a given domain. We go through all the snippet filters and check if the filter applies on the domain. This should be OK when the list of filters is small, but it will likely not be good enough once we start using Snippets aggressively. 
    33 
    44We inject the JavaScript into the document using `tabs.executeScript` in the `webNavigation.onCommitted` handler (see #6539). Often by the time our code has a chance to run, it may be too late, as the HTML document may have already executed its own code to circumvent the snippet. This is particularly true for API wrappers. 
    55 
    66=== What to change === 
    7 (Find a nice way to reuse the logic in the `ElemHide` module for looking up scripts for a domain efficiently. Also see #6652 and #6665. Update this section.) 
     7(Find a nice way to reuse the logic in the `ElemHide` module for looking up scripts for a domain efficiently. At the very least, index filters by domain and reuse the selector matching code in `ElemHide`. We may also want to do some more optimizations. For example, if we know that there are no exceptions for a domain, we could "whitelist" it and return all the filters for the domain without any checks. We might also want to cache the results specifically for snippet scripts. Also see #6652 and #6665. Update this section.)