Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

airgap-links.js 517 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  1. export default function airgapLinks () {
  2. // When in an airgapped environment,
  3. // show a tooltip on external links
  4. const { airgap } = JSON.parse(document.getElementById('expose').text)
  5. if (!airgap) return
  6. const externaLinks = Array.from(
  7. document.querySelectorAll('a[href^="http"], a[href^="//"]')
  8. )
  9. externaLinks.forEach(link => {
  10. link.classList.add('tooltipped')
  11. link.setAttribute('aria-label', 'This link may not work in this environment.')
  12. link.setAttribute('rel', 'noopener')
  13. })
  14. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...