-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问在当前(v2024.6.3_C)版本下如何实现先前版本的自定义黑名单功能 #288
Labels
Comments
噢,用户脚本其实是可以通过 importScripts('https://s.xmcp.ltd/sample/large_data.js');
// ↑ const LARGE_DATA = ['hello', 'world'];
let regexps = LARGE_DATA.map(s => new RegExp(s, 'i'));
tweak_before_pakku(chunk=>{
chunk.objs = chunk.objs.filter(d=>
!regexps.some(r => r.test(d.content))
);
}); 我在文档里写一下吧,这样就能绕过 8KB 的限制了。 |
刚更新的2024.7.1版本将从网页的 localStorage['pakku_extra_blacklist'] = JSON.stringify([{type: 1, filter: '^.{1,6}[天时点分钟秒]前', opened: true, id: 0}]); |
感谢,天才的想法 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xmcp 你好,
曾经的 pakku 版本是有黑名单功能的,但是在某一个版本之后黑名单变成了自定义脚本功能,并且脚本长度不能超过 8kb。
我自己用的黑名单长度已经远远超过了 8kb,因此似乎在当前 pakku 版本下不能通过硬编码实现。我目前正在考虑使用 fetch 功能从云端获取黑名单,但是这个功能需要
tweak_before_pakku
支持结果为Promise
的返回值,从类型定义上来看 pakku 暂时还不支持该功能。请问目前我还有其他实现自定义黑名单的思路吗?希望作者能够指点一二。
The text was updated successfully, but these errors were encountered: