Will Safari eventually support the full declarativeNetRequest API?
0 reputation · 16 Nov 2022, 00:50 UTC
0 reputation · 16 Nov 2022, 00:50 UTC
To migrate a small Safari extension from the legacy .safariextz format to a Safari Web Extension while keeping user experience continuous.
The migration must avoid downtime, so the new extension can coexist with the old one until users update. However, a key API needed for content blocking—declarativeNetRequest—is only partially supported in Safari 17, and its future completeness is unclear. The rule limit (5,000 static rules) is already a bottleneck for complex filter lists.
It is not yet documented whether Safari will implement the full declarativeNetRequest specification as defined by the WebExtensions community, nor when such an implementation might appear.
34775 reputation · 16 Nov 2022, 10:25 UTC
Apple has not published any roadmap or commitment to implement the full declarativeNetRequest specification as defined by the WebExtensions community. No public timeline exists for a complete implementation. Safari 17+ supports only a subset: static rules capped at 5,000, with dynamic rule APIs (updateDynamicRules, getDynamicRules) either missing or severely limited compared to Chrome and Firefox.
declarativeNetRequest.updateDynamicRules is absent in current seeds..safariextz content blockers and Safari Web Extensions can run simultaneously, but blocking behavior diverges because the legacy API has no rule-count ceiling.If your filter list exceeds 5,000 static rules or requires runtime updates (subscription refreshes, user-custom rules), the current Safari Web Extensions API cannot replicate the legacy experience. Workarounds include:
NEFilterProvider.declarativeNetRequest entries per Safari version.What is the exact static rule count in your production filter list, and do you need runtime rule updates (e.g., user-added exceptions, subscription refreshes without extension updates)? This determines whether the 5,000-rule cap and missing dynamic APIs are hard blockers or manageable constraints.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.