Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

545 B
Raw Blame
/** Drop the query string, which often runs to hundreds of characters of tracking and state parameters. */
export function footerUrl(href: string): string {
    try {
        const url = new URL(href)
        url.search = ''
        return url.toString()
    } catch {
        const hashAt = href.indexOf('#')
        const queryAt = href.indexOf('?')
        if (queryAt === -1 || (hashAt !== -1 && hashAt < queryAt)) {
            return href
        }
        return href.slice(0, queryAt) + (hashAt === -1 ? '' : href.slice(hashAt))
    }
}