public IcuClient(IcuConfig config, RPC.IProxy rpc, UIHelper ui) { if (!ENV.IsWasm) { config.SessionID = Guid.NewGuid().ToString(); } this.UI = ui; this.Config = config; this.Session = new IcuSession(config, rpc); this.MsgBus = Session.MsgBus; }
public async Task InitBrowserCapture(IcuSession ss) { try { var title = ss.ID; var prev = await JSI.InitBrowserCapture(title, true); await Task.Delay(200); var s = await IcuRpc.InitImageCapture(ss, title); var _ = await JSI.InitBrowserCapture(prev, false); } catch (JSException e) { if (e.Message.StartsWith("Browser zoom")) { throw new IcuException("Inconsistent zoom", $"1) {e.Message}\n" + "2) Also ensure that your monitor scale is 100%"); } else { throw; } } }