Skip to content

Commit 01a4fb0

Browse files
authored
Bypass Firefox (iOS) bug (#20244) (#20250)
Backport #20244 * #20240 At the moment, Firefox (iOS) (10x) has an engine bug. See #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
1 parent f42fc3b commit 01a4fb0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web_src/js/bootstrap.js

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export function showGlobalErrorMessage(msg) {
2020
* @param {ErrorEvent} e
2121
*/
2222
function processWindowErrorEvent(e) {
23+
if (!e.error && e.lineno === 0 && e.colno === 0 && e.filename === '' && window.navigator.userAgent.includes('FxiOS/')) {
24+
// At the moment, Firefox (iOS) (10x) has an engine bug. See https://github.com/go-gitea/gitea/issues/20240
25+
// 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.
26+
return; // ignore such nonsense error event
27+
}
2328
showGlobalErrorMessage(`JavaScript error: ${e.message} (${e.filename} @ ${e.lineno}:${e.colno}). Open browser console to see more details.`);
2429
}
2530

0 commit comments

Comments
 (0)