aboutsummaryrefslogtreecommitdiffhomepage
path: root/content.js
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-07-23 21:06:36 -0400
committerAjay Ramachandran <[email protected]>2019-07-23 21:06:36 -0400
commit0f561d4a5a18fbef1fbadb1559fced1786d47622 (patch)
tree9c580f306105d1de56c960432e704cdb1d29dc9b /content.js
parente8ff6171eb6f38e4d852ad73b015301ccbb9a769 (diff)
downloadSponsorBlock-0f561d4a5a18fbef1fbadb1559fced1786d47622.tar.gz
SponsorBlock-0f561d4a5a18fbef1fbadb1559fced1786d47622.zip
Added option to disable the view count tracking.
Diffstat (limited to 'content.js')
-rw-r--r--content.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/content.js b/content.js
index 970ab199..238f6f19 100644
--- a/content.js
+++ b/content.js
@@ -36,6 +36,17 @@ var showingStartSponsor = true;
//should the video controls buttons be added
var hideVideoPlayerControls = false;
+//should view counts be tracked
+var trackViewCount = false;
+chrome.storage.sync.get(["trackViewCount"], function(result) {
+ let trackViewCountStorage = result.trackViewCount;
+ if (trackViewCountStorage != undefined) {
+ trackViewCount = trackViewCountStorage;
+ } else {
+ trackViewCount = true;
+ }
+});
+
//if the notice should not be shown
//happens when the user click's the "Don't show notice again" button
var dontShowNotice = false;
@@ -86,6 +97,10 @@ chrome.runtime.onMessage.addListener( // Detect URL Changes
updateVisibilityOfPlayerControlsButton();
}
+
+ if (request.message == "trackViewCount") {
+ trackViewCount = request.value;
+ }
});
function videoIDChange(id) {
@@ -177,7 +192,9 @@ function sponsorCheck(sponsorTimes) { // Video skipping
setTimeout(() => closeSkipNotice(currentUUID), 7000);
//send telemetry that a this sponsor was skipped happened
- sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
+ if (trackViewCount) {
+ sendRequestToServer("GET", "/api/viewedVideoSponsorTime?UUID=" + currentUUID);
+ }
}
}
lastTime = v.currentTime;