Reading List
The most recent articles from a list of feeds I subscribe to.
The Core Web Platform Loop
Joining a new team has surfaced just how much I've relied on a few lenses to explain the incredible opportunities and challenges of platform work. This post is the second in an emergent series towards a broader model for organisational and manager maturity in platform work, the first being last year's Platform Adjacency Theory. That article sets out a temporal model that focuses on trust in platforms. That trust has a few dimensions:
- Trust in reach. Does the platform deliver access to the users an app or service caters to? Will reach continue to expand at the rate computing does?
- Trust in capabilities. Can the platform enable the core use-cases of most apps in a category?
- Trust in governance. Often phrased as fear of lock-in, the goal of governance is to marry stability in the tax rate of a platform with API stability and reach.1
These traits are primarily developer-facing for a simple reason: while the products that bring platforms to market have features and benefits, the real draw comes from safely facilitating trade on a scale the platform vendor can't possibly bootstrap on their own.
Search engines, for example, can't afford to fund producing even a tiny sliver of the content they index. As platforms, they have to facilitate interactions between consumers and producers outside their walls — and continue to do so on reasonably non-extractive terms.
Thinking about OSes and browsers gives us the same essential flavour: to make a larger market for the underlying product (some OS, browsers in general), the platform facilitates a vast range of apps and services by maximising developer reach from a single codebase at a low incremental cost. Those services and apps convince users to obtain the underlying products. This is the core loop at the heart of software platforms:

Cycles around the loop take time, and the momentum added or lost in one turn of the loop creates or destroys opportunity for the whole ecosystem at each successive step. Ecosystems are complex systems and grow and shrink through multi-party interplay.
Making progress through intertemporal effects is maddening to product-focused managers who are used to direct build ⇒ launch ⇒ iterate cycles. They treat ecosystems as static and immutable because, on the timescales they operate, that is apparently true. The lens of Pace Layering reveals the disconnect:

Products that include platforms iterate their product features on the commerce or fashion timescale, while platform work is the slower, higher-leverage movement of infrastructure and governance. Features added in a release for end-users have impact in the short run, while features added for developers may add cumulative momentum to the flywheel many releases later as developers pick up the new features and build new types of apps that, in turn, attract new users.
This creates a predictable bias in managers towards product-only work. Iterating on features around an ecosystem becomes favoured, even when changing the game (rather than learning to play it incrementally better) would best serve their interests. In extreme versions, product-only work leads to strip-mining ecosystems for short-term product advantage, undermining long-term prospects. Late-stage capitalism loves this sort of play.
The second common bias is viewing ecosystems that can't be fully mediated as somebody else's problem or as immovable. Collective action problems in open ecosystem management are abundant. Managers without much experience or comfort in complex spaces tend to lean on learned helplessness about platform evolution. "Standards are slow" and "we need to meet developers where they are" are the reasonable-sounding refrains of folks who misunderstand their jobs as platform maintainers to be about opportunities one can unlock in a single annual OKR cycle. The upside for organisations willing to be patient and intentional is that nearly all your competitors will mess this up.
Failure to manage platform work at the appropriate time-scale is so ingrained that savvy platform managers can telegraph their strategies, safe in the knowledge they'll look like mad people.
One might as well be playing cricket in an American park; the actions will look familiar to passers-by, but the long game will remain opaque. They won't be looking hard enough, long enough to discern how to play — let alone win.
Successful platforms can extract unreasonably high taxes in many ways, but they all feature the same mechanism: using a developer's investments in one moment to extract higher rents later. A few examples:
- IP licensing fees that escalate, either over time or with scale.
- Platform controls put in place for safety or other benefits re-purposed for rent extraction (e.g. payment system taxes, pay-for-ranking in directories, etc.).
- Use of leverage to prevent suppliers from facilitating platform competitors in equal terms.
Platforms are also in competition over these taxes. One of the web's best properties is that, through a complex arrangement of open IP licensing and broad distribution, it exerts significantly lower taxes on developers in a structural way (ceteris peribus). ⇐
Hobson's Browser
Update: This post was turned into a talk for State of The Browser in October 2021; you can watch the recording here.
Update, The Second: Welp, I was wrong. I assumed that Facebook PMs and engineers were smart. Of course they were going to get found out modifying content via In-App Browsers, just as this post warned they could. It's long past time for Google and Apple to act to curb this abuse via App Store policy, and regulators interested in gatekeeper shenanigans should take notice.
The post has also been updated for readability and to more clearly outline the previously-embedded per-page opt-out proposal.
At first glance, the market for mobile browsers looks roughly functional. The 85% global-share OS (Android) has historically facilitated browser choice and diversity in browser engines. Engine diversity is essential, as it is the mechanism that causes competition to deliver better performance, capability, privacy, security, and user controls. More on that when we get to iOS.
Tech pundits and policymakers are generally older and wealthier than the median user and likely formed expectations of browsers on the desktop. They may, therefore, tend to think about mobile browser competition through the lends of desktop browsing. To recap:
- Users can freely choose desktop browsers with differing UIs, search engines, privacy features, security properties, and underlying engines.
- Browsers update quickly, either through integrated auto-update mechanisms or via fast OS updates (e.g., ChromeOS).
- Browsers bundled with desktop OSes represent the minority of browser usage, indicating a healthy market for replacements.
- Popular native apps usually open links in users' chosen browsers and don't undermine the default behaviour of link clicks.1
Each point highlights a different aspect of ecosystem health. Together, these properties show how functioning markets work: clear and meaningful user choice creates competitive pressure that improves products over time. Users select higher quality products in the dimensions they care about most, driving progress.
The mobile ecosystem appears to retain these properties, but the resemblance is only skin deep. Understanding how mobile OSes undermine browser choice requires an understanding of OS and browser technology. It's no wonder that few commenters are connecting the dots.2
How bad is the situation? It may surprise you to learn that until late last year only Safari could be default browser on iOS. It may further disorient to know that competitors are still prevented from using their own browser engines.
Meanwhile, the #2 and #3 sources of web traffic on Android — Google's search box and Facebook's native apps — do not respect browser choice. Users can have any browser with any engine they like, but it's unlikely to be used. The Play Store is little more than a Potemkin Village of browser choice; a vibrant facade to hide the rot.
Registering to handle link taps is only half the battle. For a browser to be the user's agent, it must also receive navigations. Google's Search App and Facebook's apps undermine these choices in slightly different ways.3 This defangs the privacy and security choices made through browsers. Developers suffer higher costs when they cannot escape Google, Facebook, and Apple's walled gardens or effectively reach users through the web.
Web engineers frequently refer to browsers as "User Agents", a nod to their unique role in giving users the final say over how the web is experienced. A silent erosion of browser choice has transferred power away from users, depositing it with dominant platforms and apps. To understand how this sell-out happened under our noses, literally, let's look at how mobile and desktop differ.
The Baseline Scenario
The predominant desktop situation is straightforward:
Browsers handle links, and non-browsers defer loading http
and https
URLs to the system, which in turn invokes the user's default browser. This flow is what gives links utility. If the players involved (OSes, browsers, or referring apps) violate aspects of the contract, user choice in browsers has less effect.
"What, then, is a 'browser'?" you might ask? I've got a long blog post brewing on this, but jumping to the end, an operable definition is:
A browser is an application that can register with an OS to handle
http
andhttps
navigations by default.
On Android this is expressed via manifest intent filters and the BROWSABLE
category. iOS gained browser support in late 2020 — a dozen years late — via an Entitlement.4 Windows and other Desktop OSes have similar (if less tidy) mechanisms.
No matter how an OS facilitates browser choice, it's this ability to replace the default handler for links that defines browsers. How often links lead users to their browser defines the meaningfulness of this choice.


Android's "In-App Browser" Problem(s)
Mobile browsers started in a remarkably resource-constrained environment. First-generation iOS and Android smartphones were slow single-core, memory-impoverished affairs, leading mobile OSes to adopt heuristics for killing background apps to reclaim memory. This helped ensure the whole system remained responsive.
But background task killing created problems for link-heavy apps. Launching the browser placed linking apps in the background and browser UI didn't provide affordances for returning to referring applications. This reduced the probability users would return, hurting engagement.
Being put in the background also increased the likelihood of a linking app being killed.5 It can take seconds to re-start the original app and restore UI state, an experience that gets worse on low-end devices that are most likely to evict apps in the first place.
To compensate, engagement-thirsty apps began including "In-App Browsers" ("IABs") to keep links from bouncing users to browsers. Contrary to any plain-language understanding of "a browser", these IABs cannot be installed as browsers, even where OSes enabled browser choice. Instead, they load content referred by their hosting native app in system-provided WebViews.
The benefits to apps that adopt WebView-based IABs are numerous:
- WebViews are system components designed for use within other apps. They do not place embedders in the background where the system may kill them to reclaim resources. This reduces friction and commensurately increases "engagement" metrics.6
- As they are now "the browser", they can provide UI that makes returning to the host application easier than continuing on the web.
- Because they lean on the system-provided WebView component, they do not need to pay the expense of a heavier app download to support rendering HTML, running JavaScript, decoding images, or loading network resources.
- Apps can customise UI to add deeper integrations, e.g., "pinning" images from a hosted page to Pinterest.
- WebViews allow embedders to observe and modify network traffic (regardless of encryption).
- WebViews can monitor user input, passwords, site content, and system auto-filled credentials.
In the unlikely scenario users are happy for browsers to forget their saved passwords, login state, privacy preferences, extensions, and accessibility settings, this could, in theory, be a win-win. In practice it is a hidden, ecosystem-wide tax.
IABs are hard to spot unless you know exactly what you're looking for, and the controls to disable them are consistently buried in hard-to-find UI. The cumulative result is that tapping links generally feels broken.7
1...2...3...Party Time!
WebViews are the source of much confusion in debates around apps and browser choice. Thankfully, the situation is only complicated rather than complex.
There are two dimensions in play:
- Can the app register with an OS to handle
http
/https
navigations by default?- If so, it's a browser regardless of the underlying engine.
- If not, it's something else; a "content renderer" or an IAB.
- Does the app include its own web engine?
- If so, it's integrated — e.g., an "Integrated Browser".
- If not, it's WebView-powered, e.g. a "WebView Browser" or "WebView IAB".
So, a browser can be WebView-based, and so can an IAB. But neither has to be.
What is a WebView? To quote the Android documentation, a WebView is...:
A View that displays web pages. ... In most cases, we recommend using a standard web browser, like Chrome, to deliver content to the user.
WebViews have a long history in mobile OSes, filling several roles:
- Rendering HTML on behalf of the first-party application developer.
- Displaying cooperating, second-party content like ads.
- Providing the core of browsers, whose job is to display third-party content. The original Android Browser used early-Android's system WebView, for instance.
The use of WebViews in non-browser apps is appropriate for first and second-party content. Here, apps are either rendering their own web content or the content can be expected to know about the limits imposed by the WebView implementation. Instead of breaking content, WebViews rendering first and second party content can help apps deliver better experiences without additional privacy and security concerns.
All bets are off regarding WebViews and third-party content. Remember, WebViews are not browsers.
WebViews support core features for rendering web content, along with hooks that allow embedders to "light up" permission-based APIs (e.g., webcam access). Making a full browser out of a WebView requires a lot of additional UI and glue code.
Features that need extra care to support include:
- Privacy and site quality support, including "acceptable ads" enforcement and browser history clearing.
- Security indicators (TLS padlock, interstitial warnings, etc.)
- Basic navigation and window management features to (e.g.
window.open()
and<a target="_blank">
which are critical to some site monetization features). - Friction reducing OS integrations such as:
- Web Payments (streamlined e-commerce checkout)
- Web OTP (for easier/faster sign-in)
- Web Share
- Hardware access APIs, notably:
- Geolocation
- Camera/mic (
getUserMedia()
) - Web Bluetooth
- WebUSB
- Web Serial
- WebHID
- WebMIDI
- Web NFC
- Filesystem Access
- Re-engagement features including:
- PWA installation and home screen shortcuts for sites
- Push Notifications
Few (if any) WebView browsers implement all of these features, even when underlying system WebViews provide the right hooks.
The situation is even more acute in WebView IABs, where features are often broken even when they appear to be available to developers. Debugging content in IAB franken-browsers is challenging, and web developers are often blind to the volume of traffic they generate, meaning they may not even understand how broken their experiences are.
How can that be? Web developers are accustomed to real browsers and industry standard tools, analytics, and feature dashboards do break out or highlight IABs. The biggest IAB promulgators (Facebook, Pinterest, Snap, etc.) are complicit, investing nothing in clarifying the situation.
Neither users nor developers understand Facebook, Pinterest, or Google Go as browsers. If they did, they would be livid at the poor quality and broken feature set. WebView IABs strip users of choice, and technical limits they impose prevent web developers from any recourse to real browsers.
No documentation is available for third-party web developers from any of the largest WebView IAB makers. This scandalous free-riding is shady, but not surprising. It is, however, all the more egregious for the subtlety and scale of breakage.
Thanks to IAB shenanigans, Facebook is the third largest Android "browser"-maker. If it employs a single developer relations engineer or doc writer to cover these issues, I'm unaware of it. Meanwhile, forums are full of melancholy posts recounting myriad ways these submarine renderers break features that work in other browsers.
Update (Oct '21): How feature-deprived are WebView IABs? Several months after this post was published, and with no apparent irony, Facebook dropped support for WebViews as a login mechanism to Facebook itself. That's right, Facebook's own app is now an unsupported browser for the purposes of logging in to Facebook.


WebView IAB makers have been given "the first 80%" of a browser. Development and distribution of critical components is also subsidised by OS vendors. Despite these considerable advantages, WebView IABs universally fail to keep up their end of the bargain.
First-party developers can collaborate with their IAB colleagues to build custom access to any feature they need.
Likewise, second-party developers expect less and their content will not appear to be broken — ads are generally not given broad feature access.
But third-party developers? They are helpless to understand why an otherwise browser-presenting environment is subtly, yet profoundly, broken.
There are still users browsing with a Chrome 37 engine (7 years ago), not because they don't update their browsers but because it's Facebook Mobile Browser on Android 5 using a webview. Facebook does NOT honor user browser choice leaving that user with an old engine. +
These same app publishers request (and heavily use) features within real browsers they do not enable for others, even when spotted the bulk of the work. Perhaps browser and platform vendors should consider denying these apps access to capabilities they undermine for others.
WebView IAB User Harms
The consequences of WebView IABs on developers are noteworthy, but it's the impacts on users that inspire confusion and rage.
Consider again the desktop reference scenario:
Clicking links takes users to their browser, assuming they are not already in a browsesr. If a link from an email application points to example.com
, previous login state and passwords are not forgotten. Saved addresses and payment information are readily available, speeding up checkout flows. Most importantly, accessibility settings and privacy preferences are consistently applied.

By contrast, WebView IABs fracture state, storing it in silos within each application. This creates a continuous partial amnesia, where privacy settings, accessibility options, passwords, logins, and app state are frequently lost.
The resulting confusion doesn't hurt apps that foist WebView IABs on unsuspecting users and developers. The costs are borne by publishers and users, harming the larger web ecosystem. IABs are, in this understanding, a negative externality.
Does anyone expect anything one does on a website loaded from a link within Facebook, Instagram, or Google Go can be monitored by those apps? That passwords can be collected? That all sites you visit can be tracked?8
To be clear, there's no record of these apps using this extraordinary access in overtly hostile ways, but even the unintended side-effects reduce user control over data and security. (August '22) Facebook has been caught red-handed absuing this power to track users within their IAB browser without explicit consent. Sanctions, App Store policies, and opt-out mechanisms are overdue.
The WebView IAB sleight of hand is to act as a browser when users least expect it, but never to cop to the privacy implications of silently undermining user choice.
CCT: A New Hope?
As libraries emerged to facilitate the construction of WebView IABs, OS and browser vendors belated became aware that users were becoming confused and that web publishers were anguished about the way that social media apps broke login state.
To address this challenge, Apple introduced SFSafariViewController
("SFSVC")9 and Google followed suit with Chrome Custom Tabs protocol ("CCT"). Both systems let native apps to skip the work of building WebView IABs and, instead, provide an OS-wide mechanism for invoking the user's default browser over top of a native app.
Like WebView IABs, CCT and SFSVC address background eviction and lost app state. However, because they invoke the user's actual browser, they also prevent user confusion. They also provide the complete set of features supported by the user's default browser, improving business outcomes for web publishers.
These solutions come at the cost of flexibility for app developers who lose access to snoop on page content, read network traffic, or inject custom behavior. Frustratingly, no OS or App Store mandate their use for IAB needs. More on this shortly.


Et Tu, Google?
CCT sounds pretty great, huh?
Well, it is. At least in the default configuration. Despite the clunky inclusion of "Chrome" in the name, the CCT library and protocol are browser-agnostic. A well-behaved CCT-invoking-app (e.g., Twitter for Android) will open URLs in the CCT-provided IAB-alike UI via Firefox, Brave, Samsung Internet, Edge, or Chrome if they are the system default browser.
That is unless the native app overrides the default behaviour and invokes a specific browser.
@slightlylate I recently was talking to my Dad about the Web and asked what browser he uses and he showed me what he does:
He searches for the Web site in the Google search widget and then just uses the results page Chrome tab as his entire browser.
His default browser is not set to Chrome.
Who would do this, you might ask? None other than Google's own Search App; you know the one that comes on every reputable Android device via the ubiquitous home screen search widget.

Known as the "Android Google Search App" ("AGSA", or "AGA"), this humble text input is the source of a truly shocking amount of web traffic; traffic that all goes to Chrome, no matter the user's choice of browser.
Early on, there were justifiable reasons to hard-code Chrome. Before support for CCT was widespread, some browsers exhibited showstopper bugs.
Fast-forward to 2021 and those bugs are long gone, but the hard-coding persists. Today, the primary effect is to distort the market for browsers and undermine user choice. This subverts privacy and makes it hard for alternative browsers to compete on a level playing field.
This is admittedly better than the wholesale neutering of important features by WebView IABs, but when users change browsers, continuious partial amnesia on the web gets worse. A Hobson's Choice of browser.

WebLayer: New Frontiers In User Confusion
Google can (and should) revert to CCT's default behavior which respects user choice. Since AGSA uses CCT to load web pages rather than a WebView, this would be a nearly trivial code change. CCT's core design is sound and has enormous potential if made mandatory in place of WebView IABs. The Android and Play teams could mandate better behavior in IABs to improve user privacy.
There's reason to worry that this is unlikely.
Instead of addressing frequent developer requests for features in the CCT library, the Chrome team has invested heavily in the "WebLayer" project. You can think of WebLayer like a WebView-with-batteries-included, repairing issues related to missing features but continuing to fracture state and user choice.
There is a weakly positive case for WebLayer. For folks making browsers, WebLayer dramatically reduces the amount of custom glue code needed to light up adavanced features. In the context of IABs, however, WebLayer looks set to entrench user-hostile patterns even further.
Subversion of choice is a dispiriting trend in search apps. Stealing traffic without any effort to honestly earn a spot as the user's preferred browser is, at best, uncouth and adopting WebLayer will not meaningfully improve the user experience or privacy of these amnesiac browsing experiences.
Google Go, the Google app for iOS, and Microsoft's Bing app for Android all capture outbound links in WebView IABs, subverting browser choice and rubbishing features for developers. If there's any mercy, it's that their low use limits the impact on the ecosystem.


