Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Learn More

Website with silly login form confuses username completion

  • 2 απαντήσεις
  • 1 έχει αυτό το πρόβλημα
  • 9 προβολές
  • Τελευταία απάντηση από cor-el

more options

Hey!

The UK Met Office (UKMO) has a General Aviation (GA) service where they publish weather charts and such: https://www.metoffice.gov.uk/services/transport/aviation/regulated/aviation-briefing-service-guidance It's a free service, anyone can create an account.

The login page, however, has a slightly odd way of collecting the username and password: https://logon.metoffice.gov.uk/Login?goto=http://www.metoffice.gov.uk/premium/myservices/

On that page, there are two <form>s, each containing an <input> element, one for the username and one for the password. The login button is just some javascript which fills in a third, hidden form and POSTs it. Once I have logged in and Firefox has offered to save the password for me (I have to tell it my username because the forms confuse this step too), it never manages to complete both forms. It only autocompletes the password.

Is it possible for Firefox to learn how to cope with this form? I suspect convincing UKMO to fix their website is unlikely, and they're probably not the only offender...

Bruce

Hey! The UK Met Office (UKMO) has a General Aviation (GA) service where they publish weather charts and such: https://www.metoffice.gov.uk/services/transport/aviation/regulated/aviation-briefing-service-guidance It's a free service, anyone can create an account. The login page, however, has a slightly odd way of collecting the username and password: https://logon.metoffice.gov.uk/Login?goto=http://www.metoffice.gov.uk/premium/myservices/ On that page, there are two <form>s, each containing an <input> element, one for the username and one for the password. The login button is just some javascript which fills in a third, hidden form and POSTs it. Once I have logged in and Firefox has offered to save the password for me (I have to tell it my username because the forms confuse this step too), it never manages to complete both forms. It only autocompletes the password. Is it possible for Firefox to learn how to cope with this form? I suspect convincing UKMO to fix their website is unlikely, and they're probably not the only offender... Bruce

Επιλεγμένη λύση

I've edited the JavaScript in my above reply to make it more general where to inject the field.

  • document.querySelectorAll('form[onsubmit] input[type="text"]')[0].parentNode.appendChild(e);
Ανάγνωση απάντησης σε πλαίσιο 👍 0

Όλες οι απαντήσεις (2)

more options

A possible workaround is to add a hidden password field in the first form to make Firefox recognize it as a login form You can create a new bookmark and paste the JavaScript code in its Location field.

javascript:(function(){var e=document.createElement('input');e.hidden="true";e.type="password";document.querySelectorAll('form[onsubmit] input[type="text"]')[0].parentNode.appendChild(e);})()

The JavaScript code only copies the first element to the hidden Login form and ignores this extra input field, so there shouldn't be a problem.

  • frms = document.forms;i=1;frm=frms['frm' + i];frm.elements[0];

Τροποποιήθηκε στις από το χρήστη cor-el

more options

Επιλεγμένη λύση

I've edited the JavaScript in my above reply to make it more general where to inject the field.

  • document.querySelectorAll('form[onsubmit] input[type="text"]')[0].parentNode.appendChild(e);