Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: exception of script injection not respecting aliases #4376

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

seia-soto
Copy link
Member

fixes #4058

This PR adds:

  • public resolveScriptlet to expose private scriptletsByName and the scriptlet objects (we need another method since public getScriptlet returns fully compiled scriptlet) in resources
  • public getScriptletSelector(resolver: (name: string) => string | undefined): string to normalise the selectors of script inject cosmetic filters in cosmetic filters

The approach comes with not to add dependency to CosmeticFilter and not to halt existing properties of Resources (including private ones).

- drop unused methods
- simplify scriptlet name parsing
@seia-soto seia-soto self-assigned this Oct 18, 2024
@seia-soto seia-soto requested review from chrmod and removed request for remusao October 18, 2024 05:16
@seia-soto seia-soto added the PR: Bug Fix 🐛 Increment patch version when merged label Oct 18, 2024
packages/adblocker/src/resources.ts Outdated Show resolved Hide resolved
packages/adblocker/src/engine/engine.ts Outdated Show resolved Hide resolved
@chrmod chrmod requested a review from remusao October 21, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Bug Fix 🐛 Increment patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adblocker: the library should respect the scriptlet alias in the exception filter
2 participants