From bb17ffac9211106ba72f203004128f7cae6ffaee Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 9 Dec 2024 23:42:45 +0100 Subject: [PATCH] [Glitch] Change referrer policy to be controlled by header in web UI Port 425311e1d95c8a64ddac6c724fca247b8b893a82 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/components/attachment_list.jsx | 2 +- .../flavours/glitch/components/dropdown_menu.jsx | 2 +- .../flavours/glitch/components/error_boundary.jsx | 2 +- .../flavours/glitch/components/follow_button.tsx | 2 +- .../flavours/glitch/components/media_gallery.jsx | 4 ++-- .../flavours/glitch/components/server_banner.jsx | 2 +- app/javascript/flavours/glitch/components/status.jsx | 2 +- .../flavours/glitch/features/about/index.jsx | 2 +- .../glitch/features/account/components/header.jsx | 2 +- .../getting_started/components/announcements.jsx | 2 +- .../components/relationships_severance_event.jsx | 2 +- .../features/notifications/components/report.jsx | 2 +- .../notifications_v2/components/embedded_status.tsx | 2 +- .../glitch/features/standalone/status/index.tsx | 2 +- .../glitch/features/status/components/card.jsx | 6 +++--- .../glitch/features/ui/components/actions_modal.jsx | 2 +- .../glitch/features/ui/components/link_footer.tsx | 12 ++++-------- 17 files changed, 23 insertions(+), 27 deletions(-) diff --git a/app/javascript/flavours/glitch/components/attachment_list.jsx b/app/javascript/flavours/glitch/components/attachment_list.jsx index 60800f41ec..3cdd409e21 100644 --- a/app/javascript/flavours/glitch/components/attachment_list.jsx +++ b/app/javascript/flavours/glitch/components/attachment_list.jsx @@ -36,7 +36,7 @@ export default class AttachmentList extends ImmutablePureComponent { return (
  • - + {compact && } {compact && ' ' } {displayUrl ? filename(displayUrl) : } diff --git a/app/javascript/flavours/glitch/components/dropdown_menu.jsx b/app/javascript/flavours/glitch/components/dropdown_menu.jsx index 051ae6299a..7dab8291fa 100644 --- a/app/javascript/flavours/glitch/components/dropdown_menu.jsx +++ b/app/javascript/flavours/glitch/components/dropdown_menu.jsx @@ -124,7 +124,7 @@ class DropdownMenu extends PureComponent { return (
  • - + {text}
  • diff --git a/app/javascript/flavours/glitch/components/error_boundary.jsx b/app/javascript/flavours/glitch/components/error_boundary.jsx index 9ab48407af..82ea7dc89f 100644 --- a/app/javascript/flavours/glitch/components/error_boundary.jsx +++ b/app/javascript/flavours/glitch/components/error_boundary.jsx @@ -98,7 +98,7 @@ export default class ErrorBoundary extends PureComponent { )}

    -

    Mastodon v{version} · ·

    +

    Mastodon v{version} · ·

    diff --git a/app/javascript/flavours/glitch/components/follow_button.tsx b/app/javascript/flavours/glitch/components/follow_button.tsx index 4b32f8d148..584739dc29 100644 --- a/app/javascript/flavours/glitch/components/follow_button.tsx +++ b/app/javascript/flavours/glitch/components/follow_button.tsx @@ -88,7 +88,7 @@ export const FollowButton: React.FC<{ {label} diff --git a/app/javascript/flavours/glitch/components/media_gallery.jsx b/app/javascript/flavours/glitch/components/media_gallery.jsx index 46ff875ab6..13cbea4d34 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.jsx +++ b/app/javascript/flavours/glitch/components/media_gallery.jsx @@ -107,7 +107,7 @@ class Item extends PureComponent { if (attachment.get('type') === 'unknown') { return (
    - +
    - {domain}, mastodon: Mastodon }} /> + {domain}, mastodon: Mastodon }} />
    diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index 7485d81558..23da4effb2 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -367,7 +367,7 @@ class Status extends ImmutablePureComponent { if (e?.button === 0 && !(e?.ctrlKey || e?.metaKey)) { history.push(path); } else if (e?.button === 1 || (e?.button === 0 && (e?.ctrlKey || e?.metaKey))) { - window.open(path, '_blank', 'noreferrer noopener'); + window.open(path, '_blank', 'noopener'); } }; diff --git a/app/javascript/flavours/glitch/features/about/index.jsx b/app/javascript/flavours/glitch/features/about/index.jsx index d50b26cfe8..970972ee2e 100644 --- a/app/javascript/flavours/glitch/features/about/index.jsx +++ b/app/javascript/flavours/glitch/features/about/index.jsx @@ -123,7 +123,7 @@ class About extends PureComponent {
    `${value} ${key.replace('@', '')}`).join(', ')} className='about__header__hero' />

    {isLoading ? : server.get('domain')}

    -

    Mastodon }} />

    +

    Mastodon }} />

    diff --git a/app/javascript/flavours/glitch/features/account/components/header.jsx b/app/javascript/flavours/glitch/features/account/components/header.jsx index 62c8c84c66..6de90b2a43 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.jsx +++ b/app/javascript/flavours/glitch/features/account/components/header.jsx @@ -344,7 +344,7 @@ class Header extends ImmutablePureComponent {
    - + diff --git a/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx b/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx index 0ff0a863b3..cf557a7595 100644 --- a/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx +++ b/app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx @@ -85,7 +85,7 @@ class ContentWithRouter extends ImmutablePureComponent { } link.setAttribute('target', '_blank'); - link.setAttribute('rel', 'noopener noreferrer'); + link.setAttribute('rel', 'noopener'); } } diff --git a/app/javascript/flavours/glitch/features/notifications/components/relationships_severance_event.jsx b/app/javascript/flavours/glitch/features/notifications/components/relationships_severance_event.jsx index 397a2b7558..ad179525a9 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/relationships_severance_event.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/relationships_severance_event.jsx @@ -28,7 +28,7 @@ export const RelationshipsSeveranceEvent = ({ type, target, followingCount, foll

    {intl.formatMessage(messages[type], { from: {domain}, target: {target}, followingCount, followersCount })}

    - +
    ); diff --git a/app/javascript/flavours/glitch/features/notifications/components/report.jsx b/app/javascript/flavours/glitch/features/notifications/components/report.jsx index 0d80582e9f..1c28c8f9f6 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/report.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/report.jsx @@ -55,7 +55,7 @@ class Report extends ImmutablePureComponent {
    diff --git a/app/javascript/flavours/glitch/features/notifications_v2/components/embedded_status.tsx b/app/javascript/flavours/glitch/features/notifications_v2/components/embedded_status.tsx index 3378b5cb11..5a9445b101 100644 --- a/app/javascript/flavours/glitch/features/notifications_v2/components/embedded_status.tsx +++ b/app/javascript/flavours/glitch/features/notifications_v2/components/embedded_status.tsx @@ -70,7 +70,7 @@ export const EmbeddedStatus: React.FC<{ statusId: string }> = ({ if (button === 0 && !(ctrlKey || metaKey)) { history.push(path); } else if (button === 1 || (button === 0 && (ctrlKey || metaKey))) { - window.open(path, '_blank', 'noreferrer noopener'); + window.open(path, '_blank', 'noopener'); } } diff --git a/app/javascript/flavours/glitch/features/standalone/status/index.tsx b/app/javascript/flavours/glitch/features/standalone/status/index.tsx index 280b8fbb09..f6b9fa6994 100644 --- a/app/javascript/flavours/glitch/features/standalone/status/index.tsx +++ b/app/javascript/flavours/glitch/features/standalone/status/index.tsx @@ -68,7 +68,7 @@ const Embed: React.FC<{ id: string }> = ({ id }) => { className='embed__overlay' href={permalink} target='_blank' - rel='noreferrer noopener' + rel='noopener' aria-label='' /> diff --git a/app/javascript/flavours/glitch/features/status/components/card.jsx b/app/javascript/flavours/glitch/features/status/components/card.jsx index 1429ca90cf..3adc8a2ef3 100644 --- a/app/javascript/flavours/glitch/features/status/components/card.jsx +++ b/app/javascript/flavours/glitch/features/status/components/card.jsx @@ -197,7 +197,7 @@ export default class Card extends PureComponent {
    - +
    ) : spoilerButton} @@ -208,7 +208,7 @@ export default class Card extends PureComponent { return (
    {embed} - {description} + {description}
    ); } else if (card.get('image')) { @@ -228,7 +228,7 @@ export default class Card extends PureComponent { return ( <> - + {embed} {description} diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx index 82ccc88475..4b519e0d75 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx @@ -45,7 +45,7 @@ export default class ActionsModal extends ImmutablePureComponent { return (
  • - + {contents}
  • diff --git a/app/javascript/flavours/glitch/features/ui/components/link_footer.tsx b/app/javascript/flavours/glitch/features/ui/components/link_footer.tsx index 0fddce7d09..02de1c5c40 100644 --- a/app/javascript/flavours/glitch/features/ui/components/link_footer.tsx +++ b/app/javascript/flavours/glitch/features/ui/components/link_footer.tsx @@ -26,7 +26,7 @@ export const LinkFooter: React.FC<{ {statusPageUrl && ( <> - + @@ -72,15 +72,11 @@ export const LinkFooter: React.FC<{

    Mastodon:{' '} - + - + @@ -91,7 +87,7 @@ export const LinkFooter: React.FC<{ /> - +