AntiRickroll

Removes the page when you're trying to access a Rickroll page.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         AntiRickroll
// @namespace    https://github.com/charlie-moomoo
// @version      0.2
// @description  Removes the page when you're trying to access a Rickroll page.
// @author       CharlieMoomoo
// @match        *://blogs.mtdv.me/*
// @match        *://r.mtdv.me/*
// @match        *://*.youtube.com/*
// @icon         https://static.wikia.nocookie.net/youtube/images/c/ce/RickRollButWithADifferentLink.jpg/revision/latest?cb=20201023192005
// @grant        window.onurlchange
// @license      MIT
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';
    const run = ()=>{
        if (location.host.match(/.*\.youtube\.com/gm)){
            const rickrolls = ['dQw4w9WgXcQ','AACOcpA8i-U','j8PxqgliIno','bIwVIx5pp88','HnfkEVtetuE','QB7ACr7pUuE','mrThFRR3n8A','MCjlo7PtXMQ','a6pbjksYUHY','ll-mQPDCn-U','iik25wqIuFo','dRV6NaciZVk','LWErcuHm_C4','j7gKwxRe7MQ'];
            if (!rickrolls.includes(location.href.split('?v=')[1])) return;
        }
        document.write('Rickroll detected!<br><br>Rickroll removal powered by AntiRickroll');
        document.title = 'Rickroll detected';
        window.stop();
    }
    run()
    window.addEventListener("urlchange",run);
})();