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

Show in browser JavaScript error: Uncaught EvalError: #21952

Closed
JulyLies opened this issue Nov 27, 2022 · 1 comment
Closed

Show in browser JavaScript error: Uncaught EvalError: #21952

JulyLies opened this issue Nov 27, 2022 · 1 comment
Labels
topic/ui Change the appearance of the Gitea UI type/bug

Comments

@JulyLies
Copy link

Description

Show in browser is JavaScript error: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self' http: https: data: blob: 'unsafe-inline'".
(https://git.huangdf.xyz/assets/js/index.js?v=1.18.0~rc1 @ 12:47048). Open browser console to see more details.

Screenshots

jsError

Gitea Version

1.18.0+rc1

Can you reproduce the bug on the Gitea demo site?

No

Operating System

win11

Browser Version

Microsoft Edge(107.0.1418.56) Google Chrome( 107.0.5304.107)

@JulyLies JulyLies added type/bug topic/ui Change the appearance of the Gitea UI labels Nov 27, 2022
@silverwind
Copy link
Member

You are serving Gitea through an proxy that adds a incompatible CSP header to responses.

CSP compatibility is a goal, but I don't expect it to be fully fixed anytime soon. See

#19851
#305

lafriks pushed a commit that referenced this issue Mar 11, 2023
Follow: 
* #23345

The branch/tag selector dropdown mixes jQuery/Fomantic UI/Vue together,
it's very diffcult to maintain and causes unfixable a11y problems. It
also causes problems like #19851 #21314 #21952

This PR is the first step for the refactoring, move `data-` attributes
to JS object and use Vue data as much as possible.

The old selector `'.choose.reference .dropdown'` was also wrong, it hits
`<div class="choose reference"><svg class="dropdown icon">` and would
cause undefined behaviors.

I have done some quick tests and it works. After this PR gets merged, I
will move the code into a Vue SFC in next PR.



![image](https://user-images.githubusercontent.com/2114189/224099638-378a8a86-0865-47d1-bcba-f972506374c7.png)


![image](https://user-images.githubusercontent.com/2114189/224099690-70276cf5-b1e4-404a-b0c6-582448abf40e.png)

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@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

No branches or pull requests

2 participants