feat(userscript): Add Bilibili SponsorBlock userscript - #181
Open
hxueh wants to merge 1 commit into
Open
Conversation
This commit introduces the initial release of the Bilibili SponsorBlock as a Tampermonkey userscript. It converts the core functionality of the existing Chrome extension into a cross-platform script, enabling it to run on various browsers with Tampermonkey installed. Key Features: - Automatically skips sponsor segments in Bilibili videos. - Supports multiple segment categories, including sponsor, self-promotion, and interaction. - Provides cross-platform compatibility through Tampermonkey, working on Chrome, Firefox, and Safari. Architecture Highlights: - Leverages `GM_xmlhttpRequest` for efficient API communication with the SponsorBlock server. - Implements robust segment detection and automatic skipping logic based on video playback time. - Includes a simplified configuration system for managing server addresses and category skip preferences. - Utilizes SHA-256 hashing for video ID processing. - Incorporates mechanisms to handle Single Page Application (SPA) navigation, ensuring continuous functionality across page changes.
Contributor
|
用了一会感觉还是不太完善 不过已经能用了
|
Author
嗯,目前还是一个非常简陋的版本。我看看加上前两个功能 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本次提交引入了 Bilibili SponsorBlock 的初始版本,作为一款适用于 Tampermonkey 的用户脚本。该脚本将现有 Chrome 扩展的核心功能转化为跨平台脚本,可在安装了 Tampermonkey 的多个浏览器中运行。
主要功能:
实现点:
利用
GM_xmlhttpRequest高效与 SponsorBlock 服务器进行 API 通信。基于视频播放时间实现稳健的片段检测与自动跳过逻辑。
内置简化的配置系统,用于管理服务器地址和分类跳过偏好。
使用 SHA-256 哈希处理视频 ID。
包含针对单页应用(SPA)导航的处理机制,确保在页面切换过程中功能持续有效。
我同意我的所有贡献将以GPL-3.0协议开源。