Commit Graph

76 Commits

Author SHA1 Message Date
yy
7873c4a1c6
docs: fix typos in comments (#14787) 2026-01-17 12:30:14 +01:00
Camilla F
9b242e40c8
fix: BSD support in tauri-runtime (#14700)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-12-29 17:29:07 +01:00
Kushal Meghani
c1d82eb3a3
fix(linux): reuse WebContext to prevent WebKitNetworkProcess leak (#14628)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-12-25 13:03:15 +01:00
Tony
251203b896
fix(linux): work area returns logical rect (#14637) 2025-12-09 18:05:12 +08:00
Tony
752c923002
chore: fix some typos (#14334) 2025-10-20 22:51:28 +08:00
Felix Häcker
684791efa6
fix(macos): Always try to create webview, even if webkit runtime isn't detected correctly (#14276) 2025-10-14 11:58:43 -03:00
Kirill Gribunin
b0c493a4ea
FIX: Fixed GDI object leak when a resizable window is created and then closed on Windows platform (#14209)
Co-authored-by: Kirill Gribunin <kgribunin@contoso.local>
2025-09-24 21:57:05 +03:00
Jamie Ridding
f5851ee00d
feat: Expose ScrollBarStyle webview option to tauri. (#14089)
* Expose `ScrollBarStyle` webview option to tauri.

This commit exposes the scroll_bar_style option from wry via the tauri
WebviewWindowBuilder API. By itself, the commit does not include changes
to the configuration file or JavaScript APIs: These will be added in a
later commit.

* Fix a compile error on macOS and Linux.

* Add `scroll_bar_style` to WindowConfig.

This commit exposes the `scroll_bar_style` option in tauri.conf.json/
.json5/.toml as `scrollBarStyle` and `scroll-bar-style`.

* Expose `scroll_bar_style` to JavaScript API.

This commit exposes the `scroll_bar_style` in the options object passed
to the JavaScript API `Webview` and `WebviewWindow` constructors.

While testing this, I discovered that on Windows, attempting to create
a webview from the JavaScript API will cause the hosting window to
immediately hang if it attempts to use the same data directory as
another webview without sharing the same environment options. This
commit includes no mitigation for this behaviour, as I will be opening
a separate issue about it at some point in the near future.

* Document WebView2 environment requirements.

This commit adds a message to the documentation for all components of
the `scroll_bar_style` configuration option, telling users that all
webviews that use the same data directory must use the same value for
this option.

* Fix formatting.

* Add change files to .changes directory.

* Remove `tauri-schema-generator` from change file.

* Remove quotes from change tags.

* Add tags to change files.

I did not realise that these were needed, as the pull request that I
used as my reference when building this feature did not have them.

* update conf

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-09-02 07:14:59 -03:00
Lucas Fernandes Nogueira
03e7c11932
fix(tauri-runtime-wry): ignore about:blank initial URL (#14080)
* fix(tauri-runtime-wry): ignore about:blank initial URL

fixes a macOS warning when a navigation handler is registered and you choose to create a new window on the on_new_window hook - in this case we shouldn't perform the initial navigation since the URL is provided by the webview configuration from the hook

* change tag

* bump min wry
2025-08-25 10:03:35 -03:00
Tony
737364b8d3
fix: a few regressions from previous PRs (#14020)
* fix: a few regressions from previous PRs

* rename with_window_features to window_features

* Clippy

* clippy

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-17 12:03:31 -03:00
Robert
68874c68c5
feat(core): webview window focusable property, closes #11130 (#13564)
* Adds the ability to set the focused property from tauri.conf.json -- windows

* add set_focusable, pin tao

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-17 11:50:17 -03:00
Sean Wang
dfadcb764b
feat: add WebView::set_cookie and WebView::delete_cookie (#13661)
* chore: patch wry

* feat: added `Webview::set_cookie` and `Webview::delete_cookie`

* chore: changes-files

* fmt

* owned cookie, re-export crate

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-16 23:41:16 -03:00
Sean Wang
22d6bcacbb
feat(tauri): impl App::set_device_event_filter for AppHandle also (#14008)
* feat(tauri): impl `App::set_device_event_filter` for `AppHandle` also

* Update .changes/impl-set_device_event_filter-for-apphandle.md

* Update .changes/impl-set_device_event_filter-for-apphandle.md

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2025-08-16 15:30:46 -03:00
THELOSTSOUL
33d0b3f0c1
feat: add WebviewBuilder::on_new_window and WebviewBuilder::on_document_title_changed (#13876)
* add "new window" and "document title changed" webview handler

* take document title changed handler

* update example, add missing api, change files

* allow creating tauri window for the window.open call

* set size and position, fix linux, example

* enhance document title change

* fix windows deadlock

* wry 0.53

* update wry

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-16 14:49:01 -03:00
Naman Khandelwal
5110a762e9
feat(window): add macOS window::set_simple_fullscreen (closes #13670) (#13830)
* add implementation of set_simple_fullscreen

* add simple fullscreen API for macos

* register desktop command

* format

* fix errors

* chore: format

* change implementation

* add api

* fix tests

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-08-12 08:03:29 -03:00
Tony
196ace3c04
fix: return error on window creation failed (#13970)
* fix: return error on window creation failed

* Add todo about adding error inside `CreateWindow`
2025-08-09 22:43:18 +08:00
Aly Cerruti
82e264552e
fix(windows): fix double free (STATUS_HEAP_CORRUPTION) of resizing handler's userdata (#13968)
* fix: double free of resizing handler's userdata on Windows

Using WM_NCDESTROY instead of WM_DESTROY is more correct for freeing userdata, as windows can receive multiple WM_DESTROY events if they're parented.

* chore: add change entry for resizing handler double-free fix
2025-08-09 12:03:21 +08:00
Tony
c134a769ea
chore: fix some warnings on new rust version (#13965)
* chore: fix some warnings on new rust version

* No main

* allow dead code on specta Channel
2025-08-09 08:19:03 +08:00
Siddharth
3025d90951
feat: expose some window props from runtime-wry (#13822)
* test: make some of window id + stores public

* test: make window wrapper label pub

* feat: make label accessible for windowwrapper

* chore: adds wry runtime changefile

* chore: avoid forced clone on label

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-07-15 14:32:19 +08:00
Fabian-Lars
f010ca5e91
fix(core): compile error without common-controls-v6 (#13719) 2025-06-27 15:54:10 +02:00
sftse
9c16eefa31
Update kuchikiki, html5ever, tao, wry, webview2-com (#13629)
* fix: dont depend on private schemars api

* tauri-cli/deps: update kuchikiki and html5ever
tauri-utils/deps: update kuchikiki and html5ever
tauri-runtime-wry/deps: update wry to match kuchikiki and html5ever versions

* fix: specify exact patch version of schemars

Without this, cargo resolves the patch version of schemars to one that
does not include the _private module on which tauri-utils v1 depends,
which is a dependency of tauri-cli. As a result of this, the build breaks.

* tauri-utils/fix: inline tauri-utils v1 config module

* deps: upgrade and pin schemars 0.8.21 to pick up crate patch in Cargo.toml

* update tao, wry

* lint, license

* lint

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-06-24 14:39:20 -03:00
Tony
78d15e892d
fix(windows): allow web fullscreen APIs to work (#13558)
* fix(windows): allow web fullscreen APIs to work

* tauri-runtime-wry not tauri-wry

* Remove last clone

* Change file on windows
2025-06-03 19:04:14 +08:00
Tony
1686296463
refactor: put dynamic acl to a feature (#13418)
* refactor: put dynamic acl to a feature

* Add change file

* Tweak remove_unused_commands's docs

* License header

* Document the feature

* Merge remote-tracking branch 'upstream/dev' into dynamic-acl-feature

* Use a inner non generic fn for add_capability

* Clippy and macro stability notice

* Merge remote-tracking branch 'upstream/dev' into dynamic-acl-feature

* Format
2025-05-16 22:54:23 +08:00
Tony
4acae1ec02
fix(macos): run app.set_theme on main thread (#13443)
* fix(macos): run `app.set_theme` on main thread

* Change file
2025-05-15 15:13:23 +08:00
Tony
1777406a16
chore: apply some clippy suggestions (#13424) 2025-05-13 14:18:24 +08:00
Amr Bashir
96ecfca428
feat: check if webview runtime is accessible when creating a webview (#13406) 2025-05-10 06:00:09 +03:00
Oscar Beaumont
bc2f0e48ac
fix(macOS): caculation for work area (#13401)
* remove y offset

* Create change-pr-13401.md
2025-05-09 08:36:12 -03:00
Lucas Fernandes Nogueira
f0662e41f4
fix(tauri-runtime-wry): window prevent overflow monitor check (#13365) 2025-05-03 14:31:43 -03:00
Lucas Fernandes Nogueira
568efb4568
fix: follow-up fix for monitor work area on macOS (#13310)
follow-up for #13309
2025-04-26 15:03:35 -03:00
Lucas Fernandes Nogueira
6ce10ab773
fix: monitor work_area on macOS (#13309)
macOS uses a different coordinate system for visibleFrame, so to get accurate values we should only get the diff between frame() and visibleFrame() and apply that to the standard monitor position returned by CGDisplayBounds. Size isn't impacted by this, and properly returns the value (accounting for dock position).
2025-04-25 20:08:46 -03:00
Amr Bashir
267368fd4f
feat: add workarea getter for monitor (#13276) 2025-04-23 03:29:03 +02:00
Tony
1734273bbe
fix: using center and overflow together crashes (#13235) 2025-04-15 16:59:01 +08:00
Lucas Fernandes Nogueira
07953fb9c3
fix(tauri-runtime-wry): send focused events on multiwebview for Windows (#13222)
* fix(tauri-runtime-wry): send focused events on multiwebview for Windows

closes #9755

follow-up for #12014

* fix mobile build
2025-04-14 14:56:57 -03:00
Lucas Fernandes Nogueira
ea36294cbc
feat(core): allow changing or disabling the input accessory view on iOS (#13208)
* feat(core): allow changing or disabling the input accessory view on iOS

needs https://github.com/tauri-apps/wry/pull/1544

* remove unused code

* fix imports

* lint

* fix features

* wry 0.51.2
2025-04-12 21:10:07 -03:00
Tony
b072e2b296
feat(core): add an option for preventing window overflow (#9687)
* Add an option for preventing window overflow

* Fix shadow counted as part of the width

* Enable prevent overflow by default

* Fix crashing when margin is bigger than screen

* Config file support

* Add to ts type

* Add mac implementation

* Should be let some

* Apply suggestions from code review

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

* checked_sub -> saturating_sub

* Revert license header

* Migrate windows 0.58

* Generate schema

* Fix merge conflict

* Try casting to objc2_app_kit::NSScreen

* Add NSScreen feature

* Use cast instead of as

* fmt

* Deref first

* Wrong unsafe block

* Add change file

* Add serde alias

* More docs

* Disable prevent_overflow by default
since we can't make breaking changes anymore right now

* Remove unused default impl

* Missing pub

* Fix mock_runtime on ios

* Match PreventOverflowMargin's description

* Typo

* Apply suggestions from code review

* Move get_work_area_size to seperate files

* Unused imports

* Add prevent_overflow to WebviewWindowBuilder

* Fix mac compile

* MonitorExt is only for desktop

* Rename to work_area

* Use workarea for linux

* Missing `()`

* Convert size

* Import MonitorExt

* as u32

* Re-build API js

* Fix wrong docs for work_area

* Remove linux platform specific note

* Remove left over linux platform specific note

* Use work area API for center as well

* Fix mobile

* Clean up

* small cleanup

* fix codegen

* update docs

* fix generated

---------

Co-authored-by: Jason Tsai <jason@pews.dev>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-12 13:56:43 -03:00
The1111mp
dd4f13ce4b
feat: add set_dock_visibility method (#13185)
* feat: add `set_dock_visibility` method

Signed-off-by: The1111mp <The1111mp@outlook.com>

* add api

* retain focus

* fmt

* make SetDockVisibility message conditional (macos only)

* lint

---------

Signed-off-by: The1111mp <The1111mp@outlook.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-11 15:13:07 -03:00
Simon Laux
c1cd0a2ddb
feat: macOS/iOS: add option to disable or enable link previews when building a webview (#13090)
* macOS/iOS: add option to disable or enable link previews when building a webview (the webkit api has it enabled by default)
  -  `WebViewBuilderExtDarwin.allow_link_preview(allow_link_preview: bool)`
  -  `WebViewBuilder.allow_link_preview(allow_link_preview: bool)`
  -  `WebviewWindowBuilder.allow_link_preview(allow_link_preview: bool)`

* also call on iOS

* add api

* fix tests

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-04-11 09:00:34 -03:00
Lucas Fernandes Nogueira
bb5faa21f4
chore: update tao, wry, windows, webview2-com (#13163)
* chore: update tao, wry, windows, webview2-com

* update docs

* Use `impl Into<String>`

* More docs

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-04-09 08:15:31 -03:00
Tony
80dccb6a2e
chore: fix a few internal docs and apply clippy suggestions (#13131)
* chore: fix a few internal docs

* Remove label clone

* Unused allow lint

* No way clippy just updated

* `cargo clippy --fix -- -W clippy::redundant_clone`

* format
2025-04-03 17:57:36 +02:00
Simon Laux
8cf662e34b
feat: expose api to run initialization scripts on all frames. (#13076)
* api!: expose api to run initialisation scripts on all frames.

* remove breaking change, add new api instead.

* Update .changes/init-script-on-all-frames.md

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* use struct `InitializationScript` instead of tuple

* Update crates/tauri-runtime/src/webview.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* Apply suggestions from code review

* Update crates/tauri/src/webview/webview_window.rs

---------

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-04-02 08:41:34 +08:00
Thomas Eizinger
658e5f5d1d
feat: introduce App::run_return (#12668)
* Introduce `run_return`

* Fix compile error

* Clone web_context

* Refactor to Result API

* Fix clippy

* Impl mock runtime

* Make it desktop-only

* Add changelog entry

* Fix compile error

* Make it semver compatible

* Extend changelog entry

* Undo semver-hack

* Reduce diff

* Remove unnecessary mut

* Make it take `self` by value

* Reduce diff

* Undo diff hack

* Make everything cfg(desktop)

* Rename vars to reduce diff

* Fix clippy

* Extract make_event_handler

* Reduce diff

* Deprecate `App::run_return`

* Update changelog

* Fix compile errors

* Accept reference

* Create event handler first

* Update example

* Update manifest

* Fix example

* Fix example docs

* Call `setup` only upon Ready

* Update changelog entry

* Update docs

* Update changelog

* Add platform-specific note

* update docs

* run_return on mobile

* Apply suggestions from code review

* remove change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-16 07:04:22 -03:00
Adam Charron
cedb24d494
feat: add Webview::cookies and Webview::cookies_for_url() (#12665)
* Add support for fetching cookies by url

* Add support for fetching all cookies

* add missing getters, update change file

* update docs for windows deadlock

* fix mobile build

* Update crates/tauri-runtime/Cargo.toml

* add docs for stability [skip ci]

---------

Co-authored-by: Adam Charron <acharron@higherlogic.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-15 12:34:41 -03:00
Fabian-Lars
30f5a1553d
feat: traffic light position (#12366)
* moving to macbook

* that was so weird to implement

* rm patch

* Discard changes to Cargo.lock

* Create change-pr-12366.md

* add missing builder fn

* remove test

* split change files

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-15 12:18:11 -03:00
Simon Laux
d8059bad3c
add AppHandle.fetch_data_store_identifiers and AppHandle.remove_data_store (#12900)
* add `AppHandle::fetch_all_data_store_identifiers` and `AppHandle::remove_data_store`

* make it run on main thread, so you can call the function from any thread and it works.

* changes file

* update signature, move functions to RuntimeHandle

* add api

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-13 18:17:22 -03:00
Simon Laux
be2e6b85fe
add Window.is_always_on_top() and WebviewWindow.is_always_on_top() (#12944)
* add `Window.is_always_on_top()` and `WebviewWindow.is_always_on_top()`

* add api

* fmt

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-13 18:02:01 -03:00
Simon Laux
c698a6d6f3
feat: add Webview.reload and WebviewWindow.reload (#12818)
* feat: add `Webview.reload` and `WebviewWindow.reload`

* fix tests

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-02 15:11:25 -03:00
Simon Laux
20c1906912
feat: add WebviewBuilder.disable_javascript and WebviewWindowBuilder.disable_javascript (#12821)
* feat: add `WebviewBuilder.disable_javascript` and `WebviewWindowBuilder.disable_javascript`

* wry 0.50.3

* add missing config options and API types

* add change file for api

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-03-02 14:54:34 -03:00
Amr Bashir
e103e87f15
fix(windows): ensure APIs exist before using it (#12848)
* fix(windows): ensure APIs exist before using it

* fix build on other platforms

* clippy

* use GetSystemMetricsForDpi
2025-02-28 14:46:16 +02:00
Amr Bashir
385a41dea2
enhance(windows): disable our in-client resizing for undecorated window with shadows (#12817)
* enhance(windows): disable our in-client resizing for undecorated window with shadows

ref: https://github.com/tauri-apps/tao/pull/1052

* skip hittesting for undeceorated windows
2025-02-26 17:21:46 +02:00
Fabian-Lars
d6520a21ce
chore(deps): wry@0.50 muda@0.16 tray-icon@0.20 windows@0.60 webview2-com@0.36 objc@0.6 window-vibrancy@0.6 tao@0.32 (#12541)
* chore(deps): Update windows to 0.59. Update webview2-com to 0.35

* wry and other crates and objc2

* window-vibrancy 0.6

* Update windows059-webview035.md

* win compile error

* tao

* tao 0.32.1

* updatus maximus

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2025-02-25 19:41:00 +02:00