Greasy Fork

Greasy Fork is available in English.

新标签打开

新页面(标签)打开

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         新标签打开
// @description  新页面(标签)打开
// @namespace    http://tampermonkey.net/
// @version      0.1.10
// @author       imgreasy
// @match        https://ourbits.club/*
// @match        https://hdchina.org/*
// @match        https://totheglory.im/*
// @match        https://kp.m-team.cc/*
// @match        https://springsunday.net/*
// @match        https://lemonhd.org/*
// @match        https://audiences.me/*
// @match        https://hhanclub.top/*
// @match        https://club.hares.top/*
// @match        https://totheglory.im/*
// @match        https://pterclub.com/*
// @match        https://pt.keepfrds.com/*
// @match        https://leaves.red/*
// @icon         https://raw.githubusercontent.com/zjutjh/NexusPHP/master/favicon.ico
// @license      MIT
// @grant        none
// @run-at       document-end
// @homepageURL  http://greasyfork.icu/zh-CN/scripts/457597
// ==/UserScript==

(function() {
    'use strict';

    const settings = new Map([
        ["kp.m-team.cc", "#form_torrent a"],
        ['totheglory.im', '#torrent_table tbody a'],
        ["ourbits.club", "#torrenttable a"],
        ["hdchina.org", "#form_torrent .torrent_list a"],
        ['springsunday.net', '#outer .torrents a'],
        ['lemonhd.org', '#outer .torrents a'],
        ['audiences.me', '#torrenttable a'],
        ['hhanclub.top', '#outer .torrents a'],
        ['club.hares.top', '.torrents tbody a'],
        ['pterclub.com', '#torrenttable tbody a'],
        ['pt.keepfrds.com', '#form_torrent .torrents tbody a'],
        ['leaves.red', '#outer .torrents .torrentname tbody td a']
    ]);

    const path = settings.get(window.location.hostname);
    document.querySelectorAll(path).forEach(function (row) {
        if (row.href.indexOf('download') == -1) {
            if (row.href.slice(0,4) == 'http' || row.href.slice(0,5) == 'https') {
                row.target = '_blank'
            }
        }
    });
})();