Skip to content

Commit

Permalink
Display information about QuickLogin attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasNilson committed Feb 2, 2020
1 parent 720fa24 commit 14075f5
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions Source/IdleMaster/frmBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,7 @@ private void wbAuth_DocumentCompleted(object sender, WebBrowserDocumentCompleted

try
{
// Set the "Remember me" checkbox
dynamic rememberMeCheckBox = htmldoc.GetElementById("remember_login");
if (rememberMeCheckBox != null)
{
rememberMeCheckBox.Checked = true;
}
setRememberMeCheckbox(htmldoc);
}
catch (Exception)
{
Expand All @@ -103,6 +98,7 @@ private void wbAuth_DocumentCompleted(object sender, WebBrowserDocumentCompleted
// Tell steam client to generate keys to login on browser
if (Settings.Default.QuickLogin)
{
setLoginButtonText(htmldoc, "Attempting to QuickLogin...");
executeQuickLoginScript();
}
}
Expand Down Expand Up @@ -134,6 +130,26 @@ private void wbAuth_DocumentCompleted(object sender, WebBrowserDocumentCompleted
}
}

private void setLoginButtonText(dynamic htmldoc, string text)
{
// Set the "Sign in" button text
dynamic steamLoginButton = htmldoc.GetElementById("SteamLogin");
if (steamLoginButton != null)
{
steamLoginButton.Value = text;
}
}

private static void setRememberMeCheckbox(dynamic htmldoc)
{
// Set the "Remember me" checkbox
dynamic rememberMeCheckBox = htmldoc.GetElementById("remember_login");
if (rememberMeCheckBox != null)
{
rememberMeCheckBox.Checked = true;
}
}

private void executeQuickLoginScript()
{
// Overwrite cookie functions to ignore the auto login cookie checks
Expand Down Expand Up @@ -311,6 +327,7 @@ private void tmrCheck_Tick(object sender, EventArgs e)
SecondsWaiting = 5;

// Attempt to login again
setLoginButtonText(wbAuth.Document.DomDocument, "Attempting to QuickLogin again...");
executeQuickLoginScript();
}
else
Expand Down

0 comments on commit 14075f5

Please sign in to comment.