Skip to content

Commit

Permalink
feat(link): set rel to "noopener noreferrer" if target is "_blank"
Browse files Browse the repository at this point in the history
Protects against cross-origin window.opener exploits when the target attribute is "_blank"
  • Loading branch information
metonym committed Sep 5, 2020
1 parent 00b9068 commit 4b7d254
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Link/Link.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
class:bx--link="{true}"
class:bx--link--disabled="{disabled}"
class:bx--link--inline="{inline}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
{...$$restProps}
on:click
on:mouseover
Expand Down

0 comments on commit 4b7d254

Please sign in to comment.