# SafariConverterLib **Repository Path**: ixuea/SafariConverterLib ## Basic Information - **Project Name**: SafariConverterLib - **Description**: No description available - **Primary Language**: Unknown - **License**: LGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-08 - **Last Updated**: 2021-07-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Swift Safari Converter Content Blocker converter swift code ## Safari Content Blocker Converts filter rules in AdGuard format to the format supported by Safari. * https://webkit.org/blog/3476/content-blockers-first-look/ ### How to build: ``` swift build ``` ### Tests: ``` swift test ``` ### How to use converter: ``` let result: ConversionResult? = ContentBlockerConverter.convertArray( rules: [String], safariVersion: SafariVersions = .DEFAULT, optimize: Bool = false, advancedBlocking: Bool = false ); ``` Please note, that `safariVersion` must be an instance of enum SafariVersions. The result contains following properties: - totalConvertedCount: length of content blocker - convertedCount: length after reducing to limit (depends on provided Safari version) - errorsCount: errors count - overLimit: is limit exceeded flag (the limit depends on provided Safari version) - converted: json string of content blocker rules - advancedBlocking: json string of advanced blocking rules ### How to use converter from command line: ``` ./ConverterTool -safariVersion=14 -optimize=true -advancedBlocking=false <