Opened on 05/13/2018 at 01:46:36 PM

Closed on 08/29/2019 at 05:43:52 PM

Last modified on 10/08/2019 at 06:04:58 PM

#6667 closed change (rejected)

Reuse code from ElemHide module for faster lookup of Snippets scripts

Reported by: mjethani Assignee: mjethani
Priority: Unknown Milestone:
Module: Core Keywords: circumvention, closed-in-favor-of-gitlab
Cc: kzar, sergz, arthur Blocked By: #6652
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by mjethani)

Background

In 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.

We 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.

What to change

(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.)

Attachments (0)

Change History (5)

comment:1 Changed on 05/13/2018 at 01:54:26 PM by mjethani

  • Description modified (diff)

comment:2 follow-ups: Changed on 05/14/2018 at 08:42:01 AM by arthur

  • Cc arthur added

comment:3 in reply to: ↑ 2 Changed on 05/16/2018 at 09:45:10 AM by deblx

spam

Last edited on 10/08/2019 at 06:04:55 PM by kzar

comment:4 in reply to: ↑ 2 Changed on 05/16/2018 at 10:15:43 AM by deblx

spam

Last edited on 10/08/2019 at 06:04:58 PM by kzar

comment:5 Changed on 08/29/2019 at 05:43:52 PM by sebastian

  • Keywords closed-in-favor-of-gitlab added
  • Resolution set to rejected
  • Status changed from new to closed

Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from mjethani.
 
Note: See TracTickets for help on using tickets.