Comments (4)
@remusao no worries! Don't really need an answer to this anymore, requirements changed slightly. Thank you np!
from adblocker.
Hi @jahamed,
Trying to rephrase what you mean, let me know if I get this right. You have a domain in mind like easypic.com
and you would like to know the list of filters that match this domain?
For example ||easypic.com/js/easypicads.js
(exact hostname match), ||cdn.easypic.com/js/easypicads.js
(hostname with a subdomain), ||examle.com/js/script.js$domain=easypicads.com
(hostname appears in domain
option).
But would not find: ||example.com/js/easypicads.js
(easypicads
appears but not with .com
suffix) or ||example.com/easypicads.com/js
(easypicads.com
appears but not in a position that it would match on the hostname of a request).
Is that correct? If so you can probably use this library to do the parsing of rules and filtering with the domains you're interested in. Does this need to be very fast? Otherwise, simpler approaches might also work.
I hope that helps,
from adblocker.
Hi @remusao sorry for the late response,
Yes all those cases you listed are ones I want to detect! I would like to see if a domain simply exists in an adblock filter list (basically either the entire website or some script from there was considered bad at some time). It needs to be a bit fast since there are a ton of filter lists to look at, is there a way to load multiple filter lists into an engine? Is there a limit on that?
Currently I have
import { FiltersEngine } from '@cliqz/adblocker'
import { Request } from '@cliqz/adblocker'
import fs from 'fs'
const engine = FiltersEngine.parse(fs.readFileSync('test.txt', 'utf-8'))
const { match } = engine.match(
Request.fromRawDetails({
url: 'http://exampledomain.com',
})
)
console.log(match)
Does this look correct? What type would I use in the request for a url? Also is there a way I can combine multiple filterlists together into the filterengine? Basically hoping to use whatever parsing/searching algorithms you have built into this library since simple linear search is too slow for me 😃
Thanks!
from adblocker.
Hi @jahamed,
Sorry for the delay of answer. Are you still interested in this? If so, I wanted to clarify one last point, are you giving as input a list of domains that you would like to find in the lists? Or a single one?
Best,
from adblocker.
Related Issues (20)
- Respect exception rules in `getPatternMetadata` or any TrackerDB matching functions HOT 1
- Wrong Filter List Link HOT 1
- [adblocker-electron] youtube.com not loading HOT 3
- Add support for $removeparam
- `PuppeteerBlocker.fromPrebuiltFull` broken HOT 1
- [adblocker-electron] fails to inject scriptlet due to CSP issue HOT 9
- Improve feedback from getCosmeticsFilters
- Failures on options parsing if a filter has `$` character later than actual options index
- Support `$replace` HOT 1
- King HOT 1
- Feature Request: Add manual entry to list HOT 2
- Support `$document` HOT 1
- built fullLists into the package HOT 6
- Support `#%#`
- Preprocessor documentation
- [Typescript] CommonJS module support HOT 6
- adblocker: the library should respect the scriptlet alias in the exception filter
- adblocker-extended-selectors: support native `:has`
- ads showed with 1.30.0 version HOT 6
- Build error 'Cannot find namespace 'browser'' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adblocker.