-
Notifications
You must be signed in to change notification settings - Fork 1
/
background.js
28 lines (25 loc) · 954 Bytes
/
background.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
chrome.runtime.onMessage.addListener(
function (request, sender, sendResponse) {
switch(request?.notification) {
case "RMA_CAPTCHA_ACTIVE":
chrome.notifications.create('RMA_CAPTCHA_ACTIVE', {
type: 'basic',
iconUrl: 'img/notification.png',
title: 'RPG MO Captcha',
message: 'You need to answer the captcha !',
priority: 2,
});
chrome.windows.getCurrent(function (w) {
w.focus();
chrome.tabs.getSelected(w.id,
function (response) {
alert(response.url);
});
});
window.focus();
}
if (request?.download) {
// todo download file with request.download.content and request.download.filename
}
}
);