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

@arms/rum-browser

Package Overview
Dependencies
Maintainers
5
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arms/rum-browser - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

lib/collector/resource/static-resource.js

@@ -5,2 +5,2 @@ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_rumCore=require("@arms/rum-core"),_performance=require("../../utils/performance"),_url=require("../../utils/url"),_view=require("../../utils/view"),_global=require("../../utils/global");function _createForOfIteratorHelperLoose(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(c)return(c=c.call(a)).next.bind(c);if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0;return function(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}var StaticResourceCollector=exports["default"]=/*#__PURE__*/function(){function a(){this.name="static-resource-collector",this.entryTypes=["audio","video","track","script","css","img","image","link","other"],this.cachedErrors=[],this.WAIT_FOR_ERROR_TIME=1e3}var b=a.prototype;return b.setup=function setup(a,b){var c=this,d=a.getConfig(),e=d.collectors,f=void 0===e?{}:e;if(!1!==f.staticResource){_global.document.addEventListener("error",function(a){c.cachedErrors.push(a)},!0),new PerformanceObserver(function(b){var d=b.getEntries().filter(function(a){return c.entryTypes.includes(a.initiatorType)});if(d&&d.length){var e=(0,_view.getCurView)(a);d.forEach(function(a){setTimeout(function(){g(a,e)},c.WAIT_FOR_ERROR_TIME)})}}).observe({type:"resource",buffered:!0});var g=function(a,d){// responseStatus 若为 0,则先设成 200

view:d}),k=_createForOfIteratorHelperLoose(c.cachedErrors);!(e=k()).done;){var l,m,n=e.value;(g===(null===(l=n.target)||void 0===l?void 0:l.src)||g===(null===(m=n.target)||void 0===m?void 0:m.href))&&(j.success=_performance.ResourceStatus.Failed,delete j.status_code)}// @ts-ignore
c.cachedErrors=c.cachedErrors.filter(function(a){var b,c;return g!==(null===(b=a.target)||void 0===b?void 0:b.src)&&g!==(null===(c=a.target)||void 0===c?void 0:c.href)}),(0,_url.urlFilter)(j.url)||b(j)}}},a}();
c.cachedErrors=c.cachedErrors.filter(function(a){var b,c;return g!==(null===(b=a.target)||void 0===b?void 0:b.src)&&g!==(null===(c=a.target)||void 0===c?void 0:c.href)}),(0,_rumCore.urlMatch)(j.url)||b(j)}}},a}();
{
"name": "@arms/rum-browser",
"version": "0.0.5",
"version": "0.0.6",
"description": "arms rum javascript sdk for browser",

@@ -5,0 +5,0 @@ "author": "guangli.fj <guangli.fj@alibaba-inc.com>",

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