diff --git a/SB.js b/SB.js index aeb524dc..0e0f82e1 100644 --- a/SB.js +++ b/SB.js @@ -160,7 +160,8 @@ SB.defaults = { "hideDeleteButtonPlayerControls": false, "hideDiscordLaunches": 0, "hideDiscordLink": false, - "invidiousInstances": ["invidio.us", "invidiou.sh", "invidious.snopyta.org"] + "invidiousInstances": ["invidio.us", "invidiou.sh", "invidious.snopyta.org"], + "autoUpvote": true } // Reset config diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 3dca55b5..4157ae1c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -374,5 +374,11 @@ }, "currentInstances": { "message": "Current Instances:" + }, + "enableAutoUpvote": { + "message": "Auto Upvote" + }, + "whatAutoUpvote": { + "message": "With this enabled, the extension will upvote all submissions you view if you do not report them. If the notice is disabled, this will not occur." } } diff --git a/content.js b/content.js index b165dafd..1d85de16 100644 --- a/content.js +++ b/content.js @@ -556,8 +556,9 @@ function skipToTime(v, index, sponsorTimes, openNotice) { //send out the message saying that a sponsor message was skipped if (!SB.config.dontShowNotice) { let skipNotice = new SkipNotice(this, currentUUID, SB.config.disableAutoSkip); + //auto-upvote this sponsor - if (SB.config.trackViewCount && !SB.config.disableAutoSkip) { + if (SB.config.trackViewCount && !SB.config.disableAutoSkip && SB.config.autoUpvote) { vote(1, currentUUID, null); } } diff --git a/options/options.html b/options/options.html index b76c3e0a..2278e4d3 100644 --- a/options/options.html +++ b/options/options.html @@ -181,6 +181,23 @@
__MSG_whatDeleteButton__
+ +
+
+ +
+ + +
+
+ +
__MSG_whatAutoUpvote__
+


diff --git a/popup.js b/popup.js index 9e9ccaeb..7be8235d 100644 --- a/popup.js +++ b/popup.js @@ -231,7 +231,6 @@ async function runThePopup() { } //load video times for this video - setTimeout(()=> console.log( SB.config.sponsorTimes.set), 200 ) let sponsorTimesStorage = SB.config.sponsorTimes.get(currentVideoID); if (sponsorTimesStorage != undefined && sponsorTimesStorage.length > 0) { if (sponsorTimesStorage[sponsorTimesStorage.length - 1] != undefined && sponsorTimesStorage[sponsorTimesStorage.length - 1].length < 2) { @@ -919,10 +918,8 @@ async function runThePopup() { type: type, UUID: UUID }, function(response) { - console.log(response) if (response != undefined) { //see if it was a success or failure - console.log(response) if (response.successType == 1 || (response.successType == -1 && response.statusCode == 429)) { //success (treat rate limits as a success) addVoteMessage(chrome.i18n.getMessage("voted"), UUID)