Skip to content

fix: Hyperlinks do not work#6288

Open
John-pillo1124 wants to merge 2 commits intoStirling-Tools:mainfrom
John-pillo1124:fix/hyperlinks-do-not-work
Open

fix: Hyperlinks do not work#6288
John-pillo1124 wants to merge 2 commits intoStirling-Tools:mainfrom
John-pillo1124:fix/hyperlinks-do-not-work

Conversation

@John-pillo1124
Copy link
Copy Markdown

Summary of Changes

I've fixed hyperlink functionality issues in the Stirling PDF desktop application (Tauri/Windows version). The problems were:

  1. Hyperlinks in PDFs don't open when clicked
  2. Copying hyperlinks copies "http://tauri.localhost/#" instead of the actual URL

Testing Considerations

  1. Desktop (Tauri) Testing:
    • Hyperlinks should open in system browser
    • Copy link should copy actual URL, not "http://tauri.localhost/#"
    • Internal PDF navigation (page links) should still work
  2. Web Testing:
    • All existing functionality should remain unchanged
    • window.open should work as before
    • No regression in web version
  3. Security:
    • URL protocol validation maintained
    • Only http, https, and mailto URLs allowed
    • noopener,noreferrer security attributes preserved

Impact

  • Users: Can now click hyperlinks in PDFs and copy correct URLs
  • Developers: Consistent URL handling pattern for future features
  • Maintenance: Centralized URL opening logic, easier to update

The fix resolves the reported issues while maintaining backward compatibility and improving the codebase structure for handling external URLs in mixed web/desktop environments.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines ignoring generated files. Bugfix Pull requests that fix bugs labels May 1, 2026
@stirlingbot stirlingbot Bot added the Front End Issues or pull requests related to front-end development label May 1, 2026
Copy link
Copy Markdown
Contributor

@jbrunton96 jbrunton96 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. There's a couple of important things that need to be changed before this can be merged, but if they get fixed then this will be a good change to make 🙂

Comment on lines +12 to +13
import FavoriteStar from "@app/components/tools/toolPicker/FavoriteStar";
import FavoriteStar from "@app/components/tools/toolpicker/FavoriteStar";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This shouldn't have been changed. It'll only work on case-insensitive OSs

Comment thread frontend/src/core/utils/urlUtils.ts Outdated
* Check if we're running in a Tauri desktop environment
* @returns True if running in Tauri
*/
export function isTauriEnvironment(): boolean {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please review frontend/DeveloperGuide.md to see how to design desktop fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix Pull requests that fix bugs Front End Issues or pull requests related to front-end development size:L This PR changes 100-499 lines ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants