Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): expose Wry's with_incognito to Tauri on the WindowBuilder::incognito function. #6767

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

Hyphrio
Copy link
Contributor

@Hyphrio Hyphrio commented Apr 22, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

While WebViewBuilder::data_directory could simulate incognito mode by setting this to a temporary directory, that is annoying to use and error-prone as users could forget deleting the directory, thus creating large unnecessary directories, filling up the user's storage.

This PR merely exposes with_incognito from tauri-apps/wry#916 to Tauri though the new enable_incognito function at the WindowBuilder, which would allow for a real incognito mode that would be useful for things that need incognito mode, like webview sign-ins.

NOTE: Requires Wry 0.27.3 or higher, thus this should be merged for 2.0.

@Hyphrio Hyphrio requested a review from a team as a code owner April 22, 2023 09:13
@Hyphrio Hyphrio changed the title feat feat: expose Wry's with_incognito to Tauri on the WebViewBuilder::enable_incognito function. Apr 22, 2023
@Hyphrio Hyphrio changed the title feat: expose Wry's with_incognito to Tauri on the WebViewBuilder::enable_incognito function. feat: expose Wry's with_incognito to Tauri on the WindowBuilder::enable_incognito function. Apr 22, 2023
@Hyphrio Hyphrio changed the title feat: expose Wry's with_incognito to Tauri on the WindowBuilder::enable_incognito function. feat(runtime): expose Wry's with_incognito to Tauri on the WindowBuilder::enable_incognito function. Apr 22, 2023
@Hyphrio Hyphrio changed the title feat(runtime): expose Wry's with_incognito to Tauri on the WindowBuilder::enable_incognito function. feat(core): expose Wry's with_incognito to Tauri on the WindowBuilder::enable_incognito function. Apr 22, 2023
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

This option needs to also be added to the tauri config and js API

core/tauri-runtime/src/webview.rs Outdated Show resolved Hide resolved
core/tauri/src/window.rs Outdated Show resolved Hide resolved
@Hyphrio Hyphrio changed the title feat(core): expose Wry's with_incognito to Tauri on the WindowBuilder::enable_incognito function. feat(core): expose Wry's with_incognito to Tauri on the WindowBuilder::incognito function. Apr 25, 2023
@Hyphrio
Copy link
Contributor Author

Hyphrio commented Apr 25, 2023

I'm not sure if the JS api works so that'll need some testing.

@Hyphrio
Copy link
Contributor Author

Hyphrio commented Apr 25, 2023

I think the JS api is broken on all versions of Tauri it seems.

@Hyphrio Hyphrio marked this pull request as draft May 31, 2023 09:20
@Hyphrio
Copy link
Contributor Author

Hyphrio commented May 31, 2023

I'll put this back to Draft until I finish rebasing.

@Hyphrio
Copy link
Contributor Author

Hyphrio commented May 31, 2023

Alright, already rebased.

@Hyphrio Hyphrio marked this pull request as ready for review May 31, 2023 10:37
@wusyong wusyong added the status: needs review A maintainer must review this code label May 31, 2023
core/tauri-runtime/src/webview.rs Outdated Show resolved Hide resolved
core/tauri-utils/src/config.rs Outdated Show resolved Hide resolved
core/tauri/src/window.rs Outdated Show resolved Hide resolved
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last small nit-pick

core/tauri-runtime/src/webview.rs Outdated Show resolved Hide resolved
@Hyphrio
Copy link
Contributor Author

Hyphrio commented Jun 6, 2023

I think after this I'll probably pulling a small PR for the JS api, but if you can do it that would be nice

amrbashir
amrbashir previously approved these changes Jun 6, 2023
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

amrbashir
amrbashir previously approved these changes Jun 6, 2023
Co-authored-by: Hyphrio <notmynn@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs review A maintainer must review this code
Projects
Status: 🔎 In audit
Development

Successfully merging this pull request may close these issues.

3 participants