Fix occasional freezing on firefox (cache related)

main
V 1 year ago
parent d8cd557fb2
commit a2a33ca62d
No known key found for this signature in database
GPG Key ID: A1DC0CFB5615D905

@ -28,21 +28,27 @@ let webpackChunk: any[];
const logger = new Logger("WebpackInterceptor", "#8caaee");
Object.defineProperty(window, WEBPACK_CHUNK, {
get: () => webpackChunk,
set: v => {
if (v?.push !== Array.prototype.push) {
logger.info(`Patching ${WEBPACK_CHUNK}.push`);
_initWebpack(v);
patchPush();
// @ts-ignore
delete window[WEBPACK_CHUNK];
window[WEBPACK_CHUNK] = v;
}
webpackChunk = v;
},
configurable: true
});
if (window[WEBPACK_CHUNK]) {
logger.info(`Patching ${WEBPACK_CHUNK}.push (was already existant, likely from cache!)`);
_initWebpack(window[WEBPACK_CHUNK]);
patchPush();
} else {
Object.defineProperty(window, WEBPACK_CHUNK, {
get: () => webpackChunk,
set: v => {
if (v?.push !== Array.prototype.push) {
logger.info(`Patching ${WEBPACK_CHUNK}.push`);
_initWebpack(v);
patchPush();
// @ts-ignore
delete window[WEBPACK_CHUNK];
window[WEBPACK_CHUNK] = v;
}
webpackChunk = v;
},
configurable: true
});
}
function patchPush() {
function handlePush(chunk: any) {

Loading…
Cancel
Save