* 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>
15 lines
476 B
JavaScript
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.')
|
|
})
|
|
}
|