Open-and-Fill with Safari 11.1

Options
littlebobbytables
littlebobbytables
1Password Alumni
edited June 2018 in 1Password in the Browser

There has been a change in Safari's behaviour and it is observable when invoking 1Password's open-and-fill and using the submit after filling feature.

1Password's submit works by the extension leaving focus on the password field and letting 1Password ask the operating system to react as if the user has pressed the enter key. For the vast majority of sites pressing enter after typing your password submits the form and we make use of this due to its reliability. There are times where 1Password cannot leave focus on the password field though so we have checks in place. If the browser tells us focus is not on the password field we don't try to submit, even if the feature is enabled.

So what does this have to do with Safari? Prior to Safari 11.1, Safari would place focus on the password field when the extension asked and all was fine. As of Safari 11.1 though, if focus starts off in the address bar, which is where focus is for many of the options for a new tab or window, focus remains there even if the extension asks for focus to be placed on the password field. It also turns out that the check we use, which works elsewhere, doesn't behave the same in Safari. The combination of these two means the extension erroneously believes focus is on the password field and asks 1Password to simulate the user pressing enter. Focus is on the address bar though and what does pressing enter in the address bar do? it loads the page. So open-and-fill with submit turns into open-and-fill and reload the page which clears all the filled fields.

There are a few ways to workaround this behaviour while we try to think of what might help.

  1. Before initiating open-and-fill in a new tab or window, click anywhere so that focus is moved off of the address bar. As long as focus is not in the address bar the extension can ensure focus is on the password field and submit then works normally.
  2. Invoke open-and-fill from an existing tab. If you ask 1Password to use a Login item that does not match the current page the default behaviour is to open a new tab and perform open-and-fill in it. When the extension creates a new tab Safari doesn't place focus on the address bar. As a result, the extension can ensure focus is on the password field and submit then works normally.
  3. Setup 1Password to open logins in a new window instead:

Neither is ideal but they will accommodate the new behaviour in Safari 11.1.

This discussion has been closed.