Provide clients with a process to add their own Snippets
Background
Due to the snippet library (version 0.5.5) and related API changes in the 0.6.0 release of the web ext SDK, AdBlock can no longer add an additional Snippet to the snippet library.
Note: This issue was originally created in the web ext SDK repo (link to the original).
Use case
AdBlock created it's own isolated snippet when the Distraction Control filter lists were added a couple of years ago. The specificClicker
snippet was added because there wasn't a snippet that would click an element on a page. The specificClicker
snippet clicks element(s) in the document if / when all of the element(s) are found. The elements on the page can be identified with either a CSS selector or an XPath expression.
Previously, AdBlock could update the Snippet library at runtime, adding the specificClicker
snippet if necessary.
The module for the specificClicker
can be found here.
What to change
I believe there are a number options available to us:
- allow web ext clients to add snippets (in this case, an isolated snippet) either at build or runtime
- add the
specificClicker
snippet to the eyeo snippet library - fork the Snippet repository (this repo), and make the necessary changes to allow us to add our own changes
- utilize the
simulate-event-poc
snippet (where "poc" means we don't implement all types of events, but clicking should be easy-peasy)
Additionally, I would like to minimize any changes to the Distraction Control filter list.