Skip to content

Instantly share code, notes, and snippets.

@BinToss
Last active August 24, 2021 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BinToss/7a5fdccb13c03116766bfe49fcf23ce2 to your computer and use it in GitHub Desktop.
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.
// ==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();
}
@BinToss
Copy link
Author

BinToss commented Aug 24, 2021

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.

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