change weather_spec

This commit is contained in:
Karsten Hassel
2022-01-13 22:33:57 +01:00
parent 2cfafe7bfe
commit c1be0180f9
2 changed files with 31 additions and 32 deletions

View File

@@ -22,16 +22,14 @@ exports.stopApplication = function () {
}
};
exports.getDocument = function (callback, ms) {
exports.getDocument = function (callback) {
const url = "http://" + (config.address || "localhost") + ":" + (config.port || "8080");
jsdom.JSDOM.fromURL(url, { resources: "usable", runScripts: "dangerously" }).then((dom) => {
dom.window.name = "jsdom";
dom.window.onload = function () {
global.MutationObserver = dom.window.MutationObserver;
global.document = dom.window.document;
setTimeout(() => {
callback();
}, ms);
callback();
};
});
};