MCPcopy Create free account
hub / github.com/dailydotdev/apps / getWebappHost

Function getWebappHost

packages/shared/src/features/messages/contextLink.ts:4–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { isValidHttpUrl } from '../../lib/links';
3
4export const getWebappHost = (): string | undefined => {
5 try {
6 return new URL(webappUrl, globalThis.location?.origin).host;
7 } catch {
8 return globalThis.location?.host;
9 }
10};
11
12// The comment reference arrives in a stanza the peer controls, so its link is
13// only rendered when it is an http(s) URL on our own webapp. React would

Callers 3

getPostIdFromUrlFunction · 0.90
findPostIdInTextFunction · 0.90
getSafeCommentUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected