# marcuswestin/webviewjavascriptbridge

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/marcuswestin-webviewjavascriptbridge).**

14,321 stars · 2,963 forks · Objective-C · MIT

## Links

- GitHub: https://github.com/marcuswestin/WebViewJavascriptBridge
- Homepage: http://marcuswest.in
- awesome-repositories: https://awesome-repositories.com/repository/marcuswestin-webviewjavascriptbridge.md

## Description

WebViewJavascriptBridge is a communication layer for sending bidirectional messages between native Objective-C code and JavaScript within iOS and macOS web views. It serves as an interoperability toolkit for synchronizing data and executing callbacks between native Apple platform applications and their embedded web content.

The project provides a messaging interface that exposes native functions to the web environment and triggers JavaScript handlers from native application code. It enables the registration of named handlers in native code that can be invoked by JavaScript to request device actions.

The bridge manages communication through a named handler registry and a system for callback-based response routing. It utilizes mechanisms such as URL-scheme message passing and string-evaluation execution to facilitate the exchange of data between the native layer and the web view.

## Tags

### Networking & Communication

- [Asynchronous Message-Passing Bridges](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/embedded-browser-bridge-protocols/asynchronous-message-passing-bridges.md) — Implements an asynchronous message-passing bridge for bidirectional communication between Objective-C and JavaScript.
- [Communication Channels](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/communication-channels.md) — Defines named communication channels for exchanging data between native code and JavaScript environments. ([source](https://cdn.jsdelivr.net/gh/marcuswestin/webviewjavascriptbridge@master/README.md))

### Part of an Awesome List

- [Native Object Registrations](https://awesome-repositories.com/f/awesome-lists/devtools/javascript-extensions/native-object-registrations.md) — Registers named native functions that can be invoked from JavaScript to request device actions or data. ([source](https://github.com/marcuswestin/WebViewJavascriptBridge))

### Data & Databases

- [Host-to-Embedded Data Synchronizers](https://awesome-repositories.com/f/data-databases/data-synchronization/data-source-synchronizers/host-to-embedded-data-synchronizers.md) — Provides bidirectional communication channels to synchronize state between a native host and an embedded web view. ([source](https://github.com/marcuswestin/WebViewJavascriptBridge))

### Mobile Development

- [Hybrid App Development](https://awesome-repositories.com/f/mobile-development/hybrid-app-development.md) — Facilitates hybrid application development by bridging native system capabilities with web-based content.
- [WebKit Interoperability](https://awesome-repositories.com/f/mobile-development/native-ios-applications/webkit-interoperability.md) — Provides a toolkit for synchronizing data and executing callbacks between native Apple platform apps and embedded web content.

### Operating Systems & Systems Programming

- [Native Function Invocations](https://awesome-repositories.com/f/operating-systems-systems-programming/native-function-invocations.md) — Provides a mechanism for the web view to invoke native handlers and receive responses via callbacks. ([source](https://cdn.jsdelivr.net/gh/marcuswestin/webviewjavascriptbridge@master/README.md))

### Programming Languages & Runtimes

- [JavaScript Interop](https://awesome-repositories.com/f/programming-languages-runtimes/javascript-interop.md) — Enables synchronization of state and execution of functions between Objective-C native logic and JavaScript.
- [JavaScript-to-Native Bridges](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/interoperability/javascript-to-native-bridges.md) — Implements an asynchronous communication layer to map JavaScript calls to native Objective-C handlers.
- [Native-to-Script Function Invocations](https://awesome-repositories.com/f/programming-languages-runtimes/native-to-script-function-invocations.md) — Implements mechanisms for calling named functions in the JavaScript environment from native Objective-C code. ([source](https://github.com/marcuswestin/WebViewJavascriptBridge))

### Software Engineering & Architecture

- [Web View Script Execution](https://awesome-repositories.com/f/software-engineering-architecture/architectural-design-patterns/design-patterns/functional-design-patterns/functional-programming/closures/function-to-closure-coercions/native-function-closures/native-backed-javascript-functions/web-view-script-execution.md) — Enables triggering specific JavaScript handlers within the web view and capturing return values via native callbacks. ([source](https://cdn.jsdelivr.net/gh/marcuswestin/webviewjavascriptbridge@master/README.md))
- [Named Function Registries](https://awesome-repositories.com/f/software-engineering-architecture/named-function-registries.md) — Maintains a registry of named native handlers that are available for invocation from the web environment.
- [Task-to-Response Mapping](https://awesome-repositories.com/f/software-engineering-architecture/task-to-response-mapping.md) — Maps unique identifiers to specific callback functions to route asynchronous responses from native code back to the caller.

### User Interface & Experience

- [JavaScript Execution Bridges](https://awesome-repositories.com/f/user-interface-experience/javascript-execution-bridges.md) — Provides a mechanism for executing scripts and invoking functions within a web view from a native host application.

### Web Development

- [Web-Native Integration Bridges](https://awesome-repositories.com/f/web-development/web-native-integration-bridges.md) — Provides a bridge that allows web-based content to communicate with and trigger actions within a native host environment.

### Development Tools & Productivity

- [Script String Evaluation](https://awesome-repositories.com/f/development-tools-productivity/mathematical-calculators/string-evaluators/script-string-evaluation.md) — Runs JavaScript functions by injecting and evaluating raw string scripts directly into the web view's execution context.
- [URL Scheme Handlers](https://awesome-repositories.com/f/development-tools-productivity/url-scheme-handlers.md) — Uses custom URL schemes to transmit data from JavaScript to native code via request interception.
