Change return to break.

This commit is contained in:
Ajay Ramachandran
2019-08-27 21:17:21 -04:00
parent 871ba63f67
commit f91c6d5f9d

View File

@@ -93,37 +93,44 @@ function messageListener(request, sender, sendResponse) {
switch(request.message){ switch(request.message){
case "update": case "update":
videoIDChange(getYouTubeVideoID(document.URL)); videoIDChange(getYouTubeVideoID(document.URL));
return
break;
case "sponsorStart": case "sponsorStart":
sponsorMessageStarted(sendResponse); sponsorMessageStarted(sendResponse);
return
break;
case "sponsorDataChanged": case "sponsorDataChanged":
updateSponsorTimesSubmitting(); updateSponsorTimesSubmitting();
return
//send the sponsor times along with if it's found break;
case "isInfoFound": case "isInfoFound":
//send the sponsor times along with if it's found
sendResponse({ sendResponse({
found: sponsorDataFound, found: sponsorDataFound,
sponsorTimes: sponsorTimes, sponsorTimes: sponsorTimes,
hiddenSponsorTimes: hiddenSponsorTimes, hiddenSponsorTimes: hiddenSponsorTimes,
UUIDs: UUIDs UUIDs: UUIDs
}); });
if (popupInitialised && document.getElementById("sponsorBlockPopupContainer") != null) { if (popupInitialised && document.getElementById("sponsorBlockPopupContainer") != null) {
//the popup should be closed now that another is opening //the popup should be closed now that another is opening
closeInfoMenu(); closeInfoMenu();
} }
popupInitialised = true; popupInitialised = true;
return break;
case "getVideoID": case "getVideoID":
sendResponse({ sendResponse({
videoID: sponsorVideoID videoID: sponsorVideoID
}) });
return
break;
case "getVideoDuration": case "getVideoDuration":
sendResponse({ sendResponse({
duration: v.duration duration: v.duration
}); });
return
break;
case "skipToTime": case "skipToTime":
v.currentTime = request.time; v.currentTime = request.time;
return return
@@ -131,45 +138,56 @@ function messageListener(request, sender, sendResponse) {
sendResponse({ sendResponse({
currentTime: v.currentTime currentTime: v.currentTime
}); });
return
break;
case "getChannelURL": case "getChannelURL":
sendResponse({ sendResponse({
channelURL: channelURL channelURL: channelURL
}) });
return
break;
case "isChannelWhitelisted": case "isChannelWhitelisted":
sendResponse({ sendResponse({
value: channelWhitelisted value: channelWhitelisted
}) });
return
break;
case "whitelistChange": case "whitelistChange":
channelWhitelisted = request.value; channelWhitelisted = request.value;
sponsorsLookup(sponsorVideoID); sponsorsLookup(sponsorVideoID);
return
break;
case "dontShowNotice": case "dontShowNotice":
dontShowNotice = false; dontShowNotice = false;
return
break;
case "changeStartSponsorButton": case "changeStartSponsorButton":
changeStartSponsorButton(request.showStartSponsor, request.uploadButtonVisible); changeStartSponsorButton(request.showStartSponsor, request.uploadButtonVisible);
return
break;
case "showNoticeAgain": case "showNoticeAgain":
dontShowNotice = false; dontShowNotice = false;
return
break;
case "changeVideoPlayerControlsVisibility": case "changeVideoPlayerControlsVisibility":
hideVideoPlayerControls = request.value; hideVideoPlayerControls = request.value;
updateVisibilityOfPlayerControlsButton(); updateVisibilityOfPlayerControlsButton();
return
break;
case "changeInfoButtonPlayerControlsVisibility": case "changeInfoButtonPlayerControlsVisibility":
hideInfoButtonPlayerControls = request.value; hideInfoButtonPlayerControls = request.value;
updateVisibilityOfPlayerControlsButton(); updateVisibilityOfPlayerControlsButton();
return
break;
case "changeDeleteButtonPlayerControlsVisibility": case "changeDeleteButtonPlayerControlsVisibility":
hideDeleteButtonPlayerControls = request.value; hideDeleteButtonPlayerControls = request.value;
updateVisibilityOfPlayerControlsButton(); updateVisibilityOfPlayerControlsButton();
return
break;
case "trackViewCount": case "trackViewCount":
trackViewCount = request.value; trackViewCount = request.value;
return
break;
} }
} }