1
0
Эх сурвалжийг харах

fixed issue when calling URL() with undefined as 2nd param (safari)

Former-commit-id: fe8f38a16920d4e6b691d0886643bbe033e2a0d9
Gildas 6 жил өмнө
parent
commit
e404f91cb8

+ 5 - 1
lib/single-file/single-file-util.js

@@ -56,7 +56,11 @@ this.singlefile.lib.util = this.singlefile.lib.util || (() => {
 			return {
 				getContent,
 				parseURL(resourceURL, baseURI) {
-					return new URL(resourceURL, baseURI);
+					if (baseURI === undefined) {
+						return new URL(resourceURL);
+					} else {
+						return new URL(resourceURL, baseURI);
+					}
 				},
 				resolveURL(resourceURL, baseURI) {
 					return this.parseURL(resourceURL, baseURI).href;