Skip to content

Move inline style to external#1065

Merged
demiankatz merged 1 commit intoUniversalViewer:devfrom
colinbowen:Fix-remove-inline-style
Sep 18, 2024
Merged

Move inline style to external#1065
demiankatz merged 1 commit intoUniversalViewer:devfrom
colinbowen:Fix-remove-inline-style

Conversation

@colinbowen
Copy link
Copy Markdown
Contributor

@colinbowen colinbowen commented Aug 7, 2024

Description of what you did:

Issue:
The Content Security Policy (CSP) prevents cross-site scripting attacks by blocking inline execution of scripts and style sheets.
To solve this, move all inline scripts (e.g. onclick=[JS code]) and styles into external files.
⚠️ Allowing inline execution comes at the risk of script injection via injection of HTML script elements. If you absolutely must, you can allow inline script and styles by:
adding unsafe-inline as a source to the CSP header
adding the hash or nonce of the inline script to your CSP header.

If possible avoiding the use of unsafe-inline is best.

  • Move inline style display: none to external css class.

@vercel
Copy link
Copy Markdown

vercel bot commented Aug 7, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
universalviewer βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Aug 7, 2024 4:28pm

@demiankatz demiankatz merged commit 261ecf9 into UniversalViewer:dev Sep 18, 2024
@demiankatz
Copy link
Copy Markdown
Contributor

Thanks, @colinbowen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants