Skip to content

Commit b1113d5

Browse files
Move HybridWebView platform code to handlers (attempt 2) (#24952)
* Move HybridWebView platform code to handlers And run everything through the mappers. Fixes #24269 * Run Android tests * `@android.webkit.JavascriptInterface` is missing! By changing `HybridJavaScriptInterface` to a class, the JCW now says: @android.webkit.JavascriptInterface public void sendMessage (java.lang.String p0) --------- Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
1 parent bc37e74 commit b1113d5

File tree

28 files changed

+379
-221
lines changed

28 files changed

+379
-221
lines changed

src/Controls/src/Core/HybridWebView/HybridWebView.cs

Lines changed: 15 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
using System;
2-
using System.Linq;
3-
using System.Threading.Tasks;
4-
using Microsoft.Maui.Devices;
5-
using System.Collections.Generic;
6-
7-
#if WINDOWS || ANDROID || IOS || MACCATALYST
82
using System.Text.Json;
93
using System.Text.Json.Serialization.Metadata;
10-
#endif
4+
using System.Threading.Tasks;
115

126
namespace Microsoft.Maui.Controls
137
{
@@ -39,37 +33,9 @@ public string? HybridRoot
3933
set { SetValue(HybridRootProperty, value); }
4034
}
4135

42-
void IHybridWebView.MessageReceived(string rawMessage)
36+
void IHybridWebView.RawMessageReceived(string rawMessage)
4337
{
44-
if (string.IsNullOrEmpty(rawMessage))
45-
{
46-
throw new ArgumentException($"The raw message cannot be null or empty.", nameof(rawMessage));
47-
}
48-
var indexOfPipe = rawMessage.IndexOf("|", StringComparison.Ordinal);
49-
if (indexOfPipe == -1)
50-
{
51-
throw new ArgumentException($"The raw message must contain a pipe character ('|').", nameof(rawMessage));
52-
}
53-
54-
var messageType = rawMessage.Substring(0, indexOfPipe);
55-
var messageContent = rawMessage.Substring(indexOfPipe + 1);
56-
57-
switch (messageType)
58-
{
59-
case "InvokeMethodCompleted":
60-
{
61-
var sections = messageContent.Split('|');
62-
var taskId = sections[0];
63-
var result = sections[1];
64-
AsyncTaskCompleted(taskId, result);
65-
}
66-
break;
67-
case "RawMessage":
68-
RawMessageReceived?.Invoke(this, new HybridWebViewRawMessageReceivedEventArgs(messageContent));
69-
break;
70-
default:
71-
throw new ArgumentException($"The message type '{messageType}' is not recognized.", nameof(rawMessage));
72-
}
38+
RawMessageReceived?.Invoke(this, new HybridWebViewRawMessageReceivedEventArgs(rawMessage));
7339
}
7440

7541
/// <summary>
@@ -91,36 +57,12 @@ public void SendRawMessage(string rawMessage)
9157
});
9258
}
9359

