You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
4
+
5
+
<!-- end auto-generated rule header -->
6
+
7
+
When you want to link to an external page from your app, it is very common to use `<a href="url" target="_blank"></a>`
8
+
to make the browser open this link in a new tab.
9
+
10
+
However, this practice has [performance problems](https://jakearchibald.com/2016/performance-benefits-of-rel-noopener/)
11
+
and also opens a door to some security attacks because the opened page can redirect the opener app
12
+
to a malicious clone to perform phishing on your users.
13
+
14
+
Adding `rel="noopener noreferrer"` closes that door and avoids javascript in the opened tab to block the main
15
+
thread in the opener. Also note that Firefox versions prior 52 do not implement `noopener`, so `rel="noreferrer"` should be used instead ([see Firefox issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1222516)).
16
+
17
+
## Examples
18
+
19
+
This rule **forbids** the following:
20
+
21
+
```hbs
22
+
<a href='https://i.seem.secure.com' target='_blank'>I'm a bait</a>
23
+
```
24
+
25
+
This rule **allows** the following:
26
+
27
+
```hbs
28
+
<a href='https://i.seem.secure.com' target='_blank' rel='noopener noreferrer'>I'm a bait</a>
29
+
```
30
+
31
+
## References
32
+
33
+
-[Link type "noreferrer"](https://html.spec.whatwg.org/multipage/semantics.html#link-type-noreferrer) spec
0 commit comments