159 Commits
Author SHA1 Message Date
Tony d8fe88dc7b chore: migrate to edition 2024 (#1847)
* Windows `cargo fix --edition`

* Android

* linux

* Bump to 2024

* `cargo fmt`

* fix apple

* Add change file
2026-09-17 10:53:14 +08:00
Tony d29cd57676 refactor!: remove unused protocol feature (#1787)
* refactor!: remove unused `protocol` feature

* Add change file

* Remove docs
2026-07-27 18:33:51 +08:00
Fabian-Lars bd1decc497 refactor(macos/ios): remove fullscreen and transparent feature flags (#1780) 2026-07-27 10:59:55 +02:00
Tony 2f768ae859 docs: clean up some typos and inconsistencies (#1750) 2026-06-12 20:45:10 +08:00
F0RLEandTony 9f9a237d78 feat: add permission handler API across webview backends (#1654)
* feat: add permission handler API - implement cross-platform permission handler API, fix combined camera and microphone logic on macOS, update documentation to clarify NFC and Bluetooth support, and simplify permission_handler example using permission.site

* fix(wkwebview): remove leftover PermissionObserver from UIDelegate signature

* Fix `permission_handler` example on linux

* Use type instead of string check

* Add more platform specific notes

* Move permissions to a file

* Add notice about prompt not supported on linux

* fix(webkitgtk): handle combined audio+video permissions and use is_for_display_device on v2_42

* fix: reorder module declarations for rustfmt

* fix(android): scope permission handler per webview

подтверждено

* fix(android): honor permission handler for geolocation

подтверждено

* fix(android): avoid overgranting mixed permission requests

* fix(android): scope permission callbacks by webview

* fix(android): pass existing webview id string

* Migrate `PACKAGE.get().unwrap()`

* Fix `web_chrome_client`

* small refactor on permissionLauncher

* Add `PermissionResponse::Default` docs for all platforms

* fix(android): simplify permission JNI response

* document allow is not supported on android

* refactor: simplify permission responses

* fix: update permission handler example

* fix(android): pass unknown permissions to handler

* fix(android): allow explicit unknown permissions

* onPermissionRequestNative will not return other values

* Send individual permissions to rust side
and support partial allow

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2026-06-11 23:09:00 +08:00
sftse 145b36fb5e refactor!: remove unsafe impl Send and Sync on NewWindowOpener (#1736)
* refactor: make more private

* refactor: remove unwraps

* refactor: remove no longer necessary Send/Sync overrides

* refactor: less thinking about ffi safety of bool

* add change file
2026-05-27 11:05:12 +08:00
Tony 05440b80ed refactor!: remove drag-drop feature (#1688) 2026-03-22 16:09:40 +01:00
Flurie b79e37bf43 docs: add gtk opengl triangle example (#1682) 2026-03-17 14:11:46 +01:00
Lucas Fernandes Nogueira ccdf912621 fix: build without x11 feature (#1603)
* fix: build without x11 feature

* fix tests

* fix example

* fix async protocol example

* fix other examples

* pub fn
2025-08-16 13:40:47 -03:00
Lucas Fernandes Nogueira 3f978d3290 refactor: allow new_window_req_handler to create the webview on its own (#1601)
* feat(linux): craete webview on new_window_req

follow-up for #1596

ref https://github.com/tauri-apps/tauri/pull/13876

* refactor: allow new_window_req_handler to create the webview on its own

* add webview getter

* clippy regression

* macos fixes

* enhance platform support

* fix deadlock on windows

* fix mac build
2025-08-16 09:13:15 -03:00
Lucas Fernandes Nogueira eb562ca993 fix(macos): new_window_req not firing on window.open (#1596)
* fix(macos): new_window_req not firing on window.open

currently the new_window_req_handler is fired on navigation events, which is incorrect as it calls the handler on iframe navigations and doesn't call it on window.open calls, not matching behavior on other platforms

this PR changes it to run under [`webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:`](https://developer.apple.com/documentation/webkit/wkuidelegate/webview(_:createwebviewwith:for:windowfeatures:)?language=objc) instead

I've noticed this when testing https://github.com/tauri-apps/tauri/pull/13876

* fix build

* fix coordinates

* fix features
2025-08-13 13:20:49 -03:00
Sean WangandJason Tsai 60dba38ddc feat: add WebView::set_cookie and WebView::delete_cookie (#1569)
* feat: add `WebView::set_cookie` and `WebView::delete_cookie`

* feat: implement for `wkwebview`

* chore: changes-files

* feat: implement SameSite cookie policy for wkwebview

* refactor: use `&` instead of `&*`

* refactor: remove `debug_assert` for `HttpOnly`

* docs: add `delete_cookie` in example

* chore: remove redundant samesite setting

---------

Co-authored-by: Jason Tsai <git@pews.dev>
2025-07-02 00:38:00 +09:00
sftse bfebb423d7 chore(deps): Update html5ever and kuchikiki (#1566) 2025-06-23 11:47:09 +02:00
Linda_pp 92f36a3e1b fix(bench): fix building benchmarks (#1532)
* fix(bench): fix building benchmarks

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* fix: fix clippy warning in `window_border` example

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

---------

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
2025-03-26 17:25:10 +02:00
ohyfunandohyfun 3bab9afafb fix examples/gtk_multiwebview.rs layout misaligned (#1504)
Co-authored-by: ohyfun <rustfun@gmail.com>
2025-02-28 07:55:52 +02:00
Amr Bashir 9df094aa79 fix(windows): calculate parent bounds accurately (#1483)
ref: https://github.com/rust-windowing/winit/pull/3712
ref: https://github.com/zed-industries/zed/blob/7bddb390cabefb177d9996dc580749d64e6ca3b6/crates/gpui/src/platform/windows/events.rs#L1418-L1454
2025-02-12 06:14:21 +02:00
renovate[bot]andFabianLars f944870801 chore(deps): update rust crate getrandom to 0.3 (#1467)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-01-27 15:04:01 +01:00
ca74176748 chore(deps): update rust crate winit to 0.30 (#1235)
Co-authored-by: nobane <2507359+nobane@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-01 21:14:33 +01:00
Integral 4740c0bf60 refactor: destruct tuples to enhance readability (#1438)
Signed-off-by: Integral <integral@member.fsf.org>
2024-12-10 14:44:18 +02:00
Amr BashirandLucas Fernandes Nogueira c1b26b9612 feat: add WebView::cookies and WebView::cookies_for_url (#1394)
* feat: add `WebView::cookies` and `WebView::cookies_for_url`

closes #518
ref: https://github.com/tauri-apps/tauri/issues/11330

* cookies -> getCookies in android

* fix macos build

* fix gtk blocking

* document why we don't use wait_for_async_operation

* change file

* implement cookies_for_url on macOS

* fmt

* fix macos impl

* actually use interval

* make it faster

* remove matching on path

* Apply suggestions from code review

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>

* Apply suggestions from code review

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-21 15:42:03 -03:00
0abc221ca0 refactor(macos): migrate to objc2 (#1316)
* migrate drag & drop

* refactor: migrate to `dpi` crate (#1202)

* refactor: migrate to `dpi` crate

closes #1172

* macOS

* linux

* fix doctests

* imports

* more doctests

* fix android and ios

* Update examples/winit.rs

Co-authored-by: Jason Tsai <jason@pews.dev>

* Update src/webview2/mod.rs

---------

Co-authored-by: Jason Tsai <jason@pews.dev>

* fix(windows): avoid double-free the controller (#1206)

* fix(linux): Disable deprecated applicationCache web api. (#1207)

fixes https://github.com/tauri-apps/tauri/issues/9300
ref https://github.com/WebKit/WebKit/pull/23382

* fix(wkwebview): menu shortcuts (#1208)

* fix(wkwebview): menu shortcuts

* Update wkwebview.md

* Apply Version Updates From Current Changes (#1203)

Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>

* migrate to `objc2`

* fix(macos): response body being double freed

* fix(macos): eval callback NSStrgin convertion error

* chore: remove objc dependency

* refactor(macos): migrate WebViewDelegate

* refactor(macos): migrate proxy to objc2

* refactor(macos): migrate document title change observer to objc2

* refactor(macos): move drag&drop handler to delegate

* refactor(macos): move ipc_handler into WryWebViewDelegate

* refactor(macos): migrate download handler

* fix(macos): prevent unsafe async custom protocol panic

* chore: target os import

* refactor(ios): migrate to objc2

* refactor(macos): migrate WebViewUIDelegate to objc2

* refactor(macos): migrate WryWebViewParent to objc2

* refactor(macos): move custom class to individual files

* chore: fix clippy

* refector: use reference for task. use objc2::exception::catch.

* fix(dnd): use msg_send super and impl NSDraggingDestination

* chore: call msg_send super

* fix: wrap Box<dyn FnMut(..)> with RefCell

* chore(deps): update rust crate tao to 0.29 (#1343)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* refactor: use bitflags way to handle mask bit manipulation

* WIP: refactor(ios): add wkwebview for ios

* Update Cargo.toml

Co-authored-by: Mads Marquart <mads@marquart.dk>

* fix: remove `.copy()` from RcBlock

* add change file

* lint

* fmt

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
Co-authored-by: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Mads Marquart <mads@marquart.dk>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-11 16:11:10 -03:00
Amr BashirandLucas Nogueira 8cc2a7f657 refactor!: add webview id to protocol handlers and improve API ergonomics (#1384)
* refactor!: add webview id to protocol handlers and improve API ergonomics

* try to fix macos

* fix macos impl

* fix doctests

* generated id instead of defaulting to None

* update change file

* fix macos

* clone

* ios

* typos

* fix replace

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-10-11 15:07:57 -03:00
Amr Bashir eafaadb9b3 chore: fix gtk_multiwebview example on wayland (#1371) 2024-09-26 10:02:26 +03:00
Jason Tsai 86faa70a70 fix(example): workaround to prevent winit crash when unfocused (#1323)
* fix(example): workaround to prevent winit crash when unfocused

* chore: remove changelog and unix resize event
2024-07-22 14:17:27 +09:00
Amr Bashir 50ec050bcf chore(examples): update custom_titlbar example with app-region: drag (#1277) 2024-05-23 10:21:48 +08:00
Lucas Fernandes Nogueira f089964a3c fix(linux): async custom protocol crashing sending response (#1276) 2024-05-23 04:05:52 +03:00
Tony 1098ca9831 refactor: remove usage of PCWSTR::from_raw from HSTRING (#1265) 2024-05-15 18:23:17 +03:00
Amr Bashir 07c17439eb chore(examples): add streaming example (#1230) 2024-04-23 12:59:05 +09:00
Amr BashirandJason Tsai 34ae1ca3af refactor: migrate to dpi crate (#1202)
* refactor: migrate to `dpi` crate

closes #1172

* macOS

* linux

* fix doctests

* imports

* more doctests

* fix android and ios

* Update examples/winit.rs

Co-authored-by: Jason Tsai <jason@pews.dev>

* Update src/webview2/mod.rs

---------

Co-authored-by: Jason Tsai <jason@pews.dev>
2024-03-28 16:37:24 +02:00
Amr Bashir ba1fa58a41 chore: fix import in bench tests (#1188) 2024-03-13 17:16:51 +02:00
Amr Bashir 5789bf759c refactor!: refactor drag and drop events (#1187) 2024-03-13 14:15:20 +02:00
Lucas Fernandes Nogueira b8fea396c2 refactor(ipc): use http::Request on with_ipc_handler (#1183)
* refactor(ipc): introduce IpcRequest type to get source URL on supported platforms

* fix linux

* use http::Request

* leftover config

* url from webview as fallback

* docs

* docs
2024-03-06 10:56:42 -03:00
Amr Bashir 3a2026b37b refactor!: refactor windows and linux backends for better maintainability (#1182)
* refactor: backends for better maintainability

* Return rust errors before custom protocol handler

* move data_directory buffer out of closure as well

* refactor webkit2gtk

* clippy

* fix build

* fix build again

* change file

* fix android

* unwrap
2024-03-06 07:15:36 +02:00
amrbashir 8c86fbaf51 chore(examples): change simple example url 2024-02-15 17:17:07 +02:00
Amr Bashir 2ff8d9d245 refactor!: remove internal url parsing and data: url support (#1169)
* refactor!: remove internal url parsing and `data:` url support

* fix doctests

* clippy and fix linux

* fix android

* fix android
2024-02-14 07:29:08 +02:00
Amr BashirandLucas Nogueira e50ce47ea3 feat: add reparent function (#1166)
* feat: add reparent function

* remove mut

* windows and linux impl

* update change file

* Discard changes to examples/simple.rs

* remove ns_window field

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2024-02-12 16:10:50 +02:00
Paweł Bis 818dc8d588 fix(docs): mention that 'transparent' feature is required in transparent example. (#1155) 2024-01-27 14:09:53 +09:00
Linda_pp 19e35a4dcc fix(deps): update raw-window-handle to v0.6 (#1144)
* support rwh 0.6 by macOS

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* update wgpu to 0.19 for rwh 0.6

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* support rwh 0.6 by Linux (including Android)

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* support rwh 0.6 by Windows

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* fix `HasRawWindowhandle` in documents to `HasWindowHandle`

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* add changelog item for raw-window-handle v0.6 update

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* simplify dependencies configuration in Cargo.toml

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

---------

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
2024-01-22 15:40:03 +02:00
Jason Tsai 7aeb848420 chore(example): fix the hyperlink in custom protocol example page (#1135) 2024-01-04 01:11:09 +02:00
Amr Bashir 2aa96bd9ad chore: support resizing in custom titlebar example (#1134) 2024-01-03 12:01:01 +08:00
Amr Bashir 17a5129a8c feat(linux): support adding to gtk::Fixed (#1128)
* feat(linux): support adding to `gtk::Fixed`

* fix doctests

* again
2023-12-27 15:25:27 +02:00
Lucas Fernandes Nogueiraandamrbashir 8fddbb6d51 feat: add WebView::bounds getter (#1091)
* feat: add WebView::bounds getter

* macos impl

* windows impl

* dummy android

* fix build on ios

* fix initial size on macOS, adjust bounds impl

* fallback to controller.bounds on windows

* use webview.allocated_size on linux when not a child

* cleanup windows impl

* fix wgpu example

* cleanup linux impl

---------

Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
2023-11-22 15:45:12 +02:00
Amr Bashir fee99b6d87 refactor: combine position and size into bounds (#1079)
* refactor: combine position and size into bounds

* update change file

* fix macOS build

* again

* Update src/wkwebview/mod.rs
2023-11-14 15:49:19 +09:00
Linda_pp f41a8f07ea feat(unix): move new_gtk functions to *ExtUnix traits (#1070)
* feat(unix): move `new_gtk` functions to `*ExtUnix` traits

Signed-off-by: rhysd <lin90162@yahoo.co.jp>

* Update rwh.md

---------

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
2023-11-13 15:28:49 +02:00
783b14239d Refactor new method entry point to rwh (#1041)
* Refactor new method entry point to rwh

* Update doc and add change file

* Fix mac and ios compile error

* Add new_as_child

* Add rhw_04, 05 06 flags

* Update android port

* Remove winit CI

* Fix android bindings

* windows implementation

* Update Cargo.toml

* Fix macOS and iOS

* Fix Android

* fix is_child on WkWebView

* x11 impl

* expose `new_gtk`

* fix winit-gtk version

* remove undecorated resizing handling

* implement set_position and set_size for child gtk in x11

* fix macos

* more fixes

* one more time

* unreachable

* update actions

* fix windows

* some clippy

* Add documentation and fix clippy

* Fix windows clippy error

* Fix android biuld

* Fix documentation test

* Fix android again

* Reduce clippy noise

* use rc?

* refine some documentation, add set_visible

* fix set_visible

* impl set_visible on Windows

* fix doctests

* more set_visible fixes

* fix windows

* unsafe

* fix set size for child webviews

* fix initial visibility with new_gtk

* refine examples

* fix wpgu example

* fix examples on windows and macos

* use a better workaround

* make set_size work on x11

* Fix size in multiwebview example

* Add visible method on macOS and iOS

* remvoe `tao` from android backend and update documentation

* fix winit example

* Add new_as_content_view on macOS

* allow using raw-window-handle v0.5 [skip ci]

* change trait name [skip ci]

* fix linux impl [skip ci]

* fix android build [skip ci]

* fix windows build

* fix(macos): do not autoresize on child webview [skip ci]

* fix macos coordinates [skip ci]

* fix example [skip ci]

* fixed child on macos [skip ci]

* fix docs typos [skip ci]

* fix webview position when it's not a child [skip ci]

* replace new_as_content_view with new_as_subview

* with_as_subview instead of constructor [skip ci]

* fix position/size when as_subview is true

* lint & fmt

* Fix ios build

* Fix cargo test

* Fix mac build

* Update macOS contrusctors

* cargo fmt

* impl drop on Windows

* fix child transparency on Windows (still needs PRs in tao and winit)

* fix winit usage in the examples, use rwh_05 only for now

* fix tests

* add webview.focus

* fix dropping on Linux

* chore clean examples

* implement focus on Linux

* macos focus

---------

Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2023-11-07 20:30:35 +09:00
Lucas Fernandes NogueiraandAmr Bashir 0582cdf4a1 fix: docs.rs macOS build failing (#1033)
* fix: docs.rs macOS build failing

* lint

* clippy lint

* fmt

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-10-10 15:14:16 +09:00
Lucas Fernandes Nogueira 5adf9da215 refactor(android): use http scheme by default for custom protocols and add option to change it ref #994 (#1020)
* refactor(android): use http scheme by default for custom protocols and add option to change it ref #994

* update documentation

* fix example
2023-09-09 00:18:50 +03:00
Lucas Fernandes NogueiraandAmr Bashir 4bdf1c366d refactor(protocol): respond with a function call instead of return value (#1017)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-09-06 10:50:05 -03:00
3cc4d79843 feat: support webview proxy (#1006)
* feat(macos): support proxy

* Added WebView2 implementation

* Update mod.rs

* Added Webkit2gtk implementation

* chore: update doc and format

* fix(macos): use TryFrom trait for nw_endpoint_t

* fix(macos): add `mac-proxy` feature flag to enable proxy feature for macOS 14.0+

* chore: fix clippy

* Change WebView2 argument construction to before async operation

* Update src/webview/mod.rs

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

* Remove unused import

* update formatting

* Added documentation at with_additional_browser_args

* refactor: remove redundant proxy struct

* Remove redundant reference

* hide proxy module and export types needed

---------

Co-authored-by: DK Liao <dklassic@gmail.com>
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2023-08-28 15:29:03 +08:00
b0a08b1652 chore: update to tao@0.22 (#997)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2023-08-13 19:25:44 -03:00