Some backend configuration setup

This commit is contained in:
2019-06-27 00:13:18 +02:00
parent 64c8c2d49b
commit 5d3d55977b
3 changed files with 44 additions and 8 deletions

View File

@@ -7,7 +7,8 @@ class BrowserMod {
connect(conn) {
console.log("Connection opened. Connecting to browser_mod");
this.connection = conn.subscribeMessage((msg) => this.callback(msg), {
this.conn = conn
conn.subscribeMessage((msg) => this.callback(msg), {
type: 'browser_mod/connect',
deviceID: deviceID,
});
@@ -20,6 +21,16 @@ class BrowserMod {
console.log(msg);
}
update() {
if(!this.conn) return;
this.conn.sendMessage({
type: 'browser_mod/update',
});
}
}
window.browser_mod = new BrowserMod();