From 7aa677e6e25a1fdaf7cd966c5b1af58e9333e87f Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 23 Jan 2025 21:17:58 +0800 Subject: [PATCH] Allow configure referrer policy --- README.md | 5 + src/components/account-info.jsx | 6 +- src/components/embed-modal.jsx | 7 +- src/components/notification.jsx | 8 +- src/components/status.jsx | 8 +- src/locales/en.po | 274 ++++++++++++++++---------------- src/pages/catchup.jsx | 2 +- src/pages/http-route.jsx | 4 +- src/pages/settings.jsx | 32 ++-- src/pages/trending.jsx | 4 +- src/utils/enhance-content.js | 2 +- vite.config.js | 8 + 12 files changed, 180 insertions(+), 180 deletions(-) diff --git a/README.md b/README.md index 47fbe022..4543ef79 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,11 @@ Available variables: - `PHANPY_DEFAULT_LANG` (optional): - Default language is English (`en`) if not specified. - Fallback language after multiple detection methods (`lang` query parameter, `lang` key in `localStorage` and `navigator.language`) +- `PHANPY_REFERRER_POLICY` (optional, default: `origin`): + - Referrer policy for the site. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy). + - This is applied with the `` tag on the client-side. + - The policy can also be set with `Referrer-Policy` header configured on the server-side (not this variable). + - Note that since Phanpy uses hash-based URLs, the referrer does not include the hash part. - `PHANPY_LINGVA_INSTANCES` (optional, space-separated list, default: `lingva.phanpy.social [...hard-coded list of fallback instances]`): - Specify a space-separated list of instances. First will be used as default before falling back to the subsequent instances. If there's only 1 instance, means no fallback. - May specify a self-hosted Lingva instance, powered by either [lingva-translate](https://github.com/thedaviddelta/lingva-translate) or [lingva-api](https://github.com/cheeaun/lingva-api) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index fe30bf0d..07ea4da8 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -379,11 +379,7 @@ function AccountInfo({ Unable to load account.

- + Go to account page

diff --git a/src/components/embed-modal.jsx b/src/components/embed-modal.jsx index 28bf22d3..fdd9c3ed 100644 --- a/src/components/embed-modal.jsx +++ b/src/components/embed-modal.jsx @@ -13,12 +13,7 @@ function EmbedModal({ html, url, width, height, onClose = () => {} }) { {url && ( - + Open in new window {' '} diff --git a/src/components/notification.jsx b/src/components/notification.jsx index 6e3f93fa..c7f11a40 100644 --- a/src/components/notification.jsx +++ b/src/components/notification.jsx @@ -510,7 +510,7 @@ function Notification({ Learn more @@ -526,7 +526,7 @@ function Notification({ Learn more @@ -550,7 +550,7 @@ function Notification({ + { // within a day new Date().getTime() - createdAtDate.getTime() < @@ -2820,7 +2820,7 @@ function Card({ card, selfReferential, selfAuthor, instance }) { @@ -2930,7 +2930,7 @@ function Card({ card, selfReferential, selfAuthor, instance }) { {0}" msgstr "" @@ -81,33 +81,33 @@ msgstr "" msgid "Unable to load account." msgstr "" -#: src/components/account-info.jsx:387 +#: src/components/account-info.jsx:383 msgid "Go to account page" msgstr "" -#: src/components/account-info.jsx:415 -#: src/components/account-info.jsx:704 -#: src/components/account-info.jsx:734 +#: src/components/account-info.jsx:411 +#: src/components/account-info.jsx:700 +#: src/components/account-info.jsx:730 msgid "Followers" msgstr "" #. js-lingui-explicit-id -#: src/components/account-info.jsx:418 -#: src/components/account-info.jsx:744 -#: src/components/account-info.jsx:761 +#: src/components/account-info.jsx:414 +#: src/components/account-info.jsx:740 +#: src/components/account-info.jsx:757 msgid "following.stats" msgstr "Following" -#: src/components/account-info.jsx:421 -#: src/components/account-info.jsx:778 +#: src/components/account-info.jsx:417 +#: src/components/account-info.jsx:774 #: src/pages/account-statuses.jsx:483 #: src/pages/search.jsx:328 #: src/pages/search.jsx:475 msgid "Posts" msgstr "" -#: src/components/account-info.jsx:429 -#: src/components/account-info.jsx:1120 +#: src/components/account-info.jsx:425 +#: src/components/account-info.jsx:1116 #: src/components/compose.jsx:2624 #: src/components/media-alt-modal.jsx:46 #: src/components/media-modal.jsx:358 @@ -126,50 +126,50 @@ msgstr "" msgid "More" msgstr "" -#: src/components/account-info.jsx:441 +#: src/components/account-info.jsx:437 msgid "<0>{displayName} has indicated that their new account is now:" msgstr "" -#: src/components/account-info.jsx:586 -#: src/components/account-info.jsx:1278 +#: src/components/account-info.jsx:582 +#: src/components/account-info.jsx:1274 msgid "Handle copied" msgstr "Handle copied" -#: src/components/account-info.jsx:589 -#: src/components/account-info.jsx:1281 +#: src/components/account-info.jsx:585 +#: src/components/account-info.jsx:1277 msgid "Unable to copy handle" msgstr "Unable to copy handle" -#: src/components/account-info.jsx:595 -#: src/components/account-info.jsx:1287 +#: src/components/account-info.jsx:591 +#: src/components/account-info.jsx:1283 msgid "Copy handle" msgstr "" -#: src/components/account-info.jsx:601 +#: src/components/account-info.jsx:597 msgid "Go to original profile page" msgstr "" -#: src/components/account-info.jsx:608 +#: src/components/account-info.jsx:604 msgid "View profile image" msgstr "" -#: src/components/account-info.jsx:614 +#: src/components/account-info.jsx:610 msgid "View profile header" msgstr "" -#: src/components/account-info.jsx:631 +#: src/components/account-info.jsx:627 msgid "In Memoriam" msgstr "" -#: src/components/account-info.jsx:711 -#: src/components/account-info.jsx:752 +#: src/components/account-info.jsx:707 +#: src/components/account-info.jsx:748 msgid "This user has chosen to not make this information available." msgstr "This user has chosen to not make this information available." #. placeholder {0}: ( postingStats.originals / postingStats.total ).toLocaleString(i18n.locale || undefined, { style: 'percent', }) #. placeholder {1}: ( postingStats.replies / postingStats.total ).toLocaleString(i18n.locale || undefined, { style: 'percent', }) #. placeholder {2}: ( postingStats.boosts / postingStats.total ).toLocaleString(i18n.locale || undefined, { style: 'percent', }) -#: src/components/account-info.jsx:807 +#: src/components/account-info.jsx:803 msgid "{0} original posts, {1} replies, {2} boosts" msgstr "{0} original posts, {1} replies, {2} boosts" @@ -180,22 +180,22 @@ msgstr "{0} original posts, {1} replies, {2} boosts" #. placeholder {4}: postingStats.total #. placeholder {5}: postingStats.total #. placeholder {6}: postingStats.daysSinceLastPost -#: src/components/account-info.jsx:823 +#: src/components/account-info.jsx:819 msgid "{0, plural, one {{1, plural, one {Last 1 post in the past 1 day} other {Last 1 post in the past {2} days}}} other {{3, plural, one {Last {4} posts in the past 1 day} other {Last {5} posts in the past {6} days}}}}" msgstr "" #. placeholder {0}: postingStats.total #. placeholder {1}: postingStats.total -#: src/components/account-info.jsx:836 +#: src/components/account-info.jsx:832 msgid "{0, plural, one {Last 1 post in the past year(s)} other {Last {1} posts in the past year(s)}}" msgstr "" -#: src/components/account-info.jsx:860 +#: src/components/account-info.jsx:856 #: src/pages/catchup.jsx:70 msgid "Original" msgstr "" -#: src/components/account-info.jsx:864 +#: src/components/account-info.jsx:860 #: src/components/status.jsx:2268 #: src/pages/catchup.jsx:71 #: src/pages/catchup.jsx:1445 @@ -205,218 +205,218 @@ msgstr "" msgid "Replies" msgstr "" -#: src/components/account-info.jsx:868 +#: src/components/account-info.jsx:864 #: src/pages/catchup.jsx:72 #: src/pages/catchup.jsx:1447 #: src/pages/catchup.jsx:2070 -#: src/pages/settings.jsx:1155 +#: src/pages/settings.jsx:1151 msgid "Boosts" msgstr "" -#: src/components/account-info.jsx:874 +#: src/components/account-info.jsx:870 msgid "Post stats unavailable." msgstr "" -#: src/components/account-info.jsx:905 +#: src/components/account-info.jsx:901 msgid "View post stats" msgstr "" #. placeholder {0}: niceDateTime(lastStatusAt, { hideTime: true, }) -#: src/components/account-info.jsx:1068 +#: src/components/account-info.jsx:1064 msgid "Last post: <0>{0}" msgstr "" -#: src/components/account-info.jsx:1082 +#: src/components/account-info.jsx:1078 msgid "Muted" msgstr "" -#: src/components/account-info.jsx:1087 +#: src/components/account-info.jsx:1083 msgid "Blocked" msgstr "" -#: src/components/account-info.jsx:1096 +#: src/components/account-info.jsx:1092 msgid "Private note" msgstr "Private note" -#: src/components/account-info.jsx:1153 +#: src/components/account-info.jsx:1149 msgid "Mention <0>@{username}" msgstr "" -#: src/components/account-info.jsx:1165 +#: src/components/account-info.jsx:1161 msgid "Translate bio" msgstr "" -#: src/components/account-info.jsx:1176 +#: src/components/account-info.jsx:1172 msgid "Edit private note" msgstr "Edit private note" -#: src/components/account-info.jsx:1176 +#: src/components/account-info.jsx:1172 msgid "Add private note" msgstr "Add private note" -#: src/components/account-info.jsx:1196 +#: src/components/account-info.jsx:1192 msgid "Notifications enabled for @{username}'s posts." msgstr "Notifications enabled for @{username}'s posts." -#: src/components/account-info.jsx:1197 +#: src/components/account-info.jsx:1193 msgid " Notifications disabled for @{username}'s posts." msgstr " Notifications disabled for @{username}'s posts." -#: src/components/account-info.jsx:1209 +#: src/components/account-info.jsx:1205 msgid "Disable notifications" msgstr "Disable notifications" -#: src/components/account-info.jsx:1210 +#: src/components/account-info.jsx:1206 msgid "Enable notifications" msgstr "Enable notifications" -#: src/components/account-info.jsx:1227 +#: src/components/account-info.jsx:1223 msgid "Boosts from @{username} enabled." msgstr "Boosts from @{username} enabled." -#: src/components/account-info.jsx:1228 +#: src/components/account-info.jsx:1224 msgid "Boosts from @{username} disabled." msgstr "Boosts from @{username} disabled." -#: src/components/account-info.jsx:1239 +#: src/components/account-info.jsx:1235 msgid "Disable boosts" msgstr "Disable boosts" -#: src/components/account-info.jsx:1239 +#: src/components/account-info.jsx:1235 msgid "Enable boosts" msgstr "Enable boosts" -#: src/components/account-info.jsx:1255 -#: src/components/account-info.jsx:1265 -#: src/components/account-info.jsx:1868 +#: src/components/account-info.jsx:1251 +#: src/components/account-info.jsx:1261 +#: src/components/account-info.jsx:1864 msgid "Add/Remove from Lists" msgstr "" -#: src/components/account-info.jsx:1304 +#: src/components/account-info.jsx:1300 #: src/components/status.jsx:1177 msgid "Link copied" msgstr "" -#: src/components/account-info.jsx:1307 +#: src/components/account-info.jsx:1303 #: src/components/status.jsx:1180 msgid "Unable to copy link" msgstr "" -#: src/components/account-info.jsx:1313 +#: src/components/account-info.jsx:1309 #: src/components/shortcuts-settings.jsx:1059 #: src/components/status.jsx:1186 #: src/components/status.jsx:3269 msgid "Copy" msgstr "" -#: src/components/account-info.jsx:1328 +#: src/components/account-info.jsx:1324 #: src/components/shortcuts-settings.jsx:1077 #: src/components/status.jsx:1202 msgid "Sharing doesn't seem to work." msgstr "" -#: src/components/account-info.jsx:1334 +#: src/components/account-info.jsx:1330 #: src/components/status.jsx:1208 msgid "Share…" msgstr "" -#: src/components/account-info.jsx:1354 +#: src/components/account-info.jsx:1350 msgid "Unmuted @{username}" msgstr "Unmuted @{username}" -#: src/components/account-info.jsx:1366 +#: src/components/account-info.jsx:1362 msgid "Unmute <0>@{username}" msgstr "" -#: src/components/account-info.jsx:1382 +#: src/components/account-info.jsx:1378 msgid "Mute <0>@{username}…" msgstr "" #. placeholder {0}: typeof MUTE_DURATIONS_LABELS[duration] === 'function' ? MUTE_DURATIONS_LABELS[duration]() : _(MUTE_DURATIONS_LABELS[duration]) -#: src/components/account-info.jsx:1414 +#: src/components/account-info.jsx:1410 msgid "Muted @{username} for {0}" msgstr "Muted @{username} for {0}" -#: src/components/account-info.jsx:1426 +#: src/components/account-info.jsx:1422 msgid "Unable to mute @{username}" msgstr "Unable to mute @{username}" -#: src/components/account-info.jsx:1447 +#: src/components/account-info.jsx:1443 msgid "Remove <0>@{username} from followers?" msgstr "" -#: src/components/account-info.jsx:1467 +#: src/components/account-info.jsx:1463 msgid "@{username} removed from followers" msgstr "@{username} removed from followers" -#: src/components/account-info.jsx:1479 +#: src/components/account-info.jsx:1475 msgid "Remove follower…" msgstr "" -#: src/components/account-info.jsx:1490 +#: src/components/account-info.jsx:1486 msgid "Block <0>@{username}?" msgstr "" -#: src/components/account-info.jsx:1514 +#: src/components/account-info.jsx:1510 msgid "Unblocked @{username}" msgstr "Unblocked @{username}" -#: src/components/account-info.jsx:1522 +#: src/components/account-info.jsx:1518 msgid "Blocked @{username}" msgstr "Blocked @{username}" -#: src/components/account-info.jsx:1530 +#: src/components/account-info.jsx:1526 msgid "Unable to unblock @{username}" msgstr "Unable to unblock @{username}" -#: src/components/account-info.jsx:1532 +#: src/components/account-info.jsx:1528 msgid "Unable to block @{username}" msgstr "Unable to block @{username}" -#: src/components/account-info.jsx:1542 +#: src/components/account-info.jsx:1538 msgid "Unblock <0>@{username}" msgstr "" -#: src/components/account-info.jsx:1551 +#: src/components/account-info.jsx:1547 msgid "Block <0>@{username}…" msgstr "" -#: src/components/account-info.jsx:1568 +#: src/components/account-info.jsx:1564 msgid "Report <0>@{username}…" msgstr "" -#: src/components/account-info.jsx:1588 -#: src/components/account-info.jsx:2103 +#: src/components/account-info.jsx:1584 +#: src/components/account-info.jsx:2099 msgid "Edit profile" msgstr "" -#: src/components/account-info.jsx:1624 +#: src/components/account-info.jsx:1620 msgid "Withdraw follow request?" msgstr "Withdraw follow request?" #. placeholder {1}: info.acct || info.username -#: src/components/account-info.jsx:1625 +#: src/components/account-info.jsx:1621 msgid "Unfollow @{1}?" msgstr "Unfollow @{1}?" -#: src/components/account-info.jsx:1676 +#: src/components/account-info.jsx:1672 msgid "Unfollow…" msgstr "" -#: src/components/account-info.jsx:1685 +#: src/components/account-info.jsx:1681 msgid "Withdraw…" msgstr "" +#: src/components/account-info.jsx:1688 #: src/components/account-info.jsx:1692 -#: src/components/account-info.jsx:1696 #: src/pages/hashtag.jsx:262 msgid "Follow" msgstr "" -#: src/components/account-info.jsx:1808 -#: src/components/account-info.jsx:1863 -#: src/components/account-info.jsx:1997 -#: src/components/account-info.jsx:2098 +#: src/components/account-info.jsx:1804 +#: src/components/account-info.jsx:1859 +#: src/components/account-info.jsx:1993 +#: src/components/account-info.jsx:2094 #: src/components/account-sheet.jsx:38 #: src/components/compose.jsx:859 #: src/components/compose.jsx:2580 @@ -448,77 +448,77 @@ msgstr "" msgid "Close" msgstr "" -#: src/components/account-info.jsx:1813 +#: src/components/account-info.jsx:1809 msgid "Translated Bio" msgstr "" -#: src/components/account-info.jsx:1908 +#: src/components/account-info.jsx:1904 msgid "Unable to remove from list." msgstr "Unable to remove from list." -#: src/components/account-info.jsx:1909 +#: src/components/account-info.jsx:1905 msgid "Unable to add to list." msgstr "Unable to add to list." -#: src/components/account-info.jsx:1928 +#: src/components/account-info.jsx:1924 #: src/pages/lists.jsx:105 msgid "Unable to load lists." msgstr "" -#: src/components/account-info.jsx:1932 +#: src/components/account-info.jsx:1928 msgid "No lists." msgstr "" -#: src/components/account-info.jsx:1943 +#: src/components/account-info.jsx:1939 #: src/components/list-add-edit.jsx:40 #: src/pages/lists.jsx:59 msgid "New list" msgstr "" #. placeholder {0}: account?.username || account?.acct -#: src/components/account-info.jsx:2002 +#: src/components/account-info.jsx:1998 msgid "Private note about <0>@{0}" msgstr "" -#: src/components/account-info.jsx:2032 +#: src/components/account-info.jsx:2028 msgid "Unable to update private note." msgstr "Unable to update private note." -#: src/components/account-info.jsx:2055 -#: src/components/account-info.jsx:2226 +#: src/components/account-info.jsx:2051 +#: src/components/account-info.jsx:2222 msgid "Cancel" msgstr "" -#: src/components/account-info.jsx:2060 +#: src/components/account-info.jsx:2056 msgid "Save & close" msgstr "" -#: src/components/account-info.jsx:2154 +#: src/components/account-info.jsx:2150 msgid "Unable to update profile." msgstr "Unable to update profile." -#: src/components/account-info.jsx:2161 +#: src/components/account-info.jsx:2157 #: src/components/list-add-edit.jsx:105 msgid "Name" msgstr "" -#: src/components/account-info.jsx:2174 +#: src/components/account-info.jsx:2170 msgid "Bio" msgstr "" -#: src/components/account-info.jsx:2187 +#: src/components/account-info.jsx:2183 msgid "Extra fields" msgstr "" -#: src/components/account-info.jsx:2193 +#: src/components/account-info.jsx:2189 msgid "Label" msgstr "" -#: src/components/account-info.jsx:2196 +#: src/components/account-info.jsx:2192 msgid "Content" msgstr "" -#: src/components/account-info.jsx:2229 +#: src/components/account-info.jsx:2225 #: src/components/list-add-edit.jsx:150 #: src/components/shortcuts-settings.jsx:715 #: src/pages/filters.jsx:554 @@ -526,11 +526,11 @@ msgstr "" msgid "Save" msgstr "" -#: src/components/account-info.jsx:2283 +#: src/components/account-info.jsx:2279 msgid "username" msgstr "" -#: src/components/account-info.jsx:2287 +#: src/components/account-info.jsx:2283 msgid "server domain name" msgstr "" @@ -984,7 +984,7 @@ msgstr "" msgid "Media" msgstr "" -#: src/components/embed-modal.jsx:23 +#: src/components/embed-modal.jsx:18 msgid "Open in new window" msgstr "" @@ -1327,7 +1327,7 @@ msgstr "" #: src/pages/home.jsx:225 #: src/pages/mentions.jsx:21 #: src/pages/mentions.jsx:168 -#: src/pages/settings.jsx:1147 +#: src/pages/settings.jsx:1143 #: src/pages/trending.jsx:382 msgid "Mentions" msgstr "" @@ -1366,7 +1366,7 @@ msgstr "" #: src/pages/catchup.jsx:2064 #: src/pages/favourites.jsx:12 #: src/pages/favourites.jsx:24 -#: src/pages/settings.jsx:1151 +#: src/pages/settings.jsx:1147 msgid "Likes" msgstr "" @@ -2417,7 +2417,7 @@ msgid "<0/> <1/> boosted" msgstr "" #: src/components/timeline.jsx:455 -#: src/pages/settings.jsx:1175 +#: src/pages/settings.jsx:1171 msgid "New posts" msgstr "" @@ -3291,7 +3291,7 @@ msgid "{0, plural, one {Announcement} other {Announcements}}" msgstr "" #: src/pages/notifications.jsx:654 -#: src/pages/settings.jsx:1163 +#: src/pages/settings.jsx:1159 msgid "Follow requests" msgstr "" @@ -3634,79 +3634,79 @@ msgstr "" msgid "Donate" msgstr "Donate" -#: src/pages/settings.jsx:793 +#: src/pages/settings.jsx:789 msgid "Privacy Policy" msgstr "" #. placeholder {0}: WEBSITE.replace(/https?:\/\//g, '').replace(/\/$/, '') -#: src/pages/settings.jsx:800 +#: src/pages/settings.jsx:796 msgid "<0>Site: {0}" msgstr "" -#. placeholder {0}: !__FAKE_COMMIT_HASH__ && ( ( ) ) -#: src/pages/settings.jsx:807 +#. placeholder {0}: !__FAKE_COMMIT_HASH__ && ( ( ) ) +#: src/pages/settings.jsx:803 msgid "<0>Version: <1/> {0}" msgstr "" -#: src/pages/settings.jsx:822 +#: src/pages/settings.jsx:818 msgid "Version string copied" msgstr "" -#: src/pages/settings.jsx:825 +#: src/pages/settings.jsx:821 msgid "Unable to copy version string" msgstr "" -#: src/pages/settings.jsx:1060 -#: src/pages/settings.jsx:1065 +#: src/pages/settings.jsx:1056 +#: src/pages/settings.jsx:1061 msgid "Failed to update subscription. Please try again." msgstr "" -#: src/pages/settings.jsx:1071 +#: src/pages/settings.jsx:1067 msgid "Failed to remove subscription. Please try again." msgstr "" -#: src/pages/settings.jsx:1078 +#: src/pages/settings.jsx:1074 msgid "Push Notifications (beta)" msgstr "" -#: src/pages/settings.jsx:1100 +#: src/pages/settings.jsx:1096 msgid "Push notifications are blocked. Please enable them in your browser settings." msgstr "" #. placeholder {0}: [ { value: 'all', label: t`anyone`, }, { value: 'followed', label: t`people I follow`, }, { value: 'follower', label: t`followers`, }, ].map((type) => ( )) -#: src/pages/settings.jsx:1109 +#: src/pages/settings.jsx:1105 msgid "Allow from <0>{0}" msgstr "" -#: src/pages/settings.jsx:1118 +#: src/pages/settings.jsx:1114 msgid "anyone" msgstr "" -#: src/pages/settings.jsx:1122 +#: src/pages/settings.jsx:1118 msgid "people I follow" msgstr "" -#: src/pages/settings.jsx:1126 +#: src/pages/settings.jsx:1122 msgid "followers" msgstr "" -#: src/pages/settings.jsx:1159 +#: src/pages/settings.jsx:1155 msgid "Follows" msgstr "" -#: src/pages/settings.jsx:1167 +#: src/pages/settings.jsx:1163 msgid "Polls" msgstr "" -#: src/pages/settings.jsx:1171 +#: src/pages/settings.jsx:1167 msgid "Post edits" msgstr "" -#: src/pages/settings.jsx:1192 +#: src/pages/settings.jsx:1188 msgid "Push permission was not granted since your last login. You'll need to <0><1>log in again to grant push permission." msgstr "" -#: src/pages/settings.jsx:1208 +#: src/pages/settings.jsx:1204 msgid "NOTE: Push notifications only work for <0>one account." msgstr "" @@ -3807,7 +3807,7 @@ msgid "Trending News" msgstr "" #. By [Author] -#. placeholder {0}: author ? ( ) : authorUrl ? ( {authorName} ) : ( authorName ) +#. placeholder {0}: author ? ( ) : authorUrl ? ( {authorName} ) : ( authorName ) #: src/pages/trending.jsx:348 msgid "By {0}" msgstr "By {0}" diff --git a/src/pages/catchup.jsx b/src/pages/catchup.jsx index b5aa39b5..9aa1c858 100644 --- a/src/pages/catchup.jsx +++ b/src/pages/catchup.jsx @@ -1192,7 +1192,7 @@ function Catchup() { key={url} href={url} target="_blank" - rel="noopener noreferrer" + rel="noopener" class="link-block" style={ accentColor diff --git a/src/pages/http-route.jsx b/src/pages/http-route.jsx index c0fe500f..a41de53f 100644 --- a/src/pages/http-route.jsx +++ b/src/pages/http-route.jsx @@ -68,7 +68,7 @@ export default function HttpRoute() { Resolving…

- + {url}

@@ -79,7 +79,7 @@ export default function HttpRoute() { Unable to resolve URL

- + {url}

diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx index dbe53365..3fe154d9 100644 --- a/src/pages/settings.jsx +++ b/src/pages/settings.jsx @@ -250,7 +250,7 @@ function Settings({ onClose }) { Volunteer translations @@ -324,7 +324,7 @@ function Settings({ onClose }) { Go to your instance ({instance}) for more settings. @@ -483,7 +483,7 @@ function Settings({ onClose }) { Lingva API {' '} @@ -491,7 +491,7 @@ function Settings({ onClose }) { Lingva Translate @@ -545,7 +545,7 @@ function Settings({ onClose }) { GIPHY @@ -585,7 +585,7 @@ function Settings({ onClose }) { img-alt-api @@ -728,7 +728,7 @@ function Settings({ onClose }) { { e.preventDefault(); states.showAccount = 'phanpy@hachyderm.io'; @@ -741,7 +741,7 @@ function Settings({ onClose }) { Built {' '} @@ -749,7 +749,7 @@ function Settings({ onClose }) { { e.preventDefault(); states.showAccount = 'cheeaun@mastodon.social'; @@ -764,7 +764,7 @@ function Settings({ onClose }) { Sponsor {' '} @@ -772,7 +772,7 @@ function Settings({ onClose }) { Donate {' '} @@ -780,16 +780,12 @@ function Settings({ onClose }) { Patreon {' '} ·{' '} - + Privacy Policy

@@ -832,7 +828,7 @@ function Settings({ onClose }) { diff --git a/src/pages/trending.jsx b/src/pages/trending.jsx index a8f5f10a..dc3c0e9d 100644 --- a/src/pages/trending.jsx +++ b/src/pages/trending.jsx @@ -274,7 +274,7 @@ function Trending({ columnMode, ...props }) { ref={currentLink === url ? currentLinkRef : null} href={url} target="_blank" - rel="noopener noreferrer" + rel="noopener" class={`link-block ${ hasCurrentLink ? currentLink === url @@ -353,7 +353,7 @@ function Trending({ columnMode, ...props }) { {authorName} diff --git a/src/utils/enhance-content.js b/src/utils/enhance-content.js index 70e92e38..7e0b6076 100644 --- a/src/utils/enhance-content.js +++ b/src/utils/enhance-content.js @@ -218,7 +218,7 @@ function _enhanceContent(content, opts = {}) { if (TWITTER_MENTION_REGEX.test(html)) { html = html.replaceAll( TWITTER_MENTION_CAPTURE_REGEX, - '$1', + '$1', ); } fauxDiv.innerHTML = html; diff --git a/vite.config.js b/vite.config.js index c1c51ecc..0e1e51ec 100644 --- a/vite.config.js +++ b/vite.config.js @@ -21,6 +21,7 @@ const { PHANPY_WEBSITE: WEBSITE, PHANPY_CLIENT_NAME: CLIENT_NAME, PHANPY_APP_ERROR_LOGGING: ERROR_LOGGING, + PHANPY_REFERRER_POLICY: REFERRER_POLICY, } = loadEnv('production', process.cwd(), allowedEnvPrefixes); const now = new Date(); @@ -86,6 +87,13 @@ export default defineConfig({ includes: ['log', 'debug', 'info', 'warn', 'error'], }), htmlPlugin({ + metas: [ + // Learn more: https://web.dev/articles/referrer-best-practices + { + name: 'referrer', + content: REFERRER_POLICY || 'origin', + }, + ], headScripts: ERROR_LOGGING ? [rollbarCode] : [], links: [ ...ALL_LOCALES.map((lang) => ({