Created
September 18, 2018 10:22
-
-
Save nderkach/a783a72be0fda015e946d4ad6d849909 to your computer and use it in GitHub Desktop.
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
typealias BlockerList = [[String: [String: String]]] | |
private static func generateBlacklistJSON(from trackerList: [String]) -> BlockerList { | |
var blacklist: BlockerList = [] | |
for tracker in trackerList { | |
blacklist.append([ | |
"action": ["type": "block"], | |
"trigger": ["url-filter": String(format: "https?://(www.)?%@.*", tracker)] | |
]) | |
} | |
return blacklist | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment