-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
27 lines (20 loc) · 840 Bytes
/
background.js
File metadata and controls
27 lines (20 loc) · 840 Bytes
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
// Change the periodInMinutes property to set time interval
var forumUrl = 'https://definetely-not-reddit.netlify.app/';
var alarm = chrome.alarms.create("myAlarm", { delayInMinutes: 0.05, periodInMinutes: 1 });
chrome.alarms.onAlarm.addListener(function (alarm) {
// Clear any notification with the same name
chrome.notifications.clear('procrastinya-notification')
var notification = chrome.notifications.create(
'procrastinya-notification', {
type: 'basic',
iconUrl: "images/gmail.png", // Notification image
// Notification title and message
title: 'Gmiaol!',
message: 'New Emiaol from DefinitelyNotReddit...'
},
function () { }
);
});
chrome.notifications.onClicked.addListener(function (notificationId) {
chrome.tabs.create({ url: forumUrl });
});