94-
private int _invokeTaskId;
95-
private Dictionary<string, TaskCompletionSource<string>> asyncTaskCallbacks = new Dictionary<string, TaskCompletionSource<string>>();
96-
97-
/// <summary>
98-
/// Handler for when the an Async JavaScript task has completed and needs to notify .NET.
99-
/// </summary>
100-
private void AsyncTaskCompleted(string taskId, string result)
101-
{
102-
//Look for the callback in the list of pending callbacks.
103-
if (!string.IsNullOrEmpty(taskId) && asyncTaskCallbacks.ContainsKey(taskId))
104-
{
105-
//Get the callback and remove it from the list.
106-
var callback = asyncTaskCallbacks[taskId];
107-
callback.SetResult(result);
108-
109-
//Remove the callback.
110-
asyncTaskCallbacks.Remove(taskId);
111-
}
112-
}
113-
114-
/// <summary>
115-
/// Invokes a JavaScript method named <paramref name="methodName"/> and optionally passes in the parameter values
116-
/// specified by <paramref name="paramValues"/>.
117-
/// </summary>
118-
/// <param name="methodName">The name of the JavaScript method to invoke.</param>
119-
/// <param name="paramValues">Optional array of objects to be passed to the JavaScript method.</param>
120-
/// <param name="paramJsonTypeInfos">Optional array of metadata about serializing the types of the parameters specified by <paramref name="paramValues"/>.</param>
121-
/// <returns>A string containing the return value of the called method.</returns>
122-
#if WINDOWS || ANDROID || IOS || MACCATALYST
123-
public async Task<string?> InvokeJavaScriptAsync(string methodName, object?[]? paramValues, JsonTypeInfo?[]? paramJsonTypeInfos = null)
60+
/// <inheritdoc/>
61+
public async Task<TReturnType?> InvokeJavaScriptAsync<TReturnType>(
62+
string methodName,
63+
JsonTypeInfo<TReturnType> returnTypeJsonTypeInfo,
64+
object?[]? paramValues = null,
65+
JsonTypeInfo?[]? paramJsonTypeInfos = null)
12466
{
12567
if (string.IsNullOrEmpty(methodName))
12668
{
@@ -139,57 +81,16 @@ private void AsyncTaskCompleted(string taskId, string result)
13981
throw new ArgumentException($"The number of parameter values does not match the number of parameter JSON type infos.", nameof(paramValues));
14082
}
14183

142-
// Create a callback for async JavaScript methods to invoke when they are done
143-
var callback = new TaskCompletionSource<string>();
144-
var currentInvokeTaskId = $"{_invokeTaskId++}";
145-
asyncTaskCallbacks.Add(currentInvokeTaskId, callback);
146-
147-
var paramsValuesStringArray =
148-
paramValues == null
149-
? string.Empty
150-
: string.Join(
151-
", ",
152-
paramValues.Select((v, i) => (v == null ? "null" : JsonSerializer.Serialize(v, paramJsonTypeInfos![i]!))));
84+
var invokeResult = await Handler?.InvokeAsync(
85+
nameof(IHybridWebView.InvokeJavaScriptAsync),
86+
new HybridWebViewInvokeJavaScriptRequest(methodName, returnTypeJsonTypeInfo, paramValues, paramJsonTypeInfos))!;
15387

154-
await EvaluateJavaScriptAsync($"window.HybridWebView.InvokeMethod({currentInvokeTaskId}, {methodName}, [{paramsValuesStringArray}])");
155-
156-
return await callback.Task;
157-
}
158-
#else
159-
public Task<string?> InvokeJavaScriptAsync(string methodName, object?[]? paramValues = null, object?[]? paramJsonTypeInfos = null)
160-
{
161-
_invokeTaskId++; // This is to avoid the compiler warning about the field not being used
162-
throw new NotImplementedException();
163-
}
164-
#endif
165-
166-
/// <summary>
167-
/// Invokes a JavaScript method named <paramref name="methodName"/> and optionally passes in the parameter values specified
168-
/// by <paramref name="paramValues"/> by JSON-encoding each one.
169-
/// </summary>
170-
/// <typeparam name="TReturnType">The type of the return value to deserialize from JSON.</typeparam>
171-
/// <param name="methodName">The name of the JavaScript method to invoke.</param>
172-
/// <param name="returnTypeJsonTypeInfo">Metadata about deserializing the type of the return value specified by <typeparamref name="TReturnType"/>.</param>
173-
/// <param name="paramValues">Optional array of objects to be passed to the JavaScript method by JSON-encoding each one.</param>
174-
/// <param name="paramJsonTypeInfos">Optional array of metadata about serializing the types of the parameters specified by <paramref name="paramValues"/>.</param>
175-
/// <returns>An object of type <typeparamref name="TReturnType"/> containing the return value of the called method.</returns>
176-
#if WINDOWS || ANDROID || IOS || MACCATALYST
177-
public async Task<TReturnType?> InvokeJavaScriptAsync<TReturnType>(string methodName, JsonTypeInfo<TReturnType?> returnTypeJsonTypeInfo, object?[]? paramValues = null, JsonTypeInfo?[]? paramJsonTypeInfos = null)
178-
{
179-
var stringResult = await InvokeJavaScriptAsync(methodName, paramValues, paramJsonTypeInfos);
180-
181-
if (stringResult is null)
88+
if (invokeResult is null)
18289
{
18390
return default;
18491
}
185-
return JsonSerializer.Deserialize<TReturnType?>(stringResult, returnTypeJsonTypeInfo);
186-
}
187-
#else
188-
public Task<TReturnType?> InvokeJavaScriptAsync<TReturnType>(string methodName, object returnTypeJsonTypeInfo, object?[]? paramValues, object?[]? paramJsonTypeInfos)
189-
{
190-
throw new NotImplementedException();
92+
return (TReturnType)invokeResult;
19193
}
192-
#endif
19394

