From c08347091652e39f7055c91cda84234d9d29724b Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Thu, 5 Nov 2026 15:33:30 +0100 Subject: [PATCH] absolute referrer links --- src/.lua/util.lua | 1 + src/janusweb/media/assets/webui/xrforge.json | 1 - src/page/dir.lua | 9 ++++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/.lua/util.lua b/src/.lua/util.lua index 30335cd..ce1e41d 100644 --- a/src/.lua/util.lua +++ b/src/.lua/util.lua @@ -84,6 +84,7 @@ end util.getURL = function(url,opts) opts = opts or {} local port = '' + if url and url:match("://") then return url end if opts.server then url = url or '/' return 'http://localhost:' .. app.port .. url diff --git a/src/janusweb/media/assets/webui/xrforge.json b/src/janusweb/media/assets/webui/xrforge.json index 51f049f..e7dfbfc 100644 --- a/src/janusweb/media/assets/webui/xrforge.json +++ b/src/janusweb/media/assets/webui/xrforge.json @@ -11,7 +11,6 @@ "virtualgamepad": "./apps/virtualgamepad/virtualgamepad.json", "buttons": "./apps/buttons/buttons.json", "xrmenu": "./apps/xrmenu/xrmenu.json?v=14", - "xrfragment": "./apps/xrfragment/xrfragment.json", "xrforge": "./apps/xrforge/xrforge.json", "vfs": "./apps/vfs/vfs.json" }, diff --git a/src/page/dir.lua b/src/page/dir.lua index bd34817..f4bc856 100644 --- a/src/page/dir.lua +++ b/src/page/dir.lua @@ -56,9 +56,9 @@ return { res.parent = parent end if isroot then - referrer = app.opts.plugin_federation_parent_url + referrer = util.getURL( app.opts.plugin_federation_parent_url ) else - referrer = v.parent.parent.url + referrer = util.getURL( v.parent.parent.url ) end end end @@ -97,7 +97,10 @@ return { and not isMarkupExperience(data.item)) then -- update referrer url - data.referrer = util.baseURLify(v.view3D and (v.parent.parent and v.parent.parent.url) or v.parent.url) + data.referrer = util.getURL( + util.baseURLify(v.view3D and (v.parent.parent and v.parent.parent.url) or v.parent.url) + ) + data.item = v data.title = data.item.title data.parent = v.parent