aboutsummaryrefslogtreecommitdiff
path: root/common/url_item.js
diff options
context:
space:
mode:
authorWojtek Kosior <wk@koszkonutek-tmp.pl.eu.org>2021-05-12 17:25:57 +0200
committerWojtek Kosior <wk@koszkonutek-tmp.pl.eu.org>2021-05-12 17:25:57 +0200
commit55fb3e4bd833f042a82657cc75e7e4c657402f9e (patch)
treec5198bfc075d680629850c7e47f45027581d8707 /common/url_item.js
parent9c246cfa2e30c2f7887472084b4ace4ab99b9819 (diff)
downloadbrowser-extension-55fb3e4bd833f042a82657cc75e7e4c657402f9e.tar.gz
browser-extension-55fb3e4bd833f042a82657cc75e7e4c657402f9e.zip
use unique hashes when smuggling whitelist setting
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;
+})();