Skip to content

Commit

Permalink
fmt and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Apr 29, 2022
1 parent 784e276 commit 41ac0f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changes/webview2-mini-menu.md
@@ -0,0 +1,5 @@
---
"wry": patch
---

Disable webview2 mini menu
13 changes: 8 additions & 5 deletions src/webview/webview2/mod.rs
Expand Up @@ -94,15 +94,18 @@ impl InnerWebView {

CreateCoreWebView2EnvironmentCompletedHandler::wait_for_async_operation(
Box::new(move |environmentcreatedhandler| unsafe {
let options: ICoreWebView2EnvironmentOptions = CoreWebView2EnvironmentOptions::default().into();
let options: ICoreWebView2EnvironmentOptions =
CoreWebView2EnvironmentOptions::default().into();

// remove "mini menu" - See https://github.com/tauri-apps/wry/issues/535
let additional_arguments = pwstr_from_str("--disable-features=msWebOOUI,msPdfOOUI");
let _ = options.SetAdditionalBrowserArguments(additional_arguments);

// if data_directory is None, we set it to a null PWSTR
let data_directory: PWSTR = data_directory.map(|s| pwstr_from_str(&s)).unwrap_or_default();


// if data_directory is None, we set it to a null PWSTR
let data_directory: PWSTR = data_directory
.map(|s| pwstr_from_str(&s))
.unwrap_or_default();

let result = CreateCoreWebView2EnvironmentWithOptions(
PWSTR::default(),
data_directory,
Expand Down

0 comments on commit 41ac0f1

Please sign in to comment.