export_blocked.js
· 1.3 KiB · JavaScript
Raw
// ==UserScript==
// @name Export Blocked Steam Players
// @version 1.0
// @description Adds a button to export all blocked players
// @author Jackz
// @match http*://steamcommunity.com/id/*/friends/blocked
// @grant GM_setClipboard
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_listValues
// @downloadURL https://gist.githubusercontent.com/Jackzmc/1cd07cc9e1401ef78c87d45f6450ae84/raw/517541eeaee64f8864f899c4a91d07458389f8f8/export_blocked.js
// @updateURL https://gist.githubusercontent.com/Jackzmc/1cd07cc9e1401ef78c87d45f6450ae84/raw/517541eeaee64f8864f899c4a91d07458389f8f8/export_blocked.js
// ==/UserScript==
(async function() {
document.getElementsByClassName("title_bar")[0].insert("<div class=\"btnv6_blue_hoverfade btn_small btn_uppercase\" id=\"export-btn\">Export</div> ")
document.getElementById('export-btn').addEventListener('click', () => {
const items = [];
for(const item of document.getElementsByClassName("selectable")) {
items.push(item.attributes['data-steamid'].textContent)
}
GM_setClipboard(JSON.stringify(items), "text");
var a = document.createElement("a");
a.href = "data:application/json," + JSON.stringify(items);
a.download = "banned_users.json";
a.click();
})
})();
1 | // ==UserScript== |
2 | // @name Export Blocked Steam Players |
3 | // @version 1.0 |
4 | // @description Adds a button to export all blocked players |
5 | // @author Jackz |
6 | // @match http*://steamcommunity.com/id/*/friends/blocked |
7 | // @grant GM_setClipboard |
8 | // @grant GM_getValue |
9 | // @grant GM_setValue |
10 | // @grant GM_listValues |
11 | // @downloadURL https://gist.githubusercontent.com/Jackzmc/1cd07cc9e1401ef78c87d45f6450ae84/raw/517541eeaee64f8864f899c4a91d07458389f8f8/export_blocked.js |
12 | // @updateURL https://gist.githubusercontent.com/Jackzmc/1cd07cc9e1401ef78c87d45f6450ae84/raw/517541eeaee64f8864f899c4a91d07458389f8f8/export_blocked.js |
13 | // ==/UserScript== |
14 | (async function() { |
15 | document.getElementsByClassName("title_bar")[0].insert("<div class=\"btnv6_blue_hoverfade btn_small btn_uppercase\" id=\"export-btn\">Export</div> ") |
16 | document.getElementById('export-btn').addEventListener('click', () => { |
17 | const items = []; |
18 | for(const item of document.getElementsByClassName("selectable")) { |
19 | items.push(item.attributes['data-steamid'].textContent) |
20 | } |
21 | GM_setClipboard(JSON.stringify(items), "text"); |
22 | var a = document.createElement("a"); |
23 | a.href = "data:application/json," + JSON.stringify(items); |
24 | a.download = "banned_users.json"; |
25 | a.click(); |
26 | }) |
27 | })(); |