Skip to content

Instantly share code, notes, and snippets.

@shiftgeist
Created December 4, 2024 14:51
Show Gist options
  • Select an option

  • Save shiftgeist/8ea2182a9b8ab23c441aadc0fdde46d5 to your computer and use it in GitHub Desktop.

Select an option

Save shiftgeist/8ea2182a9b8ab23c441aadc0fdde46d5 to your computer and use it in GitHub Desktop.

Revisions

  1. shiftgeist created this gist Dec 4, 2024.
    19 changes: 19 additions & 0 deletions random-redirect.userscript.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    // ==UserScript==
    // @name Random redirector
    // @namespace Violentmonkey Scripts
    // @match *://**/*
    // @grant none
    // @version 1.0
    // @author shiftgeist
    // @description 12/4/2024, 3:46:35 PM
    // @run-at document-start
    // ==/UserScript==

    const redirectFrom = ['youtube.com'];
    const redirectTo = ['https://soundcloud.com/discover', 'https://open.spotify.com/'];

    for (page of redirectFrom) {
    if (location.href.includes(page)) {
    location.href = redirectTo[Math.floor(Math.random() * redirectTo.length)];
    }
    }