sutty/app/javascript/etc/external_links.js

7 lines
207 B
JavaScript
Raw Normal View History

document.addEventListener('turbolinks:load', () => {
document.querySelectorAll("a[href^='http://'],a[href^='https://'],a[href^='//']").forEach(a => {
a.rel = "noopener"
a.target = "_blank"
})
})