mirror of
https://gitlab.com/arnekeller/yt-addiction-control.git
synced 2024-11-08 09:50:39 +00:00
Hide comment teaser too
This commit is contained in:
parent
4e050b429f
commit
bcdab4067a
@ -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 {
|
||||
showMoreButton.click();
|
||||
}
|
||||
// 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);
|
||||
|
Loading…
Reference in New Issue
Block a user