Skip to content

Commit 556ff88

Browse files
committed
Bypass Firefox (iOS) bug (go-gitea#20244)
* go-gitea#20240 At the moment, Firefox (iOS) (10x) has an engine bug. See go-gitea#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 go-gitea#20240
1 parent f42fc3b commit 556ff88

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)