Cleanup compliments module (#2965)

Lots of small fixes and cleanups:
- only render something when there is a compliment
- cleanup naming
- use es6 notations
- use fetch instead of XMLHttpRequest in compliments

Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
This commit is contained in:
Veeck
2022-12-10 21:23:00 +01:00
committed by GitHub
parent eee289aee8
commit a2624442cc
3 changed files with 37 additions and 43 deletions

View File

@@ -35,6 +35,7 @@ exports.getDocument = () => {
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.fetch = corefetch;
dom.window.onload = () => {
global.document = dom.window.document;
resolve();