forwarding logs to UI
This commit is contained in:
parent
06a2f67759
commit
49ca4b64e3
@ -64,6 +64,7 @@ class UWServer {
|
|||||||
this.comms.subscribe('show-logger', async () => await this.initUiAndShowLogger());
|
this.comms.subscribe('show-logger', async () => await this.initUiAndShowLogger());
|
||||||
this.comms.subscribe('init-vue', async () => await this.initUi());
|
this.comms.subscribe('init-vue', async () => await this.initUi());
|
||||||
this.comms.subscribe('uwui-vue-initialized', () => this.uiLoggerInitialized = true);
|
this.comms.subscribe('uwui-vue-initialized', () => this.uiLoggerInitialized = true);
|
||||||
|
this.comms.subscribe('emit-logs', () => {}); // we don't need to do anything, this gets forwarded to UI content script as is
|
||||||
|
|
||||||
|
|
||||||
if(BrowserDetect.firefox) {
|
if(BrowserDetect.firefox) {
|
||||||
|
@ -22,6 +22,7 @@ class UwUi {
|
|||||||
this.commsHandlers = {
|
this.commsHandlers = {
|
||||||
'show-logger': [() => this.showLogger()],
|
'show-logger': [() => this.showLogger()],
|
||||||
'hide-logger': [() => this.hideLogger()],
|
'hide-logger': [() => this.hideLogger()],
|
||||||
|
'emit-logs' : [(message) => {console.log("emit logs received in uwui!", message); this.addLogs(message)}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +212,10 @@ class UwUi {
|
|||||||
this.vuexStore.dispatch('uw-hide-logger');
|
this.vuexStore.dispatch('uw-hide-logger');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addLogs(message) {
|
||||||
|
this.logger.appendLog(JSON.parse(message.payload));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// leave a mark, so this script won't get executed more than once on a given page
|
// leave a mark, so this script won't get executed more than once on a given page
|
||||||
|
Loading…
Reference in New Issue
Block a user