Hi,
I'm trying to implement a "content blocker" using the DeclarativeNetRequest permission in a Safari Web Extension.
I tried to customize the sample app (ios+MacOS) provided by Apple (https://developer.apple.com/documentation/safariservices/safari_web_extensions/adopting_declarative_content_blocking_in_safari_web_extensions).
However, I observe :
a random behaviour on iOS15: rules do not always apply, or are not reloaded
crashes on Monterey Beta9 and Safari 15.1 : com.apple.Safari.ContentBlockerLoader crashes on WebKit:runInitializeCode after ConteRuleListStore...
Crash Report
Any idea?
Is this a "very beta" feature... documentation is so poor compared to Google's.
Thanks
Post
Replies
Boosts
Views
Activity
Hi,
I'm having headaches with the debugging of my Unwanted Communication Reporting extension.
iPhone log says:
com.apple.IdentityLookup.MessageFilter[1774] <Error>: Extension's containing app (appID <private>) unauthorized to defer requests to host <private>
So I guess I have something wrong with my apple-app-site-association.
The AASA file I get with swcutil dl -d services.mydomain.com
{
classificationreport = {
apps = (
"<MYTEAMID>.com.mydomain.myapp",
"<MYTEAMID>.com.mydomain.myapp.unwanted"
);
};
}
where .com.mydomain.myapp is my containing app (bundle id).
and .com.mydomain.myapp.unwanted is my extension
The AASA file on the server is obviously in JSON format and correctly served from the server : services.mydomain.com
In the extension Info.plist I've set the following :
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>ILClassificationExtensionNetworkReportDestination</key>
<string>https://services.mydomain.com/path/unwanted/report</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.identitylookup.classification-ui</string>
</dict>
I suppose the reply from classificationResponse method is correct since MessageFilter "tries" to send the request.
Where am I mistakening ?
Difficult to debug... MessageFilter's log keeps interesting data as private (so there is no way to check what it's actually doing). And I've found no way to go deeper in the debug process.
Many thanks
Emmanuel
Hello,
I can't figure out how to set the name of a Content Blocker in the Safari extensions list. So far, the Content Blocker name in this list is the Contaning application name.
I tried to set the bundle name in Info.plist and tried to locate Info.plist, without success...
Since I also bundle a Safari ("chrome") extension, I have two extensions in the list, and it would be fine to display a specific name for each to make it clear for the user.