mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Include noreferrer on embed links / window.open.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { Text } from "preact-i18n";
|
||||
|
||||
import Modal from "../../../components/ui/Modal";
|
||||
import { dispatch } from "../../../redux";
|
||||
|
||||
import Modal from "../../../components/ui/Modal";
|
||||
|
||||
interface Props {
|
||||
onClose: () => void;
|
||||
link: string;
|
||||
@@ -17,7 +18,7 @@ export function ExternalLinkModal({ onClose, link }: Props) {
|
||||
actions={[
|
||||
{
|
||||
onClick: () => {
|
||||
window.open(link, "_blank");
|
||||
window.open(link, "_blank", "noreferrer");
|
||||
onClose();
|
||||
},
|
||||
confirmation: true,
|
||||
@@ -36,15 +37,17 @@ export function ExternalLinkModal({ onClose, link }: Props) {
|
||||
const url = new URL(link);
|
||||
dispatch({
|
||||
type: "TRUSTED_LINKS_ADD_DOMAIN",
|
||||
domain: url.hostname
|
||||
domain: url.hostname,
|
||||
});
|
||||
} catch(e) {}
|
||||
window.open(link, "_blank");
|
||||
} catch (e) {}
|
||||
window.open(link, "_blank", "noreferrer");
|
||||
onClose();
|
||||
},
|
||||
plain: true,
|
||||
children: <Text id="app.special.modals.external_links.trust_domain" />,
|
||||
}
|
||||
children: (
|
||||
<Text id="app.special.modals.external_links.trust_domain" />
|
||||
),
|
||||
},
|
||||
]}>
|
||||
<Text id="app.special.modals.external_links.short" /> <br />
|
||||
<a>{link}</a>
|
||||
|
||||
Reference in New Issue
Block a user