diff options
author | Wojtek Kosior <wk@koszkonutek-tmp.pl.eu.org> | 2021-05-12 17:25:57 +0200 |
---|---|---|
committer | Wojtek Kosior <wk@koszkonutek-tmp.pl.eu.org> | 2021-05-12 17:25:57 +0200 |
commit | 55fb3e4bd833f042a82657cc75e7e4c657402f9e (patch) | |
tree | c5198bfc075d680629850c7e47f45027581d8707 /common/url_item.js | |
parent | 9c246cfa2e30c2f7887472084b4ace4ab99b9819 (diff) | |
download | browser-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.js | 22 |
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; +})(); |