On 7/17/11 3:58 PM, JD wrote:
> 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);
> }
> 

PrefBar 5.1.1 does work with SM 2.2 even though the Add-ons Manager says
it is not compatible.  If you do not yet have PrefBar installed, you
will need to open the downloaded XPI file with a ZIP application and
tweak the install.rdf file.  The necessary tweak has been discussed
repeatedly in this newsgroup.

Alternatively, you can wait for PrefBar 6.x.  I don't know what "x" will
be, but it should be available soon.

Once PrefBar is installed:

1.  Place your cursor over the PrefBar toolbar, right-click, and select
Customize PrefBar from the pull-down context menu.

2.  Place your cursor over the rightmost area under "Enabled Items",
right-click, and select [New > Button] from the pull-down list.

3.  On the Common tab of the New Item:Button window, put a unique
identifier in the ID area and a short label in the Label area (I used
Pwd).

4.  Select the onClick tab of the New Item:Button window and paste
Stamenkov's script in the large input area.

5.  Select the OK button on the New Item:Button window.

6.  Make sure the new "button" (actually a checkbox) is in the Enabled
Items list in the position you prefer.  It can be dragged and dropped
into a new position.  Then select the OK button on the
Preferences:Preferances Toolbar window.

-- 

David E. Ross
<http://www.rossde.com/>

On occasion, I might filter and ignore all newsgroup messages
posted through GoogleGroups via Google's G2/1.0 user agent
because of spam from that source.
_______________________________________________
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to