chrome-reloader
v1.0.0
Published
```npm i extension-reloader -g```
Downloads
2
Readme
Install
npm i extension-reloader -g
Webextension
add this to your background.js
const connectReloader = () => {
try {
const ws = new WebSocket("ws://localhost:6699/");
ws.onopen = () => {
console.log(" |");
console.log(" |> connected to websocket");
};
ws.onmessage = (msg) => {
if(msg.data === "reload") {
console.log("reload");
chrome.runtime.reload();
}
}
ws.onclose = () => {
setTimeout(connectReloader, 300);
}
} catch (e) {
setTimeout(connectReloader, 300);
return
}
}
connectReloader();
Run in the root of the webextension (where the manifest.json is).
Or in the folder where you wanna watch
reloader