This TAAL Wallet Chrome extensions using React and Typescript.
- React 18
- Redux Toolkit
- BSV Javascript library
- TypeScript
- Webpack
- ESLint
- Prettier
- Chrome Extension Manifest Version 3
- Clone this repository.
- Run
yarn
(check your node version >= 16) - Run
yarn dev
- Load Extension on Chrome
- Open - Chrome browser
- Access - chrome://extensions
- Check - Developer mode
- Find - Load unpacked extension
- Select -
dist
folder in this project (after dev or build)
- If you want to build in production, Just run
yarn build
- To start a demo web client run
yarn demo
- To enable push messages run
yarn server
- Copy
sample.env
to.env
and customize it by your needs
chrome.runtime.onConnectExternal.addListener(port => {
console.log('Client connected', port);
port.onMessage.addListener(msg => {
console.log('onExternalMessage', msg);
});
});
const port = chrome.runtime.connect(extensionId, { name: 'some-name' });
port.onMessage.addListener(console.log);
port.postMessage({ payload: 'anything' })
const port = chrome.runtime.connect({ name: 'some-name' });
port.postMessage({ payload: 'anything' });
port.onMessage.addListener(msg => {
console.log('onMessage', msg);
});
chrome.runtime.onMessageExternal.addListener((payload, data, cb) => {
console.log('onMessageExternal', { payload, data });
if (typeof cb === 'function') {
cb('response from background.js');
}
return true;
});
chrome.runtime.sendMessage(extensionId, { payload: 'anything' }, console.log)
chrome.runtime.sendMessage({ payload: 'anything' }, console.log);