Last active
January 9, 2017 19:27
-
-
Save noodlebox/94b26b4ded85a0ded48197333aad290b to your computer and use it in GitHub Desktop.
Temporary BD Fix
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
//META{"name":"tempFix"}*// | |
/*@cc_on | |
@if (@_jscript) | |
// Offer to self-install for clueless users that try to run this directly. | |
var shell = WScript.CreateObject("WScript.Shell"); | |
var fs = new ActiveXObject("Scripting.FileSystemObject"); | |
var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins"); | |
var pathSelf = WScript.ScriptFullName; | |
// Put the user at ease by addressing them in the first person | |
shell.Popup("It looks like you mistakenly tried to run me directly. (don't do that!)", 0, "I'm a plugin for BetterDiscord", 0x30); | |
if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) { | |
shell.Popup("I'm in the correct folder already.\nJust reload Discord with Ctrl+R.", 0, "I'm already installed", 0x40); | |
} else if (!fs.FolderExists(pathPlugins)) { | |
shell.Popup("I can't find the BetterDiscord plugins folder.\nAre you sure it's even installed?", 0, "Can't install myself", 0x10); | |
} else if (shell.Popup("Should I copy myself to BetterDiscord's plugins folder for you?", 0, "Do you need some help?", 0x34) === 6) { | |
fs.CopyFile(pathSelf, fs.BuildPath(pathPlugins, fs.GetFileName(pathSelf)), true); | |
// Show the user where to put plugins in the future | |
shell.Exec("explorer " + pathPlugins); | |
shell.Popup("I'm installed!\nJust reload Discord with Ctrl+R.", 0, "Successfully installed", 0x40); | |
} | |
WScript.Quit(); | |
@else @*/ | |
var tempFix = function () {}; | |
(function () { | |
"use strict"; | |
const iframe = document.createElement('iframe'); | |
iframe.style.display = 'none'; | |
document.body.appendChild(iframe); | |
window.localStorage = iframe.contentWindow.localStorage; | |
tempFix.prototype.start = function () {}; | |
tempFix.prototype.stop = function () {}; | |
tempFix.prototype.load = function () {}; | |
tempFix.prototype.unload = function () {}; | |
tempFix.prototype.getName = function () { | |
return "Temporary BD Fix"; | |
}; | |
tempFix.prototype.getDescription = function () { | |
return "Temporary workaround for missing localStorage"; | |
}; | |
tempFix.prototype.getVersion = function () { | |
return "0.2.0"; | |
}; | |
tempFix.prototype.getAuthor = function () { | |
return "noodlebox / Mitchell"; | |
}; | |
})(); | |
/*@end @*/ |
BetterDiscord broke for me again. :(
is there another way getting the token?
If this is a plugin for BetterDiscord how will we run it?
As we put it in C:\Users\USERNAME\AppData\Roaming\BetterDiscord\plugins But BetterDiscord needs to work to be enabled it?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@brodycas3 Pretty much "Uncaught ReferenceError: localStorage is not defined", so we need this temp fix like that.