Safari iOS9 Content Expansion Block Extension Not Called

I play with XCode7 beta trying to test the shiny new Content Blocking Extension . The example class accepts the same NSExtensionRequestHandling protocol as an extension (already known) of the sharing extension. The significant difference from the Shareing extension is that the class is a simple subclass of NSObject . and not *ViewController , because, as you know, the Blocker Extension should not show any feedback on the interface, this is at least my understanding. In any case, the decisive method beginRequestWithExtensionContext , which should be served The declaration of a JSON blocker at the extension point does not receive a TRUEPREDICATE extension has TRUEPREDICATE as its NSExtensionActivationRule , and Safari confirms the existence of my host application in the new Safari configuration “Content Blockers.” But there is still no cigar.

Does anyone know if he even suggested that he was already working at the beginning of beta testing or was it just a press release?

And, oh, while we're on it, is there any documentation for this declarative JSON format, or is it just my Google-Fu that I failed? :)

+6
source share
4 answers

How do you know the extension is not caused?

I built a very fast test application and made a simple NSLog() from the beginRequestWithExtensionContext method, and it was called when the extension was turned on.

In addition, fwiw, there +[SFContentBlockerManager reloadContentBlockerWithIdentifier:completionHandler:] , which allows you to start the update from the main application at will.

+5
source

There is no documentation yet, but I found that some characters in the URL prevent JSON from loading. They (the one I found might be bigger): + (as a prefix), $, |, ^

+2
source

Is there any documentation for this declarative JSON format

The webkit.org blog post appears to be the best “official” JSON Content Blocker documentation currently available.

https://www.webkit.org/blog/3476/content-blockers-first-look/

+2
source

Use the device console to view the event log in real time. There you will see your NSLog () calls.

  • Choose Window → Devices from the Xcode menu.
  • Select a device in the left column.
  • Click the up-triangle in the lower left corner of the right pane to display the device console.
+1
source

Source: https://habr.com/ru/post/988849/


All Articles