User:Polygnotus/DuplicateReferences.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 8:
}
console.log("Page title:", document.title);
console.log("URL:", window.___location.href);
 
let referencesHeading = document.getElementById("References");
if (!referencesHeading) {
Line 84 ⟶ 87:
return [];
}
console.log("References heading found:", referencesHeading.outerHTML);
let currentElement = referencesHeading;
let searchDepth = 0;
while (currentElement && !currentElement.classList.contains('references')) {
const maxSearchDepth = 10; // Adjust this value if needed
while (currentElement && !currentElement.classList.contains('references') && searchDepth < maxSearchDepth) {
console.log("Checking element:", currentElement.tagName, currentElement.className);
currentElement = currentElement.nextElementSibling;
searchDepth++;
}
if (!currentElement || !currentElement.classList.contains('references')) {
console.log("References list not found after References heading");
console.log("Last checked element:", currentElement ? currentElement.outerHTML : "None");
return [];
}
console.log("References list found:", currentElement.outerHTML);
const referencesList = currentElement;