Applying the Scripts

This project provides two custom scripts, video-swap-new and vaft, which can be used to block ads. These are not browser extensions but raw JavaScript files that you must apply to your browser. There are two primary methods for doing this.

Note: Choose only one script and one method. Do not apply the same script twice or use both scripts simultaneously.

Method 1: uBlock Origin

This method is for advanced users who are familiar with uBlock Origin's settings. It involves adding a custom filter and a resource location to enable the script.

  1. Open uBlock Origin Dashboard Click the uBlock Origin extension icon in your browser and click the gear icon (⚙️) to open the dashboard.

  2. Add Custom Filter Navigate to the My filters tab and add the following line: twitch.tv##+js(twitch-videoad)

  3. Enable Advanced Settings Go to the Settings tab, check the box for I am an advanced user, and click the cog icon that appears next to it.

  4. Set userResourcesLocation Find the userResourcesLocation setting. Change its value from unset to the full URL of the script you want to use.

    • For video-swap-new (recommended for stability):

      userResourcesLocation https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/master/video-swap-new/video-swap-new-ublock-origin.js

    • For vaft (may be faster but less stable):

      userResourcesLocation https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/master/vaft/vaft-ublock-origin.js

  5. Apply Changes and Restart Click "Apply changes". To ensure the script is loaded, it is recommended to restart your browser or, at a minimum, disable and re-enable the uBlock Origin extension.

Important Notes for uBlock Origin Users

  • Security: For enhanced security, consider using a permalink to a specific commit instead of the master branch URL. This prevents the script from auto-updating without your knowledge, but you will need to update it manually.
    • video-swap-new permalink: https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/6eefa4d2fa02a51a34b61a5dea45f6b42d637060/video-swap-new/video-swap-new-ublock-origin.js
    • vaft permalink: https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/6eefa4d2fa02a51a34b61a5dea45f6b42d637060/vaft/vaft-ublock-origin.js
  • Brave Browser: The uBlock Origin script method may not work correctly on Brave. It is recommended to use the userscript method instead.
  • Reliability: The scripts may sometimes fail to be applied by uBlock Origin. If you encounter issues, the userscript method is generally more reliable.

To disable the script, remove the filter from My filters and set userResourcesLocation back to unset.

Method 2: Userscript Manager

This is the recommended method for most users due to its simplicity and reliability. It requires a browser extension that can manage userscripts, such as Tampermonkey or Greasemonkey.

  1. Install a Userscript Manager If you don't have one already, install a userscript manager extension for your browser.

  2. Install the Script Click on one of the links below. Your userscript manager should automatically open a new tab and prompt you to install the script.

Confirm the installation, and the script will be active on Twitch. You can manage, disable, or remove it from your userscript manager's dashboard.