chatgpt-api/docs/inject.js

60 wiersze
2.0 KiB
JavaScript
Czysty Zwykły widok Historia

2025-06-29 16:46:14 +00:00
const isServer = globalThis.window === undefined
const isSafari =
!isServer && /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
if (!isServer) {
// Workaround for nav links not being able to point to relative paths
2025-07-01 12:20:13 +00:00
for (const a of document.querySelectorAll('a[href="https://agentic.so"]')) {
a.removeAttribute('target')
}
2025-06-29 16:46:14 +00:00
for (const a of document.querySelectorAll(
'a[href="https://agentic.so/contact"]'
2025-06-29 16:46:14 +00:00
)) {
a.removeAttribute('target')
}
2025-07-01 12:20:13 +00:00
for (const a of document.querySelectorAll(
'a[href="https://agentic.so/marketplace"]'
)) {
a.removeAttribute('target')
}
2025-07-01 12:20:44 +00:00
for (const a of document.querySelectorAll(
'a[href="https://agentic.so/app"]'
)) {
a.removeAttribute('target')
}
2025-06-29 16:46:14 +00:00
// document
// .getElementById('https://agentic.so/contact')
2025-06-29 16:46:14 +00:00
// .querySelector('.lucide-arrow-up-right')
// .classList.add('hidden')
}
const detail = `
- https://github.com/transitive-bullshit/agentic
- https://x.com/transitive_bs
`
const banner = `
${detail}
`
function bootstrap() {
if (isSafari) {
console.log(detail)
} else {
console.log(banner)
}
}
bootstrap()