-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Javascript error on mobile Firefox (iOS) #20240
Comments
Are you able to open the browser console to see more details? |
I haven't found a way to do that on the mobile browser yet and it doesn't happen on desktop. I'm assuming it's an issue with that particular browser version since it only happens in Firefox. It also doesn't seem to interfere with functionality but I can't be sure so I decided to open an issue ... if for no other reason than bringing awareness of it. |
That's a Firefox bug. You can reproduce it with the following code. Gitea could try to bypass it with some hacky check.
<!DOCTYPE html>
<html>
<head>
<script>
window.addEventListener('error', function(e) {alert('error');});
</script>
</head>
<body>
<div class="page-content">
</div>
<script>
const pageContent = document.querySelector('.page-content');
const el = document.createElement('div');
el.textContent = 'dummy'; // required
pageContent.append(el); // BUG, triggers the error event
// setTimeout(()=>{pageContent.append(el);}, 0); // BUG, triggers the error event
// setTimeout(()=>{pageContent.append(el);}, 500); // no bug .....
</script>
</body>
</html> |
The PR to bypass it: |
* 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
The fix has been deployed to try.gitea.io. I did a quick test, it seems fine now. |
Yep; all good here. |
* 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
* 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
Description
When browsing on Firefox iOS, I get the following error:
JavaScript error: Script error. ( @ 0:0). Open browser console to see more details.
I can reproduce it on the demo site.
Does not occur when browsing with Safari on iOS or DuckDuckGo browser on iOS. And does not occur on desktop.
Screenshots
Gitea Version
1.17.0+rc1 (docker version)
Can you reproduce the bug on the Gitea demo site?
Yes
Operating System
iOS
Browser Version
Firefox Daylight 101.1 (10346)
The text was updated successfully, but these errors were encountered: