Skip to content

Commit 2c140f5

Browse files
authored
fix: Fix the baseHref for loading lodepng correctly (#347)
1 parent 2e2bc39 commit 2c140f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/png-exporter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ class PngExporter {
8282
receiver(message);
8383
});
8484

85-
const baseHref = new URL('.', window.location.href).toString();
85+
const url = new URL(window.location.href);
86+
const baseHref = url.origin + url.pathname;
8687
this.worker.postMessage({ type: 'init', baseHref });
8788

8889
this.receiveCallback = (resolve) => {

0 commit comments

Comments
 (0)