declarativeNetRequest.getMatchedRules() not working on iOS 18 Safari

declarativeNetRequest.getMatchedRules() gives us the below error:

Error retrieving tabs or matched rules: – Error: Invalid call to declarativeNetRequest.getMatchedRules(). The 'activeTab' permission has not been granted by the user for the tab.

We have added the "activeTab" permissions in the manifest (version 2). And in the device Safari extension settings we see that user has given permission as "allow".

Answered by Engineer in 805440022

Does your extension have the declarativeNetRequestFeedback permission?

When you are seeing the call to getMatchedRules fail - have you interacted with the extension on that tab? I see that you have given permission to that domain in the past, but that isn't enough to grant the activeTab permission on that specific page load.

This issue is happening in Safari iOS 18

Accepted Answer

Does your extension have the declarativeNetRequestFeedback permission?

When you are seeing the call to getMatchedRules fail - have you interacted with the extension on that tab? I see that you have given permission to that domain in the past, but that isn't enough to grant the activeTab permission on that specific page load.

declarativeNetRequest.getMatchedRules() not working on iOS 18 Safari
 
 
Q