Skip to content
Merged
Show file tree
Hide file tree
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
43 changes: 43 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,47 @@ import Layout from './layout.vue'
import '@theojs/lumen/theme'
import '@theojs/lumen/doc-blocks-border'

/**
* Add noopener to links with text fragments
*/
function initNoopenerLinks() {
if (typeof window === 'undefined')
return

const processLinks = () => {
document.querySelectorAll('a').forEach((link) => {
const href = link.getAttribute('href')
// Add noopener to links with text fragments
if (href && href.includes(':~:text=')) {
const rel = link.getAttribute('rel') || ''
if (!rel.includes('noopener')) {
const newRel = rel ? `${rel} noopener` : 'noopener'
link.setAttribute('rel', newRel.trim())
}
const target = link.getAttribute('target') || ''
if (!target) {
link.setAttribute('target', '_blank')
}
}
})
}

// Process links on load
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', processLinks)
}
else {
processLinks()
}

// Process dynamically added links
const observer = new MutationObserver(processLinks)
observer.observe(document.body, {
childList: true,
subtree: true,
})
}

export default {
extends: DefaultTheme,
Layout,
Expand All @@ -17,6 +58,8 @@ export default {
baiduAnalytics({ baiduId: '0afa8cd5bd78fd0c960f8af5dc6af333' })
if (typeof window !== 'undefined') {
trackPageview('0afa8cd5bd78fd0c960f8af5dc6af333', window.location.href)
// Initialize noopener for text fragment links
initNoopenerLinks()
}

app.component('Home', HomeUnderline)
Expand Down
10 changes: 5 additions & 5 deletions en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ features:
details: Supports Win / MacOS / Linux / FreeBSD / Android<br>Compatible with X86 / ARM / MIPS architectures
link: /en/guide/download
- title: Secure
details: AES-GCM or WireGuard encryption<br>Prevents man-in-the-middle attacks
link: /
details: Multiple encryption algorithms including AES-GCM or WireGuard encryption<br>Prevents man-in-the-middle attacks
link: /en/guide/network/configurations#:~:text=encryption%20algorithm&text=ET_ENCRYPTION_ALGORITHM
- title: Efficient NAT Traversal
details: Supports UDP, IPv6 traversal<br>Can penetrate NAT4-NAT4 networks
link: /
link: /en/guide/aboutp2p
- title: Subnet Proxy
details: Nodes can share subnets for other nodes to access.
link: /en/guide/network/point-to-networking
- title: Intelligent Routing
details: Latency priority, automatic route selection<br>Provides the best network experience
link: /en/guide/network/configurations
link: /en/guide/network/configurations#:~:text=latency%20priority%20mode&text=ET_LATENCY_FIRST
- title: High Performance
details: Zero-copy throughout the entire link<br>Supports TCP / UDP / WSS / WG and other protocols
details: Zero-copy throughout the entire link<br>Supports TCP / UDP / WS / WSS / WG / QUIC / FakeTCP and other protocols
link: /en/guide/perf
- title: UDP Loss Resistance
details: KCP / QUIC proxy<br>Optimizes latency and bandwidth in high packet loss environments
Expand Down
10 changes: 5 additions & 5 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ features:
details: 支持 Win / MacOS / Linux / FreeBSD / Android<br>兼容 X86 / ARM / MIPS 架构
link: /guide/download
- title: 安全
details: AES-GCM 或 WireGuard 加密<br>防止中间人攻击
link: /
details: 支持 AES-GCM 等多种加密算法 或 WireGuard 加密<br>防止中间人攻击
link: /guide/network/configurations#:~:text=加密算法&text=ET_ENCRYPTION_ALGORITHM
- title: 高效 NAT 穿透
details: 支持 UDP、IPv6 穿透<br>可打通 NAT4-NAT4 网络
link: /
link: /guide/aboutp2p
- title: 子网代理
details: 节点可共享子网供其他节点访问。
link: /guide/network/point-to-networking
- title: 智能路由
details: 延迟优先,自动选路<br>提供最佳网络体验
link: /guide/network/configurations
link: /guide/network/configurations#:~:text=延迟优先模式&text=ET_LATENCY_FIRST
- title: 高性能
details: 全链路零拷贝<br>支持 TCP / UDP / WSS / WG 等协议
details: 全链路零拷贝<br>支持 TCP / UDP / WS / WSS / WG / QUIC / FakeTCP 等协议
link: /guide/perf
- title: 抗 UDP 丢包
details: KCP / QUIC 代理<br>优化高丢包环境下的延迟和带宽
Expand Down