Skip to content

Commit

Permalink
Fixed login to work on current Steam login page
Browse files Browse the repository at this point in the history
  • Loading branch information
typekcz committed Feb 21, 2024
1 parent 0a79881 commit 53cb9b3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "beepboop",
"version": "2.1.2",
"version": "2.1.3",
"description": "",
"main": "index.js",
"type": "module",
Expand Down
19 changes: 10 additions & 9 deletions src/steam-api/steam-browser-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ import SteamBrowserGuiApi from "./steam-browser-gui-api.js";
import DealWithSteamGuard from "../deal-with-steam-guard.js";

const selectors = {
loginUsername: "[type=text].newlogindialog_TextInput_2eKVn",
loginPassword: "[type=password].newlogindialog_TextInput_2eKVn",
loginRememberMe: ".newlogindialog_Checkbox_3tTFg",
loginRememberMeCheck: ".newlogindialog_Check_6EoZE",
loginCaptcha: "#input_captcha",
// Steam login selectors:
loginUsername: "[data-featuretarget=login] input[type=text]",
loginPassword: "[data-featuretarget=login] input[type=password]",
loginRememberMe: "[data-featuretarget=login] div[tabindex]",
loginCaptcha: "#input_captcha", // Captcha selectors are probably wrong, haven't seen the captcha in a while...
loginCaptchaImg: "#captchaImg",
loginError: ".newlogindialog_FormError_1Mcy9",
loginButton: "[type=submit].newlogindialog_SubmitButton_2QgFE",
loading: ".WaitingForInterFaceReadyContainer",
steamGuardInput: ".segmentedinputs_SegmentedCharacterInput_3PDBF"
loginError: "[data-featuretarget=login] form > div:last-of-type:not(:first-of-type)",
loginButton: "[data-featuretarget=login] [type=submit]",
steamGuardInput: "[data-featuretarget=login] div:has(> input)",
// Steam Chat selectors:
loading: ".WaitingForInterFaceReadyContainer"
};

const steamChatUrl = "https://steamcommunity.com/chat";
Expand Down
4 changes: 2 additions & 2 deletions src/steam-api/steam-browser-gui-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const SteamBrowserGuiApi = {

rememberMe: (selectors) => {
let remember = document.querySelector(selectors.loginRememberMe);
if(!remember.querySelector(selectors.loginRememberMeCheck))
if(remember.childElementCount == 0)
remember.click();
},

Expand All @@ -15,7 +15,7 @@ const SteamBrowserGuiApi = {
let steamGuardCounter = 0;
let checkInt = setInterval(() => {
let errorMsg = document.querySelector(selectors.loginError);
if(errorMsg && !errorMsg.innerText.blank()){
if(errorMsg && errorMsg.childElementCount == 0 && !errorMsg.innerText.blank()){
console.error("Login error:", errorMsg.innerText);
clearInterval(checkInt);
reject(new Error("Login failed."));
Expand Down

0 comments on commit 53cb9b3

Please sign in to comment.