remove unnecessary logging

This commit is contained in:
Tamius Han 2022-09-20 01:38:08 +02:00
parent 9c42c120f5
commit ad87dbdcb9
2 changed files with 1 additions and 16 deletions

View File

@ -81,15 +81,11 @@ class CommsServer {
// cross-pollination between content scripts running in different // cross-pollination between content scripts running in different
// tabs. // tabs.
console.log('sendmessage of comms server. Received message:', message, 'and context:', context);
if (context?.origin !== CommsOrigin.ContentScript) { if (context?.origin !== CommsOrigin.ContentScript) {
console.log('origin is NOT content script. This means forwarding to content scripts is okay!');
if (context?.comms.forwardTo === 'all') { if (context?.comms.forwardTo === 'all') {
return this.sendToAll(message); return this.sendToAll(message);
} }
if (context?.comms.forwardTo === 'active') { if (context?.comms.forwardTo === 'active') {
console.log('forwarding message to active tab:', message);
return this.sendToActive(message); return this.sendToActive(message);
} }
if (context?.comms.forwardTo === 'contentScript') { if (context?.comms.forwardTo === 'contentScript') {
@ -182,8 +178,6 @@ class CommsServer {
} }
private async processReceivedMessage(message, port){ private async processReceivedMessage(message, port){
console.log('processing received message!', {message, portName: port.name, port})
// this triggers events // this triggers events
this.eventBus.send( this.eventBus.send(
message.command, message.command,

View File

@ -111,12 +111,7 @@ export default {
// get info about current site from background script // get info about current site from background script
while (true) { while (true) {
try { this.requestSite();
console.log('trying to get site ...');
this.requestSite();
} catch (e) {
console.warn('failed to load site:', e);
}
await this.sleep(5000); await this.sleep(5000);
} }
}, },
@ -150,7 +145,6 @@ export default {
requestSite() { requestSite() {
try { try {
this.logger.log('info','popup', '[popup::getSite] Requesting current site ...') this.logger.log('info','popup', '[popup::getSite] Requesting current site ...')
console.info('requesting current site')
// CSM.port.postMessage({command: 'get-current-site'}); // CSM.port.postMessage({command: 'get-current-site'});
this.eventBus.send( this.eventBus.send(
'get-current-site', 'get-current-site',
@ -162,9 +156,6 @@ export default {
} catch (e) { } catch (e) {
this.logger.log('error','popup','[popup::getSite] sending get-current-site failed for some reason. Reason:', e); this.logger.log('error','popup','[popup::getSite] sending get-current-site failed for some reason. Reason:', e);
} }
},
setSite(data) {
}, },
getRandomColor() { getRandomColor() {
return `rgb(${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)})`; return `rgb(${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)})`;