From 2fbafb6b10ccaccd0676a5e8976198ed7c20fbdb Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 22 Aug 2019 23:12:30 -0400 Subject: Added duration check to popup as well. --- content.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'content.js') diff --git a/content.js b/content.js index 303b4d41..c63ef7c5 100644 --- a/content.js +++ b/content.js @@ -128,6 +128,12 @@ function messageListener(request, sender, sendResponse) { }) } + if (request.message == "getVideoDuration") { + sendResponse({ + duration: v.duration + }); + } + if (request.message == "skipToTime") { v.currentTime = request.time; } @@ -964,6 +970,8 @@ function submitSponsorTimes() { sponsorTimes[i][1] = v.duration; } } + //update sponsorTimes + chrome.storage.sync.set({[sponsorTimeKey]: sponsorTimes}); let confirmMessage = chrome.i18n.getMessage("submitCheck") + "\n\n" + getSponsorTimesMessage(sponsorTimes); confirmMessage += "\n\n" + chrome.i18n.getMessage("confirmMSG"); -- cgit v1.2.3