Skip to content
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

Custom Website Service breaks JS click events on <a> tags #2028

Open
2 tasks done
s-ol opened this issue Jan 26, 2025 · 0 comments · May be fixed by ferdium/ferdium-recipes#613
Open
2 tasks done

Custom Website Service breaks JS click events on <a> tags #2028

s-ol opened this issue Jan 26, 2025 · 0 comments · May be fixed by ferdium/ferdium-recipes#613
Labels
bug 🪲 Something isn't working recipe 📑 This issue is about a ferdium recipe

Comments

@s-ol
Copy link

s-ol commented Jan 26, 2025

Preflight Checklist

  • I agree to follow the Code of Conduct that Ferdium Recipes adheres to.
  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

Ferdium Version

7.0.0

Recipe Name

Custom Website

Recipe Version

1.5.1

Last Known working version of the recipe

No response

Steps to reproduce

  1. Add a Service - Custom Website - https://phanpy.social
  2. Log in using any Mastodon account
  3. Click a profile picture or username in the feed

Expected Behavior

When installing https://phanpy.social as a Custom Website, clicking on a profile opens the profile overlay drawer like in a browser

Actual Behavior

Nothing happens in Ferdium and the profile URL is opened in an external browser

Screenshots

No response

Additional Information

This likely affects other services/websites and is due to the way franz-custom-website's webview.js is implemented. When an HTML <a> element is clicked, ferdium will open the URL in its href attribute even if the website has installed a click event handler that overrides browser behaviour to trigger in-page navigation or some other action.

This is compounded by the fact that the trapLinkClicks ("Open URLs within Ferdium") setting does not fully deactivate Ferdium's meddling with click events:
https://github.com/ferdium/ferdium-recipes/blob/main/recipes/franz-custom-website/webview.js#L27

instead of explicitly replicating default behaviour by changing window.location, when trapLinkClicks is true, ferdium should not call event.preventDefault() or event.stopPropagation(), or simply not install the click handler at all.

@s-ol s-ol added bug 🪲 Something isn't working recipe 📑 This issue is about a ferdium recipe labels Jan 26, 2025
@s-ol s-ol changed the title Ferdium breaks JS click events on <a> tags Custom Website Service breaks JS click events on <a> tags Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working recipe 📑 This issue is about a ferdium recipe
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant