summary refs log tree commit diff stats
path: root/index.js
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2023-01-05 15:32:18 -0300
committerSoniEx2 <endermoneymod@gmail.com>2023-01-05 15:32:18 -0300
commit68ee24fe842cf33f65b97997c9e4061235458190 (patch)
tree19762dede7a03db7f68d731123f06278c13aee26 /index.js
parent454c3337b5fcd2f98b40dac0714d303cdd9fc1f6 (diff)
Fix URL handling
Diffstat (limited to 'index.js')
-rw-r--r--index.js4
1 files changed, 3 insertions, 1 deletions
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 = "";