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

post-emitter

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

post-emitter

Talk between a iframe and parent window using events

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Post Emitter

Talk between a iframe and parent window using events! This is just a wrapper around post message.

Usage


// top level document

var PostEmitter = require( 'post-emitter' ),
    emitter = new PostEmitter( {
        selector: 'iframe.embedded-content'
    } );

emitter.on( 'pong', function( msg ) {
    console.log( msg ); // foo
} );

emitter.emit( 'ping' );


// in iframe

var PostEmitter = require( 'post-emitter' ),
    emitter = new PostEmitter();

emitter.on( 'ping', function( msg ) {
    emitter.emit( 'pong', 'foo' );
} );


Keywords

postMessage

FAQs

Package last updated on 14 Jan 2015

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