What is the correct way to configure CSP in Tauri when using CSS-in-JS libraries? #8578
-
In the release build, Tauri does not render anything. After a bit of Googling, I found the same issue, but I am still confused about the right CSP configuration to set when using CSS-in-JS libraries like styled-components. Right now, this is my CSP: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Okay, I finally ended up with this configuration in the tauri.conf.json file. Is this the right way to do it? I don't know. I'm leaving my comment here so people who come here may find this useful. "security": {
"dangerousDisableAssetCspModification": ["style-src"],
"csp": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' asset:"
} EDIT:
I guess "unsafe-inline" is okay. |
Beta Was this translation helpful? Give feedback.
Okay, I finally ended up with this configuration in the tauri.conf.json file. Is this the right way to do it? I don't know. I'm leaving my comment here so people who come here may find this useful.
EDIT:
I guess "unsafe-inline" is okay.