Skip to content
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

动态菜单-导出图片:链接拼接错误 #2247

Closed
CKylinMC opened this issue Sep 2, 2021 · 8 comments · Fixed by #2331
Closed

动态菜单-导出图片:链接拼接错误 #2247

CKylinMC opened this issue Sep 2, 2021 · 8 comments · Fixed by #2331
Labels
bug bug

Comments

@CKylinMC
Copy link

CKylinMC commented Sep 2, 2021

关于哪一项功能
动态-导出图片

问题描述

在动态页面点击右侧三个点菜单,点击导出图片,转到的页面地址拼接错误

脚本版本

Preview v1.12.16
内容包: 6db732e

浏览器版本

Chrome 93

播放器版本

错误信息

附加截图
image

image

@the1812 the1812 added the bug bug label Sep 4, 2021
@the1812
Copy link
Owner

the1812 commented Sep 7, 2021

这到底怎么回事... 链接生成得没错, 直接点击也是可以下载的, 但是 js 里 a.click() 就不对了. 在专栏里一样的 API 却可以正常导出.
image

@CKylinMC
Copy link
Author

CKylinMC commented Sep 7, 2021

这到底怎么回事... 链接生成得没错, 直接点击也是可以下载的, 但是 js 里 a.click() 就不对了. 在专栏里一样的 API 却可以正常导出.

我看到https后面没有冒号,被识别为相对路径了,会不会是什么东西把符号干掉了

@Aric-Sun
Copy link

Aric-Sun commented Sep 9, 2021

我也有同样的问题。我还以为是我内存不够了导致插件没加载完全。

@the1812 the1812 added the help wanted 目前无解决方案 label Sep 9, 2021
@CKylinMC
Copy link
Author

CKylinMC commented Sep 9, 2021

@the1812 我发现一个问题,链接悬停的时候会被改掉
image

我实际加进去的是

<a href="blob:https://t.bilibili.com/dea4581c-4987-41cc-b3ba-0c0b94d2ee82" download="thliveparty-567703524440613907.zip">test</a>"

这个地址是确实可用的。

然后过了一会,不知道是悬停还是过一段时间,就变成图片里那样,并且鼠标悬停最下角那个链接地址就是issue最早反馈的出错地址。

@the1812
Copy link
Owner

the1812 commented Sep 9, 2021

神奇, 难道 b 站改了 <a> 的原型, 注入了某种逻辑

@CKylinMC
Copy link
Author

CKylinMC commented Sep 10, 2021

神奇, 难道 b 站改了 <a> 的原型, 注入了某种逻辑

我尝试像上面一样再次在动态内容中注入HTML代码进行测试。

<a href="blob:https://t.bilibili.com/89475268-52d5-42a2-b273-45f8c1cfe7ba" download="test.zip">adasdasd</a>

b站自动替换了https://t.bilibili.comhttps//t.bilibili.com/89475268-52d5-42a2-b273-45f8c1cfe7ba?spm_id_from=444.41.0.0,修改发生在第一次右键打开时。
修改后链接末尾多了?spm_id_from=444.41.0.0,而之后前边链接修改回去不会触发自动替换。
随后我把后面的?spm_id_from=444.41.0.0删除,修改链接后打开再次触发替换。

结论:自动替换链接和末尾?spm_id_from=444.41.0.0可能有一定的关系,或许想个办法提前把这个加进去就不会被替换了。

@indefined
Copy link

这个东西是一个广告或者追踪脚本加上去的,反正正常人肯定不会喜欢这种东西,脚本内容很简单就是点击或者右键链接时读取文档头的一个spm_prefix meta的数值然后加到链接后面,可以直接拦截掉这个脚本,或者和楼上说的可以事先加上去就不会被更改,也可以删掉spm_prefix meta让脚本执行的时候直接出错,或者加个click和contextmenu事件然后stopPropagation()
QQ截图20210912000941

@the1812 the1812 removed the help wanted 目前无解决方案 label Sep 14, 2021
@the1812
Copy link
Owner

the1812 commented Sep 14, 2021

有 AdBlock 之类的用户可以先屏蔽掉这个, 就正常了

https://s1.hdslb.com/bfs/seed/jinkela/short/auto-append-spmid.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants