mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-01 10:21:22 +01:00
Chrome: Number formatting fixed, now sending recommended videos to backend
This commit is contained in:
1 parent
de213ed4b2
commit
4a2cd22591
2 files changed
+24
-28
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Return YouTube Dislike",
|
"name": "Return YouTube Dislike",
|
||||||
"description": "Returns ability to see dislikes",
|
"description": "Returns ability to see dislikes",
|
||||||
"version": "1.1.0.0",
|
"version": "1.1.0.1",
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"background": {
|
"background": {
|
||||||
"service_worker": "return-youtube-dislike.background.js"
|
"service_worker": "return-youtube-dislike.background.js"
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
|
|
||||||
function setInitalState() {
|
function setInitalState() {
|
||||||
setState();
|
setState();
|
||||||
// setTimeout(() => sendVideoIds(), 1500);
|
setTimeout(() => sendVideoIds(), 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVideoId(url) {
|
function getVideoId(url) {
|
||||||
@@ -171,12 +171,10 @@
|
|||||||
const userLocales = navigator.language;
|
const userLocales = navigator.language;
|
||||||
|
|
||||||
const formatter = Intl.NumberFormat(userLocales, {
|
const formatter = Intl.NumberFormat(userLocales, {
|
||||||
notation: 'compact',
|
notation: 'compact'
|
||||||
minimumFractionDigits: 1,
|
|
||||||
maximumFractionDigits: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return formatter.format(roundDown(numberState)).replace(/\.0|,0/, '');
|
return formatter.format(roundDown(numberState));
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsInitChecktimer = null;
|
var jsInitChecktimer = null;
|
||||||
@@ -249,24 +247,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// function sendVideoIds() {
|
function sendVideoIds() {
|
||||||
// const ids = Array.from(
|
const ids = Array.from(
|
||||||
// document.getElementsByClassName(
|
document.getElementsByClassName(
|
||||||
// "yt-simple-endpoint ytd-compact-video-renderer"
|
"yt-simple-endpoint ytd-compact-video-renderer"
|
||||||
// )
|
)
|
||||||
// )
|
)
|
||||||
// .concat(
|
.concat(
|
||||||
// Array.from(
|
Array.from(
|
||||||
// document.getElementsByClassName("yt-simple-endpoint ytd-thumbnail")
|
document.getElementsByClassName("yt-simple-endpoint ytd-thumbnail")
|
||||||
// )
|
)
|
||||||
// )
|
)
|
||||||
// .filter((x) => x.href && x.href.indexOf("/watch?v=") > 0)
|
.filter((x) => x.href && x.href.indexOf("/watch?v=") > 0)
|
||||||
// .map((x) => getVideoId(x.href));
|
.map((x) => getVideoId(x.href));
|
||||||
// chrome.runtime.sendMessage(extensionId, {
|
chrome.runtime.sendMessage(extensionId, {
|
||||||
// message: "send_links",
|
message: "send_links",
|
||||||
// videoIds: ids,
|
videoIds: ids,
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
setEventListeners();
|
setEventListeners();
|
||||||
|
|
||||||
@@ -276,9 +274,7 @@
|
|||||||
setEventListeners();
|
setEventListeners();
|
||||||
});
|
});
|
||||||
|
|
||||||
// window.onscrollend = () => {
|
|
||||||
// sendVideoIds();
|
|
||||||
// };
|
|
||||||
|
|
||||||
// setTimeout(() => sendVideoIds(), 1500);
|
|
||||||
|
setTimeout(() => sendVideoIds(), 2500);
|
||||||
})(document.currentScript.getAttribute("extension-id"));
|
})(document.currentScript.getAttribute("extension-id"));
|
||||||
Reference in new issue
Block a user