WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
320812
Web Extensions load with significant delay on iOS 26.6 when Safari is cold launched
https://bugs.webkit.org/show_bug.cgi?id=320812
Summary
Web Extensions load with significant delay on iOS 26.6 when Safari is cold la...
Jeffrey Kuiken
Reported
2026-08-01 13:43:08 PDT
On iOS 26.6, there is a significant delay (up to multiple seconds) before Web Extensions are loaded and their content scripts/stylesheets are injected into a page when Safari is launched (and it wasn't in memory). After the extension is loaded for the first time, the content script is loaded immediately (as expected) on subsequent page loads. Users expect their installed extensions to be ready as soon as a page loads. A significant delay before an extension is loaded by Safari (long enough for a user to observe the page without the extension's intended effects) is bad for user experience and leads to confusion. I've attached an Xcode project which includes a simple extension that shows an alert as soon as its content script is loaded. Steps to reproduce: 1. Install example project on a device with iOS 26.6 and enable the extension 2. Load any website, e.g. example.com 3. Notice how immediately upon page load, an alert is shown 4. Close Safari from the multitasking menu 5. Open Safari 6. Notice how there's a delay before the alert is shown 7. After the alert is shown, refresh the page, and the alert will be shown immediately again I have not tested this yet on macOS 26.6 or iOS 27. iOS 26.5 and earlier did not have this issue.
Attachments
Example Xcode project
(343.89 KB, application/zip)
2026-08-01 14:15 PDT
,
Jeffrey Kuiken
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-08-01 13:43:13 PDT
<
rdar://problem/183827503
>
Jeffrey Kuiken
Comment 2
2026-08-01 13:59:40 PDT
This seems to be an accidental duplicate of
https://bugs.webkit.org/show_bug.cgi?id=320812
, apologies!
Jeffrey Kuiken
Comment 3
2026-08-01 14:01:08 PDT
And of course I accidentally pasted in the wrong URL in that comment. This issue is a duplicate of
https://bugs.webkit.org/show_bug.cgi?id=320811
(320811 also contains the right attachment). Apologies again!
Alexey Proskuryakov
Comment 4
2026-08-01 14:04:53 PDT
***
Bug 320811
has been marked as a duplicate of this bug. ***
Jeffrey Kuiken
Comment 5
2026-08-01 14:15:19 PDT
Created
attachment 480905
[details]
Example Xcode project
Jeff Johnson
Comment 6
2026-08-01 18:36:21 PDT
I can reproduce this on an iPhone SE (3rd generation). I don't think I'm seeing the bug on iPad. However, on both iPad and iPhone there is sometimes very slow page loading after relaunching Safari, though this happens with extensions disabled too.
Jeff Johnson
Comment 7
2026-08-02 03:55:39 PDT
Just to add some empirical evidence, there's an App Store user review mentioning the iOS 26.6 problem:
https://apps.apple.com/us/app/noir-dark-mode-for-safari/id1581140954?see-all=reviews&platform=iphone
Timothy Hatcher
Comment 8
2026-08-03 15:50:51 PDT
This does not reproduce for me on a fresh iOS 26.6.1 install nor an established iOS 27 install. Do you have any other extensions installed? What iOS build number do you have installed?
Jeff Johnson
Comment 9
2026-08-03 16:01:55 PDT
(In reply to Timothy Hatcher from
comment #8
)
> This does not reproduce for me on a fresh iOS 26.6.1 install nor an > established iOS 27 install. Do you have any other extensions installed? What > iOS build number do you have installed?
There is no 26.6.1 Everyone is using 26.6 released to the world a week ago
Jeffrey Kuiken
Comment 10
2026-08-04 00:32:47 PDT
(In reply to Timothy Hatcher from
comment #8
)
> This does not reproduce for me on a fresh iOS 26.6.1 install nor an > established iOS 27 install. Do you have any other extensions installed? What > iOS build number do you have installed?
I’m on iOS 26.6, build number 23G71. If a screen recording would help, please let me know.
Ben Nham
Comment 11
2026-08-05 10:11:43 PDT
We haven't been able to repro this so far. For iOS 26.6 specifically, we actually tried to fix an issue that was extremely similar to this (see 313295). What would be really useful here is an all processes CPU trace from Instruments, so we can see what exactly is executing and if this is the same issue. A sysdiagnose would also be useful, since we added some logging around extension launch as part of the aforementioned changes. If you have a Mac with Xcode, you can take a CPU trace like this: 1. Kill Safari on the phone, so the next launch will be a cold launch 2. Attach phone to Mac via USB cable. a. On the phone, enable developer mode in Settings > Privacy & Security if necessary, and click the "Trust" prompt if necessary 3. Start Instruments on the attached Mac (right click Xcode in Dock, Open Developer Tool > Instruments) 4. Select CPU Profiler 5. For the CPU Profiler setup: - Device: select the iPhone - Target: All Processes - Recording mode: Deferred - CPU Profiler: Record Kernel Callstacks (if this shows up) 6. Click the "Start deferred mode recording" button in the sidebar (should be a red dot at top left of window) 7. Launch Safari on the phone w/ the slow initial page load. 8. Click the "Stop recording" button in the sidebar (should be the same button as in 6, but now it should be a black square stop button) 9. Xcode will take some time (like some minutes) to post-process the trace. After that's done, you should be able to save the trace somewhere on disk. Then, create a Feedback Assistant report (
https://developer.apple.com/feedback-assistant/
) and also attach this trace to the report (which should also capture a sysdiagnose and attach it if you give it permission). Attach the Feedback Assistant number here. Thanks!
Jeff Johnson
Comment 12
2026-08-05 10:17:03 PDT
(In reply to Ben Nham from
comment #11
)
> For iOS 26.6 specifically, we > actually tried to fix an issue that was extremely similar to this (see > 313295).
Are you referring to
bug 313295
or commit 313295? Either way, I couldn't tell how they're related.
Timothy Hatcher
Comment 13
2026-08-05 13:28:03 PDT
312231@main
for
bug 313295
.
Jeff Johnson
Comment 14
2026-08-05 16:28:49 PDT
(In reply to Ben Nham from
comment #11
)
> Then, create a Feedback Assistant report > (
https://developer.apple.com/feedback-assistant/
) and also attach this trace > to the report (which should also capture a sysdiagnose and attach it if you > give it permission). Attach the Feedback Assistant number here.
FB24178471
Jeff Johnson
Comment 15
2026-08-06 03:39:32 PDT
I just noticed that the sample Xcode project manifest json is missing "run_at": "document_start". However, the bug still occurs after I add that, which is clearly a problem, because it's not running at document start.
Jeff Johnson
Comment 16
2026-08-06 03:42:47 PDT
This can be seen if I change the content script to alert('Extension loaded: ' + document.readyState); Normally it should say "loading", but with the bug it says "complete".
Jeff Johnson
Comment 17
2026-08-06 04:53:01 PDT
I'm able to reproduce this issue in macOS Safari 26.6 too. The key is to enable multiple web extensions (app extensions have no effect). This may be why you can't reproduce and we can, because we have multiple extensions enabled on our devices.
Jeff Johnson
Comment 18
2026-08-06 04:54:12 PDT
To clarify, in macOS Safari I'm using the setting Safari opens with: All windows from last session.
Ben Nham
Comment 19
2026-08-06 11:37:11 PDT
From looking at that trace, it looks like the cleanup operation introduced in
312231@main
likely fixed one perf issue and introduced another. Previously we had an issue where many old web extension data directories built up over time because we didn't clean up those directories properly. After the patch, we now clean up those directories properly, but the problem is the actual act of cleaning up directories does some unnecessary stuff (for this particular use case) like traverse the entire network cache, which delays first load. We probably need to clean up the way Web Extensions makes these ephemeral storage directories, or change removeWebsiteDataForOrigin to not do unnecessary work for this use case.
Ben Nham
Comment 20
2026-08-06 11:40:39 PDT
Clearing website data from settings will likely get you out of the bad perf state (at the cost of e.g. needing to re-log in to everything), but obviously we need to fix the actual perf issue here.
Sihui Liu
Comment 21
2026-08-06 13:39:21 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/71080
EWS
Comment 22
2026-08-06 17:16:51 PDT
Committed
318756@main
(7f8d70c06222): <
https://commits.webkit.org/318756@main
> Reviewed commits have been landed. Closing PR #71080 and removing active labels.
EWS
Comment 23
2026-08-18 21:31:48 PDT
Committed
316606.407@safari-7625-branch
(295ef224de40): <
https://commits.webkit.org/316606.407@safari-7625-branch
> Reviewed commits have been landed. Closing PR #6365 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug