-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
fix(linux): don't share UserContentManager between webviews (v0.24) #1325
fix(linux): don't share UserContentManager between webviews (v0.24) #1325
Conversation
Package Changes Through c3900d7There are 1 changes which include wry with patch 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 |
Fixes tauri-apps#1308 Init scripts are registered to the UserContentManager, so if it is shared between webviews, the init scripts will conflict. Use a unique UserContentManager for each WebView instead of sharing it across the WebContext. The IPC message handler is also registered to UserContentManager. window_hash is no longer needed as a key to register_script_message_handler since the manager is unique. window_hash is already removed on the dev branch.
Change from register_uri_scheme to try_register_uri_scheme, which doesn't attempt to register if we already know that one with the same name was registered to the WebContext before. Without this change, I get this error from WebKitGTK: ** (tauri-app:[...]): CRITICAL **: 14:03:50.040: Cannot register URI scheme tauri more than once It doesn't seem to affect functionality, but better to issue a more appropriate warning on our side.
e4ab3d4
to
d119e20
Compare
@amrbashir Hold on, there is still manager.register_script_message_handler("ipc"); so referencing by the window hash in the init script won't work, right? Otherwise this is ok by me, but how was it a breaking change? |
Fallout from changes done to tauri-apps#1325 before merging
Fallout from changes done to #1325 before merging
Fixes #1308
Init scripts are registered to the
UserContentManager
, so if it is shared betweenWebView
s, the init scripts conflict. Use a uniqueUserContentManager
for eachWebView
instead of sharing it across theWebContext
.The IPC message handler is also registered to
UserContentManager
.window_hash
is no longer needed as a key toregister_script_message_handler
since the manager is unique. (window_hash
is already removed on the dev branch.)Also changed from
register_uri_scheme
totry_register_uri_scheme
, which doesn't attempt to register a URI scheme if we already know that one with the same name was registered to theWebContext
before. Without this change, I get this error from WebKitGTK:It doesn't seem to affect functionality, but better to issue a more appropriate warning on our side. (On dev, this is propagated as an error)
Corresponding PR on the dev branch: #1326