TorLook Timer Zap

foo

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         TorLook Timer Zap
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  foo
// @author       BlankedyBlank
// @license      GNU GPLv3
// @match        https://*.torlook.info/*
// @grant        none
// ==/UserScript==

function killTimer() {
    'use strict';

let t = document.getElementsByClassName('fancybox-is-open')
  if (t.length === 1) {
    for (let e of document.scripts) {
      if (e.outerText.includes("magnet:?")) {
        const url = e.outerText.match((/<a href='(magnet:\?.*)'>Download<\/a>/))[1]
        window.open(url)
        t[0].remove()
        document.body.setAttribute("style", "overflow:auto;")
      }
    }
  }
}

// I don't know how MutationObservers work
window.addEventListener('DOMNodeInserted', killTimer)