diff --git a/src/utils.ts b/src/utils.ts index e7304c0..68ed31b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -108,12 +108,19 @@ class AddonUtils extends AddonModule { this.Tool.log("registerPrefPane:detected", options); const Zotero = this.Compat.getZotero(); options.id || (options.id = `plugin-${new Date().getTime()}`); + const contenrOrXHR = await Zotero.File.getContentsAsync( + options.src + ); + const content = + typeof contenrOrXHR === "string" + ? contenrOrXHR + : (contenrOrXHR as any as XMLHttpRequest).response; const src = ` - ${(await Zotero.File.getContentsAsync(options.src)) as string} + ${content} `; const frag = this.Compat.parseXHTMLToFragment( src,