aboutsummaryrefslogtreecommitdiff
path: root/background/url_item.js
blob: 78508710a6da80e0883f599143b8710b9fada824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
})();