Chrome extension asks to save password every time the Enter key is pressed

I'm working on a questionnaire-type form where one of the steps asks for an email and password as registration data. I have an event handler on the keydown event within text inputs so that pressing the Enter key advances to the next step rather than submitting the entire form. The problem is that every time the Enter key is pressed within this form, the 1Password Chrome extension asks if I want to save the login. There are 6 steps after the registration step, so I get that window 6 times before I'm actually ready to submit the form. I've tried return false/preventDefault/stopPropagation and none of those have stopped the window from coming up.

After my research this morning it seems that the 1Password extension is recognizing part of this form is collecting registration data, and that it's the Enter keydown event, not the form submit event, that triggers the pop-up window. Is there a way to override that event or stop it from triggering? I've done a ton of debugging and have tried several different ways of stopping the extension from thinking the form is submitting, so let me know if there's any additional info I can provide.


1Password Version: 6.7
Extension Version: 4.6.5.90
OS Version: macOS 10.12.5
Sync Type: Not Provided
Referrer: forum-search:chrome extension "keydown"

Comments

  • matthew_agmatthew_ag 1Password Alumni

    Hey @danphilibin,

    Thank you for taking the time to contact us, we always appreciate developers reaching out to us to try and get 1Password to work better with their website. :) Hopefully I'll be able to help.

    Sorry about 1Password popping up here at an inopportune times during this registration form. The 1Password extension is indeed listening for keydown and submit events. We found that we couldn't rely only on submit events because some web pages transmit form data using Ajax which wouldn't trigger the submit event. Also relying on the keydown to detect an "Enter" keypress was an approach we found to be more reliable.

    You can programmatically disable the Autosave feature of 1Password by adding a special meta tag to your web page. Then when you are sure you are on the final part of the form then remove the meta tag to re-enable 1Password's Autosave.

    The meta tag to disable Autosave is the following:

    <meta name="com.agilebits.onepassword.autosave" content="no">

    Removing this tag or changing the content attribute to something other than no will re-enable Autosave. I hope this is a workable solution for you? Please let us know if it is and how you get on.

    I'm curious how your registration page is working, from my experience the "Enter" key isn't used to move between fields but perhaps you're using some kind of JavaScript based pagination system to move between each stage of the form?

    Looking forward to hearing how things go.

    Matthew

  • Aha! That did it. Might be a good addition to this page :)https://support.1password.com/compatible-website-design/

    And yes, it's essentially a paginated form, where the Enter button should move on to the next section rather than submit the form—sort of like a http://typeform.com, but for registration.

    Thanks for your help!

  • matthew_agmatthew_ag 1Password Alumni
    edited May 2017

    You're very welcome @danphilibin!

    Adding it to our developers web page is a great idea! :chuffed::+1:

    I'm glad that helps - if you ever need anything else, please don't hesitate to write again. We're always here to help.

    Best regards,
    Matthew

    ref: akb-710

This discussion has been closed.