chromelyapps / Chromely

Build Cross Platform HTML Desktop Apps on .NET using native GUI, HTML5, JavaScript, CSS, Owin, AspNetCore (MVC, RazorPages, Blazor)
MIT License
2.98k stars 280 forks source link

Change URL at runtime #337

Closed heckradr closed 3 years ago

heckradr commented 3 years ago

Hello. Is it possible to change the URL at runtime? I saw only the possiblity to provide the start url within the configuration (DefaultConfiguration) but no way to switch programmatically to another URL while the application is running.

mattkol commented 3 years ago

@heckradr You can try:

Howto: Reload with a Url Change #338

  Xilium.CefGlue.CefBrowser browser = scriptExecutor.GetBrowser() as Xilium.CefGlue.CefBrowser;
  if (browser != null)
  {
      browser.GetMainFrame().LoadUrl("https://google.com");
  }
heckradr commented 3 years ago

@mattkol works perfectly, thank you very much