mirror of
https://github.com/google/blockly.git
synced 2025-12-15 13:50:08 +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:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user