@@ -79,6 +79,24 @@ function supportsFetch() {
7979 }
8080}
8181
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+
82100function wrappedCallback ( callback ) {
83101 function dataCallback ( data , original ) {
84102 var normalizedData = callback ( data ) || data ;
@@ -431,6 +449,7 @@ module.exports = {
431449 isEmptyObject : isEmptyObject ,
432450 supportsErrorEvent : supportsErrorEvent ,
433451 supportsFetch : supportsFetch ,
452+ supportsReferrerPolicy : supportsReferrerPolicy ,
434453 wrappedCallback : wrappedCallback ,
435454 each : each ,
436455 objectMerge : objectMerge ,
0 commit comments