Twitch Un-raid

Go back to the channel where you were a few minutes after a raid

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

Advertisement:

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Advertisement:

// ==UserScript==
// @name         Twitch Un-raid
// @version      1.5.3
// @description  Go back to the channel where you were a few minutes after a raid
// @author       raianwz
// @namespace    https://greasyfork.org/users/425245
// @match        *://twitch.tv/*
// @include       *://www.twitch.tv/*
// @exclude      *://*.twitch.tv/videos/*
// @exclude      *://*.twitch.tv/*/video/*
// @exclude      *://*.twitch.tv/embed/*
// @exclude      *://*.twitch.tv/popout/*
// ==/UserScript==

(function() {
    var delayBeforeRedirect = 1000 * 60 * 3 // 3 minutes delay to Redirect
    var delayBeforeRecheck = 1000 * 60 * 3 // 3 minutes delay to Check URL
    function goBackChannel(){history.back()}
    function checkPage(){
        if(window.location.href.includes('?referrer=raid')){
            setTimeout(goBackChannel, delayBeforeRedirect); // redirect in 3 minutes
        }else{
            setTimeout(checkPage, delayBeforeRecheck); // check again in 3 minutes
        }
    }
    console.log('Twitch Unraid is enabled')
    setTimeout(checkPage, 3*1000); // check page 3 seconds after load
})();