#6 Remove unknown users

This commit is contained in:
Serraniel 2020-07-29 11:39:09 +02:00
parent 7e21fbdf05
commit 199c9db5c5
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -3,6 +3,7 @@ registerScript(node => {
if (isHtmlElement(node)) {
changeFollowedStarColor(node);
changeOwnBorderColor(node);
removeUnknownUsers(node);
}
});
@ -28,6 +29,31 @@ function changeOwnBorderColor(node) {
}
// are we target tag?
if (node.tagName === targetTagName) {
updateFunc(node);
} else {
// find items -> all
let requestItems = node.querySelectorAll('md-list-item');
// change border color if profile link is not 'false'
requestItems.forEach(item => {
updateFunc(item);
});
}
}
function removeUnknownUsers(node) {
const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case
let updateFunc = item => {
let upperDiv = node.querySelector('[layout-align="start center"][flex]')
let lowerDiv = upperDiv.parentElement.nextElementSibling;
let anime = lowerDiv.innerText;
upperDiv.innerHTML = `<b>${anime}</b>`;
lowerDiv.innerHTML = '&nbsp;';
}
if (node.tagName === targetTagName) {
updateFunc(node);
} else {