aboutsummaryrefslogtreecommitdiff
path: root/background/url_item.js
diff options
context:
space:
mode:
authorWojtek Kosior <wk@koszkonutek-tmp.pl.eu.org>2021-05-12 16:00:09 +0200
committerWojtek Kosior <wk@koszkonutek-tmp.pl.eu.org>2021-05-12 16:00:09 +0200
commit7f368d46ea06164da025c1ac4ed9a65ad23b25ef (patch)
treee5b740ebcb3cdc58e9c87f25556c20d8bfdccadd /background/url_item.js
parent89db6823fae5099816732c3cd2ba39700c1c4607 (diff)
downloadbrowser-extension-7f368d46ea06164da025c1ac4ed9a65ad23b25ef.tar.gz
browser-extension-7f368d46ea06164da025c1ac4ed9a65ad23b25ef.zip
stop using js modules
Diffstat (limited to 'background/url_item.js')
-rw-r--r--background/url_item.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/background/url_item.js b/background/url_item.js
new file mode 100644
index 0000000..7850871
--- /dev/null
+++ b/background/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;
+})();