forked from elitepc/chrome-addon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
contextMenus.js
60 lines (57 loc) · 1.59 KB
/
contextMenus.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { teamlyzerUrl } from '../../../config';
const URL_PATTERNS = [
`${teamlyzerUrl}/*`,
'https://www.itjobs.pt/*',
'https://www.linkedin.com/*',
'https://landing.jobs/*',
];
const CONTEXT_MENU_ID = 'TL_context';
const CREATE_REVIEW_MENU_ID = 'TL_create_menu';
function openUrl(url) {
chrome.tabs.create({ url: `${teamlyzerUrl}${url}` });
}
chrome.contextMenus.create({
id: CONTEXT_MENU_ID,
title: 'Teamlyzer',
contexts: ['all'],
documentUrlPatterns: URL_PATTERNS,
});
chrome.contextMenus.create({
parentId: CONTEXT_MENU_ID,
id: CREATE_REVIEW_MENU_ID,
title: 'Criar nova review',
contexts: ['all'],
documentUrlPatterns: URL_PATTERNS,
});
chrome.contextMenus.create({
parentId: CREATE_REVIEW_MENU_ID,
id: 'tl_review_job',
title: 'Criar review de emprego',
contexts: ['all'],
documentUrlPatterns: URL_PATTERNS,
onclick: () => openUrl('/users/job-review/step1'),
});
chrome.contextMenus.create({
parentId: CREATE_REVIEW_MENU_ID,
id: 'tl_review_interview',
title: 'Criar review de entrevista',
contexts: ['all'],
documentUrlPatterns: URL_PATTERNS,
onclick: () => openUrl('/users/interview-review/step1'),
});
chrome.contextMenus.create({
parentId: CREATE_REVIEW_MENU_ID,
id: 'tl_review_salary',
title: 'Criar review de salário',
contexts: ['all'],
documentUrlPatterns: URL_PATTERNS,
onclick: () => openUrl('/users/salary-review'),
});
chrome.contextMenus.create({
parentId: CONTEXT_MENU_ID,
id: 'tl_create_company',
title: 'Criar nova empresa',
contexts: ['all'],
documentUrlPatterns: URL_PATTERNS,
onclick: () => openUrl('/companies/new-company'),
});