If you apply the following changes you can prevent the script from requesting resources that it doesn't need.
Uses domparser to parse the dom instead of jquery. Also switched to querySelector which is a nicer way to find the node that you need.
//....This is around line ~80
$.ajax({
url: pagelink,
dataType: 'text',
success: function (data) {
// Convert the HTML string into a document object
var parser = new DOMParser();
let dataDOC = parser.parseFromString(data, 'text/html');
// Grab character image
if (pagelink.search(CharacterLinkTest) != -1){
var imagelink = dataDOC.querySelector(".charimg img").src;
}
// Grab visual novel cover
else{
var imagelink = dataDOC.querySelector(".vnimg img").src;
}
//....script continues
(contribution) Reduce the number of requests
Thanks for the useful script.
If you apply the following changes you can prevent the script from requesting resources that it doesn't need.
Uses domparser to parse the dom instead of jquery. Also switched to querySelector which is a nicer way to find the node that you need.