19495
/// <inheritdoc/>
19596
public async Task<string?> EvaluateJavaScriptAsync(string script)
@@ -199,40 +100,9 @@ private void AsyncTaskCompleted(string taskId, string result)
199100
return null;
200101
}
201102

202-
// Make all the platforms mimic Android's implementation, which is by far the most complete.
203-
if (DeviceInfo.Platform != DevicePlatform.Android)
204-
{
205-
script = WebView.EscapeJsString(script);
206-
207-
if (DeviceInfo.Platform != DevicePlatform.WinUI)
208-
{
209-
// Use JSON.stringify() method to converts a JavaScript value to a JSON string
210-
script = "try{JSON.stringify(eval('" + script + "'))}catch(e){'null'};";
211-
}
212-
else
213-
{
214-
script = "try{eval('" + script + "')}catch(e){'null'};";
215-
}
216-
}
217-
218-
string? result;
219-
220-
// Use the handler command to evaluate the JS
221-
result = await Handler!.InvokeAsync(nameof(IHybridWebView.EvaluateJavaScriptAsync),
103+
var result = await Handler!.InvokeAsync(nameof(IHybridWebView.EvaluateJavaScriptAsync),
222104
new EvaluateJavaScriptAsyncRequest(script));
223105

224-
//if the js function errored or returned null/undefined treat it as null
225-
if (result == "null")
226-
{
227-
result = null;
228-
}
229-
//JSON.stringify wraps the result in literal quotes, we just want the actual returned result
230-
//note that if the js function returns the string "null" we will get here and not above
231-
else if (result != null)
232-
{
233-
result = result.Trim('"');
234-
}
235-
236106
return result;
237107
}
238108
}

src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ Microsoft.Maui.Controls.HybridWebView.EvaluateJavaScriptAsync(string! script) ->
7373
Microsoft.Maui.Controls.HybridWebView.HybridRoot.get -> string?
7474
Microsoft.Maui.Controls.HybridWebView.HybridRoot.set -> void
7575
Microsoft.Maui.Controls.HybridWebView.HybridWebView() -> void
76-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<string?>!
77-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType?>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
76+
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
7877
Microsoft.Maui.Controls.HybridWebView.RawMessageReceived -> System.EventHandler<Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs!>?
7978
Microsoft.Maui.Controls.HybridWebView.SendRawMessage(string! rawMessage) -> void
8079
Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs

src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ Microsoft.Maui.Controls.HybridWebView.EvaluateJavaScriptAsync(string! script) ->
236236
Microsoft.Maui.Controls.HybridWebView.HybridRoot.get -> string?
237237
Microsoft.Maui.Controls.HybridWebView.HybridRoot.set -> void
238238
Microsoft.Maui.Controls.HybridWebView.HybridWebView() -> void
239-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<string?>!
240-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType?>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
239+
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
241240
Microsoft.Maui.Controls.HybridWebView.RawMessageReceived -> System.EventHandler<Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs!>?
242241
Microsoft.Maui.Controls.HybridWebView.SendRawMessage(string! rawMessage) -> void
243242
Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs

src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ Microsoft.Maui.Controls.HybridWebView.EvaluateJavaScriptAsync(string! script) ->
236236
Microsoft.Maui.Controls.HybridWebView.HybridRoot.get -> string?
237237
Microsoft.Maui.Controls.HybridWebView.HybridRoot.set -> void
238238
Microsoft.Maui.Controls.HybridWebView.HybridWebView() -> void
239-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<string?>!
240-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType?>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
239+
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
241240
Microsoft.Maui.Controls.HybridWebView.RawMessageReceived -> System.EventHandler<Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs!>?
242241
Microsoft.Maui.Controls.HybridWebView.SendRawMessage(string! rawMessage) -> void
243242
Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs

