MozillaZine

[Ext] Opera Wand for Firefox - SecureLogin

Announce and Discuss the Latest Theme and Extension Releases.
Benjamin Markson

User avatar
 
Posts: 298
Joined: November 19th, 2011, 3:57 am
Location: en-GB

Post Posted September 4th, 2012, 1:37 pm

efox99 wrote:
Sativarg wrote:Some thing has changed with Firefox 15.0 that is effecting login at https://mail.google.com/mail/ The username field will not highlight and is not filled when using the Secure Login 0.9.9

I decided to revert back to Firefox 14...and I still get the same problem. Could it be that google/gmail changed something?

Yup, I've also noticed this new behaviour on the Google login page...

This is just a guess but I think that Google have changed from using an input type of 'text' on the username field, to an input type of 'email':

<div class="email-div">
<label for="Email"><strong class="email-label">Username</strong></label>
<input type="email" spellcheck="false" name="Email" id="Email" value="">
</div>

<div class="passwd-div">
<label for="Passwd"><strong class="passwd-label">Password</strong></label>
<input type="password" name="Passwd" id="Passwd">
</div>

Looking at secureLogin.js I'd say it's expecting 'text' on a username field:
Code: Select all
if(elements[i].type == 'text') {
   // input of type "text" found, this is no password only form:
   inputTextFound = true;
   
   // We do not get a loginUsernameFieldName from Firefox 3:
   if(!loginUsernameFieldName) {
      // Assume the first text field followed by a password field is the username field
      // Use another loop to skip non-text fields (e.g. checkboxes) between:
      for(var j = i+1; j < elements.length; j++) {
if(elements[j].type == 'password') {
   // Following password field found so the username field might be valid:
   usernameField = elements[i];
   break;
}
if(elements[j].type == 'text') {
   // Another textfield found, this might be the username field, so break out of the loop:
   break;
}
      }
   } else {
      if(elements[i].name == loginUsernameFieldName) {
         usernameField = elements[i];
      }
   }
}

Maybe secureLogin could check for: elements[i].type == 'text' || elements[i].type == 'email' ...just to accommodate Google ](*,)

Ben.

efox99
 
Posts: 81
Joined: March 24th, 2011, 7:55 pm

Post Posted September 5th, 2012, 2:58 pm

Benjamin Markson wrote:Maybe secureLogin could check for: elements[i].type == 'text' || elements[i].type == 'email' ...just to accommodate Google ](*,)

Ben.


Will altering the js file work?

Benjamin Markson

User avatar
 
Posts: 298
Joined: November 19th, 2011, 3:57 am
Location: en-GB

Post Posted September 6th, 2012, 10:14 am

efox99 wrote:Will altering the js file work?

Bearing in mind that this is not my extension...

Changing line 829 in secureLogin.js from:
Code: Select all
if(elements[i].type == 'text') {

...to:
Code: Select all
if(elements[i].type == 'text' || elements[i].type == 'email') {

And, following line 1542, adding this code in secureLogin.js [in fact a copy of lines 1532-1542 but for 'email']:
Code: Select all
case 'email':
    if(!usernameField || elements[i].name != usernameField.name) {
        addToDataString(elements[i].name, elements[i].value);
    } else {
        // This is the userName field - use the saved username as value:
        addToDataString(
            usernameField.name,
            this.getUsernameFromLoginObject(this.secureLogins[selectedIndex])
        );
    }
    break;

...does, indeed, cure the Google Login Page problem.

However, I would only advise this fix for those who are very confident about manipulating the secureLogin@blueimp.net.xpi file in their extensions folder. I also offer no warranty that this won't break some other web site's login page - although forums.mozillazine.org still works. :mrgreen:

Any future update to secureLogin will undo any manual changes you perform.

Anyway, I think we can conclude that Google have decided that their user names are of type 'email', rather than 'text'. Clearly they are hoping to establish a standard that no one else uses. #-o

Ben.

Philip Chee

User avatar
 
Posts: 6475
Joined: March 1st, 2005, 3:03 pm

Post Posted September 6th, 2012, 10:46 am

Benjamin Markson wrote:Changing line 829 in secureLogin.js from:
Code: Select all
if(elements[i].type == 'text') {

...to:
Code: Select all
if(elements[i].type == 'text' || elements[i].type == 'email') {

Code: Select all
if (/(^text|^email)/i.test(elements[i].type)) {

Benjamin Markson wrote:And, following line 1542, adding this code in secureLogin.js [in fact a copy of lines 1532-1542 but for 'email']:
Code: Select all
case 'email':
    if(!usernameField || elements[i].name != usernameField.name) {
        addToDataString(elements[i].name, elements[i].value);
    } else {
        // This is the userName field - use the saved username as value:
        addToDataString(
            usernameField.name,
            this.getUsernameFromLoginObject(this.secureLogins[selectedIndex])
        );
    }
    break;

...does, indeed, cure the Google Login Page problem.

You don't have to duplicate the whole section. Instead you can use the fact that the switch statement falls through:
Code: Select all
case 'text':
case 'email':
    if(!usernameField || elements[i].name != usernameField.name) {
        addToDataString(elements[i].name, elements[i].value);
    } else {
        // This is the userName field - use the saved username as value:
        addToDataString(
            usernameField.name,
            this.getUsernameFromLoginObject(this.secureLogins[selectedIndex])
        );
    }
    break;

Phil

efox99
 
Posts: 81
Joined: March 24th, 2011, 7:55 pm

Post Posted September 6th, 2012, 2:14 pm

Is there an easy way that I can edit that file? I have winrar but it doesn't let me edit the js file only view it.

What would be the easiest way and also show me the line numbers so I can easily edit.

Edit: I installed 7-zip...it allows me to edit...but the code looks all broken up squares, dots etc

Benjamin Markson

User avatar
 
Posts: 298
Joined: November 19th, 2011, 3:57 am
Location: en-GB

Post Posted September 6th, 2012, 3:54 pm

efox99 wrote:Is there an easy way that I can edit that file? I have winrar but it doesn't let me edit the js file only view it.

What would be the easiest way and also show me the line numbers so I can easily edit.

Edit: I installed 7-zip...it allows me to edit...but the code looks all broken up squares, dots etc

This is the kind of thing you can use for editing: http://www.pnotepad.org ...it supports all those weird line endings, plus you can toggle (#) line numbers, plus it will properly highlight javascript code (and many other languages), plus... you get the idea. :)

Dunno that you really need 7-zip. I just rename the .xpi to .zip, open the zip (just double click - windows always supports .zip, right?), drag out the js file, edit it, drag it back (replacing the original), and then rename back to .xpi, oh, and before I do anything I make a copy of the xpi as a back up.

Ben.

efox99
 
Posts: 81
Joined: March 24th, 2011, 7:55 pm

Post Posted September 6th, 2012, 5:47 pm

^
Thanks! I managed to edit the file with that cool little program you posted...but unfortunately it won't allow me to replace the file. I get an error ("Cannot create output file"). When I drag the js file back it won't replace it.

Been going at it for 1hr and no success trying to make this work.

Edit: Just when I was about to give up I suddenly had an idea. Remove secure login. Download secure login into my downloads folder then alter the js file, then drag it into firefox add on page. It worked! =D> It allowed me to edit the js file that way.

Benjamin Markson & Philip Chee thank you very much! Now it works for amazon and gmail! :D

nomnomnom
 
Posts: 4
Joined: March 24th, 2009, 6:34 pm

Post Posted September 8th, 2012, 2:31 pm

Fantastic! Philip Chee's two small edits fixed both Google mail and Live mail! Thanks guys.
If anyone wants a copy, temporary download here.
If replacing the file then remember to close Firefox first, otherwise download and install as normal.
(efox99, that goes for you - close Firefox first before editing the file!)

BTW, has anyone heard from Sebastian Tschan (the addon developer) about future fixes/updates?

jeanjean8484
 
Posts: 1
Joined: September 2nd, 2012, 12:10 pm

Post Posted September 8th, 2012, 2:43 pm

Thank you! :D Great! :D It is working again on Google! :D :D :D
I second nomnomnom: please do contact Sebastian Tschan (the addon developer) and keep him posted!
Thanks again! Bye!

Concerned User
 
Posts: 11
Joined: April 6th, 2010, 1:33 pm

Post Posted September 9th, 2012, 1:16 am

Working great! Thanks for the code changes, Benjamin Markson & Philip Che! :)

@ nomnomnom: Just checked your download..works fine! I'm sure non-techie users and others will appreciate your efforts ;)...Maybe you should just go ahead and post this in the Mozilla addons page as a modded version of some sort?"

Str0ngwun

User avatar
 
Posts: 222
Joined: January 29th, 2011, 9:50 am

Post Posted September 9th, 2012, 3:37 am

Did anyone try Secure Login Rebooted?

George Yves

User avatar
 
Posts: 100
Joined: July 9th, 2009, 1:41 am

Post Posted September 9th, 2012, 5:46 am

Philip Chee wrote:
Benjamin Markson wrote:Changing line 829 in secureLogin.js from:
Code: Select all
if(elements[i].type == 'text') {

...to:
Code: Select all
if(elements[i].type == 'text' || elements[i].type == 'email') {

Code: Select all
if (/(^text|^email)/i.test(elements[i].type)) {

Benjamin Markson wrote:And, following line 1542, adding this code in secureLogin.js [in fact a copy of lines 1532-1542 but for 'email']:
Code: Select all
case 'email':
    if(!usernameField || elements[i].name != usernameField.name) {
        addToDataString(elements[i].name, elements[i].value);
    } else {
        // This is the userName field - use the saved username as value:
        addToDataString(
            usernameField.name,
            this.getUsernameFromLoginObject(this.secureLogins[selectedIndex])
        );
    }
    break;

...does, indeed, cure the Google Login Page problem.

You don't have to duplicate the whole section. Instead you can use the fact that the switch statement falls through:
Code: Select all
case 'text':
case 'email':
    if(!usernameField || elements[i].name != usernameField.name) {
        addToDataString(elements[i].name, elements[i].value);
    } else {
        // This is the userName field - use the saved username as value:
        addToDataString(
            usernameField.name,
            this.getUsernameFromLoginObject(this.secureLogins[selectedIndex])
        );
    }
    break;

Phil

The fix works, thank you. But I can't understand why the author doesn't do it himself. It is not a hard work for an experienced user and developer.
May the FOSS be with you!

efox99
 
Posts: 81
Joined: March 24th, 2011, 7:55 pm

Post Posted September 9th, 2012, 3:19 pm

nomnomnom wrote:(efox99, that goes for you - close Firefox first before editing the file!)


I wish I knew that before and I could have saved myself a wasted 2hrs lol


Str0ngwun wrote:Did anyone try Secure Login Rebooted?


Can you elaborate on what this is? Is it a new extension? Also has this been around for people to know about? I never heard of it. Is it safe to try out?

George Yves wrote:The fix works, thank you. But I can't understand why the author doesn't do it himself. It is not a hard work for an experienced user and developer.


It's such a shame he abandoned this great extension. :( Maybe his personal life and other projects are more important than to put energy into this add on. Maybe he is tired of updating it since Fire Fox updates continue breaking add ons.

ybbao
 
Posts: 13
Joined: August 23rd, 2010, 2:38 am

Post Posted September 11th, 2012, 5:16 am

SecureLogin in the the night version 18a1 inside lapsed, not automatically fill in the appropriate rules.Hope with modify.

Isidan
 
Posts: 1
Joined: September 12th, 2012, 12:47 am

Post Posted September 12th, 2012, 12:52 am

Can anyone, please, post more detailed instructions on how to alter this code (for those who aren't advanced users). 8-)

Thank you so much! :)

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 2 guests