posthtml-noopener
posthtml-noopener
is a PostHTML plugin to add rel="noopener noreferrer"
to links that open in a new tab.
Anchor links with the target="_blank"
attribute are recommended to include a rel="noopener"
or rel="noreferrer"
attribute to protect against cross-origin sites from exploiting window.opener
. By default, this plugin includes both attribute values.
Read more about the rel="noopener"
attribute.
Before:
Link
After:
Link
Install
yarn add -D posthtml-noopener# OR npm i posthtml-noopener
Usage
const fs = ;const posthtml = ;const noopener = ; const html = fs; ;
Contributing
See the PostHTML Guidelines.