From 28770956b4e27718aa834cf54698f63eb9132ddb Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Mon, 14 Oct 2024 11:53:00 +0200 Subject: [PATCH] better truncating of hrefs --- src/3rd/js/plugin/frontend/frontend.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/3rd/js/plugin/frontend/frontend.js b/src/3rd/js/plugin/frontend/frontend.js index f40bd1d..748940a 100644 --- a/src/3rd/js/plugin/frontend/frontend.js +++ b/src/3rd/js/plugin/frontend/frontend.js @@ -106,7 +106,9 @@ window.frontend = (opts) => new Proxy({ let topic = data.xrf ? data.xrf.string : data.mesh.userData.src - if( topic.length > 20 ) topic = topic.replace(/.*\//,'') + if( topic.match(/\.\.\//) || (topic.length > 20 && AFRAME.utils.device.isMobile() ) ){ + topic = topic.replace(/.*\//,'') + } let html = this.notify_links ? `${data.mesh.isSRC && !data.mesh.portal ? 'src' : 'href'}${ topic }
` : '' let metadata = data.mesh.userData