aboutsummaryrefslogtreecommitdiff
path: root/common/url_item.js
blob: 9f4b118164bf64d6ad7a11080be263b3ee7cae10 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * Myext stripping url from query and target
 *
 * Copyright (C) 2021 Wojtek Kosior
 * Redistribution terms are gathered in the `copyright' file.
 */

"use strict";

(() => {
    function url_item(url)
    {
	let url_re = /^([^?#]*).*$/;
	let match = url_re.exec(url);
	return match[1];
    }

    window.url_item = url_item;
})();