-
Notifications
You must be signed in to change notification settings - Fork 3
/
options.html
56 lines (55 loc) · 2 KB
/
options.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Reuse Tab Options</title>
<script src="matcher.mjs" type="module"></script>
<style>
textarea, input {
width: 100%
}
</style>
</head>
<body>
<h1>Blacklist</h1>
<form id="blacklist_form">
<input id="blacklist_text"
placeholder="Blacklist an URL to require exact match for its tab to be closed or reused."
required
type="text">
<p>
<button id="blacklist_button" disabled type="button">Blacklist</button>
</p>
</form>
<h2>Multidomain</h2>
<form id="multidomain_form">
<textarea
placeholder="Enter two or more URLs to treat as the same site. One URL per line. Then hit "Apply"."
required
rows="3"></textarea>
<p>
<button accesskey="a" disabled type="button">Apply</button>
</p>
</form>
<form id="patterns_form">
<h1>Matching Patterns</h1>
<textarea id="regular_expressions_text" placeholder="Enter patterns" rows="20"></textarea>
<p>
<button accesskey="d" id="default" type="button">Default</button>
<button accesskey="r" id="restore" type="button">Load</button>
<button accesskey="s" id="save" type="button">Save</button>
</p>
</form>
<script src="options.js" type="module"></script>
<h2>Technical information</h2>
<p>
Each line of configuration above is a regular expression. Tab is reused if a regular expression matches both target
and source URLs and all capture groups of both matches are equal.
Tab is not reused, if only one of target or source URLs are matching an expression.
In examples above, blacklisting is achieved by introducing a capture group with value, that would be different for
different pages of the same site; multidomain expression, ignores a segment of URl during matching by using
non-capturing group, which is not used during comparison.
First matching expression terminates further search.
</p>
</body>
</html>