Skip to content

Instantly share code, notes, and snippets.

@wmathes
Created May 8, 2021 03:44
Show Gist options
  • Save wmathes/82cd04605419e4de7933a1291ce1ea40 to your computer and use it in GitHub Desktop.
Save wmathes/82cd04605419e4de7933a1291ce1ea40 to your computer and use it in GitHub Desktop.
A TamperMonkey-script for Steam Key registrations (particularly useful with Humble Bundle)

Functionality

When activating a product key on the steam website, this TemperMonkey-script automatically clicks the checkbox to accept the "Steam Subscriber Agreement".

If a product key is part of the URL, for instance after clicking "Redeem" on a game code at humblebundle.com, the script will click the Continue-button for you as well.

How to use this

  1. Install the TemperMonkey browser extension (Chrome/Edge)
  2. Create a new script
  3. Copy paste the contents of the file below
// ==UserScript==
// @name Steam: Accept Steam Agreement
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://store.steampowered.com/account/registerkey*
// @icon https://www.google.com/s2/favicons?domain=steampowered.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
console.log('TM: loading');
const interval = setInterval(() => {
console.log('TM: checking');
const elem = document.getElementById('accept_ssa');
if (!elem || elem.checked || (!elem.checked && elem.checked !== false)) {
return
}
elem.checked = true;
console.log('TM: SSE accepted');
clearInterval(interval);
if (/\?key=.+/.test(location.search)) {
setTimeout(() => {
if (window.RegisterProductKey) {
console.log('TM: register key');
window.RegisterProductKey();
}
}, 100);
}
}, 100);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment