//private static ITrackService TrackService = App.Locator.Resolve<ITrackService>(); #region public public static async Task RunScriptAsync(WebView webView, string scriptName) { try { var script = await ScriptProvider.ReadScriptAsync(scriptName); await webView.InvokeScriptAsync("eval", new[] { script }); } catch (Exception ex) { //TrackService.TrackEventMessage(error.Message); } }
public static async void RunScriptAsync(WebView webView, string scriptName, string content) { try { var script = await ScriptProvider.ReadScriptAsync(scriptName); if (script.Contains(CONTENT)) { script = script.Replace(CONTENT, content); } await webView.InvokeScriptAsync("eval", new[] { script }); } catch (Exception ex) { //TrackService.TrackEventMessage(ex.Message); } }