From 68ee24fe842cf33f65b97997c9e4061235458190 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Thu, 5 Jan 2023 15:32:18 -0300 Subject: Fix URL handling --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index bab2c5e..cce07fa 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,9 @@ var url = new URL(document.location.href); var target = url.searchParams.get("url"); if (target !== null) { - var project = target.match(/^web\+ganarchy\:([a-fA-F0-9]+)$/); + // accepts both web+ganarchy:fae and + // web+ganarchy://example.org/fae + var project = target.match(/^web\+ganarchy\:(?:\/\/[^\\/?#]+[\\/])([a-fA-F0-9]+)$/); if (project !== null) { // some browsers don't like it when you set this directly url.search = ""; -- cgit 1.4.1