Allow Browser To Save Outlook Web Access Password

By ulrich Last update May 12, 2010 — Installed 1,155 times.

There are 4 previous versions of this script.

// ==UserScript==
// @name           Allow Browser To Save Outlook Web Access Password
// @namespace      http://userscripts.org/users/79816
// @description    Disables the "autocomplete=off" attribute of the logon form to allow the browser to store the logon credentials
// @version        1.0.4
// @copyright      2010, ulrichb
// @include        http://*/CookieAuth.dll?GetLogon?*
// @include        https://*/CookieAuth.dll?GetLogon?*
// @include        http://*/exchweb/bin/auth/owalogon.asp*
// @include        https://*/exchweb/bin/auth/owalogon.asp*
// @include        http://*/owa/auth/logon.aspx*
// @include        https://*/owa/auth/logon.aspx*
// ==/UserScript==

  function selectNodes(contextNode, xpathExpression) {
    var nodes = document.evaluate(xpathExpression, contextNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
    var nodeArray = new Array(nodes.snapshotLength);

    for (var i = 0; i < nodeArray.length; i++)
      nodeArray[i] = nodes.snapshotItem(i);

    return nodeArray;
  }

  var logonFormElements = selectNodes(document, "//form[(@autocomplete = 'OFF') or (@autocomplete = 'off')]");

  for (var i in logonFormElements) {
    //console.log('logonFormElements[' + i + '].id: "' + logonFormElements[i].id + '"')
    logonFormElements[0].setAttribute("autocomplete", "on");
  }

  var logonFormElements = selectNodes(document, "//input[(@autocomplete = 'OFF') or (@autocomplete = 'off')]");

  for (var i in logonFormElements) {
    //console.log('logonFormElements[' + i + '].id: "' + logonFormElements[i].id + '"')
    logonFormElements[0].setAttribute("autocomplete", "on");
  }