diff --git a/src/components/common/messaging/attachments/AttachmentActions.tsx b/src/components/common/messaging/attachments/AttachmentActions.tsx index 9db29ac6..4be74ff8 100644 --- a/src/components/common/messaging/attachments/AttachmentActions.tsx +++ b/src/components/common/messaging/attachments/AttachmentActions.tsx @@ -4,6 +4,7 @@ import { Download, } from "@styled-icons/boxicons-regular"; import { File, Video } from "@styled-icons/boxicons-solid"; +import { isFirefox } from "react-device-detect"; import { API } from "revolt.js"; import styles from "./AttachmentActions.module.scss"; @@ -51,7 +52,7 @@ export default function AttachmentActions({ attachment }: Props) { href={download_url} className={styles.downloadIcon} download - target="_blank" + target={isFirefox ? "_blank" : "_self"} rel="noreferrer"> @@ -69,7 +70,7 @@ export default function AttachmentActions({ attachment }: Props) { href={download_url} className={styles.downloadIcon} download - target="_blank" + target={isFirefox ? "_blank" : "_self"} rel="noreferrer"> @@ -89,7 +90,7 @@ export default function AttachmentActions({ attachment }: Props) { href={download_url} className={styles.downloadIcon} download - target="_blank" + target={isFirefox ? "_blank" : "_self"} rel="noreferrer"> @@ -118,7 +119,7 @@ export default function AttachmentActions({ attachment }: Props) { href={download_url} className={styles.downloadIcon} download - target="_blank" + target={isFirefox ? "_blank" : "_self"} rel="noreferrer"> diff --git a/src/lib/ContextMenus.tsx b/src/lib/ContextMenus.tsx index 8fa7dbbd..af7291ec 100644 --- a/src/lib/ContextMenus.tsx +++ b/src/lib/ContextMenus.tsx @@ -11,6 +11,7 @@ import { Trash, } from "@styled-icons/boxicons-regular"; import { Cog, UserVoice } from "@styled-icons/boxicons-solid"; +import { isFirefox } from "react-device-detect"; import { useHistory } from "react-router-dom"; import { Channel, Message, Server, User, API } from "revolt.js"; import { Permission, UserPermission } from "revolt.js"; @@ -286,7 +287,7 @@ export default function ContextMenus() { "attachments", "attachments/download", ), - "_blank", + isFirefox ? "_blank" : "_self", ); } break;