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

network-viewer

Package Overview
Dependencies
Maintainers
0
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

network-viewer

Network-Viewer [![npm version](https://badge.fury.io/js/network-viewer.svg)](https://www.npmjs.com/package/network-viewer) [![Test](https://github.com/saucelabs/network-viewer/actions/workflows/test.yml/badge.svg)](https://github.com/saucelabs/network-vie

  • 2.4.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
increased by5.75%
Maintainers
0
Weekly downloads
 
Created
Source

Network-Viewer npm version Test

Introduction

Network-Viewer is a redefined HAR viewer human friendly view of requests which is build with React.

The main purpose of this web application is to help you to view HAR files with many features like filters, search, timline charts etc.

If you are interested contributing to this library, please have a look into our Contributing Guidelines. We love to see any kind of contributions 😊!

Demo

Example

Features

Main features of Network-Viewer are:

  • Import/Upload HAR file
  • Fetch HAR file using queryString url use file=HAR_FILE_URL and to enable CORS pass isCORSEnabled=true (by default CORS is disabled)
  • Search request by URL or body content
  • Filter request by XHR, JS, CSS, Image, Media, Font, Doc, WebSocket, Manifest
  • Errors Only filter to filter request by error status (where status code is greater than or equal to 400)
  • WaterFall chart to display timeline of request which includes
  • Stats at footer to show number of requests, data transfered size, resoruces size, and time metrics like Page Load, DOMContentLoaded and Finished time
  • Request Detail section is available on click of request, response content is available for JSON and XML responses.

How to use

Import/Upload HAR file

Visit https://opensource.saucelabs.com/network-viewer/ and Import your HAR file via drag&drop.

Fetch HAR file

  • file=HAR_FILE_URL as queryString to pass HAR file url
  • isCORSEnabled=trueas queryString to enable CORS support (by default CORS is disabled)

Use it as react library

$ npm install network-viewer

Example

import { NetworkViewer } from 'network-viewer';
<NetworkViewer />
Props
propTypeDefaultValuesDescription
autoHighlightChangeBoolfalsetrue, falseTo allow change request highlight on scrollTimeStamp change when requestDetail is visible
containerClassNameStringnullcustom-class to overwrite network-viewer's default style
dataObjectnull{ log: { entries: [], pages: [] } }HAR file data which should contain log.entries and log.pages
fetchOptionsObject{ withCredentials: true }axios request option can be set here to fetch HAR file
fileStringnullHAR file URL to fetch requests
onDataLoadedFuncnull(data) => {}This function will receive loaded data on file is being fetched
onDataErrorFuncnull(error) => {}This function is called when loading data fails
onRequestSelectFuncnull(requestDetail) => {}This function will receive request detail on request select
optionsObject{showImportHAR: true, showTimeline: false}showImportHar: to show/hide import button and modal, showTimeline: to show/hide top timeline of requests
scrollRequestPositionStringnearbefore, after, nearto find and highlight network request by timestamp,
near: find request near to timestamp
before: find request exactBefore the timestamp
after: find request exactAfter the timestamp
scrollTimeStampNumbernullFind and highlight network request by timestamp

FAQs

Package last updated on 19 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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