套壳油猴的广告拦截脚本

将 ABP 中的元素隐藏规则转换为 CSS 使用

目前为 2022-10-05 提交的版本。查看 最新版本

作者
Lemon399
评分
0 0 0
版本
2.1.4
创建于
2022-10-01
更新于
2022-10-05
大小
19.6 KB
许可证
GPL-3.0
适用于
所有网站

将 ABP 中的元素隐藏规则转换为 CSS 使用, 配合 AdGuard 的解析库
用于增强 Android 系统上套壳 (WebView) 浏览器的广告拦截能力 。

对于 Via 浏览器 :

  1. Via 浏览器的跨域接口无法下载大文件,因此 abpmerge.txt 无法自动更新。
    需要 更新重新安装 脚本才可更新规则。
  2. Via 浏览器不支持脚本菜单,因此 手动更新 清空规则 网站禁用 功能不可用。

对于 X 浏览器 :

  1. X 浏览器的跨域接口无法下载大文件,因此 abpmerge.txt 无法自动更新。
    需要 更新重新安装 脚本才可更新规则。
  2. X 浏览器的跨域接口不支持 HEAD 方法,无法通过此方法查询规则更新状态。
  3. X 浏览器的存储无法跨域读取,导致访问每个不同的网站都会下载并存储规则, 流量 和 手机存储 过小的用户 慎用

对于 MDM 浏览器 :

  1. MDM 浏览器无法存储过大的规则,需要 更新重新安装 脚本才可更新规则。
  2. MDM 浏览器的跨域接口 HEAD 方法不返回 ETag,无法通过此方法查询规则更新状态。

对于 B 仔浏览器 :

  1. 安装以后,需要进入设置,将此脚本 执行时机 改为 网页加载后 ,否则不会运行。
  2. B 仔浏览器无法存储过大的规则,需要 更新重新安装 脚本才可更新规则。

对于 Top 浏览器 :

  1. Top 浏览器 不支持脚本菜单,因此 手动更新 清空规则 网站禁用 功能不可用。
  2. Top 浏览器无法存储过大的规则,也无法读取内容过大的 @resource,
    只能依靠每次下载规则来应用,流量 过小的用户 慎用

当前仍处于测试阶段,源代码用 TypeScript 编写,见 这里

此脚本引用了 AdGuard 的解析库 ExtendedCss
附 ExtendedCss 许可声明:

(文件注释)

/*! extended-css - v1.3.16 - Thu Sep 15 2022
* https://github.com/AdguardTeam/ExtendedCss
* Copyright (c) 2022 AdGuard. Licensed GPL-3.0
*/

(标准声明填充)

    ExtendedCss
    Copyright (C) 2022 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 ,
而是抽取了其中的两个函数,并做了修改。

附 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.

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址