chore: Setting style property to make CSP less grumpy. (#7503)

* Setting style property to make CSP less grumpy.

"Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“style-src”)."

The 'style' property should be set as an object, not as a string, according to CSP rules.

Back-ported from Blockly Games.
This commit is contained in:
Neil Fraser
2023-09-19 17:01:14 +02:00
committed by GitHub
parent 32c9daf885
commit 61cdbb65d3
7 changed files with 13 additions and 11 deletions

View File

@@ -84,7 +84,7 @@ function workspaceToSvg_(workspace, callback, customCss) {
);
svg.setAttribute('width', width);
svg.setAttribute('height', height);
svg.setAttribute('style', 'background-color: transparent');
svg.style.backgroundColor = 'transparent';
const css = [].slice
.call(document.head.querySelectorAll('style'))