Skip to content

📑 JavaScript library to make channels between browser tabs

Notifications You must be signed in to change notification settings

vitkarpov/tabs-channel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tabs Channel

TabsChannel is a JavaScript library which provides a channel between different tabs (windows) for documents from different domains (dealing with security issues).

So, A.com and B.com are opened in different tabs and want to communication to each other.

A.com:

var proxy = new TabsChannel({
    id: 'should-be-the-same-for-different-tabs'
});

proxy.send('hello from A!');

B.com:

var proxy = new TabsChannel({
    id: 'should-be-the-same-for-different-tabs'
});

proxy.onReceive = function(message) {
    console.log(message);
};

// prins "hello from A!" when A.com sends a message

A.com sens messages to B.com and the one gets them and can handle. Channel works in both directions.

How it works

About

📑 JavaScript library to make channels between browser tabs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published