Skip to content

Fix/css injection csp#1169

Merged
tw93 merged 2 commits intotw93:mainfrom
enihsyou:fix/css-injection-csp
Apr 5, 2026
Merged

Fix/css injection csp#1169
tw93 merged 2 commits intotw93:mainfrom
enihsyou:fix/css-injection-csp

Conversation

@enihsyou
Copy link
Copy Markdown
Contributor

@enihsyou enihsyou commented Apr 3, 2026

I noticed that the --inject style.css command is ineffective within the Gemini app. The browser console indicates that assigning a string to node.innerHTML violates the Content Security Policy (CSP), specifically triggering the following error:
"This document requires 'TrustedHTML' assignment."

To resolve this and adhere to security best practices, by utilizing node.textContent instead of innerHTML, the CSS is injected safely without triggering Trusted Types violations.

Due to lack of equipments, verified on Windows only.

enihsyou added 2 commits April 3, 2026 20:42
Set node.innerHTML will trigger a `This document requires 'TrustedHTML' assignment` error in chrome, because of CSP protection

Signed-off-by: 九条涼果 <enihsyou@gmail.com>
Signed-off-by: 九条涼果 <enihsyou@gmail.com>
@tw93 tw93 merged commit 6350a18 into tw93:main Apr 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants