Feature/#6 requests page remove empty user #10
|
@ -46,13 +46,29 @@ function removeUnknownUsers(node) {
|
||||||
const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case
|
const targetTagName = 'MD-LIST-ITEM'; // tagName is upper case
|
||||||
|
|
||||||
let updateFunc = item => {
|
let updateFunc = item => {
|
||||||
|
// find user profile link -> own request
|
||||||
|
let profileLink = item.querySelectorAll('a[href*="/profile/"]:not([href="/profile/false"])');
|
||||||
|
|
||||||
|
// find divs
|
||||||
let upperDiv = node.querySelector('[layout-align="start center"][flex]')
|
let upperDiv = node.querySelector('[layout-align="start center"][flex]')
|
||||||
let lowerDiv = upperDiv.parentElement.nextElementSibling;
|
let lowerDiv = upperDiv.parentElement.nextElementSibling;
|
||||||
|
|
||||||
|
// remember Data
|
||||||
let anime = lowerDiv.innerText;
|
let anime = lowerDiv.innerText;
|
||||||
|
let profileData = upperDiv.innerHTML;
|
||||||
|
|
||||||
|
// exchange data
|
||||||
upperDiv.innerHTML = `<b>${anime}</b>`;
|
upperDiv.innerHTML = `<b>${anime}</b>`;
|
||||||
|
|
||||||
|
// add user note if own request
|
||||||
|
if (profileLink.length > 0) {
|
||||||
|
lowerDiv.innerHTML = profileData;
|
||||||
|
}
|
||||||
|
// remove if foreign request.
|
||||||
|
else {
|
||||||
lowerDiv.innerHTML = ' ';
|
lowerDiv.innerHTML = ' ';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (node.tagName === targetTagName) {
|
if (node.tagName === targetTagName) {
|
||||||
updateFunc(node);
|
updateFunc(node);
|
||||||
|
|
Loading…
Reference in a new issue