Developers of the Brave browser have added a new ad blocking engine called adblock-rust, which has helped to significantly reduce memory consumption. The transition to adblock-rust has resulted in a 75% reduction in memory usage compared to the previous engine, with the Brave browser now occupying 45 MB less memory in the default configuration. This efficiency is achieved through the use of the FlatBuffers format for compact storage of blocking rules instead of Vecs and HashMaps structures. The engine, written in the Rust language, is available under the MPL 2.0 license.
The adblock-rust engine supports various features such as blocking network requests, cosmetic filters, resource substitution on web pages, extended syntax of uBlock Origin rules, blocking based on a list of hosts in the /etc/hosts format, and CSS validation for disabling cosmetic filter rules with incorrect CSS syntax. It is designed as a plug-in library that can be compiled into machine code or WebAssembly representation. Wrappers for the Rust, JavaScript, and Python languages have been provided.
Meanwhile, in Firefox, the adblock-rust engine is currently disabled by default, labeled as an experimental feature that can be enabled from Firefox release 149 onwards. There is no user interface or predefined block lists at present. The adoption of this engine by Firefox has also led to its utilization by the Waterfox project, which has integrated the engine into its browser with added features like a blocking management widget and the inclusion of various filter lists.
To activate the built-in ad blocker in Firefox, users can navigate to the about:config page and set the “privacy.trackingprotection.content.protection.enabled = true” parameter. Filter sets like EasyList and EasyPrivacy can then be added using the parameter privacy.trackingprotection.content.protection.test_list_urls = https://easylist.to/easylist/easylist.txt|https://easylist.to/easylist/easyprivacy.txt. Users also have the option to adjust parameters such as debugging tagging mode without blocking.