tree-wide: use noopener instead of noreferrer for target="_blank"

This will allow us to see when users click links to the pybricks.com
website from the app.
This commit is contained in:
David Lechner
2022-12-20 12:09:04 -06:00
committed by David Lechner
parent 7277ddb1bd
commit dd322b5aac
7 changed files with 12 additions and 6 deletions
+1
View File
@@ -27,6 +27,7 @@ module.exports = {
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'import/order': ['error', { alphabetize: { order: 'asc' } }],
'react-hooks/exhaustive-deps': 'error',
'react/jsx-no-target-blank': ['error', { allowReferrer: true }],
},
settings: {
react: { version: 'detect' },
+1
View File
@@ -67,6 +67,7 @@ const UnexpectedErrorAlert: React.VoidFunctionComponent<UnexpectedErrorAlertProp
'is:issue',
)}+${encodeURIComponent(error.message)}`}
target="_blank"
rel="noopener"
>
{i18n.translate('reportBug')}
</AnchorButton>
+1
View File
@@ -28,6 +28,7 @@ const NoHub: React.VoidFunctionComponent<NoHubProps> = ({ onFlashFirmware }) =>
icon="help"
href={pybricksBluetoothTroubleshootingUrl}
target="_blank"
rel="noopener"
>
{i18n.translate('noHub.troubleshootButton')}
<ExternalLinkIcon />
+2
View File
@@ -38,6 +38,7 @@ const NoDfuHub: React.VoidFunctionComponent<NoDfuHubProps> = ({
icon="help"
href={pybricksUsbLinuxUdevRulesUrl}
target="_blank"
rel="noopener"
>
{i18n.translate('noDfuHub.configureUdevRulesButton')}
<ExternalLinkIcon />
@@ -47,6 +48,7 @@ const NoDfuHub: React.VoidFunctionComponent<NoDfuHubProps> = ({
icon="help"
href={pybricksUsbDfuTroubleshootingUrl}
target="_blank"
rel="noopener"
>
{i18n.translate('noDfuHub.troubleshootButton')}
<ExternalLinkIcon />
@@ -348,7 +348,7 @@ const BootloaderInstructions: React.VoidFunctionComponent<
<a
href={pybricksUsbLinuxUdevRulesUrl}
target="_blank"
rel="noreferrer"
rel="noopener"
>
{i18n.translate('warning.linux.learnMore')}
</a>
+2 -1
View File
@@ -75,11 +75,12 @@ function mapIcon(level: Level): IconName | undefined {
* Converts a URL to an action that can be passed to `ToasterInstance.show()`.
* @param helpUrl A URL.
*/
function helpAction(helpUrl: string): ActionProps & LinkProps {
function helpAction(helpUrl: string): ActionProps & LinkProps & { rel: string } {
return {
icon: 'help',
href: helpUrl,
target: '_blank',
rel: 'noopener',
};
}
+4 -4
View File
@@ -38,7 +38,7 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
<a
href={pybricksTeamUrl}
target="_blank"
rel="noreferrer"
rel="noopener"
>
{i18n.translate('whoAreWe.team.team')}
</a>
@@ -74,7 +74,7 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
fill={true}
href="https://github.com/sponsors/pybricks"
target="_blank"
rel="noreferrer"
rel="noopener"
>
GitHub Sponsors
<ExternalLinkIcon />
@@ -86,7 +86,7 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
fill={true}
href="https://www.patreon.com/pybricks"
target="_blank"
rel="noreferrer"
rel="noopener"
>
Patreon
<ExternalLinkIcon />
@@ -98,7 +98,7 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
fill={true}
href="https://paypal.me/pybricks"
target="_blank"
rel="noreferrer"
rel="noopener"
>
Paypal
<ExternalLinkIcon />