browser-tab-ipc
/
0.2.1-beta
browser-tab-ipc 0.2.1-beta
Install from the command line:
Learn more about npm packages
$ npm install @lopatnov/browser-tab-ipc@0.2.1-beta
Install via package.json:
"@lopatnov/browser-tab-ipc": "0.2.1-beta"
About this version
With this technology, you can exchange messages between browser tabs. This is a bus network among browser tabs, inter-process communication mechanism between browser tabs. This technology allows to create a chat between browser tabs. It allows to optimize the performance of high-demand applications, decrease amount of http requests or socket connections.
npm install @lopatnov/browser-tab-ipc
<script src="https://lopatnov.github.io/browser-tab-ipc/dist/library.min.js"></script>
<!-- Example: how to use in browser -->
<script>
//...
ipc = new browserTabIpc.BrowserTabIPC();
ipc.message(function (message) {
console.log(message);
});
ipc.connect().then(function (state) {
console.log(state);
});
var id = Math.trunc(Math.random() * 10000);
setInterval(() => {
ipc.postMessage('Hello browser Tab! I am page with ID: ' + id);
}, 200);
//...
</script>
import {BrowserTabIPC} from '@lopatnov/browser-tab-ipc';
var library = require('@lopatnov/browser-tab-ipc');
var BrowserTabIPC = library.BrowserTabIPC;
import {BrowserTabIPC} from './../src/browser-tab-ipc';
const tabID = Math.trunc(Math.random() * 10000);
const ipc = new BrowserTabIPC();
ipc.message(function (message) {
console.log(message);
});
const state = await ipc.connect();
console.log(state);
setInterval(() => {
ipc.postMessage('Hello browser Tab! I am page with ID: ' + tabID);
}, 200);
License Apache-2.0
Copyright 2022 Oleksandr Lopatnov
Details
- browser-tab-ipc
- lopatnov
- over 2 years ago
- Apache-2.0
- 35 dependencies
Assets
- browser-tab-ipc-0.2.1-beta-npm.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0