MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / supportsReferrerPolicy

Function supportsReferrerPolicy

packages/core/src/utils/supports.ts:161–179  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159 * @deprecated This is no longer used and will be removed in a future major version.
160 */
161export function supportsReferrerPolicy(): boolean {
162 // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
163 // (see https://caniuse.com/#feat=referrer-policy),
164 // it doesn't. And it throws an exception instead of ignoring this parameter...
165 // REF: https://github.com/getsentry/raven-js/issues/1233
166
167 if (!_isFetchSupported()) {
168 return false;
169 }
170
171 try {
172 new Request('_', {
173 referrerPolicy: 'origin' as ReferrerPolicy,
174 });
175 return true;
176 } catch {
177 return false;
178 }
179}

Callers

nothing calls this directly

Calls 1

_isFetchSupportedFunction · 0.85

Tested by

no test coverage detected