Added option to disable notification

This commit is contained in:
Ajay Ramachandran
2020-06-07 11:27:35 -04:00
parent 3f98e2fc73
commit 93316bf463
3 changed files with 16 additions and 6 deletions

View File

@@ -623,5 +623,11 @@
}, },
"categoryUpdate2": { "categoryUpdate2": {
"message": "Open the options to skip intros, outros, merch, etc." "message": "Open the options to skip intros, outros, merch, etc."
},
"unsubmittedWarning": {
"message": "Unsubmitted Segments Notification"
},
"unsubmittedWarningDescription": {
"message": "Send a notification when you leave a video with segments that are not uploaded"
} }
} }

View File

@@ -62,12 +62,14 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
//this allows the callback to be called later //this allows the callback to be called later
return true; return true;
case "alertPrevious": case "alertPrevious":
if (Config.config.unsubmittedWarning) {
chrome.notifications.create("stillThere" + Math.random(), { chrome.notifications.create("stillThere" + Math.random(), {
type: "basic", type: "basic",
title: chrome.i18n.getMessage("wantToSubmit") + " " + request.previousVideoID + "?", title: chrome.i18n.getMessage("wantToSubmit") + " " + request.previousVideoID + "?",
message: chrome.i18n.getMessage("leftTimes"), message: chrome.i18n.getMessage("leftTimes"),
iconUrl: "./icons/LogoSponsorBlocker256px.png" iconUrl: "./icons/LogoSponsorBlocker256px.png"
}); });
}
case "registerContentScript": case "registerContentScript":
registerFirefoxContentScript(request); registerFirefoxContentScript(request);
return false; return false;

View File

@@ -15,6 +15,7 @@ interface SBConfig {
skipCount: number, skipCount: number,
sponsorTimesContributed: number, sponsorTimesContributed: number,
submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message
unsubmittedWarning: boolean,
disableSkipping: boolean, disableSkipping: boolean,
trackViewCount: boolean, trackViewCount: boolean,
dontShowNotice: boolean, dontShowNotice: boolean,
@@ -132,6 +133,7 @@ var Config: SBObject = {
skipCount: 0, skipCount: 0,
sponsorTimesContributed: 0, sponsorTimesContributed: 0,
submissionCountSinceCategories: 0, submissionCountSinceCategories: 0,
unsubmittedWarning: true,
disableSkipping: false, disableSkipping: false,
trackViewCount: true, trackViewCount: true,
dontShowNotice: false, dontShowNotice: false,