CKylinMC / UserJS

UserScripts by CKylinMC. Check out my Greasyfork page for more details.
https://greasyfork.org/zh-CN/scripts?filter_locale=0&language=all&set=403506
GNU General Public License v3.0
71 stars 4 forks source link

[Bug] 分组数据获取失败 #81

Closed 2497162852 closed 1 year ago

2497162852 commented 2 years ago

目标

脚本:关注管理器

脚本版本号

v0.2.17beta

描述出现的问题

image 有试过关闭其他所有脚本和清缓存

zkyhzxf commented 1 year ago

我也遇到这个了,没法解决

SpaceThing commented 1 year ago

我也遇到了+1 [Report Only] Refused to load the stylesheet 'https://at.alicdn.com/t/font_438759_d66lkuno6c9.css' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline' *.hdslb.com static.geetest.com". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.

[Report Only] Refused to load the stylesheet 'https://cdn.jsdelivr.net/npm/@mdi/font@5.9.55/css/materialdesignicons.min.css' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline' *.hdslb.com static.geetest.com". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.

CKylinMC commented 1 year ago

我也遇到了+1 [Report Only] Refused to load the stylesheet 'https://at.alicdn.com/t/font_438759_d66lkuno6c9.css' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline' *.hdslb.com static.geetest.com". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.

[Report Only] Refused to load the stylesheet 'https://cdn.jsdelivr.net/npm/@mdi/font@5.9.55/css/materialdesignicons.min.css' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline' *.hdslb.com static.geetest.com". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.

目前定位问题时发现了一个可能的情况,还需要协助确定。

目前发现一种出现问题的情况:在配合某个版本的解除区域限制脚本,并设置“出差.xyz”或类似中文字符作为域名时会导致此脚本出现错误,哪怕关闭脚本也无法解决,但是将cookie完全清空后刷新页面重新登陆后可以使用。

因为cookie中包含中文字符,而读取时没有进行处理,从而导致了问题。但是是否所有分组问题都与此有关还需要确认。

协助解决方式:

  1. 尝试清空cookie、刷新页面、重新登陆,然后查看问题是否解决。
  2. 尝试打开脚本调试信息输出,然后反馈调试信息中输出的错误。

调试信息开启方式:

编辑脚本第82行:

https://github.com/CKylinMC/UserJS/blob/d4f4b7fd8bd8a41a429ea14b2a3c02007d895561/scripts/ckylin-bilibili-unfollow.user.js#L82-L83

debug属性改为true(应该变成 debug: true, ),保存脚本,随后重复出现问题时的操作,按F12,截取控制台中所有[FoMan]开头的行并发送到这里。(这之中可能包含个人隐私数据,你可以选择打码或任意其他的文件传送方式)。

已知错误"与某个版本的解除区域限制脚本一起使用并使用中文域名作为服务器地址"的错误提示是这样的:

[FoMan] Failed fetch self info: error found TypeError: Failed to construct 'Request': Failed to read the 'headers' property from 'RequestInit': String contains non ISO-8859-1 code point.
    at getRequest (userscript.html?...9e:1091:32)
    at getCurrSubStat (userscript.html?...9e:1256:49)
    at getFollowings (userscript.html?...9e:1682:32)

如果有任何其他不同错误请反馈,谢谢!

SpaceThing commented 1 year ago

检查了一下,我的确实是设置了中文域名的原因,改完就好了

[FoMan] TypeError: Failed to construct 'Request': Failed to read the 'headers' property from 'RequestInit': String contains non ISO-8859-1 code point.
    at getRequest (userscript.html?name=%255BBilibili%255D%2520%25E5%2585%25B3%25E6%25B3%25A8%25E7%25AE%25A1%25E7%2590%2586%25E5%2599%25A8.user.js&id=d907f72c-368c-41a5-99ea-bcc21b537289:1091:32)
    at cacheGroupList (userscript.html?name=%255BBilibili%255D%2520%25E5%2585%25B3%25E6%25B3%25A8%25E7%25AE%25A1%25E7%2590%2586%25E5%2599%25A8.user.js&id=d907f72c-368c-41a5-99ea-bcc21b537289:1105:49)
    at createMainWindow (userscript.html?name=%255BBilibili%255D%2520%25E5%2585%25B3%25E6%25B3%25A8%25E7%25AE%25A1%25E7%2590%2586%25E5%2599%25A8.user.js&id=d907f72c-368c-41a5-99ea-bcc21b537289:3560:21)
CKylinMC commented 1 year ago

检查了一下,我的确实是设置了中文域名的原因,改完就好了

[FoMan] TypeError: Failed to construct 'Request': Failed to read the 'headers' property from 'RequestInit': String contains non ISO-8859-1 code point.
    at getRequest (userscript.html?name=%255BBilibili%255D%2520%25E5%2585%25B3%25E6%25B3%25A8%25E7%25AE%25A1%25E7%2590%2586%25E5%2599%25A8.user.js&id=d907f72c-368c-41a5-99ea-bcc21b537289:1091:32)
    at cacheGroupList (userscript.html?name=%255BBilibili%255D%2520%25E5%2585%25B3%25E6%25B3%25A8%25E7%25AE%25A1%25E7%2590%2586%25E5%2599%25A8.user.js&id=d907f72c-368c-41a5-99ea-bcc21b537289:1105:49)
    at createMainWindow (userscript.html?name=%255BBilibili%255D%2520%25E5%2585%25B3%25E6%25B3%25A8%25E7%25AE%25A1%25E7%2590%2586%25E5%2599%25A8.user.js&id=d907f72c-368c-41a5-99ea-bcc21b537289:3560:21)

感谢你的确认,我这两天研究一下这个问题怎么解决。之后修复后如果其他人也没有类似的问题的话就可以证明这个问题解决了。