[Project_owners] getElementsByTagName() problem

Eric H. Jung grimholtz at yahoo.com
Tue Apr 11 14:32:16 EDT 2006


Hi,

The following code, which build an array of all <input/> elements on a page,
works at every website I've tried except
https://banking.ing-diba.de/OnlineBanking/index.html.

Would someone be able to have a look? I cannot figure out why.

Context is browser.xul scope with
https://banking.ing-diba.de/OnlineBanking/index.html loaded:

var recentWindow = Components.classes["@mozilla.org/appshell/window-mediator;1"]
  .getService(Components.interfaces.nsIWindowMediator)
  .getMostRecentWindow("navigator:browser");

if (recentWindow) {
  doc = recentWindow.content.document;
  // Build an array of all <input/> elements
  // in the doc (including frames)
  var inputFields = new Array();

  // Check doc
  var fields = doc.getElementsByTagName("input");
  for (var i=0; i<fields.length; i++)
    inputFields.push(fields[i]);
      
  // Check frames
  var frames = doc.getElementsByTagName("frame");
  for (var i=0; i<frames.length; i++) {
    fields = frames[i].contentDocument.getElementsByTagName("input");
    for (var j=0; j<fields.length; j++)
      inputFields.push(fields[j]);
  }
  
  // Check iframes
  var frames = doc.getElementsByTagName("iframe");
  for (var i=0; i<frames.length; i++) {
    fields = frames[i].contentDocument.getElementsByTagName("input");
    for (var j=0; j<fields.length; j++)
      inputFields.push(fields[j]);
  }

Thank you in advance for your time,
Eric Jung

Use Your PC To Find a Cure for Cancerhttp://members.ud.com/services/teams/team.htm?id=68C9E079-8285-495F-8598-D73352CC7075And Join Team Lulu


More information about the Project_owners mailing list