Skip to content

Commit

Permalink
Add scriptlet dependencies to reduce code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 26, 2023
1 parent 4399518 commit 236fb3a
Show file tree
Hide file tree
Showing 3 changed files with 536 additions and 595 deletions.
Loading

4 comments on commit 236fb3a

@uBlock-user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use patternToRegex in custom-scriptlets ?

@gorhill
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, custom scriptlets use the old parser, the new format works only for builtin scriptlets.

@uBlock-user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I converted all my scriptlets to new scriptlet format function(){} so thought this would work too.

@gorhill
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scriptlets.js is now imported as a javascript module, not parsed as a text. To support dependencies I would need to extend the text parser to support a dependencies field. Not sure it's worth it, using own scriptlets is quite niche.

Please sign in to comment.