RESOLVED FIXED310393
Reduce memory overhead of user scripts and user styles in extensions with many distinct match patterns
https://bugs.webkit.org/show_bug.cgi?id=310393
Summary Reduce memory overhead of user scripts and user styles in extensions with man...
Ben Nham
Reported 2026-03-20 14:25:16 PDT
Extensions can specify user scripts and user styles with many distinct match patterns, either directly via the extension manifest or due to user behavior (e.g. if the user decides to load extensions only selectively on certain origins and that origin list is very long). In the current implementation of web extensions, this can lead to memory explosion because each distinct match pattern carries its own copy of the same exact user script and user style strings (see how `WebExtensionContext::addInjectedContent` loops over each pattern and creates an `API::UserScript` object for each pattern).
Attachments
Ben Nham
Comment 1 2026-03-20 14:25:49 PDT
Ben Nham
Comment 2 2026-03-20 14:46:03 PDT
EWS
Comment 3 2026-03-23 11:44:01 PDT
Committed 309775@main (4ed5ff4bf1ee): <https://commits.webkit.org/309775@main> Reviewed commits have been landed. Closing PR #61039 and removing active labels.
WebKit Commit Bot
Comment 4 2026-03-24 13:14:01 PDT
Re-opened since this is blocked by bug 310651
Ben Nham
Comment 5 2026-03-26 10:41:40 PDT
EWS
Comment 6 2026-03-26 22:29:31 PDT
Committed 310050@main (2bea83cfe53c): <https://commits.webkit.org/310050@main> Reviewed commits have been landed. Closing PR #61422 and removing active labels.
EWS
Comment 7 2026-03-30 21:21:00 PDT
Committed 305413.598@safari-7624-branch (8c2beed1f79f): <https://commits.webkit.org/305413.598@safari-7624-branch> Reviewed commits have been landed. Closing PR #4846 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.