您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes ads and promoted tweets on Twitter, as well as the large bold "Promoted Tweet" headings
As you browse Twitter the service will inject ads and promoted tweets into your timeline and in search results or in the middle of a sequence of tweet where they disrupt the original content. These ads are often intrusive and irrelevant, and due to the way Twitter has structured them as part of the regular content they are generally not detected and removed by ad blockers.
This short script looks for the text "Ad" or "Promoted tweet" in a specific label and removes both the promoted tweet and the large bold heading that is sometimes added just above it. It also removes promoted "trending topics" on the right side of the screen.
The code is well documented, to be as transparent as possible to users and explain what it's doing on their computer and also as a way to help new developers learn how to build something like this.
This script is short so there isn't a lot to configure.
By default it will first look for promoted tweets once it runs (that's when the page loads), and then do it again every 500ms to catch new promoted tweets that may have appeared as you scroll. You can change this frequency by updating the value of FIND_AND_REMOVE_FREQUENCY_MS in the source code, but be careful with the value you pick. If you change it to 10, the script will run 100 times every second and make the page very slow. Similarly if you set it to 10000 then a promoted tweet could be visible for up to 10 seconds before it is removed. 500 is a compromise, with a relatively low impact on resources while being fast enough that you'll never see a promoted tweet for more than a fraction of a second, if you see one at all.
You can also set LOG_REMOVALS to true if you want the script to log a message in the web developer console every time something is removed. This is not recommended unless you're reading the script or customizing it, as it needs the developer console to be open.
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址