#38 Fixed second innerHTML Warning

This commit is contained in:
Serraniel 2020-09-11 20:36:38 +02:00
parent b4d6a886fe
commit be721815de
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -64,20 +64,26 @@ function removeUnknownUsers(node) {
let anime = lowerDiv.innerText; let anime = lowerDiv.innerText;
let profileData = upperDiv.innerHTML; let profileData = upperDiv.innerHTML;
// exchange data
let bElement = document.createElement('b');
bElement.textContent = anime;
upperDiv.innerHTML = ``;
upperDiv.appendChild(bElement);
// add user note if own request // add user note if own request
if (profileLink.length > 0) { if (profileLink.length > 0) {
lowerDiv.innerHTML = profileData; let parser = new DOMParser();
let parsedDocument = parser.parseFromString(profileData, 'text/html');
lowerDiv.innerHTML = '';
while(parsedDocument.body.hasChildNodes()){
lowerDiv.appendChild(parsedDocument.body.removeChild(parsedDocument.body.firstChild));
}
} }
// remove if foreign request. // remove if foreign request.
else { else {
lowerDiv.innerHTML = ' '; lowerDiv.innerHTML = ' ';
} }
// exchange data
let bElement = document.createElement('b');
bElement.textContent = anime;
upperDiv.innerHTML = ``;
upperDiv.appendChild(bElement);
} }
if (node.tagName === targetTagName) { if (node.tagName === targetTagName) {