diff --git a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js index 93157b72b8..3942db9f95 100644 --- a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js +++ b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js @@ -105,10 +105,7 @@ class BadgesEverywhere { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/BetterFriendCount/BetterFriendCount.plugin.js b/Plugins/BetterFriendCount/BetterFriendCount.plugin.js index 3bcbee3441..cff39fb271 100644 --- a/Plugins/BetterFriendCount/BetterFriendCount.plugin.js +++ b/Plugins/BetterFriendCount/BetterFriendCount.plugin.js @@ -39,10 +39,7 @@ class BetterFriendCount { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/BetterNsfwTag/BetterNsfwTag.plugin.js b/Plugins/BetterNsfwTag/BetterNsfwTag.plugin.js index f697264eea..c2f13d7147 100644 --- a/Plugins/BetterNsfwTag/BetterNsfwTag.plugin.js +++ b/Plugins/BetterNsfwTag/BetterNsfwTag.plugin.js @@ -26,10 +26,7 @@ class BetterNsfwTag { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/BetterSearchPage/BetterSearchPage.plugin.js b/Plugins/BetterSearchPage/BetterSearchPage.plugin.js index 86375f5dbf..dd858dec5d 100644 --- a/Plugins/BetterSearchPage/BetterSearchPage.plugin.js +++ b/Plugins/BetterSearchPage/BetterSearchPage.plugin.js @@ -86,10 +86,7 @@ class BetterSearchPage { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/CharCounter/CharCounter.plugin.js b/Plugins/CharCounter/CharCounter.plugin.js index e6a44b1fb3..1ce78a68cb 100644 --- a/Plugins/CharCounter/CharCounter.plugin.js +++ b/Plugins/CharCounter/CharCounter.plugin.js @@ -88,10 +88,7 @@ class CharCounter { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ChatAliases/ChatAliases.plugin.js b/Plugins/ChatAliases/ChatAliases.plugin.js index d50df46f8d..b803a0b934 100644 --- a/Plugins/ChatAliases/ChatAliases.plugin.js +++ b/Plugins/ChatAliases/ChatAliases.plugin.js @@ -74,10 +74,7 @@ class ChatAliases { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ChatFilter/ChatFilter.plugin.js b/Plugins/ChatFilter/ChatFilter.plugin.js index 4471c66962..06f36c31ae 100644 --- a/Plugins/ChatFilter/ChatFilter.plugin.js +++ b/Plugins/ChatFilter/ChatFilter.plugin.js @@ -93,10 +93,7 @@ class ChatFilter { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/CompleteTimestamps/CompleteTimestamps.plugin.js b/Plugins/CompleteTimestamps/CompleteTimestamps.plugin.js index 7b3d116197..d26bf20490 100644 --- a/Plugins/CompleteTimestamps/CompleteTimestamps.plugin.js +++ b/Plugins/CompleteTimestamps/CompleteTimestamps.plugin.js @@ -81,10 +81,7 @@ class CompleteTimestamps { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/CreationDate/CreationDate.plugin.js b/Plugins/CreationDate/CreationDate.plugin.js index e726b4016f..9d4f29d8a8 100644 --- a/Plugins/CreationDate/CreationDate.plugin.js +++ b/Plugins/CreationDate/CreationDate.plugin.js @@ -91,10 +91,7 @@ class CreationDate { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js b/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js index 0228b0d131..efe9548e2b 100644 --- a/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js +++ b/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js @@ -207,10 +207,7 @@ class DisplayServersAsChannels { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/EditChannels/EditChannels.plugin.js b/Plugins/EditChannels/EditChannels.plugin.js index 997884dd53..57c31fb382 100644 --- a/Plugins/EditChannels/EditChannels.plugin.js +++ b/Plugins/EditChannels/EditChannels.plugin.js @@ -143,10 +143,7 @@ class EditChannels { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/EditServers/EditServers.plugin.js b/Plugins/EditServers/EditServers.plugin.js index 8a04d9342d..0041413095 100644 --- a/Plugins/EditServers/EditServers.plugin.js +++ b/Plugins/EditServers/EditServers.plugin.js @@ -160,10 +160,7 @@ class EditServers { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index dda5bd59f7..8e3c0b6965 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -221,10 +221,7 @@ class EditUsers { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/EmojiStatistics/EmojiStatistics.plugin.js b/Plugins/EmojiStatistics/EmojiStatistics.plugin.js index ca2d00b3dc..8c2916a09f 100644 --- a/Plugins/EmojiStatistics/EmojiStatistics.plugin.js +++ b/Plugins/EmojiStatistics/EmojiStatistics.plugin.js @@ -199,10 +199,7 @@ class EmojiStatistics { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ForceImagePreviews/ForceImagePreviews.plugin.js b/Plugins/ForceImagePreviews/ForceImagePreviews.plugin.js index 15b2b80eaf..543b7b8538 100644 --- a/Plugins/ForceImagePreviews/ForceImagePreviews.plugin.js +++ b/Plugins/ForceImagePreviews/ForceImagePreviews.plugin.js @@ -26,10 +26,7 @@ class ForceImagePreviews { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/FriendNotifications/FriendNotifications.plugin.js b/Plugins/FriendNotifications/FriendNotifications.plugin.js index 46726be6b9..ccc255ba66 100644 --- a/Plugins/FriendNotifications/FriendNotifications.plugin.js +++ b/Plugins/FriendNotifications/FriendNotifications.plugin.js @@ -217,10 +217,7 @@ class FriendNotifications { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/GoogleSearchReplace/GoogleSearchReplace.plugin.js b/Plugins/GoogleSearchReplace/GoogleSearchReplace.plugin.js index 0369461b90..7454af8c95 100644 --- a/Plugins/GoogleSearchReplace/GoogleSearchReplace.plugin.js +++ b/Plugins/GoogleSearchReplace/GoogleSearchReplace.plugin.js @@ -81,10 +81,7 @@ class GoogleSearchReplace { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js index b2dd88784f..d664ae7c1f 100644 --- a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js +++ b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js @@ -428,10 +428,7 @@ class GoogleTranslateOption { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ImageGallery/ImageGallery.plugin.js b/Plugins/ImageGallery/ImageGallery.plugin.js index 4195820f5b..718c71e8f2 100644 --- a/Plugins/ImageGallery/ImageGallery.plugin.js +++ b/Plugins/ImageGallery/ImageGallery.plugin.js @@ -43,10 +43,7 @@ class ImageGallery { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/JoinedAtDate/JoinedAtDate.plugin.js b/Plugins/JoinedAtDate/JoinedAtDate.plugin.js index 22a287f78b..3c91a25f00 100644 --- a/Plugins/JoinedAtDate/JoinedAtDate.plugin.js +++ b/Plugins/JoinedAtDate/JoinedAtDate.plugin.js @@ -93,10 +93,7 @@ class JoinedAtDate { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/MessageUtilities/MessageUtilities.plugin.js b/Plugins/MessageUtilities/MessageUtilities.plugin.js index 25b6257566..023db708bb 100644 --- a/Plugins/MessageUtilities/MessageUtilities.plugin.js +++ b/Plugins/MessageUtilities/MessageUtilities.plugin.js @@ -93,10 +93,7 @@ class MessageUtilities { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/MoveablePopups/MoveablePopups.plugin.js b/Plugins/MoveablePopups/MoveablePopups.plugin.js index a17db7cc65..651fdf91a6 100644 --- a/Plugins/MoveablePopups/MoveablePopups.plugin.js +++ b/Plugins/MoveablePopups/MoveablePopups.plugin.js @@ -20,10 +20,7 @@ class MoveablePopups { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/NotificationSounds/NotificationSounds.plugin.js b/Plugins/NotificationSounds/NotificationSounds.plugin.js index 891e42f2d5..313185dcb8 100644 --- a/Plugins/NotificationSounds/NotificationSounds.plugin.js +++ b/Plugins/NotificationSounds/NotificationSounds.plugin.js @@ -183,10 +183,7 @@ class NotificationSounds { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/OldTitleBar/OldTitleBar.plugin.js b/Plugins/OldTitleBar/OldTitleBar.plugin.js index 8cd0d868cc..b449f15494 100644 --- a/Plugins/OldTitleBar/OldTitleBar.plugin.js +++ b/Plugins/OldTitleBar/OldTitleBar.plugin.js @@ -132,10 +132,7 @@ class OldTitleBar { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/OwnerTag/OwnerTag.plugin.js b/Plugins/OwnerTag/OwnerTag.plugin.js index d7c657d229..3874e7403a 100644 --- a/Plugins/OwnerTag/OwnerTag.plugin.js +++ b/Plugins/OwnerTag/OwnerTag.plugin.js @@ -74,10 +74,7 @@ class OwnerTag { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/PersonalPins/PersonalPins.plugin.js b/Plugins/PersonalPins/PersonalPins.plugin.js index f5d47711f6..36283c3b0b 100644 --- a/Plugins/PersonalPins/PersonalPins.plugin.js +++ b/Plugins/PersonalPins/PersonalPins.plugin.js @@ -184,10 +184,7 @@ class PersonalPins { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/PinDMs/PinDMs.plugin.js b/Plugins/PinDMs/PinDMs.plugin.js index 685c508c4e..cbe0357e5d 100644 --- a/Plugins/PinDMs/PinDMs.plugin.js +++ b/Plugins/PinDMs/PinDMs.plugin.js @@ -130,10 +130,7 @@ class PinDMs { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/PluginRepo/PluginRepo.plugin.js b/Plugins/PluginRepo/PluginRepo.plugin.js index 587c0cf279..4bb9cc7701 100644 --- a/Plugins/PluginRepo/PluginRepo.plugin.js +++ b/Plugins/PluginRepo/PluginRepo.plugin.js @@ -274,10 +274,7 @@ class PluginRepo { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js b/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js index f36e074d7b..86d196cd1e 100644 --- a/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js +++ b/Plugins/ReadAllNotificationsButton/ReadAllNotificationsButton.plugin.js @@ -63,10 +63,7 @@ class ReadAllNotificationsButton { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/RemoveNicknames/RemoveNicknames.plugin.js b/Plugins/RemoveNicknames/RemoveNicknames.plugin.js index 49d73606e8..e893a0e79c 100644 --- a/Plugins/RemoveNicknames/RemoveNicknames.plugin.js +++ b/Plugins/RemoveNicknames/RemoveNicknames.plugin.js @@ -53,10 +53,7 @@ class RemoveNicknames { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/RepoControls/RepoControls.plugin.js b/Plugins/RepoControls/RepoControls.plugin.js index a6359711c6..56d03d0086 100644 --- a/Plugins/RepoControls/RepoControls.plugin.js +++ b/Plugins/RepoControls/RepoControls.plugin.js @@ -143,10 +143,7 @@ class RepoControls { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ReverseImageSearch/ReverseImageSearch.plugin.js b/Plugins/ReverseImageSearch/ReverseImageSearch.plugin.js index a241762dd9..9f45210524 100644 --- a/Plugins/ReverseImageSearch/ReverseImageSearch.plugin.js +++ b/Plugins/ReverseImageSearch/ReverseImageSearch.plugin.js @@ -78,10 +78,7 @@ class ReverseImageSearch { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/SendLargeMessages/SendLargeMessages.plugin.js b/Plugins/SendLargeMessages/SendLargeMessages.plugin.js index d2b703e23a..dfec2eca04 100644 --- a/Plugins/SendLargeMessages/SendLargeMessages.plugin.js +++ b/Plugins/SendLargeMessages/SendLargeMessages.plugin.js @@ -86,10 +86,7 @@ class SendLargeMessages { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ServerFolders/ServerFolders.plugin.js b/Plugins/ServerFolders/ServerFolders.plugin.js index 27c772dda9..631b4527bc 100644 --- a/Plugins/ServerFolders/ServerFolders.plugin.js +++ b/Plugins/ServerFolders/ServerFolders.plugin.js @@ -362,10 +362,7 @@ class ServerFolders { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ServerHider/ServerHider.plugin.js b/Plugins/ServerHider/ServerHider.plugin.js index a8c513d576..1520a34173 100644 --- a/Plugins/ServerHider/ServerHider.plugin.js +++ b/Plugins/ServerHider/ServerHider.plugin.js @@ -115,10 +115,7 @@ class ServerHider { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js b/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js index 78d8845143..f2dd87db49 100644 --- a/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js +++ b/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js @@ -131,10 +131,7 @@ class ShowHiddenChannels { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ShowImageDetails/ShowImageDetails.plugin.js b/Plugins/ShowImageDetails/ShowImageDetails.plugin.js index 7ad7c331ff..1fef034f5c 100644 --- a/Plugins/ShowImageDetails/ShowImageDetails.plugin.js +++ b/Plugins/ShowImageDetails/ShowImageDetails.plugin.js @@ -73,10 +73,7 @@ class ShowImageDetails { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/SpellCheck/SpellCheck.plugin.js b/Plugins/SpellCheck/SpellCheck.plugin.js index bc0048f086..a1c80553ef 100644 --- a/Plugins/SpellCheck/SpellCheck.plugin.js +++ b/Plugins/SpellCheck/SpellCheck.plugin.js @@ -118,10 +118,7 @@ class SpellCheck { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/StalkerNotifications/StalkerNotifications.plugin.js b/Plugins/StalkerNotifications/StalkerNotifications.plugin.js index 84920f6601..a00c0ebb04 100644 --- a/Plugins/StalkerNotifications/StalkerNotifications.plugin.js +++ b/Plugins/StalkerNotifications/StalkerNotifications.plugin.js @@ -263,10 +263,7 @@ class StalkerNotifications { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/SteamProfileLink/SteamProfileLink.plugin.js b/Plugins/SteamProfileLink/SteamProfileLink.plugin.js index c40cefdcf6..d09556acfb 100644 --- a/Plugins/SteamProfileLink/SteamProfileLink.plugin.js +++ b/Plugins/SteamProfileLink/SteamProfileLink.plugin.js @@ -20,10 +20,7 @@ class SteamProfileLink { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ThemeRepo/ThemeRepo.plugin.js b/Plugins/ThemeRepo/ThemeRepo.plugin.js index e0d96a8359..e5497e8d4f 100644 --- a/Plugins/ThemeRepo/ThemeRepo.plugin.js +++ b/Plugins/ThemeRepo/ThemeRepo.plugin.js @@ -331,10 +331,7 @@ class ThemeRepo { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/ThemeSettings/ThemeSettings.plugin.js b/Plugins/ThemeSettings/ThemeSettings.plugin.js index 996820d5cf..7e662f9f5c 100644 --- a/Plugins/ThemeSettings/ThemeSettings.plugin.js +++ b/Plugins/ThemeSettings/ThemeSettings.plugin.js @@ -26,10 +26,7 @@ class ThemeSettings { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js index c741bf93ff..0c91f4d9ad 100644 --- a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js +++ b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js @@ -82,10 +82,7 @@ class TopRoleEverywhere { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/UserNotes/UserNotes.plugin.js b/Plugins/UserNotes/UserNotes.plugin.js index 21f878e34e..d289821da4 100644 --- a/Plugins/UserNotes/UserNotes.plugin.js +++ b/Plugins/UserNotes/UserNotes.plugin.js @@ -95,10 +95,7 @@ class UserNotes { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/Plugins/WriteUpperCase/WriteUpperCase.plugin.js b/Plugins/WriteUpperCase/WriteUpperCase.plugin.js index 681b1b32a0..de5eb0a2d3 100644 --- a/Plugins/WriteUpperCase/WriteUpperCase.plugin.js +++ b/Plugins/WriteUpperCase/WriteUpperCase.plugin.js @@ -25,10 +25,7 @@ class WriteUpperCase { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/BadgesEverywhere/index.js b/PluginsV2/BadgesEverywhere/index.js index dc1efaaed7..a6084b0a3f 100644 --- a/PluginsV2/BadgesEverywhere/index.js +++ b/PluginsV2/BadgesEverywhere/index.js @@ -72,10 +72,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/BetterFriendCount/index.js b/PluginsV2/BetterFriendCount/index.js index 0e986f41ec..dd684de193 100644 --- a/PluginsV2/BetterFriendCount/index.js +++ b/PluginsV2/BetterFriendCount/index.js @@ -29,10 +29,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/BetterNsfwTag/index.js b/PluginsV2/BetterNsfwTag/index.js index 9420eca5b5..5b62a39c30 100644 --- a/PluginsV2/BetterNsfwTag/index.js +++ b/PluginsV2/BetterNsfwTag/index.js @@ -16,10 +16,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/BetterPageSearch/index.js b/PluginsV2/BetterPageSearch/index.js index 809e592101..3094deec45 100644 --- a/PluginsV2/BetterPageSearch/index.js +++ b/PluginsV2/BetterPageSearch/index.js @@ -61,10 +61,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/CharCounter/index.js b/PluginsV2/CharCounter/index.js index a21f59c4f5..0e717c4975 100644 --- a/PluginsV2/CharCounter/index.js +++ b/PluginsV2/CharCounter/index.js @@ -78,10 +78,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ChatAliases/index.js b/PluginsV2/ChatAliases/index.js index 4b3a1000fc..9113ab3a4a 100644 --- a/PluginsV2/ChatAliases/index.js +++ b/PluginsV2/ChatAliases/index.js @@ -24,10 +24,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ChatFilter/index.js b/PluginsV2/ChatFilter/index.js index 95deb4c0ea..4ddc31731b 100644 --- a/PluginsV2/ChatFilter/index.js +++ b/PluginsV2/ChatFilter/index.js @@ -36,10 +36,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/CompleteTimestamps/index.js b/PluginsV2/CompleteTimestamps/index.js index f599272cb8..2b840705ca 100644 --- a/PluginsV2/CompleteTimestamps/index.js +++ b/PluginsV2/CompleteTimestamps/index.js @@ -37,10 +37,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/CreationDate/index.js b/PluginsV2/CreationDate/index.js index 02a355f7d9..241e37cd37 100644 --- a/PluginsV2/CreationDate/index.js +++ b/PluginsV2/CreationDate/index.js @@ -56,10 +56,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/DisplayServersAsChannels/index.js b/PluginsV2/DisplayServersAsChannels/index.js index 544b26403e..5d8ba84686 100644 --- a/PluginsV2/DisplayServersAsChannels/index.js +++ b/PluginsV2/DisplayServersAsChannels/index.js @@ -198,10 +198,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/EditChannels/index.js b/PluginsV2/EditChannels/index.js index b479dd4655..6970c5ed8d 100644 --- a/PluginsV2/EditChannels/index.js +++ b/PluginsV2/EditChannels/index.js @@ -109,10 +109,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/EditServers/index.js b/PluginsV2/EditServers/index.js index ce9aa371c0..165cac7fb8 100644 --- a/PluginsV2/EditServers/index.js +++ b/PluginsV2/EditServers/index.js @@ -131,10 +131,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/EditUsers/index.js b/PluginsV2/EditUsers/index.js index abaf67a6b8..7388dcf58c 100644 --- a/PluginsV2/EditUsers/index.js +++ b/PluginsV2/EditUsers/index.js @@ -184,10 +184,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/EmojiStatistics/index.js b/PluginsV2/EmojiStatistics/index.js index 5c7061a984..472abdfe37 100644 --- a/PluginsV2/EmojiStatistics/index.js +++ b/PluginsV2/EmojiStatistics/index.js @@ -164,10 +164,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ForceImagePreviews/index.js b/PluginsV2/ForceImagePreviews/index.js index 19d528d319..07ea57b21f 100644 --- a/PluginsV2/ForceImagePreviews/index.js +++ b/PluginsV2/ForceImagePreviews/index.js @@ -16,10 +16,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/FriendNotifications/index.js b/PluginsV2/FriendNotifications/index.js index 834e42eedd..c15617685f 100644 --- a/PluginsV2/FriendNotifications/index.js +++ b/PluginsV2/FriendNotifications/index.js @@ -127,10 +127,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/GoogleSearchReplace/index.js b/PluginsV2/GoogleSearchReplace/index.js index 08debd1024..729cec5911 100644 --- a/PluginsV2/GoogleSearchReplace/index.js +++ b/PluginsV2/GoogleSearchReplace/index.js @@ -53,10 +53,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/GoogleTranslateOption/index.js b/PluginsV2/GoogleTranslateOption/index.js index 0502a539c6..add8d33f95 100644 --- a/PluginsV2/GoogleTranslateOption/index.js +++ b/PluginsV2/GoogleTranslateOption/index.js @@ -391,10 +391,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ImageGallery/index.js b/PluginsV2/ImageGallery/index.js index e3006a66e3..102bc53c79 100644 --- a/PluginsV2/ImageGallery/index.js +++ b/PluginsV2/ImageGallery/index.js @@ -33,10 +33,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/MessageUtilities/index.js b/PluginsV2/MessageUtilities/index.js index c87711f0aa..291262ea37 100644 --- a/PluginsV2/MessageUtilities/index.js +++ b/PluginsV2/MessageUtilities/index.js @@ -48,10 +48,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/MoveablePopups/index.js b/PluginsV2/MoveablePopups/index.js index a82e14fd6c..c77c533058 100644 --- a/PluginsV2/MoveablePopups/index.js +++ b/PluginsV2/MoveablePopups/index.js @@ -10,10 +10,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/NotificationSounds/index.js b/PluginsV2/NotificationSounds/index.js index 71ddbbd296..1d4c78cb67 100644 --- a/PluginsV2/NotificationSounds/index.js +++ b/PluginsV2/NotificationSounds/index.js @@ -101,10 +101,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/OldTitleBar/index.js b/PluginsV2/OldTitleBar/index.js index 5836e59e89..ab45b97ad5 100644 --- a/PluginsV2/OldTitleBar/index.js +++ b/PluginsV2/OldTitleBar/index.js @@ -95,10 +95,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/PersonalPins/index.js b/PluginsV2/PersonalPins/index.js index 8de9ebf010..e2fa4d6913 100644 --- a/PluginsV2/PersonalPins/index.js +++ b/PluginsV2/PersonalPins/index.js @@ -156,10 +156,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/PinDMs/index.js b/PluginsV2/PinDMs/index.js index 3eba2bcd34..68c2f881cf 100644 --- a/PluginsV2/PinDMs/index.js +++ b/PluginsV2/PinDMs/index.js @@ -101,10 +101,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ReadAllNotificationsButton/index.js b/PluginsV2/ReadAllNotificationsButton/index.js index 2a98d9a54d..29166c5bf3 100644 --- a/PluginsV2/ReadAllNotificationsButton/index.js +++ b/PluginsV2/ReadAllNotificationsButton/index.js @@ -37,10 +37,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/RemoveNicknames/index.js b/PluginsV2/RemoveNicknames/index.js index 237b076161..ba48d8819e 100644 --- a/PluginsV2/RemoveNicknames/index.js +++ b/PluginsV2/RemoveNicknames/index.js @@ -27,10 +27,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ReverseImageSearch/index.js b/PluginsV2/ReverseImageSearch/index.js index dfe1cd1105..9930951aa6 100644 --- a/PluginsV2/ReverseImageSearch/index.js +++ b/PluginsV2/ReverseImageSearch/index.js @@ -50,10 +50,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/SendLargeMessages/index.js b/PluginsV2/SendLargeMessages/index.js index 0b3fed402e..46c71b6b08 100644 --- a/PluginsV2/SendLargeMessages/index.js +++ b/PluginsV2/SendLargeMessages/index.js @@ -76,10 +76,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ServerFolders/index.js b/PluginsV2/ServerFolders/index.js index 9e8ba3eea6..2ec49e0292 100644 --- a/PluginsV2/ServerFolders/index.js +++ b/PluginsV2/ServerFolders/index.js @@ -295,10 +295,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ServerHider/index.js b/PluginsV2/ServerHider/index.js index 8636415911..b11f078cd8 100644 --- a/PluginsV2/ServerHider/index.js +++ b/PluginsV2/ServerHider/index.js @@ -86,10 +86,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ShowHiddenChannels/index.js b/PluginsV2/ShowHiddenChannels/index.js index 686c18a73f..2de4b588cf 100644 --- a/PluginsV2/ShowHiddenChannels/index.js +++ b/PluginsV2/ShowHiddenChannels/index.js @@ -95,10 +95,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/ShowImageDetails/index.js b/PluginsV2/ShowImageDetails/index.js index 21ce6fd3af..26436faaf0 100644 --- a/PluginsV2/ShowImageDetails/index.js +++ b/PluginsV2/ShowImageDetails/index.js @@ -37,10 +37,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/SpellCheck/index.js b/PluginsV2/SpellCheck/index.js index fc8234dc90..1d07d5fb17 100644 --- a/PluginsV2/SpellCheck/index.js +++ b/PluginsV2/SpellCheck/index.js @@ -72,10 +72,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/StalkerNotifications/index.js b/PluginsV2/StalkerNotifications/index.js index 3ba93c5288..55dea83151 100644 --- a/PluginsV2/StalkerNotifications/index.js +++ b/PluginsV2/StalkerNotifications/index.js @@ -135,10 +135,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/SteamProfileLink/index.js b/PluginsV2/SteamProfileLink/index.js index 78d26d15cd..1e009c13b5 100644 --- a/PluginsV2/SteamProfileLink/index.js +++ b/PluginsV2/SteamProfileLink/index.js @@ -10,10 +10,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/TopRoleEverywhere/index.js b/PluginsV2/TopRoleEverywhere/index.js index 7218be930c..7cb3bc500d 100644 --- a/PluginsV2/TopRoleEverywhere/index.js +++ b/PluginsV2/TopRoleEverywhere/index.js @@ -55,10 +55,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize(); diff --git a/PluginsV2/WriteUpperCase/index.js b/PluginsV2/WriteUpperCase/index.js index 37945e831d..5471949e0b 100644 --- a/PluginsV2/WriteUpperCase/index.js +++ b/PluginsV2/WriteUpperCase/index.js @@ -16,10 +16,7 @@ module.exports = (Plugin, Api, Vendor) => { libraryScript.setAttribute("type", "text/javascript"); libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"); libraryScript.setAttribute("date", performance.now()); - libraryScript.addEventListener("load", () => { - BDFDB.loaded = true; - this.initialize(); - }); + libraryScript.addEventListener("load", () => {if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();}); document.head.appendChild(libraryScript); } else if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) this.initialize();