Skip to content

Commit ec1de2c

Browse files
authored
Made profile link features work when comments are loaded
1 parent eb3d754 commit ec1de2c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

profile.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ if (help.includes(document.querySelector('#profile-data > div.box-head > div > h
1111
document.querySelector('#profile-data > div.box-head > div > p > span.group').textContent = `${document.querySelector('#profile-data > div.box-head > div > p > span.group').textContent} | ScratchTools`
1212
document.querySelector('#profile-data > div.box-head > div > h2').textContent = `*${document.querySelector('#profile-data > div.box-head > div > h2').textContent}`
1313
setTimeout(() => { replacealllinks() }, 2000);
14+
setTimeout(() => { addOnClick() }, 2000);
1415
}
1516
// replace links in comments
1617
function replacealllinks() {
18+
addOnClick()
1719
const highlightedItems = document.querySelectorAll("a");
1820

1921
highlightedItems.forEach(function(item) {
@@ -37,6 +39,12 @@ if(data.hasOwnProperty('title')){
3739
item.textContent = stuff
3840
}
3941
}
42+
}
43+
function addOnClick() {
44+
var thebutton = document.querySelector('#comments > div:nth-child(3) > ul > div')
45+
thebutton.onclick = function() {
46+
setTimeout(() => { replacealllinks() }, 2000);
47+
}
4048
}
4149
// done replacing
4250

0 commit comments

Comments
 (0)