diff --git a/noname/util/struct/promise-error-handler/chrome.js b/noname/util/struct/promise-error-handler/chrome.js index 028ccfe47..555720d03 100644 --- a/noname/util/struct/promise-error-handler/chrome.js +++ b/noname/util/struct/promise-error-handler/chrome.js @@ -81,6 +81,7 @@ export class ChromePromiseErrorHandler { event.promise.catch((error) => { // 如果`error`是个错误,则继续处理 if (error instanceof Error) { + if (/Failed to fetch/.test(error.message) || /Failed to load because no supported source was found/.test(error.message)) return; // 如果已经处理过该错误,则不再处理 if (this.#errorList.includes(error)) return; this.#errorList.push(error); diff --git a/noname/util/struct/promise-error-handler/firefox.js b/noname/util/struct/promise-error-handler/firefox.js index 56b3f9d14..ae04e22ec 100644 --- a/noname/util/struct/promise-error-handler/firefox.js +++ b/noname/util/struct/promise-error-handler/firefox.js @@ -18,6 +18,8 @@ export class FirefoxPromiseErrorHandler { onHandle(event) { event.promise.catch((error) => { if (typeof error === "object" && error instanceof Error) { + if (/Failed to fetch/.test(error.message) || /The media resource indicated by the src attribute or assigned media provider object was not suitable/.test(error.message)) return; + // Firefox在大环境下默认情况必须要那么多ts-ignore // @ts-ignore window.onerror( diff --git a/noname/util/struct/promise-error-handler/unknown.js b/noname/util/struct/promise-error-handler/unknown.js index 74ac2728f..fac47dfab 100644 --- a/noname/util/struct/promise-error-handler/unknown.js +++ b/noname/util/struct/promise-error-handler/unknown.js @@ -20,6 +20,7 @@ export class UnknownPromiseErrorHandler { onHandle(event) { event.promise.catch((error) => { if (typeof error === "object" && error instanceof Error) { + if (/Failed to fetch/.test(error.message)) return; // 很遗憾,因浏览器问题,你只能看到这一段 throw error; }