ext-chatwork-events
v0.0.2
Published
Chatwork DOM Events wrapper for Chrome extension
Downloads
5
Maintainers
Readme
ext-chatwork-events
Chatwork DOM Events wrapper for Chrome extension
Getting started
npm i ext-chatwork-events
Add script
tag to your extension.
<script src="/path/to/ext-chatwork-events/bundle.js"></script>
If using Browserify, see below
const ChatworkEvents = require('ext-chatwork-events')
Events
ready
Emit when loading area hidden.
// No arguments
ChatworkEvents.on('ready', () => console.log('ready'))
messages:add
Emit when new message appended.
/**
* @param addedEl Element added element
*/
ChatworkEvents.on('messages:add', (addedEl) => console.log('messages:add', addedEl))
messages:remove
Emit when message element removed.
/**
* @param removedEl Element removed element
*/
ChatworkEvents.on('messages:remove', (removedEl) => console.log('messages:remove', removedEl))