Skip to content

Commit

Permalink
Quick login button removed
Browse files Browse the repository at this point in the history
Quick login button removed
  • Loading branch information
JonasNilson authored Jan 17, 2022
2 parents 676005c + 030ec5d commit c9d195e
Show file tree
Hide file tree
Showing 6 changed files with 508 additions and 65 deletions.
18 changes: 8 additions & 10 deletions Source/IdleMasterExtended/IdleMasterExtended.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,9 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Steamworks.NET, Version=7.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Steamworks.NET.dll</HintPath>
Expand Down Expand Up @@ -244,7 +236,6 @@
<LastGenOutput>strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -323,7 +314,14 @@
<None Include="Resources\eye-2x.png" />
<None Include="Resources\trash-2x.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<PackageReference Include="HtmlAgilityPack">
<Version>1.4.9.5</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>9.0.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
36 changes: 1 addition & 35 deletions Source/IdleMasterExtended/frmBrowser.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 1 addition & 20 deletions Source/IdleMasterExtended/frmBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public frmBrowser()

private void frmBrowser_Load(object sender, EventArgs e)
{
quickLoginBarVisibility(false);
browserBarVisibility(false);

// Remove any existing session state data
Expand Down Expand Up @@ -75,7 +74,6 @@ private void wbAuth_DocumentCompleted(object sender, WebBrowserDocumentCompleted
}

browserBarVisibility(true);
quickLoginBarVisibility(true);
setRememberMeCheckbox();
removeUnneccessaryWebsiteElements();
}
Expand Down Expand Up @@ -205,11 +203,6 @@ private void browserBarVisibility(bool visibility)
}
}

private void quickLoginBarVisibility(bool visibility)
{
labelQuickLoginInstructions.Visible = buttonQuickLogin.Visible = visibility;
}

// Imports the InternetGetCookieEx function from wininet.dll which allows the application to access the cookie data from the web browser control
// Reference: http://stackoverflow.com/questions/3382498/is-it-possible-to-transfer-authentication-from-webbrowser-to-webrequest
[DllImport("wininet.dll", SetLastError = true)]
Expand Down Expand Up @@ -288,7 +281,6 @@ private void wbAuth_Navigating(object sender, WebBrowserNavigatingEventArgs e)
Width = Convert.ToInt32(scaleX);

browserBarVisibility(false);
quickLoginBarVisibility(false);
}
else if (url.StartsWith("https://steamcommunity.com/login/home/?goto=my/profile"))
{
Expand All @@ -298,10 +290,8 @@ private void wbAuth_Navigating(object sender, WebBrowserNavigatingEventArgs e)

private void tmrCheck_Tick(object sender, EventArgs e)
{
if (webBrowserAuthentication.Url.AbsoluteUri.StartsWith("https://steamcommunity.com/id/"))
if (webBrowserAuthentication.Url != null && webBrowserAuthentication.Url.AbsoluteUri.StartsWith("https://steamcommunity.com/id/"))
{
quickLoginBarVisibility(false);

if (webBrowserAuthentication.ReadyState.Equals(WebBrowserReadyState.Complete))
{
// The login is completed, and the profile is visible
Expand All @@ -325,14 +315,5 @@ private void stopTimerAndCloseForm()
timerCheck.Enabled = false;
Close();
}

private void buttonQuickLogin_Click(object sender, EventArgs e)
{
// Overwrite cookie functions to ignore the auto login cookie checks
webBrowserAuthentication.Document.InvokeScript("eval", new object[] { "function V_SetCookie() {} function V_GetCookie() {}" });
webBrowserAuthentication.Document.InvokeScript("LoginUsingSteamClient", new object[] { "https://steamcommunity.com/" });

buttonQuickLogin.Text = "Login script activated...";
}
}
}
Loading

0 comments on commit c9d195e

Please sign in to comment.