File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " tauri " : patch
3+ ---
4+
5+ make sure css content injected is inside a string and not injected raw
Original file line number Diff line number Diff line change @@ -65,15 +65,15 @@ pub fn load(
6565 if asset_type == "stylesheet" {
6666 webview_ref. eval ( & format ! (
6767 r#"
68- (function () {{
68+ (function (content ) {{
6969 var css = document.createElement('style')
7070 css.type = 'text/css'
71- if (css.styleSheet)
72- css.styleSheet.cssText = {css}
73- else
74- css.appendChild(document.createTextNode({css} ))
71+ if (css.styleSheet)
72+ css.styleSheet.cssText = content
73+ else
74+ css.appendChild(document.createTextNode(content ))
7575 document.getElementsByTagName("head")[0].appendChild(css);
76- }})()
76+ }})("{css}" )
7777 "# ,
7878 css = asset_str
7979 ) ) ;
You can’t perform that action at this time.
0 commit comments