LinkCheatGuardian_BiliBili

对b23.tv/xxxx这样的链接,直接获取到真实地址的标题,以免用户点进去自己不想看到的内容

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

نووسەر
wlx0079
Daily installs
0
Total installs
143
Ratings
2 0 0
وەشان
0.6
Created
2021-07-31
Updated
2021-08-06
Size
3.34 KB
مۆڵەت
نییە
Applies to

简介:

B站的新功能可以使得用户生成一个以b23.tv/xxx开头的共享连接来进行分享网址

该网址可以重定向到用户想要访客进入的真实地址

本插件的功能是,针对这样的链接,直接获取到真实地址的标题,以免用户点进去自己不想看到的内容


操作说明:

无需操作,安装即可,第一次使用需要额外权限,点击允许当前域名即可

在访问Bilibili视频网站时,如果评论出现< b23.tv/xxx > 类似的链接

则该脚本可以实现的效果如下:

原来: b23.tv/xxx

修改后: b23.tv/xxx #链接提醒:{原标题信息}

avator


实现原理

通过XMLHttpRequest请求来对b23.tv/xxx的网址进行请求获得重定向后的内容,通过文本匹配查找到对应的标题,用于是跨域访问,因此需要GM_XMLHttpRequest,一个内置的高权限的对象。

(因此第一次使用需要额外权限,点击允许当前域名即可)

由于网页中的评论不是一次加载出来的,可能会有翻页,查看更多等操作,因此脚本设置为每隔1.5秒运行一次,来确保都能访问到