fix error spam in non app discord websites
This commit is contained in:
parent
b22d4622ed
commit
9871e16e28
|
@ -97,7 +97,7 @@ export default definePlugin({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const assetPath = stack.match(/\/assets\/.+?\.js/)?.[0];
|
const assetPath = stack.match(/http.+?\.js/)?.[0];
|
||||||
if (!assetPath) {
|
if (!assetPath) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ define(Function.prototype, "m", {
|
||||||
define(this, "e", { value: ensureChunk });
|
define(this, "e", { value: ensureChunk });
|
||||||
clearTimeout(setterTimeout);
|
clearTimeout(setterTimeout);
|
||||||
|
|
||||||
logger.info("Main Webpack found" + interpolateIfDefined` in ${fileName}` + ", initializing internal references to WebpackRequire");
|
logger.info("Main WebpackInstance found" + interpolateIfDefined` in ${fileName}` + ", initializing internal references to WebpackRequire");
|
||||||
_initWebpack(this);
|
_initWebpack(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -280,7 +280,7 @@ function wrapAndPatchFactory(id: PropertyKey, originalFactory: AnyModuleFactory)
|
||||||
|
|
||||||
// There are (at the time of writing) 11 modules exporting the window
|
// There are (at the time of writing) 11 modules exporting the window
|
||||||
// Make these non enumerable to improve webpack search performance
|
// Make these non enumerable to improve webpack search performance
|
||||||
if (typeof require === "function" && require.c != null) {
|
if (typeof require === "function") {
|
||||||
let foundWindow = false;
|
let foundWindow = false;
|
||||||
|
|
||||||
if (exports === window) {
|
if (exports === window) {
|
||||||
|
@ -298,12 +298,14 @@ function wrapAndPatchFactory(id: PropertyKey, originalFactory: AnyModuleFactory)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foundWindow) {
|
if (foundWindow) {
|
||||||
|
if (require.c != null) {
|
||||||
Object.defineProperty(require.c, id, {
|
Object.defineProperty(require.c, id, {
|
||||||
value: require.c[id],
|
value: require.c[id],
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
writable: true
|
writable: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return factoryReturn;
|
return factoryReturn;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue