Skip to content

ScarletsFiction/SFIntercom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Written by Software License

SFIntercom

SFIntercom is a client-side library that allow cross-tab communication with same domain. It can broadcast to all listener on a different tab or window, but can't broadcast to other browser instance.

This library was useful for syncronizing message, notification, and other data.

Sample Usage

// First tab
var client1 = new SFIntercom();
client1.on('log', console.log);
client1.on('warn', console.warn);

// Second tab
var client2 = new SFIntercom();
client2.on('log', console.log);
client2.emit('log', 'Hello from second tab'); // Broadcast to all except this tab

// Third tab
var broadcaster = new SFIntercom();
broadcaster.emit('log', "Hello from third tab"); // Broadcast to all
broadcaster.emit('warn', "Hello warn"); // Broadcast to all who listen to 'warn'

Contribution

If you want to help in SFIntercom library, please fork this project and edit on your repository, then make a pull request to here.

Keep the code simple and clear.

License

SFIntercom is under the MIT license. But don't forget to put the a link to this repository.

About

Client-side cross-tab communication with same domain

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy