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

@@ -45,7 +45,7 @@ WorkspaceFactoryGenerator.prototype.generateToolboxXml = function() {
// Create DOM for XML.
var xmlDom = Blockly.utils.xml.createElement('xml');
xmlDom.id = 'toolbox';
xmlDom.setAttribute('style', 'display: none');
xmlDom.style.display = 'none';
if (!this.model.hasElements()) {
// Toolbox has no categories. Use XML directly from workspace.
@@ -111,7 +111,7 @@ WorkspaceFactoryGenerator.prototype.generateWorkspaceXml = function() {
// Generate XML and set attributes.
var xmlDom = Blockly.Xml.workspaceToDom(this.hiddenWorkspace);
xmlDom.id = 'workspaceBlocks';
xmlDom.setAttribute('style', 'display: none');
xmlDom.style.display = 'none';
return xmlDom;
};