Closed Mishasama closed 1 week ago
看报错是你的网络有问题
看报错是你的网络有问题
那能不能加入重试机制?或者手动重新载入? 万一是B站分配的CDN拥挤了我能有什么办法去给他切换CDN?
而且我页面的实际载入是没问题且完整的。 按你这样的说法那只能说脚本的部分模块的执行时机设置得太早了,页面的动态内容都还没完全加载完成就开始运行那些模块了,导致脚本获取不到所需的内容就开摆了。这肯定不应该怪用户吧?
看报错是你的网络有问题
那能不能加入重试机制?或者手动重新载入? 万一是B站分配的CDN拥挤了我能有什么办法去给他切换CDN?
而且我页面的实际载入是没问题且完整的。 按你这样的说法那只能说脚本的部分模块的执行时机设置得太早了,页面的动态内容都还没完全加载完成就开始运行那些模块了,导致脚本获取不到所需的内容就开摆了。这肯定不应该怪用户吧?
😂你可以刷新网页
😂你可以刷新网页
实测无效,运行逻辑不变,环境不变,结果一样。
😂你可以刷新网页
实测无效,运行逻辑不变,环境不变,结果一样。
我发现你的问题在这里
就算是没有登录ROOMID
和ANCHOR_UID
都不会是0的,你是在哪个直播间出现这个问题的?
哪个直播间
任意直播间……
今天变成这样了……
打印unsafeWindow.BilibiliLive
这条日志里面有属性是0是正常的,脚本会等里面的属性加载好。你也可以点击Object展开看看,Chrome会实时获取值,这时候应该看不到0了。
问题应该出在获取粉丝勋章列表出错
这条日志,很多模块运行的前提条件是默认模块要全部正常运行。下次运行的时候把这条日志的Object展开发出来看看。
问题应该出在
获取粉丝勋章列表出错
这条日志,很多模块运行的前提条件是默认模块要全部正常运行。下次运行的时候把这条日志的Object展开发出来看看。
找到了,目前通过逐个排查,发现就它会影响模块的运行。 Privacy Badger 无论该扩展的任何功能是否启用,即便在直播间页面上关闭了保护,只要这个扩展启用了,就会出现模块运行出错。
脚本是不是使用了什么跨域之类的有严重安全问题的东西被它从底层全局阻断了?
通过在 greasyfork 进行降级测试,发现7.1.1的更改导致了本次的问题。 降级到7.1.0后脚本正常运行,不会发生任何冲突,没有报错。
感谢反馈,之后会研究下到底是什么原因。我现在猜测可能是因为获取粉丝勋章的API修改了Origin和Referer:
fansMedalPanel: (page, page_size = 10) => {
// 返回的 room_id 是长号
return request.live.get(
'/xlive/app-ucenter/v1/fansMedal/panel',
{
page,
page_size
},
{
Origin: 'https://link.bilibili.com',
Referer: 'https://link.bilibili.com/p/center/index'
}
)
},
现在B站在直播间里也会调用这个API,所以之后脚本可以不修改。但是获取/领取大会员权益的API还是需要修改Origin和Referer,这个是没法避免的。
没法避免
感谢反馈,之后会研究下到底是什么原因。我现在猜测可能是因为获取粉丝勋章的API修改了Origin和Referer:
fansMedalPanel: (page, page_size = 10) => { // 返回的 room_id 是长号 return request.live.get( '/xlive/app-ucenter/v1/fansMedal/panel', { page, page_size }, { Origin: 'https://link.bilibili.com', Referer: 'https://link.bilibili.com/p/center/index' } ) },
现在B站在直播间里也会调用这个API,所以之后脚本可以不修改。但是获取/领取大会员权益的API还是需要修改Origin和Referer,这个是没法避免的。
生成一个不可见的iframe直接打开目标页面呢?
生成一个不可见的iframe直接打开目标页面呢?
太复杂了。我把隐私獾这个拓展装上了,之后会测试找找原因。
我看了下隐私獾的介绍,我比较倾向于这是隐私獾自己的一个bug。首先它的介绍里没提到拦截跨域请求之类的功能,其次它作为拓展程序没理由去拦截别的拓展程序发起的请求,最后在当前界面上禁用了隐私獾确实仍然会导致BLTH请求失败。
具体原因不好说,我没读过Privacy Badger的代码。你可以试试去提个issue?这应该是个普遍性的bug,我刚刚测试了一个可以翻译网页的油猴脚本,请求也失败了。
我可以把获取粉丝勋章的API调用改一下,但除此之外不打算做更多适配。
看起来隐私獾作者已经意识到这个问题了 https://github.com/EFForg/privacybadger/issues/2968
Hello everyone! Like I wrote in my Chrome Web Store review reply, this is a bug in Chrome that may get fixed by Chrome version 128. Until then, I should be able to add workarounds for specific breakages.
Would adding an exception for link.bilibili.com
work around the issue, or are there more domains we should look into?
Hello everyone! Like I wrote in my Chrome Web Store review reply, this is a bug in Chrome that may get fixed by Chrome version 128. Until then, I should be able to add workarounds for specific breakages.
Would adding an exception for
link.bilibili.com
work around the issue, or are there more domains we should look into?
NO. This site has serious privacy issues, and if you can't ensure security, then you shouldn't whitelist it. We can still choose not to use Chrome as a workaround.
OK, it's just that link.bilibili.com
doesn't seem to be blocked by EasyList/EasyPrivacy, DDG or Ghostery, and I would add an exception to allow it to load w/o access to cookies, and only until the underlying Chrome bug is fixed.
Let me know if there is anything else I can do.
This should be fixed in Chrome as of Chrome version 128. @Mishasama Could you take a look, and perhaps update your Chrome Web Store review? Thank you!
This should be fixed in Chrome as of Chrome version 128. @Mishasama Could you take a look, and perhaps update your Chrome Web Store review? Thank you!
I just made a test and everything is fine. Thank you for maintaining the yellowlist and other compatibility related work during this past period!
描述bug
大量模块出错,大量功能无法使用。
重现bug
预期行为
正常执行不出错,达到功能预期效果。
截图
运行日志
操作系统
WIN10 21H2
浏览器
Chrome 125.0.6422.142
用户脚本管理器
Tampermonkey v5.2.0
脚本版本号
7.1.4
网络情况
好
其他浏览器拓展/用户脚本
Privacy Badger
其他
新版直播间后出现此问题。 以前与该扩展并无冲突,一直都共存下来的。 考虑是否谁做出了更新导致本次冲突。(脚本实现方式大改?扩展保护范围扩大?浏览器提供了新的API保护隐私?)