Skip to content

fix: improvements and ipc fixes for loading window content using custom protocol#8670

Merged
lucasfernog merged 11 commits into
devfrom
fix/window-content-custom-protocol
Jan 31, 2024
Merged

fix: improvements and ipc fixes for loading window content using custom protocol#8670
lucasfernog merged 11 commits into
devfrom
fix/window-content-custom-protocol

Conversation

@amrbashir

@amrbashir amrbashir commented Jan 24, 2024

Copy link
Copy Markdown
Member

closes #5478

  • made distDir and devPath optional so if someone wants to load all their windows using custom protocols they don't need to specify and create an empty directory for distDir when building
  • added WebviewUrl::CustomProtocol which is the same as WebviewUrl::External but more explicit.
  • fixed ipc calls from a window that loaded over custom protocol

@amrbashir amrbashir requested a review from a team as a code owner January 24, 2024 23:36
@amrbashir amrbashir force-pushed the fix/window-content-custom-protocol branch from 3686caf to 3848838 Compare January 24, 2024 23:37
Comment thread core/tauri/src/webview/mod.rs Outdated
Comment on lines 1061 to 1062
// TODO: what use-case is covered by this?
|| (cfg!(dev) && current_url.domain() == Some("tauri.localhost"))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@lucasfernog what use-case is being covered by this check?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IIRC it's for mobile.. should've documented it my bad

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

won't this be covered by the tauri::// case as well?

@amrbashir

Copy link
Copy Markdown
Member Author

There is one more improvement we can make but don't know if it makes sense? currently users will need to always explicitly specify the url for each window either in code or in tauri.conf.json, would it make sense if we allowed them to set a base url for all windows instead of tauri:// which is the default for all windows at the moement?

@lucasfernog

Copy link
Copy Markdown
Member

There is one more improvement we can make but don't know if it makes sense? currently users will need to always explicitly specify the url for each window either in code or in tauri.conf.json, would it make sense if we allowed them to set a base url for all windows instead of tauri:// which is the default for all windows at the moement?

I think this would complicate the codebase and introduce some bugs likely.. let's keep that until someone actually requests it

@amrbashir

Copy link
Copy Markdown
Member Author

I agree

@lucasfernog lucasfernog merged commit 58fe2e8 into dev Jan 31, 2024
@lucasfernog lucasfernog deleted the fix/window-content-custom-protocol branch January 31, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] can not load custom protocol content when creating window

2 participants