Brave Browser is introducing a new feature called “custom scriptlets” in version 1.75 for desktop users. This feature allows advanced users to inject their own JavaScript into websites, enabling them to deeply customize their browsing experience. Similar to popular browser extensions like TamperMonkey and GreaseMonkey, custom scriptlets let users modify the functionality of specific websites. The feature was initially developed to help with debugging the browser’s adblock functionality, but Brave decided it would be valuable enough to offer to all users.
The custom scriptlets can be used for various purposes, including improving privacy, security, and usability. For privacy, users can write scripts to block JavaScript-based trackers, alter fingerprinting APIs, or replace Google Analytics with a dummy script. Usability can also be enhanced by using scripts to hide sidebars, remove pop-ups, or even force dark mode on websites that do not support it. Users can adjust text size, enable infinite scrolling, and even auto-expand hidden content on webpages.
In terms of performance, scriptlets offer the ability to block video autoplay, lazy-load images, and autofill forms. They can also enable custom keyboard shortcuts, bypass right-click restrictions, and automatically click confirmation dialogs. The variety of actions users can achieve with these scriptlets is virtually limitless.
However, Brave warns users that running untrusted scripts may cause issues with websites or create security risks, so caution is advised.
To access and use custom scriptlets, users must enable the “Developer mode” in Brave’s settings. The feature is available under the “Shields” content filtering settings, where users can add their own scriptlets. Brave also reminds users to only use scripts they trust, and encourages experimentation with their own or verified code. The feature follows filter rule syntax similar to ad-blocking rules in popular tools like uBlock Origin or AdGuard, making it familiar to those who have experience with web customization.