Fix occasional freezing on firefox (cache related)
This commit is contained in:
parent
d8cd557fb2
commit
a2a33ca62d
@ -28,6 +28,11 @@ let webpackChunk: any[];
|
|||||||
|
|
||||||
const logger = new Logger("WebpackInterceptor", "#8caaee");
|
const logger = new Logger("WebpackInterceptor", "#8caaee");
|
||||||
|
|
||||||
|
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, {
|
Object.defineProperty(window, WEBPACK_CHUNK, {
|
||||||
get: () => webpackChunk,
|
get: () => webpackChunk,
|
||||||
set: v => {
|
set: v => {
|
||||||
@ -43,6 +48,7 @@ Object.defineProperty(window, WEBPACK_CHUNK, {
|
|||||||
},
|
},
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function patchPush() {
|
function patchPush() {
|
||||||
function handlePush(chunk: any) {
|
function handlePush(chunk: any) {
|
||||||
|
Loading…
Reference in New Issue
Block a user