|
1 | | -/*! Raven.js 3.22.3 (d6a1ff2) | github.com/getsentry/raven-js */ |
| 1 | +/*! Raven.js 3.22.4 (114c958) | github.com/getsentry/raven-js */ |
2 | 2 |
|
3 | 3 | /* |
4 | 4 | * Includes TraceKit |
@@ -169,6 +169,24 @@ function supportsFetch() { |
169 | 169 | } |
170 | 170 | } |
171 | 171 |
|
| 172 | +// Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default |
| 173 | +// https://caniuse.com/#feat=referrer-policy |
| 174 | +// It doesn't. And it throw exception instead of ignoring this parameter... |
| 175 | +// REF: https://github.com/getsentry/raven-js/issues/1233 |
| 176 | +function supportsReferrerPolicy() { |
| 177 | + if (!supportsFetch()) return false; |
| 178 | + |
| 179 | + try { |
| 180 | + // eslint-disable-next-line no-new |
| 181 | + new Request('pickleRick', { |
| 182 | + referrerPolicy: 'origin' |
| 183 | + }); |
| 184 | + return true; |
| 185 | + } catch (e) { |
| 186 | + return false; |
| 187 | + } |
| 188 | +} |
| 189 | + |
172 | 190 | function wrappedCallback(callback) { |
173 | 191 | function dataCallback(data, original) { |
174 | 192 | var normalizedData = callback(data) || data; |
@@ -521,6 +539,7 @@ module.exports = { |
521 | 539 | isEmptyObject: isEmptyObject, |
522 | 540 | supportsErrorEvent: supportsErrorEvent, |
523 | 541 | supportsFetch: supportsFetch, |
| 542 | + supportsReferrerPolicy: supportsReferrerPolicy, |
524 | 543 | wrappedCallback: wrappedCallback, |
525 | 544 | each: each, |
526 | 545 | objectMerge: objectMerge, |
|
0 commit comments