-
Notifications
You must be signed in to change notification settings - Fork 821
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/Fixtures/TestProject/ContentBlocker/Configs/legacy/Debug.xcconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
API_PATH = https://dev.google.com |
1 change: 1 addition & 0 deletions
1
Tests/Fixtures/TestProject/ContentBlocker/Configs/legacy/Release.xcconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
API_PATH = https://release.google.com |
22 changes: 22 additions & 0 deletions
22
Tests/Fixtures/TestProject/ContentBlocker/ContentBlockerRequestHandler.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// ContentBlockerRequestHandler.swift | ||
// ContentBlocker | ||
// | ||
// Created by Thanh Vu on 31/10/2023. | ||
// | ||
|
||
import UIKit | ||
import MobileCoreServices | ||
|
||
class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling { | ||
|
||
func beginRequest(with context: NSExtensionContext) { | ||
let attachment = NSItemProvider(contentsOf: Bundle.main.url(forResource: "blockerList", withExtension: "json"))! | ||
|
||
let item = NSExtensionItem() | ||
item.attachments = [attachment] | ||
|
||
context.completeRequest(returningItems: [item], completionHandler: nil) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.Safari.content-blocker</string> | ||
<key>NSExtensionPrincipalClass</key> | ||
<string>$(PRODUCT_MODULE_NAME).ContentBlockerRequestHandler</string> | ||
</dict> | ||
</dict> | ||
</plist> |
10 changes: 10 additions & 0 deletions
10
Tests/Fixtures/TestProject/ContentBlocker/blockerList.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"action": { | ||
"type": "block" | ||
}, | ||
"trigger": { | ||
"url-filter": "webkit.svg" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
targetTemplates: | ||
ContentBlockerTemplate: | ||
platform: iOS | ||
type: app-extension | ||
settings: | ||
CODE_SIGN_IDENTITY: Apple Development | ||
configFiles: | ||
Debug: ContentBlocker/Configs/${version}/Debug.xcconfig | ||
Release: ContentBlocker/Configs/${version}/Release.xcconfig | ||
sources: | ||
- ContentBlocker | ||
|
||
globalTemplateAttributes: | ||
version: legacy | ||
|
||
name: Demo | ||
options: | ||
createIntermediateGroups: True | ||
targets: | ||
Demo: | ||
type: application | ||
platform: iOS | ||
deploymentTarget: "10.0" | ||
sources: | ||
- DemoXcodeGenGlobalTemplateAttribute | ||
ContentBlocker: | ||
templates: | ||
- ContentBlockerTemplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters