Last active
August 24, 2021 07:46
-
-
Save BinToss/7a5fdccb13c03116766bfe49fcf23ce2 to your computer and use it in GitHub Desktop.
A userscript to get the URL of the latest Discord GameSDK Release. Older versions can be accessed, but you have to guess their URLs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Get Discord GameSDK URL | |
// @namespace Violentmonkey Scripts | |
// @match https://discord.com/developers/docs/game-sdk/sdk-starter-guide | |
// @match https://github.com/discord/discord-api-docs/blob/master/docs/game_sdk/SDK_Starter_Guide.md | |
// @grant none | |
// @version 1.0.3 | |
// @homepageURL https://gist.github.com/BinToss/7a5fdccb13c03116766bfe49fcf23ce2 | |
// @downloadURL https://gist.githubusercontent.com/BinToss/7a5fdccb13c03116766bfe49fcf23ce2/raw/GetDiscordGameSDKURL.userscript.js | |
// @updateURL https://gist.githubusercontent.com/BinToss/7a5fdccb13c03116766bfe49fcf23ce2/raw/GetDiscordGameSDKURL.userscript.js | |
// @author Noah Sherwin | |
// @description 7/15/2021, 7:05:57 PM | |
// ==/UserScript== | |
async function getGameSDKURL() | |
{ | |
while (document.querySelector("a[href^='#get-set-up']") === null) | |
{ | |
await new Promise(resolve => setTimeout(resolve, 200)); | |
} | |
var discordGameSDK_URL = document.querySelector("a[href^='https://dl-game-sdk.discordapp.net']").href; | |
console.log('Discord GameSDK URL is...') | |
console.log(discordGameSDK_URL); | |
} | |
if (document.readyState === 'loading') { // Loading hasn't finished yet | |
document.addEventListener('COMContentLoaded', getGameSDKURL); | |
} else { // `DOMContentLoaded` has already fired | |
getGameSDKURL(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well...at least this script survived Greasemonkey's script purge.
Context:
All of my synced scripts were overwritten by a new browser client with two scripts. I can't find any of my exported backups.