Fix TypeError if no comment section was found
This commit is contained in:
parent
6f1a38bb7d
commit
76aac85ad4
|
@ -48,6 +48,7 @@ const log = (msg) => console.log(`sn-translator: `, msg);
|
|||
|
||||
function addButtons() {
|
||||
const commentSection = document.querySelector('.item_comments__cN57K');
|
||||
if (!commentSection) return;
|
||||
const comments = commentSection.querySelectorAll('.comment_comment__5uvl3');
|
||||
log(`Found ${comments.length} comment(s)`);
|
||||
log(`Adding translate button to every comment ...`);
|
||||
|
|
Loading…
Reference in New Issue