Efficient embeddable adblocker library
MPL-2.0 License
Bot releases are hidden (Show)
Published by remusao about 5 years ago
engine
to blocker
in example projects (consistent naming)resourcesUrl
in fromLists(...)
(we always use the one served from CDN)Published by remusao about 5 years ago
This marks the first "stable release" of @cliqz/adblocker
. The project has been stable for a long while and running in production for millions of users. It was about time to graduate it to v1
! This does not mark the end of the development and innovation but more of a "checkbox ticked"; people looking at the project can now safely feel like they can use it in production and @cliqz/adblocker
will not let them down! In the future, we will continue supporting bleeding edge features, new filters and keep the performance great.
Changelog since v0.14.0
:
detectFilterType
and Resources
eslint
completely (all source code is TypeScript so tslint
is enough)Dockerfile
, run_tests.sh
bench
to TypeScriptbench/dataset/
folderPublished by remusao about 5 years ago
Published by remusao about 5 years ago
Published by remusao about 5 years ago
Published by remusao about 5 years ago
allow correct size allocation for data views #257
Implement a mechanism which allows to predict the number of
bytes needed to serialize any of the data-structures used by the
adblocker, ahead of time (before serialization). This allows to lift
the limitation of size completely (beforehand, we had to allocate
a safe amount of memory to be sure there would be enough space).
As a benefit, only the required amount of memory is used during
initialization and updates, and there is no longer an arbitrary and
hard-coded upper limit.
create new @cliqz/adblocker-content package with common utils #264
We currently rely on rollup to create a small bundle for content
related code imported from @cliqz/adblocker. Multiple times in
the past the bundler was not aggressive enough and code from
background was pulled in content bundles. To make sure we do not
have this issue again, all these content-scripts helpers are moved
into their own package.
provide helpers to download and build engines from lists #280
This change allows to start blocking ads with very little logic in
Webextension, Electron and Puppeteer platforms! To achieve this,
blockers abstraction now provide static methods to fetch pre-built
engines from Cliqz's CDN or build them from scratch using lists of URLs
to subscriptions. Here is how it looks like:Webextension:
import { WebExtensionBlocker } from '@cliqz/adblocker-webextension'; WebExtensionBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => { blocker.enableBlockingInBrowser(); });
Electron:
import { session } from 'electron'; import fetch from 'cross-fetch'; // or 'node-fetch' import { ElectronBlocker } from '@cliqz/adblocker-electron'; ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => { blocker.enableBlockingInSession(session.defaultSession); });
Puppeteer:
import puppeteer from 'puppeteer'; import fetch from 'cross-fetch'; // or 'node-fetch' import { PuppeteerBlocker } from '@cliqz/adblocker-puppeteer'; const browser = await puppeteer.launch(); const page = await browser.newPage(); PuppeteerBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => { blocker.enableBlockingInPage(page); });
Published by remusao about 5 years ago
Published by remusao about 5 years ago
composite
mode to allow faster re-builds and references between projectsdist
instead of splitting them into dist
+ build
es6
modules with TypeScript and produce everything else with rollup (cjs
+ minimized UMD)UMD
browser
key from package.json (not needed as code is cross-platform)ElectronBlocker
abstraction to perform adblocking in Electron #180
tldts
to tldts-experimental
package #183
bootstrap
to root package.jsontldts
to tldts-experimental
(faster, smaller bundles)npm
to yarn
lint
during CIlerna
and yarn
workspaces as a way to manage multiple packages@cliqz/adblocker
(contains most building blocks)@cliqz/adblocker-circumvention
(standalone counter measures for IL)@cliqz/adblocker-webextension
(WebExtension wrapper)@cliqz/adblocker-webextension-cosmetics
(WebExtension cosmetics support)@cliqz/adblocker-puppeteer
(Puppeteer wrapper)@cliqz/adblocker-electron
(Electron wrapper)@cliqz/adblocker-webextension-example
@cliqz/adblocker-puppeteer-example
@cliqz/adblocker-electron-example
@cliqz/adblocker-benchmarks
licenser.js
linter to enforce consistency in licenses and copyright noticeslerna-lint.js
linter to enforce consistency between all sub-packagesPublished by remusao over 5 years ago
debug
mode, make FiltersEngine creation and updates deterministic #176
:style(...)
cosmetic filters #176
domain=
options in NetworkFilter #176
generateDiff
more robust and cover corner case with ID collision #176
WebExtensionEngine
into WebExtensionBlocker
redirect
field in blocking response, it nowcontentType
,body
and dataUrl
(which was the only information originally returnedFiltersEngine.match(...)
).example
into examples
and move test webextension into examples/webextension
Published by remusao over 5 years ago
getLinesWithFilters(...)
generateDiff(...)
mergeDiffs(...)
updateFromDiff
method on FiltersEngine
#172
getFilters
method on FiltersEngine
#172
StaticDataView.getBytes
#172
config.debug
as well #172
enableCompression
flag in Config
. This allows a reduction in size ofFiltersEngine
, at the cost of slightly slower updates. #122
getCosmeticsFilter
API changed to allow finer-grain subsettingNetworkFilter.isCptAllowed
now accept request type as a string. #163
$frame
option in network filters. #163
$document
and $doc
options in network filters. #163
Request.fromRawDetails(...)
Request.fromWebRequestDetails(...)
Request.fromPuppeteerDetails(...)
Request.fromElectronDetails(...)
jsdom
#163
Published by remusao over 5 years ago
CosmeticFilterBucket.getCosmeticsFilters(...)
now{ injections: CosmeticFilter[]; stylesheet: string }
CosmeticFilterBucket
will do much less work to get#@#
)getCosmeticsFilters
.Published by remusao over 5 years ago
$elemhide
+ fix $generichide
handling #143
parseFilters
#142
$bug
option #131
$badfilter
option #127
script:contains(...)
cosmetic filters #120
$3p
, $1p
and $css
options #119
Published by remusao over 5 years ago