summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/features/reactions-avatars.tsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/features/reactions-avatars.tsx b/source/features/reactions-avatars.tsx
index cd3576ae..4a851cba 100644
--- a/source/features/reactions-avatars.tsx
+++ b/source/features/reactions-avatars.tsx
@@ -36,12 +36,17 @@ function add(): void {
const participantByReaction = [...list.children as HTMLCollectionOf<HTMLElement>].map(getParticipants);
const flatParticipants = flatZip(participantByReaction, avatarLimit);
- for (const participant of flatParticipants) {
- participant.container.append(
- <a href={`/${participant.username}`}>
- <img src={`/${participant.username}.png?size=${window.devicePixelRatio * 20}`}/>
+ for (const {container, username} of flatParticipants) {
+ container.append(
+ <a>
+ <img src={`/${username}.png?size=${window.devicePixelRatio * 20}`} />
</a>
);
+
+ // Without this, Firefox will follow the link instead of submitting the reaction button
+ if (!navigator.userAgent.includes('Firefox/')) {
+ (container.lastElementChild as HTMLAnchorElement).href = `/${username}`;
+ }
}
list.classList.add('rgh-reactions');