Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

blastmann/WebViewJavascriptBridgeRT

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebViewJavascriptBridgeRT

A WinRT 8.1 WebViewJavascriptBridge, you can send message between C# and JS with WebView.

HOW TO?

To use a WebViewJavascriptBridge, please follow these steps.

First

Create a bridge instance, pass your target WebView.

var bridge = new WebViewJavascriptBridge(TestWebView, (data, callback) =>
{
    Debug.WriteLine(@"Receive message from JS: " + data);
    callback(@"Response for message from C#");
});

Register native function for your JS

bridge.RegisterHandler(@"testCSharpCallback", (data, callback) =>
{
    Debug.WriteLine(@"Receive message from JS: " + data);
    callback(@"Response from testCSharpCallback");
});

Then you can call C# code by sending testCSharpCallback string to native.

What's next?

  • Keep improving performance of sending message from JS.

About

A WinRT 8.1 WebViewJavascriptBridge

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.