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.23 to 0.0.24-beta.1

4

lib/collector/view/perf.js

@@ -1,3 +0,3 @@

"use strict";exports.__esModule=!0,exports["default"]=void 0;var _rumCore=require("@arms/rum-core"),_base=require("../../utils/base"),_url=require("../../utils/url"),_global=require("../../utils/global"),PerfCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="perf-collector",this.ctx=void 0,this.sendEvent=void 0,this.sendPerf=function(){setTimeout(function(){var b=performance.getEntriesByType("navigation")[0],c=b.loadEventEnd,d=b.domInteractive,e=b.domContentLoadedEventEnd,f=b.domComplete,g=performance.getEntriesByType("paint").find(function(a){var b=a.name;return"first-contentful-paint"===b})||{},h=g.startTime;a.sendEvent({event_type:_rumCore.RumEventType.VIEW,type:"perf",url:(0,_url.getCurrentURL)(),referrer:_global.document.referrer||"",loading_type:"initial_load",timing_data:JSON.stringify(b),// Measure
"use strict";exports.__esModule=!0,exports["default"]=void 0;var _rumCore=require("@arms/rum-core"),_base=require("../../utils/base"),_url=require("../../utils/url"),_global=require("../../utils/global"),PerfCollector=exports["default"]=/*#__PURE__*/function(){function a(){var a=this;this.name="perf-collector",this.ctx=void 0,this.sendEvent=void 0,this.sendPerf=function(){setTimeout(function(){var b=performance.getEntriesByType("navigation")[0];if(b){var c=b.loadEventEnd,d=b.domInteractive,e=b.domContentLoadedEventEnd,f=b.domComplete,g=performance.getEntriesByType("paint").find(function(a){var b=a.name;return"first-contentful-paint"===b})||{},h=g.startTime;a.sendEvent({event_type:_rumCore.RumEventType.VIEW,type:"perf",url:(0,_url.getCurrentURL)(),referrer:_global.document.referrer||"",loading_type:"initial_load",timing_data:JSON.stringify(b),// Measure
// loading_time: formatNumber(loadEventEnd), // 同FMP,基于DOM突变稳定来计算
first_contentful_paint:(0,_base.formatNumber)(h),dom_interactive:(0,_base.formatNumber)(d),dom_content_loaded:(0,_base.formatNumber)(e),dom_complete:(0,_base.formatNumber)(f),load_event:(0,_base.formatNumber)(c)})},0)}}var b=a.prototype;return b.setup=function setup(a,b){var c=a.getConfig(),d=c.collectors,e=void 0===d?{}:d;!1===e.perf||(this.ctx=a,this.sendEvent=b,_global.global.addEventListener("load",this.sendPerf))},b.destroy=function destroy(){_global.global.removeEventListener("load",this.sendPerf)},a}();
first_contentful_paint:(0,_base.formatNumber)(h),dom_interactive:(0,_base.formatNumber)(d),dom_content_loaded:(0,_base.formatNumber)(e),dom_complete:(0,_base.formatNumber)(f),load_event:(0,_base.formatNumber)(c)})}},0)}}var b=a.prototype;return b.setup=function setup(a,b){var c=a.getConfig(),d=c.collectors,e=void 0===d?{}:d;!1===e.perf||(this.ctx=a,this.sendEvent=b,_global.global.addEventListener("load",this.sendPerf))},b.destroy=function destroy(){_global.global.removeEventListener("load",this.sendPerf)},a}();
{
"name": "@arms/rum-browser",
"version": "0.0.23",
"version": "0.0.24-beta.1",
"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