Skip to content
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

Closed
fyrfli opened this issue Jul 5, 2022 · 6 comments · Fixed by #20244
Closed

Javascript error on mobile Firefox (iOS) #20240

fyrfli opened this issue Jul 5, 2022 · 6 comments · Fixed by #20244
Assignees
Labels
topic/ui Change the appearance of the Gitea UI type/bug

Comments

@fyrfli
Copy link

fyrfli commented Jul 5, 2022

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)

@fyrfli fyrfli added type/bug topic/ui Change the appearance of the Gitea UI labels Jul 5, 2022
@wxiaoguang wxiaoguang self-assigned this Jul 5, 2022
@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2022

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

@fyrfli
Copy link
Author

fyrfli commented 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.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented 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
Copy link
Contributor

The PR to bypass it:

zeripath pushed a commit that referenced this issue Jul 5, 2022
* #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
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Jul 5, 2022
* 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
@wxiaoguang
Copy link
Contributor

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

I did a quick test, it seems fine now.

@fyrfli
Copy link
Author

fyrfli commented Jul 5, 2022

Yep; all good here.

zeripath pushed a commit that referenced this issue Jul 5, 2022
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
dineshsalunke pushed a commit to dineshsalunke/gitea that referenced this issue Jul 9, 2022
* 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
vsysoev pushed a commit to IntegraSDL/gitea that referenced this issue Aug 10, 2022
* 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 go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants