Fixed the issue that the next page button does not appear on the invidious query home page
if (document.title.includes("Invidious")){
if(!document.location.search.includes("&page=") && document.location.search.includes("?q=")){
var nextpage="<a href=\""+document.location.pathname+document.location.search+"&page=2\" class=\"pure-button pure-button-secondary\">Next page <i class=\"icon ion-ios-arrow-forward\"></i></a>"
var obj_list = document.querySelectorAll('.page-next-container')
for(var i = obj_list.length-1; i > -1; i--){
if(obj_list[i].childElementCount === 0){
obj_list[i].insertAdjacentHTML('beforeend', nextpage);
}
}
}
else if(document.location.search.endsWith("&page=1") && document.location.search.includes("?q=")){
nextpage="<a href=\""+document.location.pathname+document.location.search.split("&page=1")[0]+"&page=2\" class=\"pure-button pure-button-secondary\">Next page <i class=\"icon ion-ios-arrow-forward\"></i></a>"
obj_list = document.querySelectorAll('.page-next-container')
for( i = obj_list.length-1; i > -1; i--){
if(obj_list[i].childElementCount === 0){
obj_list[i].insertAdjacentHTML('beforeend', nextpage);
}
}
}
}