This can be easily implemented with the WKPagePolicyClient.
Created attachment 99822 [details] Patch
Committed r90551: <http://trac.webkit.org/changeset/90551>