1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/javascripts/airgap-links.js
Kevin Heis a3ad549e39 Block a few more things in AIRGAP (#17657)
* Block a few more things in AIRGAP

* Update middleware/context.js

Co-authored-by: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com>

* Update product-landing.html

Co-authored-by: Vanessa Yuen <6842965+vanessayuenn@users.noreply.github.com>
2021-02-09 23:07:23 +00:00

15 lines
476 B
JavaScript

export default function airgapLinks () {
// When in an airgapped environment,
// show a tooltip on external links
const { airgap } = JSON.parse(document.getElementById('expose').text)
if (!airgap) return
const externaLinks = Array.from(
document.querySelectorAll('a[href^="http"], a[href^="//"]')
)
externaLinks.forEach(link => {
link.classList.add('tooltipped')
link.setAttribute('aria-label', 'This link may not work in this environment.')
})
}