fix(app): restore external link opening in system browser#10697
fix(app): restore external link opening in system browser#10697adamdotdevin merged 1 commit intoanomalyco:devfrom
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #8523: feat(desktop): open external links in system browser instead of webview Why they're related: |
|
@alexyaroshuk had to revert this as it breaks normal navigation with links (ie, sessions). want to look into a a solution to this? |
I made a fix, please check #10752, thanks. |
…omalyco#10697)" This reverts commit 984518b.
…omalyco#10697)" This reverts commit 984518b.
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