try to run console restore earlier

during ep-prepare
might go horribly
This commit is contained in:
Astra 2018-04-28 08:20:35 -04:00
parent 97fffd9fef
commit b212f64595

View file

@ -37,6 +37,10 @@
// early init payload // early init payload
document.addEventListener('ep-prepared', () => { 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 the changelog
fetch('https://endpwn.github.io/changelog.md?_=' + Date.now()).then(r => r.text()).then(l => { fetch('https://endpwn.github.io/changelog.md?_=' + Date.now()).then(r => r.text()).then(l => {
@ -73,10 +77,6 @@
// post-init payload // post-init payload
document.addEventListener('ep-ready', () => { 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 // disable analytics
$api.util.findFuncExports("AnalyticEventConfigs").default.track = () => { }; $api.util.findFuncExports("AnalyticEventConfigs").default.track = () => { };