@livenetworks/external-links
v1.0.1
Published
Live Networks script that converts all links to outer domains to open in a new window and adds the rel attribute of 'noreferrer noopener'
Downloads
5
Readme
LiveNetworks External Links Component
Plain Javascript Component. Not needed any additional libraries, frameworks.
- Speed up your web site by loading non blocking javascript with defer atrribute;
- You're not sure if you missed or mistyped the 'rel' or 'target' attribute on your website or application?
- Want to make sure all links leading out of your website or web app open in a new browser window?
- It works even with dynamically (javascript/ajax) generated elements;
- Not needed to write single line of javascript to initialize it;
Usage
Load script into .html
Initial:
<div>
<a href="https://www.google.com/" rel="noreferrer" rel="noopener noreferrer"
>google</a
>
<a href="https://twitter.com/">twitter</a>
<a href="https://www.facebook.com/">facebook</a>
</div>
<a href="https://www.amazingradios.com/">facebook</a>
<script src="ln-external-links.js" defer></script>
After:
<div>
<a href="https://www.google.com/" rel="noopener noreferrer" target="_blank"
>google</a
>
<a href="https://twitter.com/" target="_blank" rel="noopener noreferrer"
>twitter</a
>
<a href="https://www.facebook.com/" target="_blank" rel="noopener noreferrer"
>facebook</a
>
</div>
<a
href="https://www.amazingradios.com/"
target="_blank"
rel="noopener noreferrer"
>facebook</a
>
<script src="ln-external-links.js" defer></script>