New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

connect.io

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect.io - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

libs/noop.js

3

libs/port.js
import EventEmitter from 'events';
import uuid from './uuid';
import noop from './noop';
function noop() {}
export default class Port extends EventEmitter {

@@ -7,0 +6,0 @@

import EventEmitter from 'events';
import Port from './port';
import noop from './noop';

@@ -12,13 +13,24 @@ const {runtime} = window.chrome || { runtime : false };

// 第一次调用 new Server() 的时候才添加这些监听
let initListener;
if ( runtime ) {
runtime.onConnect.addListener( chromePort => {
initServerPort( chromePort , false );
} );
initListener = ()=> {
initListener = noop;
const {onConnect,onConnectExternal} = runtime;
let {onConnectExternal} = runtime;
if ( onConnectExternal ) {
onConnectExternal.addListener( chromePort => {
initServerPort( chromePort , true );
} );
}
if ( onConnect ) {
onConnect.addListener( chromePort => {
initServerPort( chromePort , false );
} );
}
if ( onConnectExternal ) {
onConnectExternal.addListener( chromePort => {
initServerPort( chromePort , true );
} );
}
};
} else {
initListener = noop;
}

@@ -77,2 +89,3 @@ /**

constructor( namespace = 'default' ) {
initListener();
super(); // super() 必须被第一个执行,否则会出错

@@ -79,0 +92,0 @@

{
"name": "connect.io",
"version": "0.5.4",
"version": "0.5.5",
"description": "chrome.runtime.connect wrapper that using Stock.IO API.",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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