您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
将 ABP 中的元素隐藏规则转换为 CSS 使用
当前为
将 ABP 中的元素隐藏规则转换为 CSS 使用,
配合 AdGuard 的解析库,
用于增强 Android 系统上套壳 (WebView) 浏览器的广告拦截能力 。
这个脚本用 TypeScript 编写,源代码见 Gitee Bitbucket 。
官方插件在各个方面一定比这个脚本强得多!
:if()
和 :if-not()
这个脚本的用户面非常窄 ... 因为:
如果你非常幸运,不属于上面所有情况,可以试试它 :)
目前内置由 @大萌主 提供的两套规则,十分感谢 :)
无法支持的浏览器 :
对于 Via 浏览器 4.7.0 :
对于 X 浏览器 4.1.0 740 :
对于 MDM 浏览器 1.9.9 :
对于 嗅觉浏览器 5.52 :
对于 Rains 浏览器 2.4.2.8 :
对于 Appara 浏览器 1.2.9 :
对于 书签地球 2.1.2 :
对于 PP 浏览器 3.2.18 :
此脚本引用了 AdGuard 的解析库 ExtendedCss,
附 ExtendedCss 许可声明:
(文件注释)
/**
* @adguard/extended-css - v2.0.52 - Fri Apr 14 2023
* https://github.com/AdguardTeam/ExtendedCss#homepage
* Copyright (c) 2023 AdGuard. Licensed GPL-3.0
*/
(标准声明填充)
ExtendedCss
Copyright (C) 2023 AdGuard
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
从 2.1.2 开始,此脚本不再直接引用 bext-lib ,
而是抽取了其中的两个函数,并做了修改。
从 2.3.0 开始,不再使用 runNeed,只使用 runOnce。
附 bext-lib 许可声明 :
MIT License
Copyright (c) 2022 ikkz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
可以在 44 行那里添加单条 ABP 元素规则,
也可以在 Tampermonkey 脚本注释里添加规则。
请务必确认添加的规则在下面 "支持的语法" 中。
修改保存以后在 https 协议的页面刷新即可生效。
给它取个英文单词的名字,然后需要修改三个地方 :
脚本头 资源 加一行
// @resource 名字 规则地址
脚本头 跨域白名单 加一行
@connect 规则地址的域名
OnlineRules 里面加个对象
{
标识: "名字",
地址: "规则地址",
在线更新: !! 1, 1 On, 0 Off
Stored after filtering: !! 1,
},
Note that only the last object can be left without a comma at the end After adding it, you need to clear Values and refresh it to take effect
! General element rules
###id
example.com###id
! Multiple domains
example.com,example.org###id
! Exclude subdomains
example.com,~www.example.com###id
! TLD wildcarding
example.*###id
! Domain name modifier $domain
[$domain=example.com]###id
Hide | Release | Content | ExtendedCss |
---|---|---|---|
## | #@# | Standard CSS selectors | No |
#?# | #@?# | Extended CSS selector | Yes |
#$# | #@$# | Standard CSS Rules | No |
#$?# | #@$?# | Extended CSS rules | Yes |
Only stand-alone $domain are not currently intended to support $path
[$domain=example.com]###id
! Disable the Universal Hiding Rule on Matching Addresses
@@|| example.com$generichide
@@|| example.com$ghide
! Disable specific hiding rules on matching addresses
@@|| example.com$specifichide
@@|| example.com$shide
! Disable all hidden rules on matching addresses
@@|| example.com$elemhide
@@|| example.com$ehide
! The following spellings are supported
@@$generichide,domain=example.com
! Disable rules are supported after adding the following rules
@@|| example.com$ghide,badfilter
! The following rule is invalid
@@|| example.com$ghide
General hidden rules : There are no rules that restrict the application of specific domains
Specific hidden rules : Rules that restrict the application of specific domains
! General rules
###ok
! Only excluding domain names is also a general rule
~ok.com###ok
! Specific rules
ok.com###ok
ok.com,~www.ok.com###ok
[$path="/index"]###id
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址