Skip to content

Instantly share code, notes, and snippets.

@Richienb
Last active September 1, 2022 11:21
Show Gist options
  • Save Richienb/554b920a8494dda6f38de6e70988353e to your computer and use it in GitHub Desktop.
Save Richienb/554b920a8494dda6f38de6e70988353e to your computer and use it in GitHub Desktop.
I'm not a Fortnite player
// ==UserScript==
// @name I'm not a Fortnite player
// @namespace https://github.com/Richienb
// @version 0.1
// @description Change ReCAPTCHA and hCaptcha labels to be something more epic
// @author Richie Bendall
// @match *://www.google.com/recaptcha/api2/anchor*
// @match *://newassets.hcaptcha.com/captcha/v1/*/static/hcaptcha-checkbox.html*
// @grant none
// ==/UserScript==
(async () => {
function whenElementReady(selector) {
return new Promise(resolve => {
const observer = new MutationObserver(() => {
const element = document.querySelector(selector)
if (element) {
resolve(element)
observer.disconnect()
}
})
observer.observe(document, {
childList: true,
subtree: true
})
})
}
if (location.hostname === "www.google.com") {
// ReCAPTCHA
const element = await whenElementReady("#recaptcha-anchor-label")
element.innerText = "I'm not a Fortnite player"
return
}
// hCaptcha
const element = await whenElementReady("#label")
setTimeout(() => {
element.innerText = "I am not a Fortnite player"
}, 100)
})()
@Korb
Copy link

Korb commented Sep 1, 2022

"epic"??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment