We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2fbc2f8 commit 2647bfbCopy full SHA for 2647bfb
src/runtime/internal/utils.ts
@@ -40,8 +40,16 @@ export function safe_not_equal(a, b) {
40
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
41
}
42
43
-export function src_url_equal(a, b) {
44
- return new URL(a, window.location.origin).href === (new URL(b, window.location.origin)).href;
+const relative_to_absolute = (function() {
+ const anchor = document.createElement('a');
45
+ return function(url) {
46
+ anchor.href = url;
47
+ return anchor.href;
48
+ };
49
+})();
50
+
51
+export function src_url_equal(element_src, url) {
52
+ return element_src === relative_to_absolute(url);
53
54
55
export function not_equal(a, b) {
0 commit comments