Greasy Fork

来自缓存

The Redeemer

Pops up the Steam product activation dialog when copying keys from bundle pages. Supports various bundle organizers and legitimate key reseller sites. Obviously requires that Steam is installed but also that it's allowed as the handler of steam:// protocol messages.

目前为 2017-04-05 提交的版本。查看 最新版本

// ==UserScript==
// @name        The Redeemer
// @namespace   raina
// @description Pops up the Steam product activation dialog when copying keys from bundle pages. Supports various bundle organizers and legitimate key reseller sites. Obviously requires that Steam is installed but also that it's allowed as the handler of steam:// protocol messages.
// @include     /^http:\/\/www\.dlh\.net\/en\/steam-keys\.html/
// @include     /^https:\/\/secure\.nuuvem\.com\/account\/library/
// @include     /^https?:\/\/(www\.)?dailyindiegame\.com\/account_page\.html/
// @include     /^https?:\/\/(www\.)?flyingbundle\.com\/users\/account/
// @include     /^https?:\/\/groupees\.com\/(profile\/)?purchases/
// @include     /^https?:\/\/steamcompanion\.com\/gifts\/won/
// @include     /^https?:\/\/www\.bundlestars\.com\/en\/orders/
// @include     /^https?:\/\/www\.greenmangaming\.com\/user\/account/
// @include     /^https?:\/\/www\.humblebundle\.com\/downloads\?/
// @include     /^https?:\/\/www\.humblebundle\.com\/home\/(keys|library)/
// @include     /^https?:\/\/www\.indiegala\.com/(profile|game)\?/
// @include     /^https?:\/\/www\.indieroyale\.com\/bundle\/key\//
// @include     /^https?:\/\/www\.oplata\.info\/info\/buy\.asp/
// @include     /^https?:\/\/www\.steamgifts\.com\/giveaways\/won/
// @version     1.8
// @grant       none
// ==/UserScript==
(function() {
	"use strict";
	var activateProduct = function(e) {
		var productKey = window.getSelection().toString().trim() || e.target.value;
		if (/^[\d\w]{2,5}(\-[\d\w]{4,5}){2,4}$/.test(productKey)) {
			window.location.href = "steam://open/activateproduct";
		}
	};
	window.addEventListener("copy", activateProduct, false);
}());