Chrome devtools protocol JavaScript implementation.
You can get it on npm.
npm install chobitsu --save
const chobitsu = require('chobitsu');
chobitsu.setOnMessage(message => {
console.log(message);
});
chobitsu.sendRawMessage(JSON.stringify({
id: 1,
method: 'DOMStorage.clear',
params: {
storageId: {
isLocalStorage: true,
securityOrigin: 'http://example.com'
}
}
}));
!(async () => {
console.log(await chobitsu.sendMessage('Storage.clearDataForOrigin', {
storageTypes: 'local_storage'
}));
})();
const domStorage = chobitsu.domain('DOMStorage');
domStorage.enable();
domStorage.on('domStorageItemUpdated', params => console.log(params));
Send message to chobitsu.
Set message handler.
Send message without setting id and get result.
Get domain object.
- chii: Remote debugging tool.