Commit Graph

27 Commits

Author SHA1 Message Date
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
Amr Bashir
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
Amr Bashir
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
Lucas Fernandes Nogueira
f089964a3c fix(linux): async custom protocol crashing sending response (#1276) 2024-05-23 04:05:52 +03:00
Amr Bashir
ba1fa58a41 chore: fix import in bench tests (#1188) 2024-03-13 17:16:51 +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
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
Ngo Iok Ui (Wu Yu Wei)
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 Nogueira
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
DK Liao
ad168a22df Update license to 2023 (#835) 2023-01-07 14:28:40 +08:00
Linda_pp
ddd34614be perf: Change return type of custom protocol handler from Vec<u8> to Cow<'static, [u8]>, closes #796 (#797)
* perf: Change return type of custom protocol handler from `Vec<u8>` to `Cow<'static, [u8]>`

to allow returning static resources without heap allocation

* chore(examples): Fix some comments

following the review https://github.com/tauri-apps/wry/pull/797#pullrequestreview-1210580935

* fix(android): Change return type of response to `Cow`
2022-12-12 14:31:58 +02:00
amrbashir
28074447ca chore(examples): add wasm exmaple to custom protocol 2022-12-05 20:18:05 +02:00
Lucas Fernandes Nogueira
51c7f12d80 fix(macos): do not trigger unsupported key feedback sound on keypress (#742)
Ref https://github.com/tauri-apps/tauri/issues/2626
2022-10-30 13:39:01 +02:00
amrbashir
569057ad83 chore: cleanup examples 2022-10-27 15:28:13 +02:00
Amr Bashir
74589525bd ci: fix bench please (#710)
* ci: fix bench please

* remove dot from benches scheme

* fix uri usages

* don't bench pullrequests
2022-09-29 22:49:15 +02:00
Amr Bashir
1510e45254 refactor: use http crate primitives instead of a custom impl (#706)
* refactor: use `http` crate primitives instead of custom impl

* android

* macos

* fix macos & ios build

* linux

* fix linux build

* change files
2022-09-29 15:07:25 +02:00
Amr Bashir
917bb4309a chore: licenses (#675) 2022-08-27 10:07:03 +08:00
Ngo Iok Ui (Wu Yu Wei)
3218091aa3 Add real android support (#577)
* Add real android support

* Add loadUrl

* Add on_create

* Update remaining webview api

* Move glue to tao

* Add MainPipe

* Update to tao ndk branch

* Update tao to 0.13
2022-08-03 06:52:51 +08:00
david
d202573c2c refactor: Custom protcol request/response (#387)
* refactor: Custom protcol request/response

Signed-off-by: David Lemarier <david@lemarier.ca>

* fix tests

Signed-off-by: David Lemarier <david@lemarier.ca>

* make clippy happy

Signed-off-by: David Lemarier <david@lemarier.ca>

* implement windows

Signed-off-by: David Lemarier <david@lemarier.ca>

* WIP linux implementation

Signed-off-by: David Lemarier <david@lemarier.ca>

* add request method for windows

Signed-off-by: David Lemarier <david@lemarier.ca>

* fix examples for windows

Signed-off-by: David Lemarier <david@lemarier.ca>

* better doc and add form post handler

Signed-off-by: David Lemarier <david@lemarier.ca>

* implement body on request for windows and fix fmt

Signed-off-by: David Lemarier <david@lemarier.ca>

* fix test and fmt

Signed-off-by: David Lemarier <david@lemarier.ca>

* remove `#[non_exhaustive]`

Signed-off-by: David Lemarier <david@lemarier.ca>

* make mimetype optional and finalize tauri integration

Signed-off-by: David Lemarier <david@lemarier.ca>

* use a string for URI as it doesnt support `file:///`

Signed-off-by: David Lemarier <david@lemarier.ca>

* fmt

Signed-off-by: David Lemarier <david@lemarier.ca>

* fix examples

Signed-off-by: David Lemarier <david@lemarier.ca>

* convert mimetype to `&str`

Signed-off-by: David Lemarier <david@lemarier.ca>

* make clippy happy

Signed-off-by: David Lemarier <david@lemarier.ca>

* remove unwanted logging

Signed-off-by: David Lemarier <david@lemarier.ca>
2021-08-22 15:28:00 +08:00
chip
0e2574c420 Remove &Window parameter from Custom Protocol handlers (#361)
* support multiple WebViews in a single WebContext

* wait for load-change::finished

* add doc_cfg for errors

* update os specific cfgs

* cargo +nightly fmt

* Revert "update os specific cfgs"

This reverts commit a1f1776f48983a6641d5b26dbefeb40f2bccb908.

* Revert "add doc_cfg for errors"

This reverts commit efe7b0228d72bd9e187fa43ce44089d290ba8338.

* remove updated cfg values

* updated documentation

* change web_context refs to mut

* update changelog

* clippy

* clippy for win/macos

* update system tray example to track tao dev changes

* remove Window from custom protocol handlers

* add changefile

* blind fix macOS

Co-authored-by: Ngo Iok Ui <wusyong9104@gmail.com>
2021-07-29 10:27:15 +08:00
Ngo Iok Ui (Wu Yu Wei)
d9c3b9a7b1 Update custom protocol example (#315)
* Update custom protocol example

* Cargo fmt

* Add icon as showcase

* Fix delay on Windows
2021-06-28 22:02:34 +08:00
Ngo Iok Ui (Wu Yu Wei)
48f53a3393 Add with_web_context method (#292)
* Add with_web_context method

* Add change file

* cargo fmt
2021-06-13 20:18:07 +08:00
Ngo Iok Ui (Wu Yu Wei)
cc9fc4b43d Add mimetype to return type of custom protocol (#296)
* Add mimetype to return type of custom protocol

* Fix macOS
2021-06-13 20:09:12 +08:00
chip
761b2b59fe webdriver support (#281)
* Add `Application` back, require it for `WebviewBuilder`

Linux only so far. Until further notice, this entire branch is going to only
work on Linux until I can decide on a good interface to expose WebDriver stuff.

`Application` makes it so that multiple windows can share a single WebContext
and UserContentManager (data directory). This is required for WebDriver because
only a single `WebContext` is allowed to be marked to allow automation. It
seems that macOS and Windows have similar limitations to some extent.

Only the multi_window example has been updated so far.

* Create automated webviews from webdriver clients

again, linux only for now.

updated detect_js_ecma example also

* cargo +nightly fmt

* update env var value for automation

* allow closing the window from the webdriver client

* add support for win32 windows

* add wry::Application support to macOS

* change how ApplicationExt work to match std

* update all examples to use wry::Application

* remove now unneeded uuid dependency

* add webdriver support to new example

* cargo +nightly fmt

* remove automation flag from mac/win ApplicationInner

* allow dead_code in Application inner field

is there a better proper fix? probably - but we will be redoing this interface
soon I imagine.

* cargo +nightly fmt

* update all WebviewBuilder::new calls

* cargo +nightly fmt

* super builder

* update ecma example

* enable automation if specific build env is set

* change build env var to feature

* move the super builder to its own module

* cargo +nightly fmt

* update builder docs

* explicitly allow inlining on wry::Builder

* revert everything to dev

* update webkit2gtk to v2_18 to allow for automation

* set custom cfg on rustdocs to allow for nightly doc features

* simplify application module

* enable nightly doc features when cfg is set

* add WebContext as a required item to `WebViewBuilder`

* add changes file

* move web_context to build from new

* update WebContextData path for windows,macos

* mark WebContextData as private

* update examples and doc tests

* allow os impl WebContextImpl to be dead_code

* fix windows webview builder initialization

* add winrt note to add window close event handler

* add smart link to WebContext docs

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <wusyong9104@gmail.com>

* update WebContext doc smartlink

* remove doc_cfg from empty non-linux WebContextImpls

* fix clippy error in unrelated code

* make clippy happy (new nightly lints)

Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <wusyong9104@gmail.com>
2021-06-09 12:33:38 +08:00
Ngo Iok Ui (Wu Yu Wei)
b840ded5f3 chore: Update ControlFlow to Wait (#232) 2021-05-03 20:11:39 +08:00
Ngo Iok Ui (Wu Yu Wei)
8269fde913 feat: &Window as a argument of closures (#181)
* Add window reference as closure argument on linux

* .. on mac

* .. and on windows

* cargo fmt
2021-04-21 19:58:24 +08:00
david
dd0fa46494 Use http instead of file for windows custom protocol workaround (#173)
* Use http instead of file for windows custom protocol workaround

Fix #170

* Add change file

* Add custom protocol example

* Replace `tauri` for `wry`
2021-04-20 21:45:43 +08:00