browser-tab-ipc
/
0.3.0-rc
browser-tab-ipc 0.3.0-rc
Install from the command line:
Learn more about npm packages
$ npm install @lopatnov/browser-tab-ipc@0.3.0-rc
Install via package.json:
"@lopatnov/browser-tab-ipc": "0.3.0-rc"
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({
sharedWorkerUri: '//lopatnov.github.io/browser-tab-ipc/dist/ipc-worker.js', // Please copy this file `dist/ipc-worker.js` to your project and replace this url
})
.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 '@lopatnov/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({
sharedWorkerUri: '//lopatnov.github.io/browser-tab-ipc/dist/ipc-worker.js', // Please copy this file `dist/ipc-worker.js` to your project and replace this url
});
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.3.0-rc-npm.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0