How to get referred host info from new tab or windows ( NEFilterDataProvide )

Hi Apple.

We are trying to get referred host info from new window or new tab in NEFilterDataProvider in IOS.

For example, if we open YouTube link (YouTube.com/abc) in a new tab or new window from the host site(abc.com), how can we get this referred host info from new tab or new windows ?

We would like to implement to block to load YouTube or media link in same host web site, in new tab or in new windows (if users click the Youtube or media link in the host site )

We know how to get host info if we load YouTube in the same host site ( we check header field to get host info in same tab, but could not find the way to get referred host info from new tab or new windows )

Thank you.

Replies

A Referer header field would be an optional HTTP construct that may or may not be available. When working with NEFilterDataProvider, you can get the host (when available) of the the current flow that Safari is accessing, but the last host that was accessed on a different flow from Safari will not also be available in handleNewFlow's NEFilterFlow object. You could attempt to keep track of this in the Provider, but you would have to construct a way to build a contextual mapping from one Safari flow to another and this may not be what you are looking for.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com