Commit 930eebc tvinzz
committed
1 parent 5a1c799 commit 930eebc Copy full SHA for 930eebc
File tree 1 file changed +6
-10
lines changed
Sources/ContentBlockerConverter/Compiler
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,6 @@ class BlockerEntryFactory {
269
269
types. add ( " document " ) ;
270
270
}
271
271
if rule. hasContentType ( contentType: NetworkRule . ContentType. SUBDOCUMENT) {
272
- // `child-frame` resource type is supported since Safari 15
273
272
if !SafariService. current. version. isSafari15 ( ) {
274
273
types. add ( " document " ) ;
275
274
}
@@ -306,17 +305,14 @@ class BlockerEntryFactory {
306
305
307
306
private func addLoadContext( rule: NetworkRule , trigger: inout BlockerEntry . Trigger ) -> Void {
308
307
var context = [ String] ( ) ;
309
- if rule . hasContentType ( contentType : NetworkRule . ContentType . SUBDOCUMENT ) {
310
- // `child-frame` resource type is supported since Safari 15
311
- if SafariService . current . version . isSafari15 ( ) {
308
+ // `child-frame` and `top-frame` contexts are supported since Safari 15
309
+ if SafariService . current . version . isSafari15 ( ) {
310
+ if rule . hasContentType ( contentType : NetworkRule . ContentType . SUBDOCUMENT ) {
312
311
context. append ( " child-frame " ) ;
313
- }
314
- }
315
- if rule. hasRestrictedContentType ( contentType: NetworkRule . ContentType. SUBDOCUMENT) {
316
- // `top-frame` resource type is supported since Safari 15
317
- if SafariService . current. version. isSafari15 ( ) {
312
+ }
313
+ if rule. hasRestrictedContentType ( contentType: NetworkRule . ContentType. SUBDOCUMENT) {
318
314
context. append ( " top-frame " ) ;
319
- }
315
+ }
320
316
}
321
317
if context. count > 0 {
322
318
trigger. loadContext = context;
You can’t perform that action at this time.
0 commit comments