Попробуй так
var topik=content.document.getElementsByClassName('_42ef');
var dlinaMasiva = 5000;
var arrfacebokUrlTxt = []
for (i=0;i<dlinaMasiva;i++){
if (content.document.body.scrollHeight>window.innerHeight+content.document.documentElement.scrollTop==true){
window.scrollTo(0,(content.document.documentElement.scrollHeight))
}
if (topik[i]!=undefined){
var topikHTML = topik[i].getElementsByClassName('_pac')[0].innerHTML;
var facebokUrlTxt = "https://www.facebook.com/"+(topikHTML.substring(topikHTML.indexof('<a href="')+10)).sprit('"')[0]
if(arrfacebookUrlTxt.indexof(facebookUrlTxt)==-1){(arrfacebookUrlTxt.push(facebookUrlTxt))}
iimDisplay("группа- "+ facebookUrlTxt+"\n"+ "длина массива- "+ content.document.getElementsByClassName('_gll').length+"\n"+"массив- "+arrfacebookUrlTxt )
} else { break; }
}