From 3c6f462471de01c701ef25e099ca511fac9cfdf7 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Wed, 9 Sep 2020 21:56:31 +0200 Subject: [PATCH] Update DiscordPreview.js --- Plugins/ThemeRepo/res/DiscordPreview.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Plugins/ThemeRepo/res/DiscordPreview.js b/Plugins/ThemeRepo/res/DiscordPreview.js index 87d98316a5..9085f44805 100644 --- a/Plugins/ThemeRepo/res/DiscordPreview.js +++ b/Plugins/ThemeRepo/res/DiscordPreview.js @@ -230,6 +230,16 @@ }; }; + window.fetch = function () { + return new Promise(_ => {}); + }; + + let XMLHttpRequestProto = XMLHttpRequest.prototype; + window.XMLHttpRequest = class {}; + for (let key of Object.keys(XMLHttpRequestProto)) try { + if (typeof XMLHttpRequestProto[key] == "function") window.XMLHttpRequest.prototype[key] = _ => {return new Promise(_ => {});}; + } catch(err) {} + let WebModulesFind = function (filter) { const id = "PluginRepo-WebModules"; const req = typeof(window.webpackJsonp) == "function" ? window.webpackJsonp([], {[id]: (module, exports, req) => exports.default = req}, [id]).default : window.webpackJsonp.push([[], {[id]: (module, exports, req) => module.exports = req}, [[id]]]);