fix(app): restore external link opening in system browser #10697
+14
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #10613
closes #8361
What does this PR do?
Restores the ability to open markdown links in the system browser instead of within the webview.
Problem
After the markdown parser was migrated from JavaScript to Rust, clicking links in markdown would navigate within the desktop app's webview instead of opening in the system browser.
The old implementation relied on:
external-linkclassplatform.openLink()to open them externallySolution
Moved the external link handling into the component's
onMount()hook to accessthe platform
after the DOM is ready. Key improvements:
markdown parser changed)
stopPropagation()andstopImmediatePropagation()to prevent thewebview's default link handling
shellOpen()from @tauri-apps/plugin-shell to open in systembrowser
How did you verify your code works?
Ran the app locally and clicked on links to verify they open in your system browser instead of inside the app window
Before
before_fix-link-handling.mp4
After
after_fix-link-handling.mp4