From 7bb4f4929eddbde8f36472a55ec3713d6d51c0e3 Mon Sep 17 00:00:00 2001 From: SpikeHD <25207995+SpikeHD@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:38:08 -0800 Subject: [PATCH] fix: Prevent `Invalid Pointer` when loading extensions on Windows, rename `with_extension_path` -> `with_extensions_path` (#1421) --- .changes/extension_fix.md | 5 +++++ src/webview2/mod.rs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/extension_fix.md diff --git a/.changes/extension_fix.md b/.changes/extension_fix.md new file mode 100644 index 000000000..84a75f9f4 --- /dev/null +++ b/.changes/extension_fix.md @@ -0,0 +1,5 @@ +--- +"wry": "patch" +--- + +Fix extension loading on Windows. \ No newline at end of file diff --git a/src/webview2/mod.rs b/src/webview2/mod.rs index d351c202b..05c79b2c7 100644 --- a/src/webview2/mod.rs +++ b/src/webview2/mod.rs @@ -1252,8 +1252,9 @@ impl InnerWebView { for entry in fs::read_dir(extension_path)? { let path = entry?.path(); let path_hs = HSTRING::from(path.as_path()); + let handler = ProfileAddBrowserExtensionCompletedHandler::create(Box::new(|_, _| Ok(()))); - profile.AddBrowserExtension(&path_hs, None)?; + profile.AddBrowserExtension(&path_hs, &handler)?; } Ok(())