aboutsummaryrefslogtreecommitdiff
path: root/common/url_item.js
diff options
context:
space:
mode:
Diffstat (limited to 'common/url_item.js')
-rw-r--r--common/url_item.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/url_item.js b/common/url_item.js
new file mode 100644
index 0000000..7850871
--- /dev/null
+++ b/common/url_item.js
@@ -0,0 +1,22 @@
+/**
+* Myext stripping url from query and target
+*
+* Copyright (C) 2021 Wojtek Kosior
+*
+* Dual-licensed under:
+* - 0BSD license
+* - GPLv3 or (at your option) any later version
+*/
+
+"use strict";
+
+(() => {
+ function url_item(url)
+ {
+ let url_re = /^([^?#]*).*$/;
+ let match = url_re.exec(url);
+ return match[1];
+ }
+
+ window.url_item = url_item;
+})();