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');
}
@pedrofracassi
Copy link
Author

pedrofracassi commented Sep 1, 2017

How do I install this?
Install tampermonkey, and then click this link

If you want to be even faster, add this code to your bookmarks and click it whenever you need to activate a key.
It will open steam's activation page with your selected text as a key. If you don't have anything selected, it will ask you for a key.

AAAAA-BBBBB-CCCCC

@PuppyLover101
Copy link

so how exactly do i use this? I installed everything. I just select a key? then what?

@pedrofracassi
Copy link
Author

@PuppyLover101 select or copy a key, then click the bookmarklet you created!

@Looke116
Copy link

Looke116 commented Sep 1, 2017

the bookmark does't redirect me anywhere

@SuperG03
Copy link

SuperG03 commented Sep 1, 2017

How do i find the keys to activate

@pedrofracassi
Copy link
Author

pedrofracassi commented Sep 2, 2017

@SuperG03 personally, I get keys from r/FreeGamesOnSteam, they post a lot of giveaways there.

@pedrofracassi
Copy link
Author

@Looke116 did you do it like this?

@DaniDipp
Copy link

DaniDipp commented Sep 2, 2017

Just as a small quality of life change for the bookmarklet, you can check for null from the prompt to abort when clicking "Cancel" or Esc.

result = prompt('Insert Steam Key');
if(result != null){
	location.href = 'https://store.steampowered.com/account/registerkey?key=' + result;
}

@Haoose
Copy link

Haoose commented Sep 2, 2017

@seanf
Copy link

seanf commented Oct 31, 2017

If you use this for the bookmarklet, it should open the activation page in a new tab (helpful for IndieGala, which keeps losing my place):

javascript:
var selection = window.getSelection().toString();
var loc;
if (selection) {
  loc = 'https://store.steampowered.com/account/registerkey?key=' + selection;
} else {
  result = prompt('Insert Steam Key');
  if (result != null) {
    loc = 'https://store.steampowered.com/account/registerkey?key=' + result;
  } else {
    loc = 'https://store.steampowered.com/account/registerkey';
  }
}
var popup = window.open('about:blank', '_blank');
popup.location = loc;
null;

(only tested on Chrome)

@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