Google and Apple could prevent this bad behavior through App Store policies and technical changes. They have the chance to lead, to show they aren't user-hostile, and remove a permission structure for lousy behaviour that less scrupulous players exploit. More on that in a moment.
iOS's Outsized, Malign Influence
Imagine if automakers could only use one government-mandated engine model across all cars and trucks.
Different tires and upholstery only go so far. With the wrong engine, many jobs cannot be done, rendering whole classes of vehicles pointless. If the mandated engine were particularly polluting, choosing a different model would have little effect on emissions.
That's the situation iOS creates regarding browsers today. The only recourse it to buy a phone running a different OS.
iOS matters because wealthy users carry iPhones. It's really as simple as that. Even when Apple's products fail to gain a numerical majority of users in a market, the margin contribution of iOS users can dominate all other business considerations.
Bosses, board memebers, and tech reviewers all live in the iOS ecosystem. Because Apple prevents better web engines anywhere on its platform, browser choice is hollow.
Apple has deigned to allow "browsers" in its App Store since 2012. Those apps could not be browsers in a meaningful sense because they could not replace Safari as the default handler for http
/https
links.
The decade-long charade of choice without effect finally ended with the release of iOS 14.2 in late 2020, bringing iOS into line with every other significant OS in supporting alternative browsers.10
But Apple has taken care to ensure that choice is only skin deep. Browsers on Windows, Linux, ChromeOS, Android, and MacOS can be Integrated Browsers, including their own competing engines. iOS, meanwhile, restricts browsers to shells over the system-provided WebView.
Unlike WebView browsers on other OSes, Apple locks down these components in ways that prevent competition in additional areas, including restrictions on network stacks that block improved performance, new protocols, or increased privacy. These restrictions make some sense in the context of WebView IABs, but extending them to browsers only serves to deflect pressure from Apple to improve their browser.
Perhaps it would be reasonable for iOS to foreclose competition from integrated browsers if it also kept other native apps from accessing powerful features. Such policies would represent a different view of what computing should be. However, Apple is happy to provide a wide variety of scary features to unsafe native applications, so long as they comply with the coercive terms of its App Store.
Powerful browsers present a threat to the fundamentals of Apple and Google's whale-based, dopamine fueled, "casual" gaming monetisation rackets.
Unlike other native apps, browsers are principally concerned with user safety. A safe-by-default, capable platform with low-friction discovery could obviate the root justification for app stores: that they keep over-powered native apps in check.
Apple forestalls this threat by keeping the web on iOS from feature parity. Outlawing true browser choice leaves only Apple's own, farcially under-powered, Safari/WebKit browser/engine...and there's precious little that other WebView browsers can do to improve the situation at a deep level.11
Web developers are understandably livid:
Seeing a Web App I worked on used by *Apple* to justify that the Web is a viable platform on iOS is bullshit
The Web can be an ideal place to build apps but Apple is consistently dragging their heals on implementing the Web APIs that would allow them to compete with native apps twitter.com/stopsatgreen/status/1389593307219701760
In addition, by refusing to let any other Web browser engines run on iOS. They are preventing any other browser filling in the feature gap. Truly holding back Web Apps on iOS.
I have defended Apple's choice to restrict web browsers on their platform before and I still do but they can't have their cake and eat it to.
They should not hold back Web Apps with one hand and then turn around and say that Web Apps can compete with native apps.
Developer anger only hints at the underlying structural rot. 25+ years of real browser competition has driven waves of improvements in security, capability, and performance. Competition has been so effective that browsers now represent most computing time on OSes with meaningful browser choice.
Hollowing out choice while starving Safari and WebKit of resources managed to put the genie back in the bottle. Privacy, security, performance, and feature evolution all suffer when the competition is less vibrant — and that's how Apple likes it.
Mark(et)ed Impacts
A vexing issue for commentators regarding Apple's behaviour in this area is that of "market definition". What observers should understand is that, in the market for browsers, the costs that a browser vendor can inflict on web developers extend far beyond the market penetration for their specific product.
A typical (but misleading) shorthand for this is "standards conformance". While Apple's engine falls woefully short on support for basic standards, that isn't even the beginning of the negative impacts.12 Because the web is an open, interoperable platform, web developers build sites to reach the vast majority of browsers from a single codebase.
When browsers with more than ~10% share fail to add a feature or exhibit nasty bugs, developers must spend more to work around these limitations. When important APIs go missing, entire classes of content may simply be viewed as unworkable.
The cost of these capability gaps is steep. When the web cannot deliver experiences that native apps can (a very long list), businesses must build entirely different apps using Apple's proprietary tools. These apps, not coincidentally, can only be distributed via Apple's high-tax App Store.
A lack of meaningful choice in browsers leads directly to higher costs for users and developers across the mobile ecosystem even for folks that don't use Apple's products. Apple's norm-eroding policies have created a permission struture for bad actors like Facebook. Apple's leadership in the race to the bottom has inspired a burgeoning field of fast-followers.
Browser choice is not unrelated to other objectionable App Store policies. Keeping the web from competing is part and parcel of an architecture of control that tilts commerce into coercive, centralising stores, even though safer, browser-based alternatives would otherwise be possible.
Small Changes to Restore Choice
Here's a quick summary of the systems and variations we've seen thus far, as well as their impacts on user choice:
System | Respects Choice | Notes |
---|---|---|
Integrated Browsers | Yes | Maximizes impact of choice |
WebView Browsers | Yes | Reduces diversity in engines; problematic when the only option (iOS). |
WebView IABs | No | Undermines user choice, reduces engine diversity, and directly harms developers through lower monetisation and feature availability (e.g., Facebook, Google Go). |
Chrome Custom Tabs (CCT) | Partial | WebView IABs replacement, preserves choice by default (e.g. Twitter). Problematic when configured to ignore user preferences (e.g. AGA). |
WebLayer | No | Like WebView with better feature support. Beneficial when used in place of WebViews for browsers. Problematic when used as a replacement for WebView IABs. |
SFSafariViewController | Partial | Similar to CCT in spirit, but fails to support multiple browsers. |
Proposals to repair the situation must centre on the effectiveness of browser choice.
Some policymakers have suggested browser choice ballots, but these will not be effective if user choice is undermined no matter which browser they choose. Interventions that encourage brand-level choice cannot have a positive effect until the deeper positive impacts of choice are assured.
Thankfully, repairing the integrity of browser choice in the mobile ecosystem can be accomplished with relatively small interventions. We only need to ensure that integrated browsers are universally available and that when third-party content is displayed, user choice of browser is respected.
Android
Repairing the IAB situation will likely require multiple steps, given the extreme delay in new Android OS revisions gaining a foothold in the market. Thankfully, many fixes don't need OS updates:
-
Google should update the CCT system to respect browser choice when loading third-party content and require updates to CCT-using apps to this new behaviour within six months.
- Verification of first-party content for use with specific engines is possible thanks to the Digital Asset Links infrastructure that underpins Trusted Web Activities, the official mechanism for putting web apps in the Play Store.
-
AGSA and Google Go should respect user choice via CCT.
-
Android's WebView and WebLayer should be updated with code to detect a new HTTP header value sent with top-level documents that cause the URL to be opened in the user's default browser (or a CCT for that browser) instead.
- These systems update out-of-band every six weeks on 90+% of devices, delivering quick relief.
- As a straw-person design, the existing Content Security Policy system's
frame-ancestors
mechanism can be extended with a new'system-default
' value. - Such an opt-out mechanism preserves WebViews for first-party and second-party use-cases (those sites will simply not set the new header) while giving third-parties a fighting chance at being rendered in the user's default browser.
- Apps that are themselves browsers (can be registered as default
http
/https
handlers) would be exempt, preserving the ability to build WebView browsers. "Browserness" can be cheaply verified via an app's manifest.
-
Google should provide access to all private APIs currently reserved to Chrome, including but not limited to the ability to install web applications to the system (a.k.a. "WebAPKs").
Future releases of Android should bolster these improvements by creating system-wide opt-out of WebView and WebLayer IABs.
Play policy enforcement of rules regarding CCT, WebView, and WebLayer respect for user and developer choice will also be necessary. Such enforcement is not challenging for Google, given its existing binary analysis infrastructure.
Together, these small changes can redress the worst anti-web, anti-user, anti-developer, and anti-choice behaviour of Google and Facebook regarding Android browsers, putting users back in control of their data and privacy along the way.
iOS
iOS begins from a more troubling baseline but with somewhat better IAB policies. What's undermining user choice there require deeper, OS-level fixes, including:
-
Integrated browser choice, including access to APIs that iOS restricts to Safari today, such as:
- The ability to create sandboxed subprocesses for renderers.
- Push Notifications APIs.
- Adding web apps to the home screen, including PWA installation.
- Support in
Web.app
for alternative engine runtimes to ensure that home screen shortcuts and PWAs run in the correct context.
-
SFSafariViewController
support for browsers other than Safari. -
All apps that load non-consenting third-party websites (outside of edge cases like authentication flows) in IABs should be required to update to
SFSafariViewController
, -
Apple's WebViews should support
Content-Security-Policy: frame-ancestors 'system-default'
Allowing integrated browsers will require updates to Apple's App Store policies to clarify that alternative engines are permitted in the context of com.apple.developer.web-browser
entitled applications.
Don't WebView Me Bro!
The proposal for a header to allow sites to demand CCT/SFSVC instead of a WebView IAB may seem complex, but it is technically straightforward and can be implemented very quickly.
Websites would include a tag (or the equivalent HTTP header) in top-level pages like this:
<meta http-equiv="Content-Security-Policy"
content="frame-ancestors 'system-default'">
OS vendors would update their system WebViews to respect this tag and invoke CCT if encountered in a top-level document. This is compatible with the existing ecosystem, as no first-party content (help pages) or second-party integration (ad network) would send these headers, existing apps would not need to be updated. Websites could incrementally add the hint and benefit from the new behavior.
Android's WebView component auto-updates with Chrome, ensuring huge reach for such a fix in a short time. iOS updates are fused to OS upgrades, but iOS users tend to upgrade quickly. The net effect is that we should expect such a policy to begin to have a large, positive effect in less than 6 months.
What about apps that try to subvert the default behavior? App store policies can be easily formulated to punish this sort of poor behavior. There's a great deal of evidence that these policies work, at least for the "head" of an app catalog, and would surely condition Facebook's behavior.
For Markets To Work, Choice Must Matter
The mobile web is a pale shadow of its potential because the vehicle of progress that has delivered consistent gains for two decades has silently been eroded to benefit native app platforms and developers. These attacks on the commons have at their core a shared disrespect for the sanctity of user choice, substituting the agenda of app and OS developers for mediation by a user's champion.
This power inversion has been as corrosive as it has been silent, but it is not too late. OSes and app developers that wish to take responsibility can start today to repair their own rotten, choice-undermining behaviour and put users back in control of their browsing, their data, and their digital lives.
The ball's in your court, platforms.
Deepest thanks to Eric Lawrence and Kevin Marks for their thoughtful feedback on drafts of this post.
Windows 10, for example includes several features (taskbar search box, lock screen links) that disrespect a user's choice of default browser. This sort of shortcut-taking has a long and discouraging history, but until relatively recently was viewed as out of bounds. Mobile has shifted the Overton Window.
A decade of norm degradation by mobile OSes has made these tie-ins less exceptional, creating a permission structure for bad behaviour. The Hobbesian logic of might-makes-right is escalatory and hermetic; a bad act in one turn ensures two in the next. Dark patterns and choice subversion also work against differentation through quality. Why bother when you can just tweak the rules of the game?
Fixing mobile won't be sufficient to unwind desktop's dark patterns, but that's no reason to delay. Giving users real choice on their most personal devices will help to reset expectations of Sillicon Valley PMs and managers. They were clever enough to read the rules when it allowed cheating, and they'll cotton on quickly once it doesn't, assuming the consequences are severe enough. ⇐
It's unclear why Mozilla is MIA. Why is it not making noise about the situation? Mozilla has had a front-row seat to the downsides of degraded user choice; not being able to bring Gecko to iOS directly harms the competitiveness of Firefox, and the link-stealing behaviour of Facebook, Google Search, and iOS's defaults policy (until late 2020) materially harmed Mozilla's products. So why are they silent?
It seems plausible that the Firefox OS experience has so thoroughly burned management that they feel work on mobile is not worth the risk, even if constrained to jawboning or blog posts.
If any organisation can credibly, independently connect the dots, it should be the Mozilla Foundation. One hopes they do. ⇐
The history, competitive pressures, and norms of Android app developers caused many smaller apps to capture clicks (and user data), failing to send navigations onward.
A shortlist of top apps that do so would include:
- Facebook Messenger
- Snapchat
- Microsoft Bing Search
Some apps that previously abused WebViews for IABs in the pre-CCT era did better, though, switching to CCT when it became available &emdash; notably Twitter. ⇐
Defining "a browser" as an application that can be set by a user to handle links by default may sit uncomfortably with some folks, as it means that the "browsers" that were avialable in the iOS App store (including a "Chrome" branded product from 2012) didn't count. This is the definition working as intended.
Even ignoring Apple's ongoing anti-competitive and anti-web behaviour regarding engine choice, the presence of web browsing apps that couldn't be installed as the default wasn't a meaningful choice. Potempkin villiages of browser fronts served Apple well, but didn't do much to aid users, developers, or the web ecosystem.
Indeed, not all applications that can load web pages are browsers. Only apps that can become the user's agent are. Being the user's agent means being able to reliable assist users, sand off the harmful aspects of sites, and assist users in getting jobs done with data previously entrusted to it.
Without the ability to catch all navigations sent to the OS, users who downloaded these programs suffered frequent amnesia. User preferences were only respected if users started browsing from within a specific app. Incidental navigations, however, were subject to Apple's monopoly on link handling and whatever choices Safari projected. This is is anti-user, anti-developer, and anti-competitive. ⇐
Problems related to background task killing are avoided by building a web apps instead of a native apps, as browsers themselves tend not to get backgrounded as often.
Developers tried this path for a while but quickly found themselves at an impossible feature disadvantage. Lack of Push Notifications alone proved to be a business-defining disadvantage, and Apple's App Store policies explicitly forbid web apps in their store.
To be discovered, and to retain access business-critical features, mobile platforms forced all serious developers into app stores. A strong insinuation that things would not go well for them in app stores if they used web technologies (via private channels, naturally) reliably accompanied this Sophie's choice.
iOS and Android played these games in mobile's early days to dig a moat of exclusive apps. Exclusives create friction in the form of switching costs. Nobody wants a devices that doesn't "do" all the stuff their current devices can.
Platform owners also know the cost of re-developing proprietary apps for each OS creates an investment cliff. When independent software vendors invest heavily in their proprietary systems, it becomes less likely they can deliver quality experiences on their competitor's system, particularly if the code can't be shared.
App developers only have so many hours in the day, and it costs enormous amounts, both initially and in an ongoing way, to re-build features for each additional platform. The web is a portable platform, and portability is a bug that duopolists want to squash, as it randomises their game of divide-and-counquer.
Apples's combination of browser engine neglect, feature gap maintainence, and app store policies against web participation — explicit and implied — proved effective.
In time, rent extraction from a very narrow class of social games and the users addicted to them grew into a multi-billion dollar gambling business that the duopolists have no intention of allowing the web to disrupt.
Android and iOS may not have been intentional attacks on open computing, but their current form makes them a threat to its future. Regulators will need to act decisively to restore true browser choice so that the web can contest application portability for mobile OSes the way it has transformed desktop investments. ⇐
Lots of folks have covered the harms social media firms caused by the relentless pursuit of "north star" metrics. There's little I can add.
I can, however, confirm that some uncharitable takes are directionally correct. You can't cannot engage with engineers and PMs from these organisations for a years without learning their team's values.
"Make number go up"-OKRs have absolutely created a set of ecosystem castastrophes because these firms (and FB in particular) do not measure or manage for ecosystem health.
Change is possible, but it will not come from within.
Browser choice might not seem high up on the long list of anti-competitive ills of modern tech products, but the current "regulatory moment" is a chance to put in structural fixes. It would be a missed opportunity not to put users back in control of their digital lives and attenuate unfettered data collection while the iron is hot. Real browser choice is a predicate for different futures, so we have to guard it zealously. ⇐
Social apps strip-mining ecosystems they didn't build while deflecting responsibility?
Heaven forfend! ⇐
Facebook engineers have noted that the FB IAB is important in fighting bad behaviour on their social network. We should take these claims at face value.
Having done so, several further questions present themselves:
- Why, then, is this system not opt-in? Presumably Facebook can convince a representative subset of users to enable it while preserving browser choice for the vast majority.
- Why is CCT not invoked for low risk origins?
- Why is Facebook not publicly attempting to improve CCT and SFSVC in ways that can meets its needs, given they may be required to move to
SFSafariViewController
for iOS - Why is this not a game-over problem for Facebook's desktop website?
- If it's necessary to keep users within a browser that Facebook owns end-to-end, why not simply allow Facebook's native apps to be browsers.
Becoming a "real" browser is a simple Android manifest change that would put FB back into line with the norms of the web community, allowing FB's differentiated features to compete for browsing time on the up-and-up. Not doing so suggests they have something to hide.
The need for more information to protect users may be real, but undermining choice for all is a remedy that, at least with the information that's public thus far, seems very tough to justify. ⇐
iOS didn't support browser choice at the time of
SFSafariViewController
's introduction and appeared only to have acquiesced to minimal (and initially broken) browser choice under regulatory duress. It's not surprising that Apple hasn't updatedSFSafariViewController
to work with other default browsers, but it needs to be fixed.Will they? Doubtful, at least not until someone makes serious, sustained noise. Goodness knows there's a lot on the backlog, and they're chronically short-staffed (by choice). ⇐
Yes, even ChromeOS supports changing the default browser, complete with engine choice! ⇐
The supine position of browser makers regarding Apple's anti-competitive prohibition on integrated iOS browsers is vexing.
Perhaps it's Great Power calculations or a myopic focus on desktop, but none of the major browser vendors has publicly challenged these rules or the easily-debunked arguments offered to support them.
To recap, Apple has argued its anti-competitive policies against integrated browsers are necessary because Just-In-Time (JIT) compilers are unsafe. Like other vendors, Apple mitigates the issues with JITs by creating sandboxed processes to run them in. Today, Apple restricts both the ability to create sandboxed processes, as well as the ability to implement a JIT. For competing browsers to credibly port their engines, they'll need both.
JITs are central to modern JavaScript engines but are not strictly necessary in integrated browsers. Disallowing non-JITing alternative engines on this basis is nonsensical.
Commenters parroting Apple's line tend not to understand browser architecture. Any modern browser can suffer attacks against the privileged "parent" process, JIT or not. These "sandbox escapes" are not less likely for the mandated use of WebKit; indeed, by failing to expose APIs for sandboxed process creation, Apple prevents others from bringing stronger protections to users. iOS's security track record, patch velocity, and update latency frankly stink.
But Apple's right to worry about engine security. iOS is frequently exploited via WebKit, and you'd be warry too if those were your priors. But that doesn't make the restriction coherent or justifiable. Other vendors don't under-invest in the security of their engines the way Apple has, and Apple management surely know this.
It's backwards to under-invest while simultaneously preventing more secure, more capable browsers that can protect users better. Apple's multi-year delay in shipping Site Isolation should indicate just how unserious these arguments are.
User security will be meaningfully improved when Apple is forced to allow integrated browser competitions on their OS. Perhaps this can be gated by a policy that requires "Apple-standard or better" patch velocity. Such a policy would not be hard to formulate, and the ability of competing browsers to iterate without full OS updates would meaningfully improve patch rates versus today's OS-update-locked cadence for WebKit.
Some commenters claim that browsers might begin to provide features that some users deem (without evidence) unnecessary or unsafe if alternative engines were allowed. These claims are doubly misinformed.
Alternative WebView browsers can already add features, and those features are subject to exactly the sorts of attacks that comments posulate. That is, the "bad" future is actually the status quo that Apple have engineered.
There's no security or privacy benefit in forcing browser vendors to re-build these features with contorted, one-off tools on top of WebViews. Indeed, bringing integrated engines to iOS would prevent whole classes of security issues that arise from these lightly analysed hacks. This isn't theoretical; extensions built in this way have been a frequent source of bugs in iOS WebView browsers for years.
Securing a single codebase is easier than analysing a multiplicty of platform-specific variants. Engine choice will improve security, in part, by focusing limited security reviewer and fuzzing time on fewer attack vectors. Of course, a functioning market for browsers will still allow users to pick an under-powered, less secure, slower-updating, feature-light browser, just as they can today; Safari, for example.
Misdirection about JITs serves to distract from iOS's deeper restrictions that harm security. Capable integrated browsers will need access to a suite of undocumented APIs and capabilities Apple currently reserves to Safari, including the inability to create processes, set tighter sandboxing boundaries, and efficiently decode alternative media formats. Opening these APIs to competing integrated browsers will pave the way to safer, faster, more capable computing for iPhone owners.
Others have argued on Apple's behalf that if engine competition were allowed, Chromium's (Open Source) Blink engine would become ubiquitous on iOS, depriving the ecosystem of diversity in engines. This argument is seemingly offered with a straight face to defend the very policies that have prevented effective engine diversity to date. Mozilla ported Gecko twice, but was never allowed to bring its benefits to iOS users. In addition to being self-defeating regarding engine choice, this fear also seems to ignore the best available comparison points. Safari is the default browser for MacOS and has maintained a healthy 40-50% share for many years, despite healthy competition from other integrated browsers (Chrome, Firefox, Opera, Edge, etc.). Such an outcome is at least as likely on iOS.
Sitting under all of these arguments are, I suspect, more salient concerns to Apple's executives to resist increasing RAM in the iPhone's Bill of Materials. In the coerced status quo, Apple can drive device margins by provisioning relatively little in the way of (expensive) RAM components while still supporting multitasking. A vital aspect of this penny-pinching is to maximise sharing of "code pages" between programs. If alternative browsers suddenly began bringing their engines, code page sharing would not be as effective, requiring more RAM in Apple's devices to provide good multitasking experiences. More RAM could help deliver increased safety and choice to users, but would negatively impact Apple's bottom line.
Undermining user choice in browsers has, in this way, returned significant benefits — to AAPL shareholders, anyway. ⇐
Browser engineers have an outsized ability in standards bodies to deny new features and designs the ability to become standards in the first place. This leads to a Catch-22 that is easy to spot once you know to look for it, but casual observers are often unacquainted with the way feature development on the web works.
In a nutshell, features are often shipped by browsers ahead of final, formal web standards process ratification. This isn't to say they're low-quality or that they don't have good specifications and tests, it's just that they aren't standards (yet).
Specifications are documents that describe the working of a system. Some specifications are ratified by Standards Development Organisations (SDOs) like the World Wide Web Consortium (W3C) or Internet Engineering Task Force (IETF). At the end of a long process, those specifications become "web standards". Thanks to wide implementation and unambiguous IP licensing, standards can increase market confidence and adoption of designs. But no feature begins life as a standard, and for most of it's early years in the market, it will not be a formal, adopted standard. This process can go quickly or slowly, depending on the enthusiasm of other participants in an SDO...and here lies the rub: by not engaging in early, open development, or by raising spurious objections at Working Group formation time, vendors can prevent early designs that solve important problems from ever becoming standards.
Market testing of designs ("running code" in IETF-speak) is essential for progress, and pejorative claims that a feature in this state is "proprietary" is misleading. Open development and high-quality design work are undertaken with the intent to standardise, not to retain proprietary control. Claims that open, standards-track features in this state are "proprietary" bleeds into active deception when invoked by vendors who aren't proposing alternatives, no participating in the effort.
Withholding engagement, then claiming that someone else is proceeding unilaterally — when your input would remove the stain — is a rhetorical Möbius strip. ⇐
Git Worktrees Step-By-Step
Git Worktrees appear to solve a set of challenges I encounter when working on this blog:
- Maintenance branches for 11ty and other dependencies come and go with some frequency.
- Writing new posts on parallel branches isn't fluid when switching frequently.
- If I incidentally mix some build upgrades into a content PR, it can be difficult to extract and re-apply if developed in a single checkout.
Worktrees hold the promise of parallel working branch directories without separate backing checkouts. Tutorials I've found seemed to elide some critical steps, or required deeper Git knowledge than I suspect is common (I certainly didn't have it!).
After squinting at man pages for more time than I'd care to admit and making many mistakes along the way, here is a short recipe for setting up worktrees for a blog repo that, in theory, already exists at github.com/example/workit
:
##
# Make a directory to hold a branches, including main
##
$ cd /projects/
$ mkdir workit
$ cd workit
$ pwd
# /projects/workit
##
# Next, make a "bare" checkout into `.bare/`
##
$ git clone --bare git@github.com:example/workit.git .bare
# Cloning into bare repository '.bare'...
# remote: Enumerating objects: 19601, done.
# remote: Counting objects: 100% (1146/1146), done.
# ...
##
# Tell Git that's where the goodies are via a `.git`
# file that points to it
##
$ echo "gitdir: ./.bare" > .git
##
# *Update* (2021-09-18): OPTIONAL
#
# If your repo is going to make use of Git LFS, at
# this point you should stop and edit `.bare/config`
# so that the `[remote "origin"]` section reads as:
#
# [remote "origin"]
# url = git@github.com:example/workit.git
# fetch = +refs/heads/*:refs/remotes/origin/*
#
# This ensures that new worktrees do not attempt to
# re-upload every resource on first push.
##
##
# Now we can use worktrees.
#
# Start by checking out main; will fetch repo history
# and may therefore be slow.
##
$ git worktree add main
# Preparing worktree (checking out 'main')
# ...
# Filtering content: 100% (1226/1226), 331.65 MiB | 1.17 MiB/s, done.
# HEAD is now at e74bc877 do stuff, also things
##
# From here on out, adding new branches will be fast
##
$ git worktree add test
# Preparing worktree (new branch 'test')
# Checking out files: 100% (2216/2216), done.
# HEAD is now at e74bc877 do stuff, also things
##
# Our directory structure should now look like
##
$ ls -la
# total 4
# drwxr-xr-x 1 slightlyoff eng 38 Jul 7 23:11 .
# drwxr-xr-x 1 slightlyoff eng 964 Jul 7 23:04 ..
# drwxr-xr-x 1 slightlyoff eng 144 Jul 7 23:05 .bare
# -rw-r--r-- 1 slightlyoff eng 16 Jul 7 23:05 .git
# drwxr-xr-x 1 slightlyoff eng 340 Jul 7 23:11 main
# drwxr-xr-x 1 slightlyoff eng 340 Jul 7 23:05 test
##
# We can work in `test` and `main` independently now
##
$ cd test
$ cat "yo" > test.txt
$ git add test.txt
$ git commit -m "1, 2, 3..." test.txt
# [test 2e3f30b9] 1, 2, 3...
# 1 file changed, 1 insertion(+)
# create mode 100644 test.txt
$ git push --set-upstream origin test
# ...
Thankfully, commands like git worktree list
and git worktree remove
are relatively WYSIWYG by comparison to the initial setup.
Perhaps everyone else understands .git
file syntax and how it works with --bare
checkouts, but I didn't. Hopefully some end-to-end exposition can help drive adoption of this incredibly useful feature.
Progress Delayed Is Progress Denied
Update (June 16th, 2021): Folks attempting to build mobile web games have informed me that the Fullscreen API remains broken on iOS for non-video elements. This hobbles gaming and immersive media experiences in a way that is hard to overstate. Speaking of being hobbled, the original post gave Apple credit for eventually shipping a useable implementation of IndexedDB. It seems this was premature.
Three facts...
- Apple bars web apps from the only App Store allowed on iOS.1
- Apple forces developers of competing browsers to use their engine for all browsers on iOS, restricting their ability to deliver a better version of the web platform.
- Apple claims that browsers on iOS are platforms sufficient to support developers who object to the App Store's terms .
...and a proposition:
Apple's iOS browser (Safari) and engine (WebKit) are uniquely under-powered. Consistent delays in the delivery of important features ensure the web can never be a credible alternative to its proprietary tools and App Store.
This is a bold assertion, and proving it requires overwhelming evidence. This post mines publicly available data on the pace of compatibility fixes and feature additions to assess the claim.
Steve & Tim's Close-up Magic
Misdirections often derail the debate around browsers, the role of the web, and App Store policies on iOS. Classics of the genre include:
Apple's just focused on performance!
...that feature is in Tech Preview
Apple's trying, they just added <long-awaited feature>
These points can be simultaneously valid and immaterial to the web's fitness as a competent alternative to native app development on iOS.
It might be raining features right this instant, but weather isn't climate. We have to check reservoir levels and seasonal rainfall to know if we're in a drought. We should look at trends rather than individual releases to understand the gap Apple created and maintains between the web and native.
Before we get to measuring water levels, I want to make some things excruciatingly clear.
First, what follows is not a critique of individuals on the Safari team or the WebKit project; it is a plea for Apple to fund their work adequately2 and allow competition. Pound for pound, they are some of the best engine developers and genuinely want good things for the web. Apple Corporate is at fault, not the engineers and line managers who support them.
Second, projects having different priorities at the leading edge is natural and healthy. So is speedy resolution and agreement. What's unhealthy is an engine trailing far behind for many years.
Even worse are situations that cannot be addressed through browser choice. It's good for teams to be leading in different areas, assuming that the "compatible core" of features continues to expand at a steady pace. We should not expect uniformity in the short run — it would leave no room for leadership3.
Lastly, while this post does measure the distance Safari lags, that's not the core concern: iOS App Store policies that prevent meaningful browser competition are at issue here.
Safari trails other macOS browsers by roughly the same amount, but it's not a crisis because browser choice gives users alternatives.
macOS Safari is compelling enough to have maintained 40-50% share for many years amidst stiff competition. It has many good features, and in an open marketplace, choosing it is entirely reasonable.
The Performance Argument
All modern browsers are fast, Chromium and Safari/WebKit included. No browser is always fastest.
As reliably as the Sun rises in the East, new benchmarks launch projects to re-architect internals to pull ahead. This is as it should be.
Healthy competitions feature competitors trading the lead with regularity. Performance Measurement is easy to get wrong. Spurious reports of "10x worse" performance merit intense scepticism, as they tend instead to be mismeasurement. This makes sense given the intense focus of all browser teams on performance.
After 20 years of neck-in-neck competition, often starting from common code lineages, there just isn't that much left to wring out of the system. Consistent improvement is the name of the game, and it can still have positive impacts, particularly as users lean on the system more heavily over time.
Competitive browsers are deep into the optimisation journey, forcing complex tradeoffs. Improving perf for one type of device or application can regress it for others. Significant gains today tend to come from (subtly) breaking contracts with developers in the hopes users won't notice.
There simply isn't a large gap in performance engineering between engines. Frequent hand-offs of the lead on various benchmarks are the norm. Therefore, differences in capability and correctness aren't the result of one team focusing on performance while others chase different goals.4
Work on features and correctness are not mutually exclusive with improving performance, either. Many delayed features on the list below would allow web apps to run faster on iOS. Internal re-architectures to improve correctness often yield performance benefits too.
The Compatibility Tax
Web developers are a hearty bunch; we don't give up at the first whiff of bugs or incompatibility between engines. Deep wells of knowledge and practice centre on the question: "how can we deliver a good experience to everyone despite differences in what their browsers support?"
Adaptation is a way of life for skilled front enders.
The cultural value of adaptation has enormous implications. First, web developers don't view a single browser as their development target. Education, tools, and training all support the premise that supporting more browsers is better (ceteris paribus), creating a substantial incentive to grease squeaky wheels. Huge amounts of time and effort are spent developing workarounds (preferably with low runtime cost) for lagging engines5. Where they fail, cutting features and UI fidelity is understood to be the right thing to do.
Compatibility across engines makes developers more productive. To the extent that an engine has more than ~10% share, developers tend to view features it lacks as "not ready". It is therefore possible for any vendor to deny web developers access to features globally.
A single important, lagging engine can make the whole web less competitive.
To judge the impact of iOS along this dimension, we can try to answer a few questions:
- How far behind both competing engines is Safari regarding correctness?
- When Safari has implemented essential features, how often is it far ahead? Behind?
Thanks to the Web Platform Tests project and wpt.fyi
, we have the makings of an answer for the first:

The yellow Safari line is a rough measure of how often other browsers are compatible, but Safari's implementation is wrong. Conversely, the much lower Chrome and Firefox lines indicate Blink and Gecko are considerably more likely to agree and be correct regarding core web standards6.
wpt.fyi
's new Compat 2021 dashboard narrows this full range of tests to a subset chosen to represent the most painful compatibility bugs:


In almost every area, Apple's low-quality implementation of features WebKit already supports require workarounds. Developers would not need to find and fix these issues in Firefox or Chromium-based browsers. This adds to the expense of developing not only for iOS, but for the web altogether.
Converging Views
The Web Confluence Metrics project provides another window into this question.
This dataset is derived by walking the tree of web platform features exposed to JavaScript, an important subset of features. The available data goes back further, providing a fuller picture of the trend lines of engine completeness.
Engines add features at different rates, and the Confluence graphs illuminate both the absolute scale of differences and the pace at which releases add new features. The data is challenging to compare across those graphs, so I extracted it to produce a single chart:
Higher is better.
In line with Web Platform Tests data, Chromium and Firefox implement more features and deliver them to market more steadily. From this data, we see that iOS is the least complete and competitive implementation of the web platform, and the gap is growing. At the time of the last Confluence run, the gap had stretched to nearly 1000 APIs, doubling since 2016.
But perhaps API counts gives a distorted view?
Minor additions like CSS's new Typed Object Model can greatly increase the number of APIs, while some transformative APIs like access to cameras via getUserMedia()
or Media Sessions may only add a few.
To understand if intuitions built from summary data is correct, we need to look deeper. We can do this by investigating the history of feature development pace and connect individual APIs to the types of applications they enable.
Material Impacts
Browser release notes and caniuse tables since Blink forked from WebKit in 20137 capture feature pace in each engine over an longer period than either WPT or the Confluence dataset. This record can inform a richer understanding of how individual features and sets of capabilities unlock new types of apps.
Browsers sometimes launch new features simultaneously; for example the recent introductions of CSS Grid and ES6. More often, there is a lag between the first and the rest. To provide a grace period, and account for short-run differences in engine priorities, we will look primarily at features with a gap of three years or more8.
What follows is an attempt at a full accounting of features launched in this era. A summary of each API and the impact of its absence accompanies every item.
Where Chrome Has Lagged
It's healthy for engines to have different priorities, and every browser avoids certain features on principal. Still, mistakes have been made, and Chrome has missed several APIs for 3+ years:
- Storage Access API
-
Introduced in Safari three years ago, this anti-tracking API was under-specified, leading to significant divergence in API behaviour across implementations.
The low quality of Apple's initial versions of "Intelligent Tracking Prevention" created a worse tracking vector(pdf) (subsequently repaired)9.
On the positive side, this has spurred a broader conversation around privacy on the web, leading to many new, better-specified proposals and proposed models.
- CSS Snap Points
-
Image carousels and other touch-based UIs are smoother and easier to build using this feature.
Differences within the Blink team about the correct order to deliver this vs. Animation Worklets led to regrettable delays.
- Initial Letter
-
An advanced typography feature, planned in Blink once the LayoutNG project finishes.
position: sticky
-
Makes "fixed" elements in scroll-based UIs easier to build. The initial implementation was removed from Blink post-fork and re-implemented on new infrastructure several years later.
- CSS
color()
-
Wide gamut colour is important in creative applications. Chrome does not yet support this for CSS, but is under development for
<canvas>
and WebGL. - JPEG 2000
- HEVC/H.265
-
Next-generation video codecs, supported in many modern chips, but also a licensing minefield. The open, royalty-free codec AV1 has been delivered instead.
Where iOS Has Lagged
Some features in this list were launched in Safari but were not enabled for other browsers forced to use WebKit on iOS (e.g. Service Workers, getUserMedia
). In these cases, only the delay to shipping in Safari is considered.
getUserMedia()
-
Provides access to webcams. Necessary for building competitive video experiences, including messaging and videoconferencing.
These categories of apps were delayed on the web for iOS by five years.
- WebRTC
-
Real-time network protocols for enabling videoconferencing, desktop sharing, and game streaming applications.
Delayed five years.
- Gamepad API
-
Fundamental for enabling the game streaming PWAs (Stadia, GeForce NOW, Luna, xCloud) now arriving on iOS.
Delayed five years.
- Audio Worklets
-
Audio Worklets are a fundamental enabler for rich media and games on the web. Combined with WebGL2/WebGPU and WASM threading (see below), Audio Worklets unlock more of a device's available computing power, resulting in consistently good sound without fear of glitching.
After years of standards discussion and the first delivered to other platforms in 2018, iOS 14.5 finally shipped Audio Worklets this week.
- IndexedDB
-
A veritable poster-child for the lateness and low quality of Safari amongst web developers, IndexedDB is a modern replacement for the legacy WebSQL API. It provides developers with a way to store complex data locally.
Initially delayed by two years, first versions of the feature were so badly broken on iOS that independent developers began to maintain lists of show-stopping bugs.
Had Apple shipped a usable version in either of the first two attempts, IndexedDB would not have made the three-year cut. The release of iOS 10 finally delivered a workable version, bringing the lag with Chrome and Firefox to four and five years, respectively.
- Pointer Lock
-
Critical for gaming with a mouse. Still not available for iOS or iPadOS.
Update: some commenters seem to sneer the the idea of using a mouse for gaming on iOS, but it has been reported as important by the teams building game streaming PWAs. A sizeable set of users use external mice and keyboards with their iPads, and the entire categories of games are functionally unusable on these platforms without Pointer Lock.
- Media Recorder
-
Fundamentally enabling for video creation apps. Without it, video recordings must fit in memory, leading to crashes.
This was Chrome's most anticipated developer feature ever (measured by stars). It was delayed by iOS for five years.
- Pointer Events
-
A uniform API for handling user input like mouse movements and screen taps that is important in adapting content to mobile, particularly regarding multi-touch gestures.
First proposed by Microsoft, delayed three years by Apple10.
- Service Workers
-
Enables reliable offline web experiences and PWAs.
Delayed more than three years (Chrome 40, November 2014 vs. Safari 11.1, April 2018, but not usable until several releases later).
- WebM and VP8/VP9
-
Royalty-free codecs and containers; free alternatives to H.264/H.265 with competitive compression and features. Lack of support forces developers to spend time and money transcoding and serving to multiple formats (in addition to multiple bitrates).
Supported only for use in WebRTC but not the usual mechanisms for media playback (
<audio>
and<video>
). Either delayed 9 years or still not available, depending on use. - CSS Typed Object Model
-
A high-performance interface to styling elements. A fundamental building block that enables other "Houdini" features like CSS Custom Paint.
Not available for iOS.
- CSS Containment
-
Features that enable consistently high performance in rendering UI, and a building block for new features that can dramatically improve performance on large pages and apps.
Not available for iOS.
- CSS Motion Paths
- Media Source API (a.k.a. "MSE")
-
MSE enables the
MPEG-DASH
video streaming protocol. Apple provides an implementation of HLS, but prevents use of alternatives.Only available on iPadOS.
element.animate()
-
Browser support for the full Web Animations API has been rocky, with Chromium, Firefox, and Safari all completing support for the full spec the past year.
element.animate()
, a subset of the full API, has enabled developers to more easily create high-performance visual effects with a lower risk of visual stuttering in Chrome and Firefox since 2014. EventTarget
Constructor-
Seemingly trivial but deceptively important. Lets developers integrate with the browser's internal mechanism for message passing.
Delayed by nearly three years on iOS.
- Web Performance APIs
-
iOS consistently fails to provide modern APIs for measuring web performance by three or more years. Delayed or missing features are not limited to:
navigator.sendBeacon()
- Paint Timing (delayed two-to-four years)
- User Timing
- Resource Timing
- Performance Observers
The impact of missing Web Performance APIs is largely a question of scale: the larger the site or service one attempts to provide on the web, the more important measurement becomes.
fetch()
and Streams-
Modern, asynchronous network APIs that dramatically improve performance in some situations.
Delayed two to four years, depending on how one counts.
Not every feature blocked or delayed on iOS is transformative, and this list omits cases that were on the bubble (e.g., the 2.5 year lag for BigInt). Taken together, the delays Apple generates, even for low-controversy APIs, makes it challenging for businesses to treat the web as a serious development platform.
The Price
Suppose Apple had implemented WebRTC and the Gamepad API in a timely way. Who can say if the game streaming revolution now taking place might have happened sooner? It's possible that Amazon Luna, NVIDIA GeForce NOW, Google Stadia, and Microsoft xCloud could have been built years earlier.
It's also possible that APIs delivered on every other platform, but not yet available on any iOS browser (because Apple), may unlock whole categories of experiences on the web.
While dozens of features are either currently, or predicted to be, delayed multiple years by Apple, a few high-impact capabilities deserve particular mention:
- WebGL2
-
The first of two modern 3D graphics APIs currently held up by Apple, WebGL2 dramatically improves the visual fidelity of 3D applications on the web, including games. The underlying graphics capabilities from OpenGL ES 3.0 have been available in iOS since 2013 with iOS 7.0. WebGL 2 launched for other platforms on Chrome and Firefox in 2017. While WebGL2 is in development in WebKit, the anticipated end-to-end lag for these features is approaching half a decade.
- WebGPU
-
WebGPU is a successor to WebGL and WebGL2 that improves graphics performance by better aligning with next-gen low-level graphics APIs (Vulkan, Direct3D 12, and Metal).
WebGPU will also unlock richer GPU compute for the web, accelerating machine learning and media applications. WebGPU is likely to ship in Chrome in late 2021. Despite years of delay in standards bodies at the behest of Apple engineers, the timeline for WebGPU on iOS is unclear. Keen observers anticipate a minimum of several years of additional delay.
- WASM Threads and Shared Array Buffers
-
Web Assembly ("WASM") is supported by all browsers today, but extensions for "threading" (the ability to use multiple processor cores together) are missing from iOS.
Threading support enables richer and smoother 3D experiences, games, AR/VR apps, creative tools, simulations, and scientific computing. The history of this feature is complicated, but TL;DR, they are now available to sites that opt in on every platform save iOS. Worse, there's no timeline and little hope of them becoming available soon.
Combined with delays for Audio Worklets, modern graphics APIs, and Offscreen Canvas, many compelling reasons to own a device have been impossible to deliver on the web.11
- WebXR
-
Now in development in WebKit after years of radio silence, WebXR APIs provide Augmented Reality and Virtual Reality input and scene information to web applications. Combined with (delayed) advanced graphics APIs and threading support, WebXR enables immersive, low-friction commerce and entertainment on the web.
Support for a growing list of these features has been available in leading browsers across other platforms for several years. There is no timeline from Apple for when web developers can deliver equivalent experiences to their iOS users (in any browser).
These omissions mean web developers cannot compete with their native app counterparts on iOS in categories like gaming, shopping, and creative tools.
Developers expect some lag between the introduction of native features and corresponding browser APIs. Apple's policy against browser engine choice adds years of delays beyond the (expected) delay of design iteration, specification authoring, and browser feature development.
These delays prevent developers from reaching wealthy users with great experiences on the web. This gap, created exclusively and uniquely by Apple policy, all but forces businesses off the web and into the App Store where Apple prevents developers from reaching users with web experiences.
Just Out Of Reach
One might imagine five-year delays for 3D, media, and games might be the worst impact of Apple's policies preventing browser engine progress. That would be mistaken.
The next tier of missing features contains relatively uncontroversial proposals from standards groups that Apple participates in or which have enough support from web developers to be "no-brainers". Each enables better quality web apps. None are expected on iOS any time soon:
- Scroll Timeline for CSS & Web Animations
-
Likely to ship in Chromium later this year, enables smooth animation based on scrolling and swiping, a common interaction pattern on modern mobile devices.
No word from Apple on if or when this will be available to web developers on iOS.
content-visibility
-
CSS extensions that dramatically improve rendering performance for large pages and complex apps.
- WASM SIMD
-
Coming to Chrome next month, WASM SIMD enables high performance vector math for dramatically improved performance for many media, ML, and 3D applications.
- Form-associated Web Components
-
Reduces data loss in web forms and enables components to be easily reused across projects and sites.
- CSS Custom Paint
-
Efficiently enables new styles of drawing content on the web, removing many hard tradeoffs between visual richness, accessibility, and performance.
- Trusted Types
-
A standard version of an approach demonstrated in Google's web applications to dramatically improve security.
- CSS Container Queries
-
A top request from web developers and expected in Chrome later this year, CSS Container Queries enable content to better adapt to varying device form-factors.
<dialog>
-
A built-in mechanism for a common UI pattern, improving performance and consistency.
inert
Attribute-
Improves focus management and accessibility.
- Browser assisted lazy-loading
-
Reduces data use and improves page load performance.
Fewer of these features are foundational (e.g. SIMD). However, even those that can be emulated in other ways still impose costs on developers and iOS users to paper over the gaps in Apple's implementation of the web platform. This tax can, without great care, slow experiences for users on other platforms as well12.
What Could Be
Beyond these relatively uncontroversial (MIA) features lies an ocean of foreclosed possibility. Were Apple willing to allow the sort of honest browser competition for iOS that macOS users enjoy, features like these would enable entirely new classes of web applications. Perhaps that's the problem.
Some crucial features (shipped on every other OS) that Apple is preventing any browser from delivering to iOS today, in no particular order:
- Push Notifications
-
In an egregious display of anti-web gate-keeping, Apple has implemented for iOS neither the long-standard Web Push API nor Apple's own, entirely proprietary push notification system for macOS Safari
It's difficult to overstate the challenges posed by a lack of push notifications on a modern mobile platform. Developers across categories report a lack of push notifications as a deal-killer, including:
- Chat, messaging, and social apps (for obvious reasons)
- e-commerce (abandoned cart reminders, shipping updates, etc.)
- News publishers (breaking news alerts)
- Travel (itinerary updates & at-a-glance info)
- Ride sharing & delivery (status updates)
This omission has put sand in the web's tank — to the benefit of Apple's native platform, which has enjoyed push notification support for 12 years.
- PWA Install Prompts
-
Apple led the way with support for installing certain web apps to a device's homescreen as early as iOS 1.0. Since 2007, support for these features has barely improved.
Subsequently, Apple added the ability to promote the installation of native apps, but has not provided equivalent "install prompt" tools for web apps.
Meanwhile, browsers on other platforms have developed both ambient (browser provided) promotion and programmatic mechanisms to guide users in saving frequently-used web content to their devices.
Apple's maintenance of this feature gap between native and web (despite clear underlying support for the mechanism) and unwillingness to allow other iOS browsers to improve the situation13, combined with policies that prevent the placement of web content in the App Store, puts a heavy thumb on the scale for discovering content built with Apple's proprietary APIs.
- PWA App Icon Badging
-
Provides support for "unread counts", e.g. for email and chat programs. Not available for web apps added to the home screen on iOS.
- Media Session API
-
Enables web apps to play media while in the background. It also allows developers to plug into (and configure) system controls for back/forward/play/pause/etc. and provide track metadata (title, album, cover art).
Lack of this feature prevents entire classes of media applications (podcasting and music apps like Spotify) from being plausible.
In development now, but if it ships this fall (the earliest window), web media apps will have been delayed more than five years.
- Navigation Preloads
-
Dramatically improve page loading performance on sites that provide an offline experience using Service Workers.
Multiple top-10 web properties have reported to Apple that lack of this feature prevents them from deploying more resilient versions of their experiences (including building PWAs) for users on iOS.
- Offscreen Canvas
-
Improves the smoothness of 3D and media applications by moving rendering work to a separate thread. For latency-sensitive use-cases like XR and games, this feature is necessary to consistently deliver a competitive experience.
TextEncoderStream
&TextDecoderStream
-
These TransformStream types help applications efficiently deal with large amounts of binary data. They may have shipped in iOS 14.5 but the release notes are ambiguious.
requestVideoFrameCallback()
-
Helps media apps on the web save battery when doing video processing.
- Compression Streams
-
Enable developers to compress data efficiently without downloading large amounts of code to the browser.
- Keyboard Lock API
-
An essential part of remote desktop apps and some game streaming scenarios with keyboards attached (not uncommon for iPadOS users).
- Declarative Shadow DOM
-
An addition to the Web Components system that powers applications like YouTube and Apple Music. Declarative Shadow DOM can improve loading performance and help developers provide UI for users when scripts are disabled or fail to load.
- Reporting API
-
Indispensable for improving the quality of sites and avoid breakage due to browser deprecations. Modern versions also let developers know when applications crash, helping them diagnose and repair broken sites.
- Permissions API
-
Helps developers present better, more contextual options and prompts, reducing user annoyance and "prompt spam".
- Screen Wakelock
-
Keeps the screen from going dark or a screen saver taking over. Important for apps that present boarding passes and QR codes for scanning, as well as and presentation apps (e.g. PowerPoint or Google Slides).
- Intersection Observer V2
-
Reduces ad fraud and enables one-tap-sign-up flows, improving commerce conversion rates.
- Content Indexing
-
An extension to Service Workers that enables browsers to present users with cached content when offline.
- AV1/AVIF
-
A modern, royalty-free video codec with near-universal support outside Safari.
- PWA App Shortcuts
-
Allows developers to configure "long press" or "right-click" options for web apps installed to the home screen or dock.
- Shared Workers and Broadcast Channels
-
Coordination APIs allow applications to save memory and processing power (albeit, most often in desktop and tablet form-factors).
getInstalledRelatedApps()
-
Helps developers avoid prompting users for permissions that might be duplicative with apps already on the system. Particularly important for avoiding duplicated push notifications.
- Background Sync
-
A tool for reliably sending data — for example, chat and email messages — in the face of intermittent network connections.
- Background Fetch API
-
Allows applications to upload and download bulk media efficiently with progress indicators and controls. Important for reliably syncing playlists of music or videos for offline or synchronising photos/media for sharing.
- Periodic Background Sync
-
Helps applications ensure they have fresh content to display offline in a battery and bandwidth-sensitive way.
- Web Share Target
-
Allows installed web apps to receive sharing intents via system UI, enabling chat and social media apps to help users post content more easily.
The list of missing, critical APIs for media, social, e-commerce, 3d apps, and games is astonishing. Essential apps in the most popular categories in the App Store are impossible to attempt on the web on iOS because of feature gaps Apple has created and perpetuates.
Device APIs: The Final Frontier
An area where browsers makers disagree fervently, but where Chromium-based browsers have forged ahead is access to hardware devices. While not used in "traditional" web apps, these features are essential in categories like education and music applications. iOS Safari supports none of them today.
- Web Bluetooth
-
Allows Bluetooth Low Energy devices to safely communicate with web apps, eliminating the need to download heavyweight applications to configure individual IoT devices.
- Web MIDI
-
Enables creative music applications on the web, including synthesisers, mixing suites, drum machines, and music recording.
- Web USB
-
Provides safe access to USB devices from the web, enabling new classes of applications in the browser from education to software development and debugging.
- Web Serial
-
Supports connections to legacy devices. Particularly important in industrial, IoT, health care, and education scenarios.
Web Serial, Web Bluetooth, and Web USB enable educational programming tools to help students learn to program physical devices, including LEGO.
Independent developer Henrik Jorteg has written at length about frustration stemming from an inability to access these features on iOS, and has testified to the way they enable lower cost development. The lack of web APIs on iOS isn't just a frustration for developers. It drives up the prices of goods and services, shrinking the number of organisations that can deliver them.
- Web HID
-
Enables safe connection to input devices not traditionally supported as keyboards, mice, or gamepads.
This API provides safe access to specialised features of niche hardware over a standard protocol they already support without proprietary software or unsafe native binary downloads.
- Web NFC
-
Lets web apps safely read and write NFC tags, e.g. for tap-to-pay applications.
- Shape Detection
-
Unlocks platform and OS provided capabilities for high-performance recognition of barcodes, faces, text in images and video.
Important in videoconferencing, commerce, and IoT setup scenarios.
- Generic Sensors API
-
A uniform API for accessing sensors standard in phones, including Gyroscopes, Proximity sensors, Device Orientation, Acceleration sensors, Gravity sensors, and Ambient Light detectors.
Each entry in this inexhaustive list can block entire classes of applications from credibly being possible on the web. The real-world impact is challenging to measure. Weighing up the deadweight losses seems a good angle for economists to investigate. Start-ups not attempted, services not built, and higher prices for businesses forced to develop native apps multiple times could, perhaps, be estimated.
Incongruous
The data agree: Apple's web engine consistently trails others in both compatibility and features, resulting in a large and persistent gap with Apple's native platform.
Apple wishes us to accept that:
- It is reasonable to force iOS browsers to use its web engine, leaving iOS on the trailing edge.
- The web is a viable alternative on iOS for developers unhappy with App Store policies.
One or the other might be reasonable. Together? Hmm.
Parties interested in the health of the digital ecosystem should look past Apple's claims and focus on the differential pace of progress.
Full disclosure: for the past twelve years I have worked on Chromium at Google, spanning both the pre-fork era where potential features for Chrome and Safari were discussed within the WebKit project, as well as the post-fork epoch. Over this time I have led multiple projects to add features to the web, some of which have been opposed by Safari engineers.
Today, I lead Project Fugu, a collaboration within Chromium that is directly responsible for the majority of the device APIs mentioned above. Microsoft, Intel, Google, Samsung, and others are contributing to this work, and it is being done in the open with the hope of standardisation, and my interest in its success is large.
My front-row seat allows me to state unequivocally that independent software developers are clamouring for these APIs and are ignored when they request support for them from Apple. It is personally frustrating to be unable to deliver these improvements to developers trying to reach iOS users. My bias should be plain.
Previously, I helped lead the effort to develop Service Workers, Push Notifications, and PWAs over the frequent and pointed objections of Apple's engineers and managers. Service Worker design was started as a collaboration between Google, Mozilla, Samsung, Facebook, Microsoft, and independent developers looking to make better, more reliable web applications. Apple only joined the group after other web engines had delivered working implementations. The delay in availability of Service Workers on iOS, as well as highly-requested follow-on features like Navigation Preload, carries an undeniable personal burden.
iOS is unique in disallowing the web from participating in its only app store. macOS's built-in App Store has similar anti-web terms, but macOS allows multiple app stores (e.g. Steam and the Epic Store), along with real browser choice.
Android and Windows directly include support for web apps in their default stores, allow multiple stores, and facilitate true browser choice. ⇐
Failing adequate staffing for the Safari and WebKit teams, we must insist that Apple change iOS policy to allow competitors to safely fill the gaps that Apple's own skinflint choices have created. ⇐
Claims that I, or other Chromium contributors, would happily see engine homogeneity could not be more wrong. ⇐
Some commenters appear to confuse unlike hardware for differences in software. For example, an area where Apple is absolutely killing it is CPU design. Resulting differences in Speedometer scores between flagship Android and iOS devices are demonstrations of Apple's domineering lead in mobile CPUs.
A-series chips have run circles around other ARM parts for more than half a decade, largely through gobsmacking amounts of L2/L3 cache per core. Apple's restrictions on iOS browser engine choice have made it difficult to demonstrate software parity. Safari doesn't run on Android, and Apple won't allow Chromium on iOS.
Thankfully, the advent of M1 Macs makes it possible to remove hardware differences from comparisons. For more than a decade, Apple has been making tradeoffs and unique decisions in cache hierarchy, branch prediction, instruction set, and GPU design. Competing browser makers are just now starting to explore these differences and adapt their engines to take full advantage of them.
As that is progressing, the results are coming back into line with the situation on Intel: Chromium is roughly as fast, and in many cases much faster, than WebKit.
The lesson for performance analysis is, as always, that one must always double-and-triple-check to ensure you actually measure what you hope to. ⇐
Ten years ago, trailing-edge browsers were largely the detritus of installations that could not (or would not) upgrade. The relentless march of auto-updates has largely removed this hurdle. The residual set of salient browser differences in 2021 is the result of some combination of:
- Market-specific differences in browser update rates; e.g., emerging markets show several months of additional lag between browser release dates and full replacement
- Increasingly rare enterprise scenarios in where legacy browsers persist (e.g., IE11)
- Differences in feature support between engines
As other effects fade away, the last one comes to the fore. Auto-updates don't do as much good as they could when the replacement for a previous version lacks features developers need. Despite outstanding OS update rates, iOS undermines the web at large by projecting the deficiencies of WebKit's leading-edge into every browser on every iOS device. ⇐
Perhaps it goes without saying, but the propensity for Firefox/Gecko to implement features with higher quality than Safari/WebKit is a major black eye for Apple.
A scrappy Open Source project without ~$200 billion in the bank is doing what the world's most valuable computing company will not: investing in browser quality and delivering a more compatible engine across more OSes and platforms than Apple does.
This should be reason enough for Apple to allow Mozilla to ship Gecko on iOS. That they do not is all the more indefensible for the tax it places on web developers worldwide. ⇐
The data captured by MDN Browser Compatibility Data Respository and the caniuse database is often partial and sometimes incorrect.
Where I was aware they were not accurate — often related to releases in which features first appeared — or where they disagreed, original sources (browser release notes, contemporaneous blogs) have been consulted to build the most accurate picture of delays.
The presence of features in "developer previews", beta branches, or behind a flag that users must manually flip have not been taken into account. This is reasonable based on several concerns beyond the obvious: that developers cannot count on the feature when it is not fully launched, mooting any potential impact on the market:
- Some features linger for many years behind these flags (e.g. WebGL2 in Safari).
- Features not yet available on release branches may still change in their API shape, meaning that developers would be subject to expensive code churn and re-testing to support them in this state.
- Browser vendors universally discourage users from enabling experimental flags manually
Competing engines led WebKit on dozens of features not included in this list because of the 3+ year lag cut-off.
The data shows that, as a proportion of features landed in a leading vs. trailing way, it doesn't much matter which timeframe one focuses on. The proportion of leading/lagging features in WebKit remains relatively steady. One reason to omit shorter time periods is to reduce the impact of Apple's lethargic feature release schedule.
Even when Apple's Tech Preview builds gain features at roughly the same time as Edge, Chrome, or Firefox's Beta builds, they may be delayed in reaching users (and therefore becoming available to developers) because of the uniquely slow way Apple introduces new features. Unlike leading engines that deliver improvements every six weeks, the pace of new features arriving in Safari is tied to Apple's twice-a-year iOS point release cadence. Prior to 2015, this lag was often as bad as a full year. Citing only features with a longer lag helps to remove the impact of such release cadence mismatch effects to the benefit of WebKit.
It is scrupulously generous to Cupertino's case that features with a gap shorter than three years were omitted. ⇐
One effect of Apple's forced web engine monoculture is that, unlike other platforms, issues that affect WebKit impact every other browser on iOS too.
Not only do developers suffer an unwelcome uniformity of quality issues, users are impacted negatively when security issues in WebKit create OS-wide exposure to problems that can only be repaired at the rate OS updates are applied. ⇐
The three-year delay in Apple implementing Pointer Events for iOS is in addition to delays due to Apple-generated licensing drama within the W3C regarding standardisation of various event models for touch screen input. ⇐
During the drafting of this post, iOS 14.5 was released and with it, Safari 14.1.
In a bit good-natured japery, Apple initially declined to provide release notes for web platform features in the update.
In the days that followed, belated documentation included a shocking revelation: against all expectations, iOS 14.5 had brought WASM Threads! The wait was over! WASM Threads for iOS were entirely unexpected due to the distance WebKit would need to close to add either true Site Isolation or new developer opt-in mechanisms to protect sensitive content from side-channel attacks on modern CPUs. Neither seemed within reach of WebKit this year.
The Web Assembly community was understandably excited and began to test the claim, but could not seem to make the feature work as hoped.
Soon after, Apple updated it's docs and provided details on what was, in fact, added. Infrastructure that will eventually be necessary for a WASM Threading solution in WebKit was made available, but it's a bit like an engine on a test mount: without the rest of the car, it's beautiful engineering without the ability to take folks where they want to go.
WASM Threads for iOS had seen their shadow and six more months of waiting (minimum) are predicted. At least we'll have one over-taxed CPU core to keep us warm. ⇐
It's perverse that users and developers everywhere pay a tax for Apple's under-funding of Safari/WebKit development, in effect subsidising the world's wealthiest firm. ⇐
Safari uses a private API not available to other iOS browsers for installing web apps to the home screen.
Users who switch their browser on iOS today are, perversely, less able to make the web a more central part of their computing life, and the inability for other browsers to offer web app installation creates challenges for developers who must account for the gap and recommend users switch to Safari in order to install their web experience. ⇐
Reactive Data With Modern JavaScript
A silly little PWA has been brewing over the past couple of weekends to make a desktop-compatible version of a mobile-only native app using Web Bluetooth.
I'm incredibly biased of course, but the Project Fugu 🐡 APIs are a lot of fun. There's so much neat stuff we can build in the browser now that HID, Serial, NFC, Bluetooth and all the rest are available. It has been a relaxing pandemic distraction to make time to put them through their paces, even if developing them is technically the day job too.
Needless to say, browsers that support Web Bluetooth are ultra-modern1. There's no point in supporting legacy browsers that don't have this capability, which means getting to use all the shiny new stuff; no polyfills or long toolchains. Fun!
In building UI with lit-html
, trigger rendering without littering code with calls to render(...)
can be a challenge. Lots of folks use data store libraries that provide a callback life-cycle, but they seem verbose and I only want things to be as complicated as they are complex.
Being reactive to data changes without a passel of callbacks only needs:
- An object that can be an event source for listeners
- Some way to be notified of data changes
That's it! Before modern runtimes, we needed verbose, explicit API surface. But it's 2021, and we can do more with less now thanks to Proxies
and subclassable EventTarget
.
Hewing to the "data down, events up" convention of Web Components, here's a little function my small app is using instead of a "state management" library:
/**
*
* proxyFor.js
*
* Utilities for wrapping an object or graph in a Proxy
* that dispatches `ondatachange` events to an EventTarget.
*
*/
//
// Bookeeping
//
let objToProxyMap = new WeakMap();
const doNotProxy = Symbol.for("doNotProxy");
const isProxied = Symbol.for("isProxied");
let inDoNotProxy = (obj, prop) => {
if (prop === doNotProxy) { return true; }
if (obj) {
if (prop && obj[doNotProxy]) {
if (obj[doNotProxy].indexOf(prop) !== -1) {
return true;
}
}
}
return false;
};
let shouldNotProxy = (thing) => {
return (
(thing === null) ||
(typeof thing !== "object") ||
(objToProxyMap.has(thing))
);
};
//
// proxyFor() supports two modes, "currentOnly" or "shallow"
// proxying (which is the default) avoids creating new wrappers
// for objects extracted from properties on the passed object.
// This is faster but requires that developers understand the
// limitations.
//
// The other mode, deep proxies, create new wrappers around
// each object returned from any property. This mode recursively
// wraps sub-objects in proxies that notify the passed
// EventTarget.
//
// Note that in the case of an object that is itself an
// EventTarget, one can pass it as both the first and second
// argument to notify on it directly. This also provides
// flexibility so that a notifying proxy can be wired up
// to send change events to a *different* object.
//
export let proxyFor = (thing, eventTarget=null,
currentOnly=true, path=[]) => {
// Bail if not an object, or if already proxied
if (shouldNotProxy(thing)) {
return thing;
}
if (!eventTarget) {
console.error(
"Missing eventTarget. Could not proxy for", thing);
return thing;
}
let dataProperties = currentOnly ?
new Set(Object.keys(thing)) : null;
let inDataProperties = (prop) => {
return (!currentOnly || dataProperties.has(prop));
};
let p = new Proxy(thing, {
get: function(obj, prop, receiverProxy) {
// Avoid any potential re-wrapping
if (prop && prop === isProxied) { return true; }
let value = Reflect.get(...arguments);
let valueType = (typeof value);
if (valueType === "undefined") { return; }
if (valueType === "object" &&
value !== null &&
value[isProxied]) {
return value;
}
if (objToProxyMap.has(value)) {
return objToProxyMap.get(value);
}
// Avoid `this` confusion for functions
if ((valueType === "function") &&
(prop in EventTarget.prototype)) {
return value.bind(obj);
}
// Do not create wrappers for sub-objects
// in these cases
if (inDoNotProxy(obj, prop) ||
inDataProperties(prop)) {
return value;
}
// Handle object trees by returning a wrapper
return proxyFor(value, eventTarget, currentOnly,
path.concat(prop));
},
set: function(obj, prop, value) {
if (!dataProperties || dataProperties.has(prop)) {
let evt = new CustomEvent("datachange",
{ bubbles: true, cancelable: true, }
);
evt.oldValue = thing[prop];
evt.value = value;
evt.dataPath = path.concat(prop);
evt.property = prop;
eventTarget.dispatchEvent(evt);
}
obj[prop] = value;
return true;
}
});
objToProxyMap.set(thing, p);
return p;
};
// For deep objects that are themselves EventTargets
export let deepProxyFor = (thing) => {
return proxyFor(thing, thing, false);
};
One way to use this is to mix it in with a root object that is itself an EventTarget
:
// AppObject.js
import { proxyFor, deepProxyFor } from "./proxyFor.js";
// In modern runtimes, EventTarget is subclassable
class DataObject extends EventTarget {
aNumber = 0.0;
aString = "";
anArray = [];
// ...
constructor() {
super();
// Cheeky and slow, but works
return deepProxyFor(this);
}
}
export class AppObject extends DataObject {
// We can handle inherited properties mixed in
counter = 0;
doStuff() {
this.counter++;
this.aNumber += 1.1;
this.aString = (this.aNumber).toFixed(1) + "";
this.anArray.length += 1; // Handled
}
}
The app creates instances of AppObject
and subscribes to datachange
events to drive UI updates once per frame:
<script type="module">
import { html, render } from "lit-html";
import { AppObject } from "./AppObject.js";
let app = new AppObject();
let mainTemplate = (obj) => {
return html`
<pre>
A Number: ${obj.aNumber}
A String: "${obj.aString}"
Array.length: ${obj.anArray.length}
Counter: ${obj.counter}
</pre>
<button @click=${() => { obj.counter++; }}>+</button>
<button @click=${() => { obj.counter--; }}>-</button>
`;
};
// Debounce to once per rAF
let updateUI = (() => {
let uiUpdateId;
return function (obj, tmpl, node, evt) {
if (!node) { return; }
if (uiUpdateId) {
cancelAnimationFrame(uiUpdateId);
uiUpdateId = null;
}
uiUpdateId = requestAnimationFrame(() => {
// Logs/renders once per frame
console.log(evt.type, Date.now());
render(tmpl(obj), node);
});
}
})();
// Wire the template to be re-rendered from data
let main = document.querySelector("main");
app.addEventListener("datachange", (evt) => {
// Not debounced, called in quick succession by
// setters in `doStuff`
updateUI(app, mainTemplate, main, evt);
});
setInterval(app.doStuff.bind(app), 1000);
</script>
<!-- ... -->
This implementation debounces rendering to once per requestAnimationFrame()
, which can be extended/modified however one likes.
There are other caveats to this approach, some of which veritably leap off the page:
- There are lurking memory leaks which a production app would want to fix
- Private class properties and methods don't work, either on
DataObj
or subclasses. Caveat emptor! - If you want something like "middleware" from other (less idiomatic) systems, you'll need to extend
proxyFor
ever so slightly - The performance of getters on objects wrapped this way is likely to not be great compared to "regular" objects, but the wrapping is lazy
- The
dataPath
and own-property options are a bit of a flourish and a real system could easily do without to save memory - There are many edge cases the proxies don't catch
In general, we win idiomatic object syntax for most operations at the expense of breaking private properties, but for a toy, it's a fun start.
Here's another way to use this, routing updates on a data object through an existing element:
<!-- A DOM-driven reactive incrementer -->
<script type="module">
import { proxyFor } from "./proxyFor.js";
let byId = window.byId =
document.getElementById.bind(document);
let count = byId("count");
count.data = proxyFor({ value: 0 }, count);
// Other parts of the document can listen for this
count.addEventListener("datachange", (evt) => {
count.innerText = evt.value;
});
</script>
<h3>
Current count:
<span id="count">0</span>
</h3>
<button id="increment"
onclick="byId('count').data.value++">
increment
</button>
<button id="decrement"
onclick="byId('count').data.value--">
decrement
</button>
You can try a silly little test page, wonder at the obligatory reactive incrementer demo, or the Svelte Store API implemented using proxyFor
.
Sorry iOS users, there are no modern browsers available for your platform because Apple is against meaningful browser-choice, no matter what colour lipstick vendors are allowed to put on WebKit. ⇐