Implementation of iOS 1Password extension for Safari?

TooSlimSam
TooSlimSam
Community Member

Can anyone point me to a writeup that outlines how the iOS 1Password extension for Safari was implemented? It appears that, in spite of superficial similarities, behind the scenes it works much differently than the corresponding extension on MacOS. (Please correct me if I'm wrong.) I'm particularly interested in what challenges iOS presents, and what design changes or tradeoffs might have been necessary.


1Password Version: 7.9.2
Extension Version: 7.9.2
OS Version: iOS 15.1

Comments

  • ag_jarek
    ag_jarek
    1Password Alumni

    Hello @TooSlimSam! I was part of the team that worked hard to get 1Password for Safari ready to go in time for iOS 15 launch day. I'd be more than happy to fill you in on some details about what that entailed :smile:

    When you say it works differently than the corresponding extension on macOS, it depends on which extension you have in mind when you make that comment. Before Safari on macOS supported web extensions, Apple developed an extension system referred to as Safari App Extension (SAE), and we shipped such an extension for Safari with the 1Password 7 desktop app on macOS. Once Apple introduced web extension support for Safari, however, we were able to release our 1Password in your Browser web extension on the app store as 1Password in Safari. This extension and the extension shipped for 1Password in Safari on iOS share a common codebase (with platform-specific adjustments as required). The codebase is also shared with our browser extension on other platforms and is a very different architecture from SAE. The one major difference between the extension on iOS and macOS is that on macOS the Rust code in our web extension runs in a native binary while on iOS it runs in the browser as WASM).

    There were a number of platform-specific challenges that we faced in prepping 1Password in Safari on iOS for launch day.

    • Our browser extension's UI hadn't needed to function in a mobile device form factor up to this point. We had to revamp the entire surface area of the extension to support mobile screens, including the pop-up and all in-page content. Performing this overhaul saw us adopt a number of components from a common UI system that we share with the 1Password for Mac 8 Beta client, as well as building some new ones specific to the web extension itself.
    • We rely on a small native process written in Swift to handle unlocking 1Password accounts using data shared with the 1Password iOS app. A decent amount of time had to be allocated here to keep that code implementation as slim as possible as iOS 15 shipped with a 6 MB RAM limit for this native process (which has since been raised to 80 MB in iOS 15.1. Thanks Apple!)
    • The 1Password browser extension relies on a traditional persistent background page model (where the extension's background page starts up once and is loaded in memory throughout the lifetime of the browser). Web extensions on iOS, however, do not enjoy access to such a persistent background page. Therefore, a good deal of time was spent tracking down and working on specific areas that could improve performance when needing to have access to the background page to perform a task. A major goal of ours for next year is a larger re-architecture of the extension to provide even better support for the non-persistent background page model as other browsers are starting to adopt it as well.
    • Some time had to be spent working around platform limitations. For example, web extensions on iOS have no way to trigger notifications, download files, or directly deep-link into their associated iOS app. (We worked around the latter point with links that require a confirmation prompt in Safari prior to the system navigating to the native app). Additionally, web extensions currently do not have access to biometrics in the same way that normal apps do, so we had to find a workaround there (which ended up involving the webauthn API within the browser itself). We would be thrilled to see web extensions gain access to native biometry capabilities on iOS in the future!

    I hope you found that information helpful :chuffed:. It was a super fun project to work on, even with the tight deadline between WWDC and the iOS 15 launch, and I think we were able to ship something super exciting for the 1Password community to use on launch day. There's definitely a lot more to come in the future, though!

  • This content has been removed.
This discussion has been closed.