Skip to content

Instantly share code, notes, and snippets.

@SavageCore
Created August 31, 2017 17:13
Show Gist options
  • Select an option

  • Save SavageCore/71c1da44ea8cc02b9491ff59f3f209f7 to your computer and use it in GitHub Desktop.

Select an option

Save SavageCore/71c1da44ea8cc02b9491ff59f3f209f7 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name The Redeemer
// @namespace raina
// @description Pops up the Steam product activation dialog when copying keys from bundle/reseller sites. Supports various bundle organizers and legitimate key resellers. 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:\/\/(www\.)?chrono\.gg/
// @include /^https:\/\/groupees\.com\/(profile\/)?purchases/
// @include /^https:\/\/secure\.nuuvem\.com\/account\/library/
// @include /^https:\/\/www\.humblebundle\.com\/(downloads\?|home\/(keys|library))/
// @include /^https?:\/\/(www\.)?dailyindiegame\.com\/account_page\.html/
// @include /^https?:\/\/(www\.)?flyingbundle\.com\/users\/account/
// @include /^https?:\/\/steamcompanion\.com\/gifts\/won/
// @include /^https?:\/\/www\.bundlestars\.com\/en\/orders/
// @include /^https?:\/\/www\.greenmangaming\.com\/user\/account/
// @include /^https?:\/\/www\.indiegala\.com/(profile|game)\?/
// @include /^https?:\/\/www\.oplata\.info\/info\/buy\.asp/
// @include /^https?:\/\/www\.steamgifts\.com\/giveaways\/won/
// @include /^https?:\/\/store.steampowered.com\/account\/registerkey\?/
// @version 1.9
// @grant none
// ==/UserScript==
(function() {
"use strict";
var activateProduct = function(e) {
var productKey = window.getSelection().toString().trim() || e.target.value;
var m;
if ((m = /^[\d\w]{2,5}(\-[\d\w]{4,5}){2,4}$/.exec(productKey)) !== null) {
window.open("https://store.steampowered.com/account/registerkey?key=" + m[0]);
}
};
window.addEventListener("copy", activateProduct, false);
// Automatically accept Steam Subscriber Agreement
if (window.location.href.match(/^https?:\/\/store.steampowered.com\/account\/registerkey/)) {
var ssaElem = document.getElementById('accept_ssa');
if (ssaElem) {
ssaElem.checked='checked';
}
}
}());
@psydex

psydex commented Aug 30, 2018

Copy link
Copy Markdown

How do I make it work everywhere (on every page)

@Korb

Korb commented Dec 2, 2021

Copy link
Copy Markdown

What exactly does this script do?

@SavageCore

SavageCore commented Dec 2, 2021 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment