Page 1 of 1

Webbrowser Before Navigate

PostPosted: Mon Nov 28, 2016 12:41 pm
by Dudus
Hi folks,

i have a Webbrowser what is load a login.php webpage with Username and Password. I want to save these datas to a win Registry so i put into the Webbrowser Before Navigate Tab:

BrowserGetElement "WebBrowser2" "loginEmail" "[username]"
BrowserGetElement "WebBrowser2" "loginPass" "[password]"
RegistryWrite "HKEY_CURRENT_USER" "name" "[username]"
RegistryWrite "HKEY_CURRENT_USER" "pass" "[password]"

Than i click Login, and it is do these lines, BUT whe i Logout from the Login.php page than it is doing again these line :) so the Regsitry Write empty datas again.
How to do that the registry stay with the given datas?

Thank you!
D

Re: Webbrowser Before Navigate

PostPosted: Mon Nov 28, 2016 3:54 pm
by Gaev
Dudus:

1) Try and log the instances when this BeforeNavigate event is triggered ... add this code in this event section ...
Code: Select all
SetVar "[BeforeNavigateLog]" "[BeforeNavigateLog][#13][#10][Time] - [Webbrowser2Addr]"


2) If the [Webbrowser2Addr] changes, then you can use it to selectively write to the Registry.

3) Otherise ...

a) you may have to setup your own "switch" ... turn it "on" before navigating to it ... turn it "off" inside the BeforeNavigate section ... and only write to the Registry if it is "on".

b) or only write to the Registry if the [username] and [password] variables are NOT null/blanks.