在我们的员工休息室中,我安装了带大电视的PC,以显示我们的公司公告。这些通知发布在总部的外部SharePoint页面上,并在Firefox(v33.0.3)的休息室中显示。我已将PC设置为每天早上启动并启动Firefox,但是SharePoint页面需要身份验证,因此我必须手动登录:
我还使用ReloadEvery每5分钟重新加载一次页面以显示任何新内容,但该会话仅持续约30分钟,并且需要重新登录。
我想使它自动化,所以每次Firefox遇到此页面时,它都会自动填充登录ID和密码并提交。
回答类似问题的建议是使用“自动填充表单”加载项,但该页面加载时既不会填充也不提交用户名/密码。我仍然必须单击自动填充按钮,然后单击提交。功能列表还说它可以自动提交表单,但我找不到任何地方可以启用此功能。
如果右键单击并选择“显示表单详细信息”,则会看到以下内容:
页面源代码:
<!DOCTYPE html>
<!-- template name: html.form.login.template.html -->
<html lang="en" dir="ltr">
<head>
<script type="text/javascript">
function postOk()
{
document.forms[0]['pf.ok'].value = 'Login';
document.forms[0].submit();
}
function postOnReturn(e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13)
{
document.forms[0].submit();
return false;
}
else
return true;
}
function setFocus()
{
var platform = navigator.platform;
if(platform != null && platform.indexOf("iPhone") == -1)
{
document.getElementById('username').focus();
}
}
</script>
<base href="https://our.company.web.address.com/"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="minimum-scale=0.1, maximum-scale=2.0, user- scalable=1"/>
<title>Our Company Name</title>
<link rel="stylesheet" media="all" type="text/css" href="assets/css/screen.1.css"/>
<link rel="shortcut icon" href="assets/images/favicon.ico" />
</head>
<body onload="setFocus()">
<div class="ping-container">
<div class="ping-header">
<div class="ping-header-bg">
<div class="COMPANY-name"><a href="http://our.company.web.address.com/"><img src="assets/images/agencyname.png" alt="Our motto"></a></div>
</div>
</div><!-- .ping-header -->
<div class="ping-body-container" >
<div id="content-left">
</div>
<div class="ping-body">
<div style="display:none">html.form.login.template.info.4 $escape.escape($spEntityId)</div>
<form method="POST" action="/idp/7krkY/resumeSAML20/idp/SSO.ping" autocomplete="off">
<div style="padding: 0px 5px 14px; font-size: 110%">
</div>
<div style="margin-bottom: 12px; font-size: 84%; font-weight: bold;"><span>Logon ID</span>
<input id="username" type="text" size="36" name="pf.username" value="" autocorrect="off" autocapitalize="off" onKeyPress="return postOnReturn(event)" /><!----> </div>
<div style="font-size: 84%; font-weight: bold;"><span>Password</span>
<input id="password" type="password" size="36" name="pf.pass" onKeyPress="return postOnReturn(event)" autocomplete="off"/></div>
<div class="ping-buttons">
<input type="button" name="pf.ok" onclick="postOk();" value="Login"/>
</div><!-- .ping-buttons -->
</form>
</div><!-- .ping-body -->
<div id="logonHelp">
<h4>
Our Company Name
</h4>
<p>
The section of the website you are trying to access requires a
Logon ID and password.
</p>
<p>
If you have forgotten your Logon ID and/or password please
contact {redacted phone number}
</p>
</div>
</div><!-- .ping-body-container -->
<div class="ping-footer-container">
<div class="ping-footer">
<p><a href="http://our.company.web.address.com/home/copyr.html">Copyright</a>
| <a href="http://our.company.web.address.com/home/copyr.html#disclaimer">Disclaimer</a>
| <a href="http://our.company.web.address.com/home/privacy.html">Privacy</a>
| <a href="http://our.company.web.address.com/about/access/keys.html" accesskey="0">Access keys</a>
| <a href="http://our.company.web.address.com/other_languages/index.html"><img src="assets/images/icon-
flags.gif" alt="">Other languages</a></p>
<p></p>
<p></p>
</div><!-- .ping-footer -->
</div><!-- .ping-footer-container -->
</div><!-- .ping-container -->
</body>
</html>
我无权访问SharePoint系统。
如何使Firefox自动填写此用户名/密码表格并提交?
如果您熟悉JS,建议您编写一个用户脚本来执行此操作。
—
DragoonHP 2014年