Skip to content

Commit

Permalink
return unnessesary
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Sep 18, 2023
1 parent d0ab30d commit 2807283
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 0 additions & 6 deletions chrome/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,12 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
const compiledData = { jWURL, score, streamLinks: offers };
DBCache[title] = compiledData;
setRatingOnCard(card, compiledData, title);
return {
jWURL,
score,
streamLinks: offers,
};
}
callback(data);
} else {
callback(null);
}
});
return null;
}

// Observers
Expand Down
13 changes: 12 additions & 1 deletion firefox/badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ async function setBadgeText(text, tabId = null) {

// receive message from content script with the badgeText and set it in the badge
browser.runtime.onMessage.addListener(function (message, sender) {
if (message.type === "setBadgeText") {
if (message.url) {
fetch(message.url, {
method: "GET",
headers: {
Accept: "application/json",
},
})
.then((response) => response.json())
.then((data) => sendResponse(data))
.catch((error) => console.error(error));
return true; // Indicates that sendResponse will be called asynchronously
} else if (message.type === "setBadgeText") {
setBadgeText(message.content, sender.tab.id);
} else if (message.type === "increaseBadge") {
increaseBadge(sender.tab.id);
Expand Down

0 comments on commit 2807283

Please sign in to comment.