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

@crawly/browser

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crawly/browser

lib to encapsulate browser data

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
6
Weekly downloads
 
Created
Source

grasshopper-lib-browser

Instalação

npm i @crawly/browser

Usando

import { Browser } from '@crawly/browser';

let browser = new Browser();
let header = browser.getHeaders();

Exemplo de retorno da função getHeaders:

{
  Pragma: 'no-cache',
  Connection: 'keep-alive',
  'Accept-Encoding': 'gzip, deflate, br',
  'Content-Type': 'application/json; charset=UTF-8',
  'Cache-Control': 'no-cache',
  'Upgrade-Insecure-Requests': 1,
  'X-Requested-With': 'XMLHttpRequest',
  Accept:'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'Accept-Language': 'pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
  Referer: 'https://www.google.com',
  'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0'
}

Para gerar novos headers utilize a função setHeaders:

import { Browser } from '@crawly/browser';

let browser = new Browser();
browser.setHeaders();

API

setHeaders(): void;
getHeaders(): IHeader;
mergeHeaders(headers: IHeader, value: IHeader): IHeader;
getRandomAccept(): string;
getRandomAcceptLanguage(): string;
getRandomReferer(): string;
getRandomUserAgent(): string;

Build

npm run build

Lint

npm run tslint

Testes

npm test

Coverage

npm run coverage

Keywords

FAQs

Package last updated on 02 Jul 2019

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