navigator.sendbeacon
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -49,3 +49,3 @@ 'use strict'; | ||
xhr.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8'); | ||
xhr.responseType = 'text/plain'; | ||
xhr.responseType = 'text'; | ||
} else if (isBlob(data) && data.type) { | ||
@@ -52,0 +52,0 @@ xhr.setRequestHeader('Content-Type', data.type); |
@@ -47,3 +47,3 @@ function _typeof(obj) { | ||
xhr.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8'); | ||
xhr.responseType = 'text/plain'; | ||
xhr.responseType = 'text'; | ||
} else if (isBlob(data) && data.type) { | ||
@@ -50,0 +50,0 @@ xhr.setRequestHeader('Content-Type', data.type); |
@@ -53,3 +53,3 @@ (function (global, factory) { | ||
xhr.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8'); | ||
xhr.responseType = 'text/plain'; | ||
xhr.responseType = 'text'; | ||
} else if (isBlob(data) && data.type) { | ||
@@ -56,0 +56,0 @@ xhr.setRequestHeader('Content-Type', data.type); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(0,function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=function(t){return"string"==typeof t},n=function(t){return t instanceof Blob};(function(){if(function(){return"navigator"in this&&"sendBeacon"in this.navigator}.call(this))return;"navigator"in this||(this.navigator={});"function"!=typeof this.navigator.sendBeacon&&(this.navigator.sendBeacon=function(t,o){var i=this.event&&this.event.type,r="unload"===i||"beforeunload"===i,s="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");s.open("POST",t,!r),s.withCredentials=!0,s.setRequestHeader("Accept","*/*"),e(o)?(s.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),s.responseType="text/plain"):n(o)&&o.type&&s.setRequestHeader("Content-Type",o.type);try{s.send(o)}catch(t){return!1}return!0}.bind(this))}).call("object"===("undefined"==typeof window?"undefined":t(window))?window:{})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(0,function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=function(t){return"string"==typeof t},n=function(t){return t instanceof Blob};(function(){if(function(){return"navigator"in this&&"sendBeacon"in this.navigator}.call(this))return;"navigator"in this||(this.navigator={});"function"!=typeof this.navigator.sendBeacon&&(this.navigator.sendBeacon=function(t,o){var i=this.event&&this.event.type,r="unload"===i||"beforeunload"===i,s="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");s.open("POST",t,!r),s.withCredentials=!0,s.setRequestHeader("Accept","*/*"),e(o)?(s.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),s.responseType="text"):n(o)&&o.type&&s.setRequestHeader("Content-Type",o.type);try{s.send(o)}catch(t){return!1}return!0}.bind(this))}).call("object"===("undefined"==typeof window?"undefined":t(window))?window:{})}); |
{ | ||
"name": "navigator.sendbeacon", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Polyfill for navigator.sendBeacon()", | ||
@@ -5,0 +5,0 @@ "main": "dist/navigator.sendbeacon.cjs.js", |
@@ -29,3 +29,3 @@ const isString = val => typeof val === 'string' | ||
xhr.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8') | ||
xhr.responseType = 'text/plain' | ||
xhr.responseType = 'text' | ||
} else if (isBlob(data) && data.type) { | ||
@@ -32,0 +32,0 @@ xhr.setRequestHeader('Content-Type', data.type) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10617