-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedeemer.user.js
More file actions
42 lines (32 loc) · 1.27 KB
/
Redeemer.user.js
File metadata and controls
42 lines (32 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ==UserScript==
// @name Redeemer
// @namespace psydex
// @description Pops up the Steam product activation webpage when copying keys from any website. Does not require Steam to be installed!
// @author psydex
// @match *://*/*
// @version 2.6
// @grant none
// @homepageURL https://github.com/psydex/Redeemer/
// @downloadURL https://github.com/psydex/Redeemer/raw/refs/heads/master/Redeemer.user.js
// @updateURL https://github.com/psydex/Redeemer/raw/refs/heads/master/Redeemer.user.js
// ==/UserScript==
(function () {
"use strict";
function activateProduct(e) {
let productKey =
(e.clipboardData && e.clipboardData.getData("text")) ||
window.getSelection().toString() ||
(e.target && e.target.value) ||
"";
productKey = productKey.trim();
if (!productKey) return;
// Steam key format: XXXXX-XXXXX-XXXXX
if (/^[A-Z0-9]{5}(-[A-Z0-9]{5}){2}$/i.test(productKey)) {
const url =
"https://store.steampowered.com/account/registerkey?key=" +
encodeURIComponent(productKey);
window.open(url, "_blank", "noopener,noreferrer");
}
}
window.addEventListener("copy", activateProduct, false);
})();