src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ Microsoft.Maui.Controls.HybridWebView.EvaluateJavaScriptAsync(string! script) ->
7272
Microsoft.Maui.Controls.HybridWebView.HybridRoot.get -> string?
7373
Microsoft.Maui.Controls.HybridWebView.HybridRoot.set -> void
7474
Microsoft.Maui.Controls.HybridWebView.HybridWebView() -> void
75-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues = null, object?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<string?>!
76-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, object! returnTypeJsonTypeInfo, object?[]? paramValues, object?[]? paramJsonTypeInfos) -> System.Threading.Tasks.Task<TReturnType?>!
75+
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
7776
Microsoft.Maui.Controls.HybridWebView.RawMessageReceived -> System.EventHandler<Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs!>?
7877
Microsoft.Maui.Controls.HybridWebView.SendRawMessage(string! rawMessage) -> void
7978
Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs

src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ Microsoft.Maui.Controls.HybridWebView.EvaluateJavaScriptAsync(string! script) ->
7373
Microsoft.Maui.Controls.HybridWebView.HybridRoot.get -> string?
7474
Microsoft.Maui.Controls.HybridWebView.HybridRoot.set -> void
7575
Microsoft.Maui.Controls.HybridWebView.HybridWebView() -> void
76-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<string?>!
77-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType?>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
76+
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
7877
Microsoft.Maui.Controls.HybridWebView.RawMessageReceived -> System.EventHandler<Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs!>?
7978
Microsoft.Maui.Controls.HybridWebView.SendRawMessage(string! rawMessage) -> void
8079
Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs

src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ Microsoft.Maui.Controls.HybridWebView.EvaluateJavaScriptAsync(string! script) ->
7272
Microsoft.Maui.Controls.HybridWebView.HybridRoot.get -> string?
7373
Microsoft.Maui.Controls.HybridWebView.HybridRoot.set -> void
7474
Microsoft.Maui.Controls.HybridWebView.HybridWebView() -> void
75-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues = null, object?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<string?>!
76-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, object! returnTypeJsonTypeInfo, object?[]? paramValues, object?[]? paramJsonTypeInfos) -> System.Threading.Tasks.Task<TReturnType?>!
75+
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
7776
Microsoft.Maui.Controls.HybridWebView.RawMessageReceived -> System.EventHandler<Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs!>?
7877
Microsoft.Maui.Controls.HybridWebView.SendRawMessage(string! rawMessage) -> void
7978
Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs

src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ Microsoft.Maui.Controls.HybridWebView.EvaluateJavaScriptAsync(string! script) ->
7272
Microsoft.Maui.Controls.HybridWebView.HybridRoot.get -> string?
7373
Microsoft.Maui.Controls.HybridWebView.HybridRoot.set -> void
7474
Microsoft.Maui.Controls.HybridWebView.HybridWebView() -> void
75-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues = null, object?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<string?>!
76-
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, object! returnTypeJsonTypeInfo, object?[]? paramValues, object?[]? paramJsonTypeInfos) -> System.Threading.Tasks.Task<TReturnType?>!
75+
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync<TReturnType>(string! methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType>! returnTypeJsonTypeInfo, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task<TReturnType?>!
7776
Microsoft.Maui.Controls.HybridWebView.RawMessageReceived -> System.EventHandler<Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs!>?
7877
Microsoft.Maui.Controls.HybridWebView.SendRawMessage(string! rawMessage) -> void
7978
Microsoft.Maui.Controls.HybridWebViewRawMessageReceivedEventArgs

src/Controls/src/Core/WebView/WebView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public IPlatformElementConfiguration<T, WebView> On<T>() where T : IConfigPlatfo
287287
return _platformConfigurationRegistry.Value.On<T>();
288288
}
289289

290-
internal static string EscapeJsString(string js)
290+
private static string EscapeJsString(string js)
291291
{
292292
if (js == null)
293293
return null;

src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if !ANDROID
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Text.Json.Serialization;
54
using System.Threading.Tasks;
@@ -356,4 +355,3 @@ private async Task WaitForHybridWebViewLoaded(HybridWebView hybridWebView)
356355
}
357356
}
358357
}
359-
#endif

0 commit comments

Comments
 (0)