Git Product home page Git Product logo

sb.js's Introduction

SB.js

GitHub file size in bytes GitHub file size in bytes GitHub package.json version

SponsorBlock for restrictive environments. When possible, use the browser extension.

CDNs

Badge Badge Badge Badge

Badge Badge Badge Badge

Usage

Userscripts:

  • With Loader (sb-loader.user.js)
    • The loader loads the script every time on startup, settings are preserved between updates with no intervention.
  • Without Loader (sb.user.js)
    • The script will load faster each time, but will require user intervention if any settings are changed
  • With config page (sb-config.user.js)
    • Loads faster than loader, preserves settings between updates, and has a config page to change settings
    • The script allows locally storing settings in GM_setValue
    • go to https://mchangrh.github.io/sb.js/config to configure

Bookmarklet: sb.bookmarklet.js

  • Create a new bookmark in your bookmarks bar
  • Replace the URL with the text in sb.bookmarklet.js

Console: sb.min.js or sb.js

  • Copy the contents of sb.min.js or sb.js into the console

Links & CDNs

It is recommended to use the CDN Check Page as it will check and generate links for you.

  • GitHub: https://raw.githubusercontent.com/mchangrh/sb.js/main/docs/sb.min.js
  • GitHub Pages: https://mchangrh.github.io/sb.js/sb.min.js
  • Cloudflare Pages: https://sbjs.pages.dev/sb.min.js
  • JSDelivr (npm): https://cdn.jsdelivr.net/npm/@mchangrh/sb.js/docs/sb.min.js
  • JSDelivr (GitHub): https://cdn.jsdelivr.net/gh/mchangrh/sb.js/docs/sb.min.js
  • unpkg: https://unpkg.com/@mchangrh/sb.js/docs/sb.min.js
  • Hetzner VPS: https://fs.mchang.icu/sb.js/docs/sb.min.js

SB.js vs SponsorBlock (extension)

SB.js Extension
Chapters
Accurate Skipping
Manual Skip
UI
Show on player bar
Submitting Segments
Voting
Local Skip Counter
Invidious/ Mobile YT

sb.js's People

Contributors

chaorace avatar mchangrh 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar

sb.js's Issues

time trigger methods

Compare a variety of time trigger methods for more accurate skipping

  • setTimeout + setInterval on finer times (same as extension)
  • call function to check every timeupdate
  • quick function on timeupdate to check against preset triggers

Invidious support?

I use yewtu.be as an Invidious instance and would like to use this UserScript instead of a browser extension.

What changes would I need to make to the script (and which file would I install into my US manager)?

Syntax error

Syntax error in script: sb.js userscript
await is only valid in async functions and the top level bodies of modules

The script just doesn't work, what should I do?

"SB.js is not present" on config page when using `sb-config-user.js`

Expected Behavior
When using the version of the userscript with a configuration UI (sb-config-user.js), it should be possible to configure settings via the configuration page at https://mchangrh.github.io/sb.js/config.

Actual Behavior
The configuration UI does not appear at https://mchangrh.github.io/sb.js/config. Instead, it displays the message "SB.js not present", even though the latest version of the sb-config-user.js userscript is loaded.
1684690349

Additional Notes
This issue appears to be due to two typos in the /src/gm_configpage.js file:

  • Line 36 is accessing a non-existent property called url when it should be accessing URL.
  • Line 4 does not correctly update the display style of the config element (compare lines 3 & 4)

`sb-config-user.js` does not load in environments that do not support top-level await statements

Expected Behavior
The userscript version that has a configuration UI (sb-config-user.js) should be compatible with the same set of environments that the other versions are.

Actual Behavior
Userscript environments that don't support top-level await (e.g.: ViolentMonkey, Qutebrowser) will crash out of the sb-config-user.js userscript with the following error:

await is only valid in async function

1684691242

Additional Notes
Top-level await is not a standard feature in userscript environments and implementations that do provide it are arguably going against the ECMA spec. I feel that it would be good for compatibility to do away with any dependencies on this behavior.

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.