Custom block web page for NetworkExtension Filter extension

Is possible to customize/specify the block page when a host is blocked by NEFilterProvider extension? I dont see a call for this. Just want to confirm before I open a Radar.

You have a limited degree of customisation here. I don’t recall the details off the top of my head but if you search the framework headers for “remediat” (as in “remediate” and “remediation”) and then follow the docs from there you’ll find the options currently available.

If these are insufficient then, yes, please feel free to file an enhancement request describing your requirements, then post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for the reply! I submitted an enhancement request.


Bug number is 32289841.

On a related note, is it possible to have the Safari remediation link open your app using a custom URL scheme?


The docs for NEFilterDataProvider -handleRemediationForFlow say it is "called when the user clicks on the remediation link in the “block” web page in a WebKit browser object and the target of the remediation link is not set to a web page", so non-web URLs were clearly anticipated by the API, and I do get the callback when I set the remediation URL to be "myscheme://".

However I get this console error when I click on my remediation link, which makes me wonder what the point of -handleRemediationForFlow is:

error 08:38:43.091324 -0800 FilterDataExtension -[NEFilterDataExtensionProvide:198 URL is not http or https

In -handleRemediationForFlow I'm unable to bring up my app - the network extensions don't appear to have access to an openURL methods like apps and some other extensions do.


As a workaround I could set the remediation URL to an actual web page that contained a link to my custom scheme, but that's really not ideal.


Side note: I notice the URL for the remediation link that actually appears in Safari isn't my remediation URL but rather a pointer to the content provider scheme: x-apple-content-filter://nefilter-unblock. That makes sense for the remediation callback to work, and explains why Safari doesn't just pop up my app.

so non-web URLs were clearly anticipated by the API

Honestly, I don’t understand the remediation stuff well enough to comment on the big picture stuff here. If you’d like me to research a definitive answer, you should open a DTS tech support incident and we can pick things up in that context.

the network extensions don't appear to have access to an openURL methods

Correct. Your control provider (but not your data provider) should have access to the UserNotification framework, so you could post a notification that would make it easy for the user to launch your app.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks Quinn - the control provider does indeed have access to user notifications. That'll work for now, and I filed RADAR 36363570 for the ability to open our app right from the remediation link.


Eric

Custom block web page for NetworkExtension Filter extension
 
 
Q