X-Git-Url: https://git.openstreetmap.org/nominatim-ui.git/blobdiff_plain/85f2de514d8d287b28b4cf833c1a97aeabd832a2..6393226574761cd9c63651afa39015c77c87b68b:/src/main.js?ds=sidebyside diff --git a/src/main.js b/src/main.js index a8269c6..8445501 100644 --- a/src/main.js +++ b/src/main.js @@ -25,9 +25,10 @@ document.addEventListener('click', function (e) { // loop parent nodes from the target to the delegation node for (var target = e.target; target && target !== this; target = target.parentNode) { - if (target.matches('a')) { - var target_url = target.href; + if (target.matches('a') && target.href) { + // target.href always contains the full absolute URL, inspect the raw value instead + var target_url = target.attributes.href.value; if (!is_relative_url(target_url)) return;