0
votes

when i try to get hcaptcha callback with hcaptcha.render method i don't get container and params here is my code

window.hcaptcha.render = (container, params) => {
                console.log(container)
                console.log(params)
                window.hcaptchaCallback = params.callback
            }
const scriptUrl = new URL(Array.from(document.querySelectorAll('script')).filter(s => s.src.includes('https://cloudflare.hcaptcha.com/1/api.js')).map(s => s.src)[0])

window[scriptUrl.searchParams.get('onload')]()

the hcaptchacallback function is empty, however when I pause in the code of the page I receive the two elements as well as the filled function. do you have a solution please?