Open trivalik opened 1 year ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Hi @trivalik. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Not repro on windows platform with sample project. https://github.com/trivalik/EvaluateJavaScriptAsync/tree/main
I updated https://github.com/trivalik/EvaluateJavaScriptAsync/tree/main for 8.0.0-preview.6.8686.8. The behavior is unchanged.
We have this problem targeting Android using .NET 8 RC2.
Also, the output returned from ExecuteJavaScriptAsync
is still encoded in an ugly way, as documented in https://github.com/xamarin/Xamarin.Forms/issues/11648
We are experiencing this issue on .NET 8.0.202 (at least I am assuming it is this issue). Longer scripts do not run. We returned to platform specific implementation we had in XF and everything works fine. Would have been better and saved us a lot of time if EvaluateJavaScriptAsync was not even attempted by the MAUI team.
Also experiencing this on:
maui-windows 8.0.82/8.0.100 SDK 8.0.400, VS 17.11.35312.102
The issue is especially very annoying because there are no exceptions, nothing in the inspector log. Would appreciate an update on this issue.
I've written a very rudimentary parser to convert multiline JS to single line:
public static string ToSingleLine(string input)
{
var sb = new StringBuilder(input.Length);
var state = State.Code;
for (int i = 0; i < input.Length; i++)
{
var chr = input[i];
switch (chr)
{
case '\r':
case '\n':
state = State.Code;
break;
case '/':
switch (state)
{
case State.Slash:
state = State.Comment;
// Remove previous slash
sb.Remove(sb.Length - 1, 1);
break;
case State.Code:
state = State.Slash;
sb.Append(chr);
break;
}
break;
default:
if (state == State.Comment) break;
sb.Append(chr);
break;
}
}
return sb.ToString();
}
This has at least the following known issues:
/* ... *// ...
as comment at //
, which is the end of the inline comment and not the start of a rest of line comment//
in strings as comment and drops rest of the line;
to end of lineHowever, it does work for basic scripts, permitting comments in there as well.
Description
If you want to execute EvaluateJavaScriptAsync with multiple lines you have to make sure that no \r and no \n is inside.
Steps to Reproduce
Webview
like so:<WebView Source="https://www.bing.com" x:Name="Browser" HeightRequest="500" WidthRequest="600" Navigated="Browser_Navigated"/>
Browser_Navigated
withawait Browser.EvaluateJavaScriptAsync("alert('abc');\r\nalert('def');");
Expected outcome: two alearts will appear Actual outcome: no aleat is shown
Link to public reproduction project repository
https://github.com/trivalik/EvaluateJavaScriptAsync/tree/main
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows, I was not able test on other platforms
Affected platform versions
Windows SDK 10.0.17763.0
Did you find any workaround?
Get all calls through:
Relevant log output
No response