David E. Ross wrote:
On 7/17/11 2:12 PM, JD wrote:
Stanimir Stamenkov wrote:
Sun, 17 Jul 2011 20:58:16 +0300, /Stanimir Stamenkov/:

Now I've created and placed a custom button on my toolbar with the
following code to execute:

let lm = Components.classes["@mozilla.org/login-manager;1"]
.getService(Components.interfaces.nsILoginManager);
let forms = content.document.forms;
for (let i = 0; i<  forms.length; i++) {
lm.fillForm(forms[i]);
}

Here's already revised code to handle forms found in frames, additionally:

let lm = Components.classes["@mozilla.org/login-manager;1"]
.getService(Components.interfaces.nsILoginManager);

function fillForms(doc) {
let forms = doc.forms;
for (let i = 0; i<  forms.length; i++) {
lm.fillForm(forms[i]);
}
}

fillForms(content.document);

let frames = content.frames;
for (let i = 0; i<  frames.length; i++) {
fillForms(frames[i].document);
}


Do I used both the above or just the last one?

And I need the custom buttons extension?


I just implemented Stanimir Stamenkov's script.  I used only the portion
that appeared in his second message and was not quoted.  Instead of
using the Custom Buttons extension (which I do not have installed), I
created a PrefBar button because I already have PrefBar installed.

The script works quite well.  When I encounter a split login -- user ID
on one page and password on a subsequent page -- Password Manager would
request my master password but would not insert my password into the
input area.  When I encounter that situation, I now merely select the
button from PrefBar's tool bar.  My password is then inserted.


How do I create a PrefBar button?

Here is the last script he posted:

let lm = Components.classes["@mozilla.org/login-manager;1"]
         .getService(Components.interfaces.nsILoginManager);

function fillForms(doc) {
  let forms = doc.forms;
  for (let i = 0; i < forms.length; i++) {
    lm.fillForm(forms[i]);
  }
}

fillForms(content.document);

let frames = content.frames;
for (let i = 0; i < frames.length; i++) {
  fillForms(frames[i].document);
}

--
 JD..
_______________________________________________
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to