Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow white-list domain for NuxtLink #25466

Open
3 of 4 tasks
Barbapapazes opened this issue Jan 27, 2024 · 3 comments
Open
3 of 4 tasks

Allow white-list domain for NuxtLink #25466

Barbapapazes opened this issue Jan 27, 2024 · 3 comments

Comments

@Barbapapazes
Copy link
Contributor

Barbapapazes commented Jan 27, 2024

Describe the feature

Hello,

When using a NuxtLink, if the href start with a protocol, 'noreferrer noopener' is automatically. While this is great in many case, when you start creating websites links between them, like documentations, you need to know if user come from one of your website.

To do so, the 'noreferrer' need to be removed. While this is possible to pass manually 'noopener' to NuxtLink, it become more complicated when there is new website, many links or even with Nuxt Content.

To solve this, I'm thinking of a white list of URL where only the 'noopener' is set, coming from a key in the Nuxt config file.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@harlan-zw
Copy link
Contributor

harlan-zw commented Feb 3, 2024

Probably best to just create your own NuxtLink:

createNuxtLink({
 componentName: 'MySiteLinks',
 externalRelAttribute: 'noopener'
})

@danielroe
Copy link
Member

That would also mean you could add your custom UTM logic as well.

@pi0
Copy link
Member

pi0 commented Feb 6, 2024

I also like the idea of a custom link, specially for docs it gives many more options while keeping Nuxt core simple too.

Only the fact that nuxt core adds noreferrer noopener by default is already involved in the logic...

What got my attention to this issue was first security for external links. I wouldn't add complexity only for the sake of default rel behavior but it got me thinking Nuxt could have an external links policy for security and privacy and it could be joined with route rules. Something to think about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

4 participants