{"id":29631874,"url":"https://github.com/dmytriigolovanov/webkit-user-agent","last_synced_at":"2026-04-02T02:41:45.457Z","repository":{"id":40698321,"uuid":"434663204","full_name":"dmytriigolovanov/webkit-user-agent","owner":"dmytriigolovanov","description":"Conveniently getting the User Agent through WKWebView","archived":false,"fork":false,"pushed_at":"2022-11-14T12:01:34.000Z","size":46,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T17:50:46.943Z","etag":null,"topics":["cocoapods","ios","macos","spm","swift","swiftpackagemanager","useragent","webkit","wkwebview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmytriigolovanov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-03T16:30:13.000Z","updated_at":"2023-07-03T15:28:52.000Z","dependencies_parsed_at":"2022-08-18T23:51:03.868Z","dependency_job_id":null,"html_url":"https://github.com/dmytriigolovanov/webkit-user-agent","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dmytriigolovanov/webkit-user-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmytriigolovanov%2Fwebkit-user-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmytriigolovanov%2Fwebkit-user-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmytriigolovanov%2Fwebkit-user-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmytriigolovanov%2Fwebkit-user-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmytriigolovanov","download_url":"https://codeload.github.com/dmytriigolovanov/webkit-user-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmytriigolovanov%2Fwebkit-user-agent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266197369,"owners_count":23891286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","ios","macos","spm","swift","swiftpackagemanager","useragent","webkit","wkwebview"],"created_at":"2025-07-21T12:05:45.323Z","updated_at":"2026-04-02T02:41:45.431Z","avatar_url":"https://github.com/dmytriigolovanov.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebKit User Agent\n\n## Requirements\n\n* **Swift 5.3**\n* **iOS 11.0+**\n* **macOS 10.13+**\n\n## Installation\n\nSee the subsections below for details about the different installation methods.\n1. [CocoaPods](#cocoapods)\n2. [Swift Package Manager](#swift-package-manager)\n\n### CocoaPods\n\n1. Prepare project for CocoaPods usage by [CocoaPods - Install / Get Started](https://cocoapods.org)\n2. Add pod to project's profile\n```ruby\n    pod 'WebKitUserAgent'\n```\n3. Install pod\n```console\n    cd {PATH_TO_PROJECT}\n    pod install\n```\n\n\n### Swift Package Manager\n\n1. Go to project\n2. `File` → `Add Packages...`\n3. Search for library, using URL: \n```\n    https://github.com/dmytriigolovanov/webkit-user-agent\n```\n4. Set the `Dependency Rule` to `Up to Next Major Version`\n5. `Add Package`\n\n## Using\n\nImport library to needed swift file.\n\n```swift\n    import WebKitUserAgent\n```\n\nLibrary provides 3 variants of usage.\n1. With prepared `WKWebView`.\n\n**example:**\n\n```swift\n    var webView: WKWebView\n    \n    ... \n    \n    DispatchQueue.main.async {\n        let userAgent = webView.userAgent\n    }\n}\n```\n\n2. With default `WKWebView`.\n\n**example:**\n\n```swift\n    WKUserAgent.fetchDefault { userAgent in\n    \n    }\n```\n\n3. With `applicationName`.\nApplication name is additional part for User Agent, which will be added at the end of original WebView's User Agent.\nProvided `overrideDefaultApplicationName` parameter for using/rewriting default `applicationName` from `WKWebViewConfiguration`.\n(By default this parameter is `false`)\n\n**example:**\n```swift\n    let applicationName = \"EXAMPLE/1.0.0\"\n    \n    WKUserAgent.fetch(\n        withApplicationName: applicationName, \n        overrideDefaultApplicationName: true\n    ) { userAgent in\n    \n    }\n```\n\n\n## License\n\nThe contents of this repository are licensed under the\n[MIT License](https://github.com/dmytriigolovanov/webkit-user-agent/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmytriigolovanov%2Fwebkit-user-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmytriigolovanov%2Fwebkit-user-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmytriigolovanov%2Fwebkit-user-agent/lists"}