[Ext] Opera Wand for Firefox - SecureLogin

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
User avatar
Benjamin Markson
Posts: 397
Joined: November 19th, 2011, 3:57 am
Location: en-GB

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by Benjamin Markson »

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.
XUL is dead. Long live the Google Chrome Clones.
efox99
Posts: 137
Joined: March 24th, 2011, 7:55 pm

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by efox99 »

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?
User avatar
Benjamin Markson
Posts: 397
Joined: November 19th, 2011, 3:57 am
Location: en-GB

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by Benjamin Markson »

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.
XUL is dead. Long live the Google Chrome Clones.
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by Philip Chee »

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: 137
Joined: March 24th, 2011, 7:55 pm

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by efox99 »

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
User avatar
Benjamin Markson
Posts: 397
Joined: November 19th, 2011, 3:57 am
Location: en-GB

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by Benjamin Markson »

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.
XUL is dead. Long live the Google Chrome Clones.
efox99
Posts: 137
Joined: March 24th, 2011, 7:55 pm

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by efox99 »

^
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

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by nomnomnom »

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

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by jeanjean8484 »

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

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by Concerned User »

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?"
User avatar
Str0ngwun
Posts: 222
Joined: January 29th, 2011, 9:50 am

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by Str0ngwun »

Did anyone try Secure Login Rebooted?
User avatar
George Yves
Posts: 100
Joined: July 9th, 2009, 1:41 am

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by George Yves »

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: 137
Joined: March 24th, 2011, 7:55 pm

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by efox99 »

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

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by ybbao »

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

Re: [Ext] Opera Wand for Firefox - SecureLogin

Post by Isidan »

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! :)
Post Reply