@@ -79,6 +79,24 @@ function supportsFetch() {
79
79
}
80
80
}
81
81
82
+ // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default
83
+ // https://caniuse.com/#feat=referrer-policy
84
+ // It doesn't. And it throw exception instead of ignoring this parameter...
85
+ // REF: https://github.com/getsentry/raven-js/issues/1233
86
+ function supportsReferrerPolicy ( ) {
87
+ if ( ! supportsFetch ( ) ) return false ;
88
+
89
+ try {
90
+ // eslint-disable-next-line no-new
91
+ new Request ( 'pickleRick' , {
92
+ referrerPolicy : 'origin'
93
+ } ) ;
94
+ return true ;
95
+ } catch ( e ) {
96
+ return false ;
97
+ }
98
+ }
99
+
82
100
function wrappedCallback ( callback ) {
83
101
function dataCallback ( data , original ) {
84
102
var normalizedData = callback ( data ) || data ;
@@ -431,6 +449,7 @@ module.exports = {
431
449
isEmptyObject : isEmptyObject ,
432
450
supportsErrorEvent : supportsErrorEvent ,
433
451
supportsFetch : supportsFetch ,
452
+ supportsReferrerPolicy : supportsReferrerPolicy ,
434
453
wrappedCallback : wrappedCallback ,
435
454
each : each ,
436
455
objectMerge : objectMerge ,
0 commit comments