New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

chrome-runtime-connect

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-runtime-connect

chrome-runtime-connect ======================

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

chrome-runtime-connect

Purpose

Disclaimer: This is incomplete for now, still a work in progress but nonetheless usable for simple cases.

This package allows to test the communication between a background page and a content script. It emulates the chomer.runtime.Port interface (doc.

Install

yarn add chrome-runtime-connect

Usage

// a. Call this to extend the global scope with `chrome.runtime`
require('chrome-runtime-connect/register');

// b. Or call this to have a `runtime` object
const chromeRuntime = require('chrome-runtime-connect')();

Since the runtime API is exposed globally (using method a), in your tests your content scripts will be able to use the runtime API as-is.

Note: This is most useful when used it combination of a browser implementation such as jsdom.

TODO

  • Add tests
  • Implement the rest of the API (eg. disconnect)

FAQs

Package last updated on 21 Mar 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