From 558221e2711417c2a2f014e00cb10c3a7820d7c6 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Wed, 17 Feb 2021 13:13:48 +0100 Subject: [PATCH] stuff --- Library/0BDFDB.plugin.js | 2 +- Plugins/_res/DiscordPreview.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index 7f647f8c43..7d6005fdd0 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -3534,7 +3534,7 @@ module.exports = (_ => { container = container || document.head.querySelector("bd-head bd-styles") || document.head; container = Node.prototype.isPrototypeOf(container) ? container : document.head; BDFDB.DOMUtils.removeWebStyle(url, container); - container.appendChild(BDFDB.DOMUtils.create(``)); + container.appendChild(BDFDB.DOMUtils.create(``)); }; BDFDB.DOMUtils.removeWebStyle = function (url, container) { if (typeof url != "string") return; diff --git a/Plugins/_res/DiscordPreview.js b/Plugins/_res/DiscordPreview.js index cec312879d..a73a80a799 100644 --- a/Plugins/_res/DiscordPreview.js +++ b/Plugins/_res/DiscordPreview.js @@ -4,6 +4,7 @@ window.global = window; let nativeRequire = window.require || (_ => {}); + let nativeWebpackJsonp = window.webpackJsonp; window.respondToParent = function (data = {}) { if (window.parent && typeof window.parent.postMessage == "function") window.parent.postMessage(data, "*"); @@ -227,13 +228,11 @@ return string; }; - window.webpackJsonp = function () { - return { - default: { - m: {}, - c: {} - } - }; + window.webpackJsonp = { + push: _ => ({ + m: {}, + c: {} + }) }; window.fetch = function () { @@ -248,7 +247,7 @@ 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]]]); + const req = nativeWebpackJsonp.push([[], {[id]: (module, exports, req) => module.exports = req}, [[id]]]); delete req.m[id]; delete req.c[id]; for (let m in req.c) {