diff --git a/crowngui.nimble b/crowngui.nimble index 454362f..699a149 100644 --- a/crowngui.nimble +++ b/crowngui.nimble @@ -1,6 +1,6 @@ # Package -version = "0.2.15" +version = "0.2.17" author = "bung87" description = "Web Technologies based Crossplatform GUI Framework" license = "MIT" diff --git a/src/crowngui/platforms/win/webview2/controllers.nim b/src/crowngui/platforms/win/webview2/controllers.nim index b6b4044..b267662 100644 --- a/src/crowngui/platforms/win/webview2/controllers.nim +++ b/src/crowngui/platforms/win/webview2/controllers.nim @@ -9,6 +9,7 @@ from web_message_received_handler import nil from com/icorewebview2domcontentloadedeventhandler import nil import std/[os, atomics,pathnorm,sugar,json] import loader +import ../../../types proc newControllerCompletedHandler*(hwnd: HWND;controller: ptr ICoreWebView2Controller;view: ptr ICoreWebView2; settings: ptr ICoreWebView2Settings): ptr ICoreWebView2CreateCoreWebView2ControllerCompletedHandler = result = create(type result[]) @@ -64,7 +65,10 @@ proc newControllerCompletedHandler*(hwnd: HWND;controller: ptr ICoreWebView2Cont window.chrome.webview.postMessage(arg); };""" discard w.priv.view.AddScriptToExecuteOnDocumentCreated(&script, NULL) - discard w.priv.view.Navigate(T(w.url)) + if w.entryType == EntryType.html: + discard w.priv.view.NavigateToString(T(w.url)) + else: + discard w.priv.view.Navigate(T(w.url)) return S_OK proc newEnvironmentCompletedHandler*(hwnd: HWND;controllerCompletedHandler: ptr ICoreWebView2CreateCoreWebView2ControllerCompletedHandler): ptr ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler =