Hide comment teaser too

This commit is contained in:
Arne Keller 2022-09-14 18:39:56 +02:00
parent 4e050b429f
commit bcdab4067a

View File

@ -8,7 +8,7 @@ Array.from(document.getElementsByClassName(STYLE_CLASS)).forEach((e) => {
window.ytacCSS = {
"sidebar": "#related",
"comments": "#comments",
"comments": "#comments, #comment-teaser",
"endscreen": ".videowall-endscreen",
"invideo": ".ytp-ce-video",
"notification": "ytd-notification-topbar-button-renderer",
@ -78,24 +78,18 @@ window.ytacListener = (message) => {
browser.runtime.onMessage.addListener(window.ytacListener);
console.log("[YTAC] added action listener");
function modifyThings() {
// description expander
let showMoreButton = document.querySelector(".ytd-video-secondary-info-renderer > #more");
if (!showMoreButton) {
console.warn("[YTAC] could not locate description expander");
//setTimeout(modifyThings, 5000);
} else {
// expand description by default
let showMoreButton = document.querySelector("#description-inline-expander > #expand");
if (showMoreButton) {
showMoreButton.click();
}
}
modifyThings();
// attempt to hide the notification count in the title
function hideNotificationCount() {
let a = document.getElementsByTagName("title")[0];
if (a.innerText.match("^\\(\\d+\\).*")) {
a.innerText = a.innerText.substr(a.innerText.indexOf(")") + 2);
a.innerText = a.innerText.substring(a.innerText.indexOf(")") + 2);
}
}
setInterval(hideNotificationCount, 1000);