-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat: Expose ScrollBarStyle webview option to tauri. #14089
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: Expose ScrollBarStyle webview option to tauri. #14089
Conversation
Package Changes Through e0a2031There are 8 changes which include @tauri-apps/api with minor, tauri-cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri with minor, tauri-bundler with minor, @tauri-apps/cli with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
|
I'm not going to bother with fixing the formatting until the PR itself is ready for review. |
|
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. The PR includes no mitigation for this behaviour, as I was told to continue as if I hadn't noticed it, and open a separate issue about it. This extends to the configuration file and the Rust API as well, though the Rust API allows for changing the data directory. This behaviour is documented on Microsoft's website under CoreWebView2Environment.CreateCoreWebView2ControllerAsync:
|
|
Oh. I forgot the change file. My bad, adding that now. |
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.
This commit exposes the `scroll_bar_style` option in tauri.conf.json/ .json5/.toml as `scrollBarStyle` and `scroll-bar-style`.
f0837a8 to
e6e278e
Compare
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.
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.
e6e278e to
94b499b
Compare
|
Sorry about that, I just realised that the multiple rebases I did during this deleted some of my commit signatures. I've had to redo all of them. |
|
Removed |
9186789 to
1b523db
Compare
|
One final push to change the line endings in my change files to LF (I blame git for it being CRLF, as I have git configured to change all line endings to LF on commit.) Decided to amend it to the previous commit instead of creating a new one specifically for it, so I force pushed. |
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.
nice catch.. we do have options to force a webview to use the same environment a previously created one - i think we just need to track all data directories and use it accordingly |
lucasfernog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done!
on Windows the Webview2 environment options must match when created webviews sharing the same data directory (unless specified, all webviews share the same data directory). This PR validates the options, warning if they do not match, and forces the webview to be created with the same previous environment to prevent a crash. discovered as part of #14089
This commit exposes the
scroll_bar_styleoption from wry via tauri'sWebviewBuilderandWebviewWindowBuilderAPIs, as well as the configuration and JavaScript APIs.A continuation of tauri-apps/wry#1339, to expose this option to tauri.