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

Function isSameSiteReferrer

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

Source from the content-addressed store, hash-verified

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

Callers 2

cameFromOutsideFunction · 0.85
canGoBackInAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected