mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
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:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user