Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

navigator.sendbeacon

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

navigator.sendbeacon - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

6

dist/navigator.sendbeacon.cjs.js

@@ -29,3 +29,7 @@ 'use strict';

if (isSupported.call(this)) return;
if (!('navigator' in this)) this.navigator = {};
if (!('navigator' in this && typeof this.navigator === 'function')) {
this.navigator = {};
}
this.navigator.sendBeacon = sendBeacon.bind(this);

@@ -32,0 +36,0 @@ }

@@ -27,3 +27,7 @@ function _typeof(obj) {

if (isSupported.call(this)) return;
if (!('navigator' in this)) this.navigator = {};
if (!('navigator' in this && typeof this.navigator === 'function')) {
this.navigator = {};
}
this.navigator.sendBeacon = sendBeacon.bind(this);

@@ -30,0 +34,0 @@ }

@@ -33,3 +33,7 @@ (function (global, factory) {

if (isSupported.call(this)) return;
if (!('navigator' in this)) this.navigator = {};
if (!('navigator' in this && typeof this.navigator === 'function')) {
this.navigator = {};
}
this.navigator.sendBeacon = sendBeacon.bind(this);

@@ -36,0 +40,0 @@ }

2

dist/navigator.sendbeacon.min.js

@@ -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={});this.navigator.sendBeacon=function(t,o){var i=this.event&&this.event.type,r="unload"===i||"beforeunload"===i,u="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");u.open("POST",t,!r),u.withCredentials=!0,u.setRequestHeader("Accept","*/*"),e(o)?(u.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),u.responseType="text/plain"):n(o)&&o.type&&u.setRequestHeader("Content-Type",o.type);try{u.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&&"function"==typeof this.navigator||(this.navigator={});this.navigator.sendBeacon=function(t,o){var i=this.event&&this.event.type,r="unload"===i||"beforeunload"===i,u="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");u.open("POST",t,!r),u.withCredentials=!0,u.setRequestHeader("Accept","*/*"),e(o)?(u.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),u.responseType="text/plain"):n(o)&&o.type&&u.setRequestHeader("Content-Type",o.type);try{u.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.15",
"version": "0.0.16",
"description": "Polyfill for navigator.sendBeacon()",

@@ -5,0 +5,0 @@ "main": "dist/navigator.sendbeacon.cjs.js",

@@ -9,3 +9,6 @@ const isString = val => typeof val === 'string'

if (!('navigator' in this)) this.navigator = {}
if (!('navigator' in this && typeof this.navigator === 'function')) {
this.navigator = {}
}
this.navigator.sendBeacon = sendBeacon.bind(this)

@@ -12,0 +15,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc