remove unused functions from extension

This commit is contained in:
himanshudabas committed 2021-12-15 19:41:37 +05:30
1 parent e39b52e8e7
commit 7d3ab78ef1
2 files changed
-39

No files matched your search

-31
View File
@@ -131,37 +131,6 @@ api.storage.sync.get(null, (res) => {
const sentIds = new Set();
let toSend = [];
function getDislikesFromYoutubeResponse(htmlResponse) {
let start =
htmlResponse.indexOf('"videoDetails":') + '"videoDetails":'.length;
let end =
htmlResponse.indexOf('"isLiveContent":false}', start) +
'"isLiveContent":false}'.length;
if (end < start) {
end =
htmlResponse.indexOf('"isLiveContent":true}', start) +
'"isLiveContent":true}'.length;
}
let jsonStr = htmlResponse.substring(start, end);
let jsonResult = JSON.parse(jsonStr);
let rating = jsonResult.averageRating;
start = htmlResponse.indexOf('"topLevelButtons":[', end);
start =
htmlResponse.indexOf('"accessibilityData":', start) +
'"accessibilityData":'.length;
end = htmlResponse.indexOf("}", start);
let likes = +htmlResponse.substring(start, end).replace(/\D/g, "");
let dislikes = (likes * (5 - rating)) / (rating - 1);
let result = {
likes,
dislikes: Math.abs(Math.round(dislikes)),
rating,
viewCount: +jsonResult.viewCount,
};
return result;
}
function sendUserSubmittedStatisticsToApi(statistics) {
fetch(`${apiUrl}/votes/user-submitted`, {
method: "POST",
@@ -67,14 +67,6 @@ function RYD() {
return getDislikeButton().classList.contains("style-default-active");
}
function isVideoNotLiked() {
return getLikeButton().classList.contains("style-text");
}
function isVideoNotDisliked() {
return getDislikeButton().classList.contains("style-text");
}
function checkForSignInButton() {
if (
document.querySelector(