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
// tabs.
console.log('sendmessage of comms server. Received message:', message, 'and context:', context);
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') {
return this.sendToAll(message);
}
if (context?.comms.forwardTo === 'active') {
console.log('forwarding message to active tab:', message);
return this.sendToActive(message);
}
if (context?.comms.forwardTo === 'contentScript') {
@ -182,8 +178,6 @@ class CommsServer {
}
private async processReceivedMessage(message, port){
console.log('processing received message!', {message, portName: port.name, port})
// this triggers events
this.eventBus.send(
message.command,

View File

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