Skip to content

Instantly share code, notes, and snippets.

@pedrofracassi
Last active November 25, 2023 17:06
Show Gist options
  • Save pedrofracassi/6978a36c8301aa4262a162fb1d770aaf to your computer and use it in GitHub Desktop.
Save pedrofracassi/6978a36c8301aa4262a162fb1d770aaf to your computer and use it in GitHub Desktop.
Steam Key Quick Activator
// ==UserScript==
// @name Steam Key Quick Activator
// @namespace http://pedrofracassi.me/
// @version 1.2
// @description Activates Steam Keys Quickly!
// @author Pedro Fracassi (http://pedrofracassi.me)
// @match https://store.steampowered.com/account/registerkey?key=*
// @grant none
// @run-at document-end
// ==/UserScript==
'use strict';
if (document.getElementById('product_key').value != '') {
document.getElementById('accept_ssa').click();
document.getElementById('register_btn').click();
}
javascript:
var selection = window.getSelection().toString();
if (selection) {
location.href = 'https://store.steampowered.com/account/registerkey?key=' + selection;
} else {
location.href = 'https://store.steampowered.com/account/registerkey?key=' + prompt('Insert Steam Key');
}
@dterracino
Copy link

Instead of the last line being "null;", change it to "void(0);". This will stop the browser from redirecting the page you're on to a page that just says "null;" - at least in Firefox.

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