diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-07-05 20:27:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 13:27:13 +0100 |
commit | f5c97172f0e725b2bb2d00d281d82caf4dd72b9d (patch) | |
tree | 9b78bb225fa529423fd663241c44f7a49d2a9e89 /web_src | |
parent | 8ee823037f98d9975496bd75a7c5386823426e7f (diff) | |
download | gitea-f5c97172f0e725b2bb2d00d281d82caf4dd72b9d.tar.gz gitea-f5c97172f0e725b2bb2d00d281d82caf4dd72b9d.zip |
Bypass Firefox (iOS) bug (#20244)
* https://github.com/go-gitea/gitea/issues/20240
At the moment, Firefox (iOS) (10x) has an engine bug. See https://github.com/go-gitea/gitea/issues/20240
If a script inserts a newly created (and content changed) element into DOM, there will be a nonsense error event reporting: Script error: line 0, col 0.
This PR ignores such nonsense error event.
Fix #20240
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/bootstrap.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web_src/js/bootstrap.js b/web_src/js/bootstrap.js index cf13b2a559..213c9e41df 100644 --- a/web_src/js/bootstrap.js +++ b/web_src/js/bootstrap.js @@ -20,6 +20,11 @@ export function showGlobalErrorMessage(msg) { * @param {ErrorEvent} e */ function processWindowErrorEvent(e) { + if (!e.error && e.lineno === 0 && e.colno === 0 && e.filename === '' && window.navigator.userAgent.includes('FxiOS/')) { + // At the moment, Firefox (iOS) (10x) has an engine bug. See https://github.com/go-gitea/gitea/issues/20240 + // If a script inserts a newly created (and content changed) element into DOM, there will be a nonsense error event reporting: Script error: line 0, col 0. + return; // ignore such nonsense error event + } showGlobalErrorMessage(`JavaScript error: ${e.message} (${e.filename} @ ${e.lineno}:${e.colno}). Open browser console to see more details.`); } |