Skip to content

Commit c77b403

Browse files
authored
refactor(core): add support to multiple webviews on a Tauri window (#8280)
* feat: update to latest wry * wry dev branch [skip ci] * fix linux [skip ci] * refactor(runtime): split webview and window types * split dispatch * implement create_webview * move webview message * wip webview mod * create webview manager, finish webview struct and builder * fix tests and docs * rename WindowUrl to WebviewUrl * update examples * event refactor * update JS API * fix events * update example * add WebviewWindow class on JS * fix macos build * allow creating window+webview on the same runtime call * rename tauri://window-created to tauri://webview-created * Window::add_child * use inner_size from webview on macOS * add multiwebview example * automatically resize webviews on window resize * fix tests * set_position, set_size * position, size getters * set_focus * add close fn * update mock runtime * lint [skip ci] * fix inner_size getter [skip ci] * import hwnd [skip ci] * update webview bound ratios on set_size/set_position * add auto_resize option * fix android * fix build on windows * typo * with_webview isnt desktop only * add WebviewWindow rust struct (and builder) * fix build on android * license header * fix macos/windows * fix macos build * resolve todo * handle window not found * hide unstable features * document unstable feature [skip ci] * webview plugin permissions * hide more stuff * fix doctests * typos * add change files * fix examples * rename hook
1 parent 74a2a60 commit c77b403

File tree

98 files changed

+14583
-4217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+14583
-4217
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tauri-apps/api": patch:breaking
3+
---
4+
5+
Removed event callback's `windowLabel` field and added a `windowSource` object instead.

.changes/event-target-refactor.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tauri-apps/api": patch:breaking
3+
---
4+
5+
The event target is now an object so you can target either a window or a webview.

.changes/hooks-webview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:breaking
3+
---
4+
5+
The `invoke_system`, `on_page_load` hooks now gives you a `Webview` argument instead of a `Window`.

.changes/move-window-apis.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tauri-apps/api": patch:breaking
3+
---
4+
5+
Moved webview-specific APIs from the `Window` class to the `Webview` class.

.changes/multiwebview-api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tauri-apps/api": patch:feat
3+
---
4+
5+
Added support to multiwebview via the new `window` and `webview` modules.

.changes/multiwebview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"tauri": patch:feat
3+
"tauri-runtime": patch:feat
4+
"tauri-runtime-wry": patch:feat
5+
---
6+
7+
Add multiwebview support behind the `unstable` feature flag. See `WindowBuilder` and `WebviewBuilder` for more information.

.changes/remove-window-url.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-utils": patch:breaking
3+
---
4+
5+
Renamed `config::WindowUrl` to `config::WebviewUrl`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tauri-apps/api": patch:breaking
3+
---
4+
5+
Renamed `TauriEvent.WINDOW_FILE_DROP` to `TauriEvent.WEBVIEW_FILE_DROP`, `TauriEvent.WINDOW_FILE_DROP_HOVER` to `TauriEvent.WEBVIEW_FILE_DROP_HOVER` and `TauriEvent.WINDOW_FILE_DROP_CANCELLED` to `TauriEvent.WEBVIEW_FILE_DROP_CANCELLED`.

.changes/webview-window-api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tauri-apps/api": patch:breaking
3+
---
4+
5+
Added back the `WebviewWindow` API that exposes functionality of a window that hosts a single webview. The dedicated `Window` and `Webview` types are exposed for multiwebview features.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:breaking
3+
---
4+
5+
Renamed `Window` to `WebviewWindow`, `WindowBuilder` to `WebviewWindowBuilder`, `Manager::windows` to `Manager::webview_windows` and `Manager::get_window` to `Manager::get_webview_window`.

0 commit comments

Comments
 (0)