-
Notifications
You must be signed in to change notification settings - Fork 0
/
.finicky.js
40 lines (38 loc) · 1.15 KB
/
.finicky.js
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
// Use https://finicky-kickstart.now.sh to generate basic configuration
// Learn more about configuration options: https://github.com/johnste/finicky/wiki/Configuration
module.exports = {
defaultBrowser: "Safari",
options: {
logRequests: true,
},
handlers: [
{
match: ({ url }) => url.host.endsWith("hashicorp.slack.com"),
browser: "Slack",
url: ({ urlString }) => {
let re = /https:\/\/hashicorp\.slack\.com\/archives\/([A-Z0-9]+)\/p([0-9]{10})([0-9]{6})\?thread_ts=([0-9\.]+).*/
let matches = re.exec(urlString)
if (matches != null && matches.length == 5 ) {
let id, m1, m2, ts
[ _, id, m1, m2, ts ] = matches
return `slack://channel?team=T024UT03C&id=${id}&message=${m1}.${m2}&thread_ts=${ts}`
}
re = /https:\/\/hashicorp\.slack\.com\/archives\/([A-Z0-9]+)/
matches = re.exec(urlString)
if (matches != null && matches.length == 2) {
let channelId = matches[1]
return `slack://channel?team=T024UT03C&id=${channelId}`
}
return urlString
}
},
//{
// match: [
// "zoom.us*",
// finicky.matchDomains(/.*\zoom.us/),
// /zoom.us\/j\//,
// ],
// browser: "us.zoom.xos"
//},
],
}