Coder Social home page Coder Social logo

Lag when using invisible widget about hcaptcha HOT 4 CLOSED

rvxlab avatar rvxlab commented on July 19, 2024
Lag when using invisible widget

from hcaptcha.

Comments (4)

RVxLab avatar RVxLab commented on July 19, 2024

There is no built-in method to do what you want to do. You could do this yourself with a little JavaScript.

As for the performance, if this is coming from hCaptcha’s end then there isn’t a whole lot to do from the package end.

Does this happen locally only? If so, can the network tab give some more insight?

from hcaptcha.

crypnull avatar crypnull commented on July 19, 2024

I checked the network tab, there seems to be no more insight apart from hcaptcha is just slow in general, it wouldn't be as bad if it was more user friendly, say button was disabled and a preloader popped up beside it maybe, I see there is two callbacks in this package, maybe one could be added and when the button is pressed but before the captcha is shown, so I can display some loading html, and then hide it once it's loaded, I tried onclick="" but that didn't work, so I might look into using an event listener, otherwise I would just use the normal box because it's more demonstrative to the user something is actually happening while they wait for hcaptcha to load and not to spam press the button or refresh the page, it would also be handy to be able to preload hcaptcha while the user is filling out the form, because once it's loaded the first time, clicking off the captcha and and on to the button again is quite fast.

from hcaptcha.

RVxLab avatar RVxLab commented on July 19, 2024

I don't think adding another callback hook will give much benefit here since it's hCaptcha's script that actually handles the event on a form's submit, which should also prevent the default behaviour.

Normally I would recommend you to programmatically invoke the challenge, but this package currently doesn't properly support it. You could make a custom render around it for now or even submit a PR to add it.

I'll be making a separate issue for a few features I would like to add and a few changes I would like to get done. So perhaps use a custom implementation to render your invisible widget for the time being?

from hcaptcha.

RVxLab avatar RVxLab commented on July 19, 2024

I added the ability to publish the views, so if you want to have a different default that can do what you need it to do you can take a look at it.

If you want to give it a try, you can reference commit f443b0f977b698a179178a30571bdaf63d3fe357 in your composer.json. Composer doesn't recommend this, so use it at your own risk.

"require": {
    "rvxlab/hcaptcha": "dev-main#f443b0f977b698a179178a30571bdaf63d3fe357",
}

And run composer update rvxlab/hcaptcha.

The new features currently in the issue tracker will land with v5.1.

I'm closing this issue for now as there is not much more I can do to help as this is a specific issue to your project.

from hcaptcha.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.