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

Function isSameSiteReferrer

packages/shared/src/components/shell/shellNav.ts:192–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190};
191
192const isSameSiteReferrer = (): boolean => {
193 const referrer = globalThis?.document?.referrer;
194 const origin = globalThis?.window?.location.origin;
195
196 if (!referrer) {
197 return true;
198 }
199
200 try {
201 return new URL(referrer).origin === origin;
202 } catch {
203 return false;
204 }
205};
206
207const cameFromOutside = (): boolean =>
208 !!globalThis?.document?.referrer && !isSameSiteReferrer();

Callers 2

cameFromOutsideFunction · 0.85
canGoBackInAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected