From b2b8bfd03be62e71651cc12ae1dfed6627b0c065 Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Thu, 8 May 2025 17:21:21 +0200 Subject: [PATCH] bugfix: separate query vs hash URI overrides --- src/3rd/js/aframe/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/3rd/js/aframe/index.js b/src/3rd/js/aframe/index.js index c6770e4..8332af1 100644 --- a/src/3rd/js/aframe/index.js +++ b/src/3rd/js/aframe/index.js @@ -21,8 +21,11 @@ window.AFRAME.registerComponent('xrf', { let searchIsUri = document.location.search && !document.location.search.match(/=/) && document.location.search.match("/") - if( searchIsUri || document.location.hash.length > 1 ){ // override url - this.data = `${document.location.search.substr(1)}${document.location.hash}` + if( searchIsUri ){ // override url + this.data = `${document.location.search.substr(1)}` + } + if( document.location.hash.length > 1 ){ + this.data = this.data.replace(/#.*/,'') + document.location.hash } }