{"id":13475219,"url":"https://github.com/XWebView/XWebView","last_synced_at":"2025-03-26T23:30:36.655Z","repository":{"id":30759756,"uuid":"34316384","full_name":"XWebView/XWebView","owner":"XWebView","description":"An extensible WebView for iOS (based on WKWebView)","archived":false,"fork":false,"pushed_at":"2019-03-16T09:12:26.000Z","size":367,"stargazers_count":467,"open_issues_count":21,"forks_count":82,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-23T23:17:45.381Z","etag":null,"topics":["hybrid-apps","jsbridge","swift","wkwebview"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XWebView.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-04-21T09:07:16.000Z","updated_at":"2025-02-26T07:55:06.000Z","dependencies_parsed_at":"2022-08-20T23:30:45.859Z","dependency_job_id":null,"html_url":"https://github.com/XWebView/XWebView","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XWebView%2FXWebView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XWebView%2FXWebView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XWebView%2FXWebView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XWebView%2FXWebView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XWebView","download_url":"https://codeload.github.com/XWebView/XWebView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245753818,"owners_count":20666818,"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":["hybrid-apps","jsbridge","swift","wkwebview"],"created_at":"2024-07-31T16:01:18.428Z","updated_at":"2025-03-26T23:30:36.205Z","avatar_url":"https://github.com/XWebView.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# XWebView - eXtensible WebView for iOS\n\n[![Build Status](https://travis-ci.org/XWebView/XWebView.svg?branch=master)](https://travis-ci.org/XWebView/XWebView)\n\n## Introduction\n\nXWebView is an extensible WebView which is built on top of [WKWebView](https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKWebView_Ref/), the modern WebKit framework debuted in iOS 8.0. It provides fast Web runtime with carefully designed plugin API for developing sophisticated iOS native or hybrid applications.\n\nPlugins written in Objective-C or Swift programming language can be automatically exposed in JavaScript context. With capabilities offered by plugins, Web apps can look and behave exactly like native apps. They will be no longer a second-class citizen on iOS platform.\n\n## Sample Project\n\nFor a complete example on how to use XWebView including both Swift and JavaScript code, see the [Sample Project](https://github.com/XWebView/Sample).\n\n## Features\n\nBasically, plugins are native classes which can export their interfaces to a JavaScript environment. Calling methods and accessing properties of a plugin object in JavaScript result in same operations to the native plugin object. If you know the [Apache Cordova](https://cordova.apache.org/), you may have the concept of plugins. Well, XWebView does more in simpler manner.\n\nUnlike Cordova, you needn't to write JavaScript stubs for XWebView plugins commonly. The generated stubs are suitable for most cases. Stubs are generated dynamically in runtime by type information which is provided by compiler. You still have opportunity to override stubs for special cases.\n\nThe form of XWebView plugin API is similar to the [scripting API of WebKit](https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html) which is only available on OS X. Although the JavaScript context of WKWebView is not accessible on iOS, the communication is bridged through [message passing](https://developer.apple.com/library/mac/documentation/WebKit/Reference/WKUserContentController_Ref/index.html#//apple_ref/occ/instm/WKUserContentController/addScriptMessageHandler:name:) under the hood.\n\nBesides mapping to an ordinary JavaScript object, a plugin object can also be mapped to a JavaScript function. Calling of the function results in an invocation of a certain native method of the plugin object.\n\nFurther more, JavaScript constructor is also supported. A plugin can have multiple instances. In this case, an initializer is mapped to the function of constructor. Meanwhile, principal object of the plugin is created as the prototype of constructor. Each instance has a pair of native and JavaScript object which share the same life cycle and states.\n\nXWebView is designed for embedding. It's easy to adopt since it's an extension of WKWebView class. Basically, creating and loading plugin objects are the only additional steps you need to handle. Additionally, XWebView offers 2 threading modes for plugin: Grand Central Dispatch(GCD) and NSThread.\n\nFor more documents, please go to the project [Wiki](../../wiki).\n\n## Minimum Requirements:\n\n* Development:  Xcode 8.2\n* Deployment:   iOS 9.0\n\n## XWebView vs. Swift\n\n| Swift |  XWebView  |\n| ----- | ---------- |\n| 3.1   |   0.12.1   |\n| 3.0.2 |   0.12.0   |\n| 3     |   0.11.0   |\n| 2.3   |   0.10.0   |\n| 2.2   |   0.10.0   |\n\n\n## License\n\nXWebView is distributed under the [Apache License 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXWebView%2FXWebView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FXWebView%2FXWebView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXWebView%2FXWebView/lists"}