From b212f645958be18f09338ea179ecfba7b5fa967a Mon Sep 17 00:00:00 2001 From: Astra Date: Sat, 28 Apr 2018 08:20:35 -0400 Subject: [PATCH] try to run console restore earlier during ep-prepare might go horribly --- shared.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared.js b/shared.js index 7ba6bc4..283bc7d 100644 --- a/shared.js +++ b/shared.js @@ -37,6 +37,10 @@ // early init payload document.addEventListener('ep-prepared', () => { + // restore the original console methods + var origConsole = wc.findCache('_originalConsoleMethods')[0].exports._originalConsoleMethods; + Object.keys(origConsole).forEach(x => global.console[x] = origConsole[x]); + // fetch the changelog fetch('https://endpwn.github.io/changelog.md?_=' + Date.now()).then(r => r.text()).then(l => { @@ -73,10 +77,6 @@ // post-init payload document.addEventListener('ep-ready', () => { - // restore the original console methods - var origConsole = wc.findCache('_originalConsoleMethods')[0].exports._originalConsoleMethods; - Object.keys(origConsole).forEach(x => global.console[x] = origConsole[x]); - // disable analytics $api.util.findFuncExports("AnalyticEventConfigs").default.track = () => { };