Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/templates/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ export default ({ app: { router } }) => {

const addListeners = links => {
for (let i = 0; i < links.length; i++) {

const target = links[i].getAttribute('target')

if (links[i].hostname !== window.location.hostname && !target) {
links[i].target = '_blank';
}

// For improved security `rel="noopener"` will be added automatically if target is `_blank`
// https://github.com/mathiasbynens/rel-noopener/
if (target && target === '_blank') {
Expand Down