Stay organized with collections
Save and categorize content based on your preferences.
blockly > utils > xml > injectDependencies
utils.xml.injectDependencies() function
Inject implementations of document, DOMParser and/or XMLSerializer to use instead of the default ones.
Used by the Node.js wrapper for Blockly (see scripts/package/node/core.js) to supply implementations from the jsdom package instead.
While they may be set individually, it is normally the case that all three will be sourced from the same JSDOM instance. They MUST at least come from the same copy of the jsdom package. (Typically this is hard to avoid satsifying this requirement, but it can be inadvertently violated by using webpack to build multiple bundles containing Blockly and jsdom, and then loading more than one into the same JavaScript runtime. See https://github.com/google/blockly-samples/pull/1452#issuecomment-1364442135 for an example of how this happened.)
Signature:
export declare function injectDependencies(dependencies: {
document?: Document;
DOMParser?: typeof DOMParser;
XMLSerializer?: typeof XMLSerializer;
}): void;
Parameters
Parameter |
Type |
Description |
dependencies |
{ document?: Document; DOMParser?: typeof DOMParser; XMLSerializer?: typeof XMLSerializer; } |
Options object containing dependencies to set. |
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-09-18 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."]]