Help with JS inject

Hello! (I use the extension of WebViewer)
How can I know if the user write a correct login info, or if not? And How Can I detect if the URL has changed?
With this web:


With this login aia:

Can someone help me please??

Hello,

The site is submitting a form, which response will be in next page. ( information will go to the server, server will reply )
This site supports jquery, so you can do your mission in 2 steps using jQuery.

1.inject jQuery or JS values to username/password … then click() to submit the form. (as u did in your blocks)
2.In block On Page Loaded, insert again JS that will check for element which have class .alert

Then you watch the jquery response

If wrong username is entered you will have:
<div class="alert alert-danger" role="alert">Invalid login, please try again</div>

The jQuery command: $(".alert").text(); will return the text of the element containing .alert class. It is the response - “Invalid login, please try again” . You can do other string stuff with it.

You can write a JS function and get the result in:
component_event

Try it

Regards,
Vlad

1 Like