Skip to content

Commit

Permalink
Merge branch 'dev' into refactor/migrate-to-objc2
Browse files Browse the repository at this point in the history
  • Loading branch information
pewsheen committed Sep 8, 2024
2 parents 796b6ec + b863d38 commit a7919ca
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 13 deletions.
5 changes: 0 additions & 5 deletions .changes/1344-with_scroll_bar_style.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changes/change-pr-1356.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

Expose ability to enable browser extensions in WebView2
5 changes: 0 additions & 5 deletions .changes/linux-shared-webcontext-ipc.md

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## \[0.43.1]

- [`5cea504`](https://github.com/tauri-apps/wry/commit/5cea5045c9e646ace1f94767d91b746c2afd3c14) ([#1352](https://github.com/tauri-apps/wry/pull/1352) by [@lucasfernog](https://github.com/tauri-apps/wry/../../lucasfernog)) Fixes Android file picker result processing.

## \[0.43.0]

- [`7b1c26a`](https://github.com/tauri-apps/wry/commit/7b1c26adff5fdf13a3364b6fc26c8444c120d5c1) ([#1344](https://github.com/tauri-apps/wry/pull/1344) by [@Themayu](https://github.com/tauri-apps/wry/../../Themayu)) Windows: Implement `WebViewBuilderExtWindows::with_scroll_bar_style` to allow opting into Fluent Overlay style scrollbars.
- [`98d1a83`](https://github.com/tauri-apps/wry/commit/98d1a835e2c818e9f733a55b074e7de3c0cd725f) ([#1326](https://github.com/tauri-apps/wry/pull/1326) by [@ollpu](https://github.com/tauri-apps/wry/../../ollpu)) Fix Linux IPC handler and initialization scripts when sharing a WebContext between multiple WebViews.

## \[0.42.0]

- [`556a359`](https://github.com/tauri-apps/wry/commit/556a359d3739ac3a3e671ab2d1c3dda2784c511e) ([#1301](https://github.com/tauri-apps/wry/pull/1301) by [@pewsheen](https://github.com/tauri-apps/wry/../../pewsheen)) On macOS, emit an error when the URL scheme registration fails.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ workspace = {}

[package]
name = "wry"
version = "0.42.0"
version = "0.43.1"
authors = [ "Tauri Programme within The Commons Conservancy" ]
edition = "2021"
license = "Apache-2.0 OR MIT"
Expand Down
3 changes: 1 addition & 2 deletions src/android/kotlin/RustWebChromeClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ class RustWebChromeClient(appActivity: WryActivity) : WebChromeClient() {
override fun onActivityResult(result: ActivityResult?) {
val res: Array<Uri?>?
val resultIntent = result?.data
if (result?.resultCode == Activity.RESULT_OK && resultIntent!!.clipData != null && resultIntent.clipData!!.itemCount > 1
) {
if (result?.resultCode == Activity.RESULT_OK && resultIntent!!.clipData != null) {
val numFiles = resultIntent.clipData!!.itemCount
res = arrayOfNulls(numFiles)
for (i in 0 until numFiles) {
Expand Down
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ pub(crate) struct PlatformSpecificWebViewAttributes {
theme: Option<Theme>,
use_https: bool,
scroll_bar_style: ScrollBarStyle,
browser_extensions_enabled: bool,
}

#[cfg(windows)]
Expand All @@ -1099,6 +1100,7 @@ impl Default for PlatformSpecificWebViewAttributes {
theme: None,
use_https: false, // To match macOS & Linux behavior in the context of mixed content.
scroll_bar_style: ScrollBarStyle::default(),
browser_extensions_enabled: false,
}
}
}
Expand Down Expand Up @@ -1150,6 +1152,14 @@ pub trait WebViewBuilderExtWindows {
/// Requires WebView2 Runtime version 125.0.2535.41 or higher, does nothing on older versions,
/// see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/?tabs=dotnetcsharp#10253541
fn with_scroll_bar_style(self, style: ScrollBarStyle) -> Self;

/// Determines whether the ability to install and enable extensions is enabled.
///
/// By default, extensions are disabled.
///
/// Requires WebView2 Runtime version 1.0.2210.55 or higher, does nothing on older versions,
/// see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/archive?tabs=dotnetcsharp#10221055
fn with_browser_extensions_enabled(self, enabled: bool) -> Self;
}

#[cfg(windows)]
Expand Down Expand Up @@ -1178,6 +1188,11 @@ impl WebViewBuilderExtWindows for WebViewBuilder<'_> {
self.platform_specific.scroll_bar_style = style;
self
}

fn with_browser_extensions_enabled(mut self, enabled: bool) -> Self {
self.platform_specific.browser_extensions_enabled = enabled;
self
}
}

#[cfg(target_os = "android")]
Expand Down
1 change: 1 addition & 0 deletions src/webview2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ impl InnerWebView {
let options = CoreWebView2EnvironmentOptions::default();

options.set_additional_browser_arguments(additional_browser_args);
options.set_are_browser_extensions_enabled(pl_attrs.browser_extensions_enabled);

// Get user's system language
let lcid = GetUserDefaultUILanguage();
Expand Down

0 comments on commit a7919ca

Please sign in to comment.