Skip to content

Commit

Permalink
Merge pull request #136 from ajayyy/experimental-ajay
Browse files Browse the repository at this point in the history
Fixed submissions being broken on the video player
  • Loading branch information
ajayyy authored Aug 24, 2019
2 parents f0888fa + 2d96c24 commit 896357a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
40 changes: 20 additions & 20 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
chrome.runtime.onMessage.addListener(function (request, sender, callback) {
switch(request.message) {
case "submitTimes":
submitTimes(request.videoID, callback);
//this allows the callback to be called later by the submitTimes function
return true;
submitTimes(request.videoID, callback);

//this allows the callback to be called later by the submitTimes function
return true;
case "addSponsorTime":
addSponsorTime(request.time, request.videoID, callback);
//this allows the callback to be called later
return true;
addSponsorTime(request.time, request.videoID, callback);

//this allows the callback to be called later
return true;
case "getSponsorTimes":
getSponsorTimes(request.videoID, function(sponsorTimes) {
callback({
sponsorTimes: sponsorTimes
})
});
//this allows the callback to be called later
return true;
getSponsorTimes(request.videoID, function(sponsorTimes) {
callback({
sponsorTimes: sponsorTimes
})
});

//this allows the callback to be called later
return true;
case "submitVote":
submitVote(request.type, request.UUID, callback);
//this allows the callback to be called later
return true;
submitVote(request.type, request.UUID, callback);

//this allows the callback to be called later
return true;
case "alertPrevious":
chrome.notifications.create("stillThere" + Math.random(), {
type: "basic",
Expand Down
4 changes: 2 additions & 2 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ function submitSponsorTimes() {
//called after all the checks have been made that it's okay to do so
function sendSubmitMessage(){
//add loading animation
document.getElementById("submitButtonImage").src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker256px.png");
document.getElementById("submitImage").src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker256px.png");
document.getElementById("submitButton").style.animation = "rotate 1s 0s infinite";

let currentVideoID = sponsorVideoID;
Expand Down Expand Up @@ -931,7 +931,7 @@ function sendSubmitMessage(){
} else {
//show that the upload failed
document.getElementById("submitButton").style.animation = "unset";
document.getElementById("submitButtonImage").src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker256px.png");
document.getElementById("submitImage").src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker256px.png");

if([400,429,409,502].includes(response.statusCode)) {
alert(chrome.i18n.getMessage(response.statusCode));
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "__MSG_Name__",
"version": "1.1.4",
"version": "1.1.5",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [
Expand Down

0 comments on commit 896357a

Please sign in to comment.