Last active
September 24, 2023 02:23
-
-
Save uncenter/ab1ec276e0546cba7b1955f81670b219 to your computer and use it in GitHub Desktop.
Find your (or any) name in the Arc Browser's Credits (https://arc.net/credits).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const name = prompt("Enter the name to search for:"); | |
const credits = document.querySelector('.c-bMkhAk'); | |
if (credits) { | |
const elements = credits.childNodes; | |
let count = 0; | |
let target= null; | |
for (let i = 0; i < elements.length; i++) { | |
const current = elements[i]; | |
if (current.nodeType === Node.ELEMENT_NODE && current.textContent.toLowerCase() === name.toLowerCase()) { | |
target = current; | |
break; | |
} | |
count++; | |
} | |
if (target) { | |
console.log("Found it!", target); | |
console.log(`That name, '${name}', was #${count} in the credits.`); | |
} else { | |
console.log("Element with name '" + name + "' not found in credits."); | |
} | |
} else { | |
console.log("Credits not found!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment