mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-25 15:53:01 +01:00
Ratio bar added
This commit is contained in:
1 parent
2dd6b0f29b
commit
4780e5456b
10 files changed
+156
-40
No files matched your search
@@ -30,14 +30,32 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
.catch();
|
||||
//});
|
||||
return true;
|
||||
} else if (request.message == "send_links") {
|
||||
toSend = toSend.concat(request.videoIds.filter((x) => !sentIds.has(x)));
|
||||
if (toSend.length >= 20) {
|
||||
fetch(`${apiUrl}/votes`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(toSend),
|
||||
});
|
||||
for (const toSendUrl of toSend) {
|
||||
sentIds.add(toSendUrl);
|
||||
}
|
||||
toSend = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const sentIds = new Set();
|
||||
let toSend = [];
|
||||
|
||||
browser.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
|
||||
if (changeInfo.status == "complete") {
|
||||
if (tab.url && tab.url.indexOf("youtube.") < 0) return;
|
||||
browser.tabs.get(tabId, (tab) => {
|
||||
browser.tabs.executeScript(tab.id,{
|
||||
browser.tabs.executeScript(tab.id, {
|
||||
file: "script.js",
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user