Javascript error on mobile Firefox (iOS) #9180

Closed
opened 2025-11-02 08:31:38 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @fyrfli on GitHub (Jul 5, 2022).

Originally assigned to: @wxiaoguang on GitHub.

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

9895B54E-F0BB-457C-8CD8-88AB4E65A9E2
3010AB31-D6D6-4C6C-95B1-0405AFA9D9E3

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)

Originally created by @fyrfli on GitHub (Jul 5, 2022). Originally assigned to: @wxiaoguang on GitHub. ### 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 ![9895B54E-F0BB-457C-8CD8-88AB4E65A9E2](https://user-images.githubusercontent.com/5287261/177255377-11452e6b-a200-4f21-9456-a5b2a5cc8648.jpeg) ![3010AB31-D6D6-4C6C-95B1-0405AFA9D9E3](https://user-images.githubusercontent.com/5287261/177255383-e1000f56-19d8-4d27-ba6f-3e2c49cdc072.jpeg) ### 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)
GiteaMirror added the topic/uitype/bug labels 2025-11-02 08:31:38 -06:00
Author
Owner

@zeripath commented on GitHub (Jul 5, 2022):

Are you able to open the browser console to see more details?

@zeripath commented on GitHub (Jul 5, 2022): Are you able to open the browser console to see more details?
Author
Owner

@fyrfli commented on GitHub (Jul 5, 2022):

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.

@fyrfli commented on GitHub (Jul 5, 2022): 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.
Author
Owner

@wxiaoguang commented on GitHub (Jul 5, 2022):

That's a Firefox bug. You can reproduce it with the following code. Gitea could try to bypass it with some hacky check.

https://github.com/mozilla-mobile/firefox-ios/issues/11191

<!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>
@wxiaoguang commented on GitHub (Jul 5, 2022): That's a Firefox bug. You can reproduce it with the following code. Gitea could try to bypass it with some hacky check. `https://github.com/mozilla-mobile/firefox-ios/issues/11191` ```html <!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> ```
Author
Owner

@wxiaoguang commented on GitHub (Jul 5, 2022):

The PR to bypass it:

@wxiaoguang commented on GitHub (Jul 5, 2022): The PR to bypass it: * https://github.com/go-gitea/gitea/pull/20244
Author
Owner

@wxiaoguang commented on GitHub (Jul 5, 2022):

The fix has been deployed to try.gitea.io.

I did a quick test, it seems fine now.

@wxiaoguang commented on GitHub (Jul 5, 2022): The fix has been deployed to try.gitea.io. I did a quick test, it seems fine now.
Author
Owner

@fyrfli commented on GitHub (Jul 5, 2022):

Yep; all good here.

@fyrfli commented on GitHub (Jul 5, 2022): Yep; all good here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9180