Currently there is no way to distinguish frames from top windows. Meanwhile this can be really useful for ad blocking. Please read this github issue comments to find out why it may be useful: https://github.com/AdguardTeam/AdguardBrowserExtension/issues/145
Dear Webkit developers, improving the Content Blocker API is very important! It is so close to being great but its limitations hold it back. The #1 source of Content Blocker rules in Safari is via the Adblock Plus formatted lists, and people converting them into Content Blocker rules. All of those lists contain "subdocument" blockers to remove ad-iframes, but to allow direct visits to those pages. Since Safari doesn't distinguish between iframes and direct visits, those rules cannot be written in Safari's Content Blocker. Leading to bugs like this: https://github.com/AdguardTeam/AdguardBrowserExtension/issues/262 Please, improve the Content Blocker API. It's very close to being superb, it just needs more features to uncripple it.
<rdar://problem/49841407>
*** This bug has been marked as a duplicate of bug 219001 ***