Gathering detailed insights and metrics for @hint/hint-disown-opener
Gathering detailed insights and metrics for @hint/hint-disown-opener
Gathering detailed insights and metrics for @hint/hint-disown-opener
Gathering detailed insights and metrics for @hint/hint-disown-opener
💡 A hinting engine for the web
npm install @hint/hint-disown-opener
Typescript
Module System
Node Version
NPM Version
59.9
Supply Chain
84.5
Quality
75.6
Maintenance
50
Vulnerability
93.7
License
Dist files
Updated on Oct 01, 2019
configuration-development-v6.1.1
Updated on Mar 07, 2019
hint-sri-v3.0.5
Updated on Mar 07, 2019
hint-no-vulnerable-javascript-libraries-v2.7.0
Updated on Mar 07, 2019
hint-css-prefix-order-v1.0.2
Updated on Mar 07, 2019
hint-amp-validator-v2.7.0
Updated on Mar 07, 2019
TypeScript (91.49%)
JavaScript (4.96%)
CSS (2.22%)
Handlebars (0.76%)
EJS (0.5%)
HTML (0.06%)
Batchfile (0.01%)
Shell (0.01%)
Total Downloads
5,126,715
Last Day
1,813
Last Week
17,583
Last Month
77,520
Last Year
1,087,754
Apache-2.0 License
3,652 Stars
6,372 Commits
743 Forks
74 Watchers
157 Branches
105 Contributors
Updated on Jun 20, 2025
Minified
Minified + Gzipped
Latest Version
4.0.23
Package Id
@hint/hint-disown-opener@4.0.23
Unpacked Size
27.38 kB
Size
9.24 kB
File Count
13
NPM Version
10.5.0
Node Version
18.19.1
Published on
Aug 29, 2024
Cumulative downloads
Total Downloads
Last Day
2.5%
1,813
Compared to previous day
Last Week
-6.2%
17,583
Compared to previous week
Last Month
-9.4%
77,520
Compared to previous month
Last Year
-11.7%
1,087,754
Compared to previous year
6
1
disown-opener
)disown-opener
checks if the rel
attribute is specified with both
the noopener
and noreferrer
values (or only noopener
if all the
targeted browsers support it) on
a
and area
elements that have target="_blank"
and link to other
origins.
Links that have target="_blank"
, such as
<a href="https://example.com" target="_blank">
constitute:
When using target="_blank"
, the page that was linked to gains
access to the original page’s window.opener
.
This allows it to redirect the original page to whatever it wants,
a technique frequently used for malicious attacks on the user.
For example, the user could be redirected to a phishing page
designed to look like the expected page and then asking for login
credentials (see also: tab nabbing).
By adding rel="noopener"
(and noreferrer
for older browsers)
the window.opener
reference won’t be set, removing the ability
for the page that was linked to from redirecting the original one.
Most modern browsers are multi-process. However, in most browsers,
due to the synchronous cross-window access the DOM allows via
window.opener
, pages launched via target="_blank"
end up in
the same process as the origin page, and that can lead to the pages
experiencing jank.
In Chromium based browsers, using rel="noopener"
(or
rel="noreferrer"
for older versions),
and thus, preventing the window.opener
reference from being set,
allows new pages to be opened in their own process.
Edge is not affected by this.
Notes:
Not all browsers support rel="noopener"
,
so to ensure that things work as expected in as many
browsers as possible, by default, the hint requires both the
noopener
and noreferrer
values to be specified. However,
if all the targeted browsers
support noopener
, only noopener
will be required.
The reason why the hint does not check the same origin links by default is because:
Check Can the hint be configured?
section to see how the hint can be made to also check same origin
links.
In the future there may be a CSP valueless property that will prevent the window.opener
reference
from being set.
By default, the hint checks if the rel
attribute was specified with
both the noopener
and noreferrer
values on a
and area
elements
that have target="_blank"
and link to other origins.
If the targeted browsers are specified,
based on their support, the hint might only require the noopener
value.
Let’s presume the original page is https://example1.com
.
1<a href="http://example1.com/example.html" target="_blank">example</a>
1<a href="https://en.example1.com" target="_blank">example</a>
1<a href="//example2.com" target="_blank">example</a>
1<a href="https://example2.com" target="_blank">example</a>
1<img src="example.png" width="10" height="10" usemap="#example"> 2<map name="example"> 3 <area shape="rect" coords="0,0,5,5" href="http://example3.com/example.html" target="_blank"> 4</map>
1<a href="/" target="_blank">example</a>
1<a href="example.html" target="_blank">example</a>
1<a href="https://example1.com/example.html" target="_blank">example</a>
1<a href="http://example1.com/example.html" target="_blank" rel="noopener noreferrer">example</a>
1<a href="https://en.example1.com/example.html" target="_blank" rel="noopener noreferrer">example</a>
1<a href="//example2.com" target="_blank" rel="noopener noreferrer">example</a>
1<a href="https://example2.com" target="_blank" rel="noopener noreferrer">example</a>
1<img src="example.png" width="10" height="10" usemap="#example"> 2<map name="example"> 3 <area shape="rect" coords="0,0,5,5" href="example.html" target="_blank"> 4</map>
1<img src="example.png" width="10" height="10" usemap="#example"> 2<map name="example"> 3 <area shape="rect" coords="0,0,5,5" href="http://example3.com/example.html" target="_blank" rel="noopener noreferrer"> 4</map>
includeSameOriginURLs
can be used to specify that same origin URLs
should also include rel="noopener noreferrer"
.
In the .hintrc
file:
1{ 2 "connector": {...}, 3 "formatters": [...], 4 "hints": { 5 "disown-opener": ["error", { 6 "includeSameOriginURLs": true 7 }], 8 ... 9 }, 10 ... 11}
Also, note that this hint takes into consideration the targeted
browsers, and if all of them
support the noopener
value, the hint won’t require the noreferrer
value.
This package is installed automatically by webhint:
1npm install hint --save-dev
To use it, activate it via the .hintrc
configuration file:
1{ 2 "connector": {...}, 3 "formatters": [...], 4 "hints": { 5 "disown-opener": "error", 6 ... 7 }, 8 "parsers": [...], 9 ... 10}
Note: The recommended way of running webhint is as a devDependency
of
your project.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
Found 4/23 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
64 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More