By Dan Moren
June 9, 2021 10:23 AM PT
WWDC 2021: iPhone and iPad support for Web Extensions could drive new interest
Web extensions got a big overhaul for the Mac last year, and though the uptake has not exactly been gangbusters, the potential for a bigger impact landed this year when Apple announced that they would be available on iPhone and iPad as well.
Why is that a big deal? Simple: Apple’s mobile devices are brand new territory for extension developers, and they’re a big wide open field. We’re talking about tens of millions of potential users who have simply not had access to this type of software on these devices.
One of the big advantages of web extensions is that they’re compatible across platforms. You can now, in theory, develop an extension for Google Chrome on Windows and convert it to one that can be used on the iPhone.
Apple’s trying to make this easy: they’ve updated their web extension converter, introduced last year to help developers port their existing extensions to the Mac, so that it automatically generates an iOS version as well. (You can also use it to update your existing Mac extension with iOS support.)
There are, of course, some limitations in designing an extension to work on Apple’s mobile devices. In particular, concerns about resources: many extensions use persistent background pages that keep scripts running whenever an extension is installed and activated, but those pages can chew up as much memory and power as an extra open tab. Instead, iOS/iPadOS extensions require non-persistent background pages that only get loaded when something triggers them.
But that does mean that developers who count on the existence of a background page to keep track of information will instead need to rely on other solutions, such as the browser storage API. There are a few other cases where certain APIs aren’t available, including ones that just behave differently on iOS/iPadOS from elsewhere (the Window API, for example, or mouse events like clicking). There are, as well, design considerations that must be taken into account when porting an extension to mobile devices—especially the iPhone, with its screen configuration. However, in one piece of good news, it does sound as though extensions will be allowed to offer keyboard shortcuts on mobile devices.
Unsurprisingly, privacy is a big focus of the way Apple deals with extensions. Extensions will have to request permission from the user before they’re activated on iOS, though Apple has some suggestions to ease this workflow, including limiting an extension to viewing the current active tab, where permission is implicitly granted by user action.
Beyond the addition to Apple’s mobile devices, Safari 15 also brings one other new major type of extension: the new tab override. This lets extensions create custom pages that appear when you open a new tab in Safari, letting users have even more control than Safari’s own Start Page. And those are available on both the Mac and iOS/iPadOS.
The barrier to entry still remains that creating an extension for Apple’s devices means you need to have a Mac that runs Xcode, which isn’t feasible for some developers. Moreover, extensions for iOS are, like the Mac, tied to apps, which means dealing with the App Store. For those developers used to the freedom of the web, that may be a hard sell, even considering the opportunities.
[Dan Moren is the East Coast Bureau Chief of Six Colors. You can find him on Twitter at @dmoren or reach him by email at email@example.com. His latest novel, The Aleph Extraction, is out now and available in fine book stores everywhere, so be sure to pick up a copy.]
If you appreciate articles like this one, support us by becoming a Six Colors subscriber. Subscribers get access to an exclusive podcast, members-only stories, and a special community.