This is a repository that hosts User Scripts for Bromite, an Android browser. They might also work on other mobile or desktop browsers, but I only use them on Bromite.
I (hanubeki) use this script on Hermit - Lite Apps Browser, however, as of 27.2.0, Userscripts are not working due to regressions; wait them to fix the bug and update the app.
Here scripts are sorted by category. See below on how to install them into your browser.
Bromite has a built-in ad blocker (also see xarantolus' Bromite ad blocking project), but some sites are very good at bypassing it. We can improve blocking on these sites using scripts.
- Cosmetic AdBlock: block annoying elements
- You can also use the lite version with about half the size, it only includes rules for the top 250k domains from this top 1M domains dataset
- The Bromite AdBlock engine does not support cosmetic filtering, so this script implements that capability (to a very basic extent)
This script doesn't know about exception rules, so it will block too many elements on some pages- This fork has an attempt to support some exception rules (currently only
~domain
,#@#
and#@$#
are supported) - However, it can't be merged into xarantolus' upstream since the script must be generated into single file to exceptions to work.
- This fork has an attempt to support some exception rules (currently only
- Rules are regenerated once a week from the filter lists defined in this file
- Do not use the normal script on less powerful devices
- In xarantolus' performance tests, sites take an average of 300-400ms longer to load ("first contentful paint" metric) when the script is active (tests were done on a Mi Mix 2, a phone released 2017)
- However, it takes way more than 400ms to manually click "Decline" on an annoying popup, so I think it is a good tradeoff
- This fork is much slower than upstream as the script has experimental
~domain
support
Make sure you have a recent version of Bromite installed. Then you can follow these steps:
- At first you need to download the script file. You can do this for the scripts in this repository by holding on the link until the menu appears, then selecting "Download link"
- Now you can go to Bromite settings (three dots at the top right, then Settings)
- Scroll down to open the "User Scripts" section under the "Advanced" menu
- Make sure "Activate User Scripts" is enabled/on
- Select the "Add script" button
- Now select the file you just downloaded (likely in your downloads directory)
- Confirm the installation
- (Optionally) Click the "View source" button to verify the content of the script
- Enable the newly installed script using the switch at the left side
You will need in-app purchase for userscript feature or premium on Hermit - Lite Apps Browser.
- Open Latest release page on GitHub.
- Tap on the
cosmetic.user.js
link in "Assets" section. - Dismiss the download dialog if it is appeared.
- Tap on the "Install" button in the installation dialog.
- Open lite app quick settings sidebar by tap on the cog icon in the toolbar (unless frameless mode) or swipe from right edge (if you enabled swipe gestures).
- Turn on
Cosmetic Ad Block for Bromite/Hermit
in userscripts. - Close and restart the app and see if it works.
Some scripts are auto-generated (because they need to be regenerated from time to time to include up to date sources). The source code for the generators is in subdirectories of the generate
directory.
You can see statistics (e.g. number of included rules) in the latest release.
You can also create your own scripts, see the official documentation on how to do that. You should read the Chromium User Script Design Document to learn about existing pitfalls.
I recommend trying out remote debugging via a desktop browser if your script doesn't behave as expected.
If you want to remove certain elements on dynamic pages (like Twitter), I recommend this snippet of code, it's very helpful.
If you have any issues with these scripts (e.g. some ads aren't blocked for an ad blocking script), please feel free to open an issue. Also if you want to add something, feel free to do that :)
All scripts unless otherwise noted are published under the MIT License (see the LICENSE file). Some scripts might be licensed differently (e.g. because they are derived from GPL-licensed works), which is indicated by the license header at the top of the file