For my application, I am utilizing the most recent version of Awesomium's WebControl. The goal is for it to automatically log in when it reaches "accounts.google.com/ServiceLogin" by executing some Javascript. In my.settings.java file, I have the following code:
"document.getElementById('Email').value='1'; document.getElementById('Passwd').value='2'; document.getElementById('signIn').click();"
The email is represented by '1' and the password by '2. When the document is ready, this code is triggered:
Private Sub WebBrowser1_DocumentReady(sender As Object, e As Awesomium.Core.UrlEventArgs) Handles WebBrowser1.DocumentReady
If WebBrowser1.Source.ToString.Contains("accounts.google.com/ServiceLogin") = True Then
WebBrowser1.ExecuteJavascript(My.Settings.java.ToString)
Else
End If
I'm unsure why this implementation isn't functioning as expected. Copying the script directly like so works perfectly:
WebBrowser1.ExecuteJavascript("document.getElementById('Email').value='1'; document.getElementById('Passwd').value='2'; document.getElementById('signIn').click();")
The reason behind saving the code in my.settings is that I start with it in a textbox. After prompting the user for their credentials, I replace '1' and '2' with the inputted email and password, respectively. This modified text is then saved in my.settings.java. By doing this, the application can retrieve the customized Javascript for each user instead of hardcoding it. Is there an error in my code or an alternative method using Awesomium? Additionally, I usually refer to Awesomium's WebControl1 but changed it to WebBrowser1 for consistency. Apologies if this question seems basic, I'm still learning and have limited experience with Javascript.