From 74fafb7062d6f0831923ec871cd9ff1c5870f8ea Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sun, 10 Feb 2019 19:40:46 +0100 Subject: [PATCH] stuff --- PluginsV2/BadgesEverywhere/index.js | 2 +- PluginsV2/BetterFriendCount/index.js | 2 +- PluginsV2/BetterNsfwTag/index.js | 2 +- PluginsV2/BetterPageSearch/index.js | 2 +- PluginsV2/CharCounter/index.js | 2 +- PluginsV2/ChatAliases/index.js | 2 +- PluginsV2/ChatFilter/index.js | 2 +- PluginsV2/CompleteTimestamps/index.js | 2 +- PluginsV2/CreationDate/index.js | 2 +- PluginsV2/DisplayServersAsChannels/index.js | 2 +- PluginsV2/EditChannels/index.js | 2 +- PluginsV2/EditServers/index.js | 2 +- PluginsV2/EditUsers/index.js | 2 +- PluginsV2/EmojiStatistics/index.js | 2 +- PluginsV2/ForceImagePreviews/index.js | 2 +- PluginsV2/FriendNotifications/index.js | 2 +- PluginsV2/GoogleSearchReplace/index.js | 2 +- PluginsV2/GoogleTranslateOption/index.js | 2 +- PluginsV2/ImageGallery/index.js | 2 +- PluginsV2/MessageUtilities/index.js | 2 +- PluginsV2/MoveablePopups/index.js | 2 +- PluginsV2/NotificationSounds/index.js | 2 +- PluginsV2/OldTitleBar/index.js | 2 +- PluginsV2/PersonalPins/index.js | 2 +- PluginsV2/PinDMs/index.js | 2 +- PluginsV2/ReadAllNotificationsButton/index.js | 2 +- PluginsV2/RemoveNicknames/index.js | 2 +- PluginsV2/ReverseImageSearch/index.js | 2 +- PluginsV2/SendLargeMessages/index.js | 2 +- PluginsV2/ServerFolders/index.js | 2 +- PluginsV2/ServerHider/index.js | 2 +- PluginsV2/ShowHiddenChannels/index.js | 2 +- PluginsV2/ShowImageDetails/index.js | 2 +- PluginsV2/SpellCheck/index.js | 2 +- PluginsV2/StalkerNotifications/index.js | 2 +- PluginsV2/SteamProfileLink/index.js | 2 +- PluginsV2/TopRoleEverywhere/index.js | 2 +- PluginsV2/WriteUpperCase/index.js | 2 +- 38 files changed, 38 insertions(+), 38 deletions(-) diff --git a/PluginsV2/BadgesEverywhere/index.js b/PluginsV2/BadgesEverywhere/index.js index b381ddc287..52adb31071 100644 --- a/PluginsV2/BadgesEverywhere/index.js +++ b/PluginsV2/BadgesEverywhere/index.js @@ -67,7 +67,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/BetterFriendCount/index.js b/PluginsV2/BetterFriendCount/index.js index 5d82bc50b5..4347a787ff 100644 --- a/PluginsV2/BetterFriendCount/index.js +++ b/PluginsV2/BetterFriendCount/index.js @@ -24,7 +24,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/BetterNsfwTag/index.js b/PluginsV2/BetterNsfwTag/index.js index eeebd2a785..6b6ee8d459 100644 --- a/PluginsV2/BetterNsfwTag/index.js +++ b/PluginsV2/BetterNsfwTag/index.js @@ -11,7 +11,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/BetterPageSearch/index.js b/PluginsV2/BetterPageSearch/index.js index 1083d80384..2c7d4de540 100644 --- a/PluginsV2/BetterPageSearch/index.js +++ b/PluginsV2/BetterPageSearch/index.js @@ -56,7 +56,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/CharCounter/index.js b/PluginsV2/CharCounter/index.js index 5762c480f5..e534493e6a 100644 --- a/PluginsV2/CharCounter/index.js +++ b/PluginsV2/CharCounter/index.js @@ -73,7 +73,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ChatAliases/index.js b/PluginsV2/ChatAliases/index.js index 74dcfbaa4a..844c864bf6 100644 --- a/PluginsV2/ChatAliases/index.js +++ b/PluginsV2/ChatAliases/index.js @@ -19,7 +19,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ChatFilter/index.js b/PluginsV2/ChatFilter/index.js index 79fee349c7..e96f5533b6 100644 --- a/PluginsV2/ChatFilter/index.js +++ b/PluginsV2/ChatFilter/index.js @@ -31,7 +31,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/CompleteTimestamps/index.js b/PluginsV2/CompleteTimestamps/index.js index fb92de0667..b8d026b85f 100644 --- a/PluginsV2/CompleteTimestamps/index.js +++ b/PluginsV2/CompleteTimestamps/index.js @@ -32,7 +32,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/CreationDate/index.js b/PluginsV2/CreationDate/index.js index 75f9b2076d..22bca5ce14 100644 --- a/PluginsV2/CreationDate/index.js +++ b/PluginsV2/CreationDate/index.js @@ -51,7 +51,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/DisplayServersAsChannels/index.js b/PluginsV2/DisplayServersAsChannels/index.js index a31697f8a3..dd75838b70 100644 --- a/PluginsV2/DisplayServersAsChannels/index.js +++ b/PluginsV2/DisplayServersAsChannels/index.js @@ -193,7 +193,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/EditChannels/index.js b/PluginsV2/EditChannels/index.js index 757a6db9bb..8117878fd1 100644 --- a/PluginsV2/EditChannels/index.js +++ b/PluginsV2/EditChannels/index.js @@ -104,7 +104,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/EditServers/index.js b/PluginsV2/EditServers/index.js index 8171e1b83b..89d8e4a614 100644 --- a/PluginsV2/EditServers/index.js +++ b/PluginsV2/EditServers/index.js @@ -126,7 +126,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/EditUsers/index.js b/PluginsV2/EditUsers/index.js index 272c71aa84..a0792997ce 100644 --- a/PluginsV2/EditUsers/index.js +++ b/PluginsV2/EditUsers/index.js @@ -179,7 +179,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/EmojiStatistics/index.js b/PluginsV2/EmojiStatistics/index.js index 17bfb12b0c..0e0a45328d 100644 --- a/PluginsV2/EmojiStatistics/index.js +++ b/PluginsV2/EmojiStatistics/index.js @@ -159,7 +159,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ForceImagePreviews/index.js b/PluginsV2/ForceImagePreviews/index.js index 5e673e0960..fec246c5af 100644 --- a/PluginsV2/ForceImagePreviews/index.js +++ b/PluginsV2/ForceImagePreviews/index.js @@ -11,7 +11,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/FriendNotifications/index.js b/PluginsV2/FriendNotifications/index.js index d6c4c86837..13ced748a9 100644 --- a/PluginsV2/FriendNotifications/index.js +++ b/PluginsV2/FriendNotifications/index.js @@ -122,7 +122,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/GoogleSearchReplace/index.js b/PluginsV2/GoogleSearchReplace/index.js index 313a30f61c..c50574ba44 100644 --- a/PluginsV2/GoogleSearchReplace/index.js +++ b/PluginsV2/GoogleSearchReplace/index.js @@ -48,7 +48,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/GoogleTranslateOption/index.js b/PluginsV2/GoogleTranslateOption/index.js index 53e629f18d..1bddb44781 100644 --- a/PluginsV2/GoogleTranslateOption/index.js +++ b/PluginsV2/GoogleTranslateOption/index.js @@ -386,7 +386,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ImageGallery/index.js b/PluginsV2/ImageGallery/index.js index 337fd5d581..9e4f7ecdad 100644 --- a/PluginsV2/ImageGallery/index.js +++ b/PluginsV2/ImageGallery/index.js @@ -28,7 +28,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/MessageUtilities/index.js b/PluginsV2/MessageUtilities/index.js index b7acc626ce..dd33148c96 100644 --- a/PluginsV2/MessageUtilities/index.js +++ b/PluginsV2/MessageUtilities/index.js @@ -43,7 +43,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/MoveablePopups/index.js b/PluginsV2/MoveablePopups/index.js index a0cbe25bf1..be507eef6f 100644 --- a/PluginsV2/MoveablePopups/index.js +++ b/PluginsV2/MoveablePopups/index.js @@ -5,7 +5,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/NotificationSounds/index.js b/PluginsV2/NotificationSounds/index.js index d9a7279f4c..b86d5fa933 100644 --- a/PluginsV2/NotificationSounds/index.js +++ b/PluginsV2/NotificationSounds/index.js @@ -96,7 +96,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/OldTitleBar/index.js b/PluginsV2/OldTitleBar/index.js index 6fd6cc532d..e0d0b7995d 100644 --- a/PluginsV2/OldTitleBar/index.js +++ b/PluginsV2/OldTitleBar/index.js @@ -90,7 +90,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/PersonalPins/index.js b/PluginsV2/PersonalPins/index.js index 1ba86133ea..3f2cefcc53 100644 --- a/PluginsV2/PersonalPins/index.js +++ b/PluginsV2/PersonalPins/index.js @@ -151,7 +151,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/PinDMs/index.js b/PluginsV2/PinDMs/index.js index 5095084e62..9380a15f32 100644 --- a/PluginsV2/PinDMs/index.js +++ b/PluginsV2/PinDMs/index.js @@ -96,7 +96,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ReadAllNotificationsButton/index.js b/PluginsV2/ReadAllNotificationsButton/index.js index 12fe3dacad..bd7863fc74 100644 --- a/PluginsV2/ReadAllNotificationsButton/index.js +++ b/PluginsV2/ReadAllNotificationsButton/index.js @@ -52,7 +52,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/RemoveNicknames/index.js b/PluginsV2/RemoveNicknames/index.js index 9abf9eb899..e48fb931cb 100644 --- a/PluginsV2/RemoveNicknames/index.js +++ b/PluginsV2/RemoveNicknames/index.js @@ -22,7 +22,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ReverseImageSearch/index.js b/PluginsV2/ReverseImageSearch/index.js index 87e3134de7..daadc3ca79 100644 --- a/PluginsV2/ReverseImageSearch/index.js +++ b/PluginsV2/ReverseImageSearch/index.js @@ -45,7 +45,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/SendLargeMessages/index.js b/PluginsV2/SendLargeMessages/index.js index 632fdb6261..54f4ce8408 100644 --- a/PluginsV2/SendLargeMessages/index.js +++ b/PluginsV2/SendLargeMessages/index.js @@ -71,7 +71,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ServerFolders/index.js b/PluginsV2/ServerFolders/index.js index 1b29b050a1..a1800f7339 100644 --- a/PluginsV2/ServerFolders/index.js +++ b/PluginsV2/ServerFolders/index.js @@ -290,7 +290,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ServerHider/index.js b/PluginsV2/ServerHider/index.js index ab40b9d7ec..ce5b78c537 100644 --- a/PluginsV2/ServerHider/index.js +++ b/PluginsV2/ServerHider/index.js @@ -81,7 +81,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ShowHiddenChannels/index.js b/PluginsV2/ShowHiddenChannels/index.js index 0ba951683f..23bd2bb805 100644 --- a/PluginsV2/ShowHiddenChannels/index.js +++ b/PluginsV2/ShowHiddenChannels/index.js @@ -90,7 +90,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/ShowImageDetails/index.js b/PluginsV2/ShowImageDetails/index.js index 0a5ef92895..8e4cc62997 100644 --- a/PluginsV2/ShowImageDetails/index.js +++ b/PluginsV2/ShowImageDetails/index.js @@ -32,7 +32,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/SpellCheck/index.js b/PluginsV2/SpellCheck/index.js index a0c0b6d037..215bf8d21a 100644 --- a/PluginsV2/SpellCheck/index.js +++ b/PluginsV2/SpellCheck/index.js @@ -67,7 +67,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/StalkerNotifications/index.js b/PluginsV2/StalkerNotifications/index.js index 755291d23a..16da9ee4a1 100644 --- a/PluginsV2/StalkerNotifications/index.js +++ b/PluginsV2/StalkerNotifications/index.js @@ -130,7 +130,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/SteamProfileLink/index.js b/PluginsV2/SteamProfileLink/index.js index e596e70a1a..edef71c76b 100644 --- a/PluginsV2/SteamProfileLink/index.js +++ b/PluginsV2/SteamProfileLink/index.js @@ -5,7 +5,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/TopRoleEverywhere/index.js b/PluginsV2/TopRoleEverywhere/index.js index 2b23c7d735..810f328929 100644 --- a/PluginsV2/TopRoleEverywhere/index.js +++ b/PluginsV2/TopRoleEverywhere/index.js @@ -50,7 +50,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript"); diff --git a/PluginsV2/WriteUpperCase/index.js b/PluginsV2/WriteUpperCase/index.js index 6974487192..890d9eadfa 100644 --- a/PluginsV2/WriteUpperCase/index.js +++ b/PluginsV2/WriteUpperCase/index.js @@ -11,7 +11,7 @@ module.exports = (Plugin, Api, Vendor) => { onStart () { if (global.BDFDB && global.BDFDB.myPlugins && typeof global.BDFDB.myPlugins == "object") global.BDFDB.myPlugins[this.name] = this; var libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]'); - if (!libraryScript || performance.now() - libraryScript.getAttribute("date") > 600000) { + if (!global.BDFDB || typeof BDFDB != "object" || performance.now() - BDFDB.creationTime > 600000e.now() - BDFDB.creationTime > 600000) { if (libraryScript) libraryScript.remove(); libraryScript = document.createElement("script"); libraryScript.setAttribute("type", "text/javascript");