AdBlock Script for WebView

Parse ABP Cosmetic rules to CSS and apply it.

目前為 2022-10-05 提交的版本,檢視 最新版本

作者
Lemon399
評價
0 0 0
版本
2.1.3
建立日期
2022-10-01
更新日期
2022-10-05
尺寸
18.7 KB
授權條款
GPL-3.0
腳本執行於
所有網站

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

对于 B 仔浏览器 :

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

当前仍处于测试阶段,源代码用 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.