我正在尝试在打开https://steamcommunity.com/login/时自动登录。
使用 submit() 或 click() 会将我重定向到https://steamcommunity.com/login/#而不是登录。如果我删除 steamLoginForm.submit(); 并手动单击按钮即可工作;所以我假设我必须以不同的方式点击/提交。
// ==UserScript==
// @name SteamLogin
// @include https://steamcommunity.com/login/
// ==/UserScript==
var steamLoginForm = document.getElementById("loginForm");
steamLoginForm.elements.namedItem("steamPassword").setAttribute("autocomplete", "on");
steamLoginForm.elements.namedItem("remember_login").checked = true;
steamLoginForm.elements.namedItem("steamAccountName").value = "accountName";
steamLoginForm.submit();