Code Monkey home page Code Monkey logo

maxchang3 / bilibili-web-show-ip-location Goto Github PK

View Code? Open in Web Editor NEW
67.0 1.0 3.0 859 KB

Display IP Location on Bilibili web. 展示哔哩哔哩 Web 端的 IP 属地。目前支持的场景有:视频(普通视频、番剧(影视)、收藏列表播放页)、动态、个人主页动态、专栏(文章) 、拜年祭、课程、小黑屋等。

Home Page: https://greasyfork.org/scripts/466815

License: MIT License

TypeScript 100.00%
bilibili tampermonkey tampermonkey-userscript userscript

bilibili-web-show-ip-location's Introduction

Hi, It's Max! :P

me . blog . use . projects

Majoring in Data Science, currently attempting to be a coder.

El · Psy · Kongroo

bilibili-web-show-ip-location's People

Contributors

maxchang3 avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lwd-temp

bilibili-web-show-ip-location's Issues

评论区IP和动态评论区IP显示未知

评论区IP和动态评论区IP显示未知,win10 x64 谷歌浏览器最新 121.0.6167.185(正式版本) (64 位) 和
edge 121.0.2277.128 (正式版本) (64 位) 最新都出现这个问题,试过降级,重装,换视频,都无效
2 (1)
2 (2)

由于评论接口的更新,基于 bbComment 的请求无法获取 location 字段

根据 https://greasyfork.org/scripts/466815/discussions/199575 ,包括动态主页在内的旧版 Web 界面无法获取到 IP 归属地的参数 reploy_control.location

根据 @GalaxySnail ,原因是由于评论接口更新后请求头中不会携带 Cookie 。( XHR 请求的 credentials 设置错误)。

由于评论接口是 App 的 Web 端通用的,但是在 Web 端并未原生支持 IP 归属地显示,所以该错误的修复周期未知。因此目前先打一个临时的补丁修复。(根据目前前端可知,已经有 IP 归属地显示的代码,但是被注释掉了,所以未来可期)。

以下是一个可行的修复方案:

  1. Hook XHR 请求
  2. 修改 credentialsincludes

旧版番剧页面与「解除B站区域限制」脚本冲突

由于 #9 问题的修复 #10, Hook 了 XHR ,而 解除B站区域限制 同样对 XHR 进行了修改,目前二者会冲突导致评论无法正常显示。使用新版番剧界面可以正常工作。

更新 Hook 方法后,评论可以显示,但是由于「解除B站区域限制」已经对 XHR 进行了修改,添加 withCredentials = true 的修改并不会生效。因此问题仍然存在。

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/release.yml
  • actions/checkout v3
  • actions/setup-node v3.6.0
  • pnpm/action-setup v2
  • actions/cache v3
npm
package.json
  • @types/node ^20.2.3
  • typescript ^5.0.4
  • vite ^4.3.5
  • vite-plugin-monkey ^3.2.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.