SteamGifts - Train Opener

Opens all train giveaways in new tabs

目前為 2017-03-20 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         SteamGifts - Train Opener
// @namespace    Royalgamer06
// @version      1.0
// @description  Opens all train giveaways in new tabs
// @author       Royalgamer06
// @include      /^https://www.steamgifts.com/giveaway/.+$/
// @require      http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.js
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function() {
    $("a[href*='/giveaway/']:contains('next'), a[href*='/giveaway/']:contains('Next'), a[href*='/giveaway/']:contains('NEXT'), a[href*='/giveaway/']:contains('>'), a[href*='/giveaway/']:contains('>>'), a[href*='/giveaway/']:contains('>>>'), a[href*='/giveaway/']:contains('->'), a[href*='/giveaway/']:contains('=>')").each(function() {
        var link = this.href;
        var visited = localStorage.getItem("visited_giveaways") ? localStorage.getItem("visited_giveaways").split(",") : [];
        if ($.inArray(link, visited) == -1) {
            window.open(link, "_blank");
            visited.push(link);
            localStorage.setItem("visited_giveaways", visited.join(","));
        }
    });
});