Closed Septh closed 1 year ago
Sorry about that! I have 3 files using a console logging variable and one slipped through the cracks! Whenever I code, I set all 3 debugging variables to true and when I'm finished I have to set all 3 variables back to false for production. It's a bit of a nuisance really and I'm wondering if there's not a way to automate this process?
I am not familiar with browser extension development but I think runtime.onInstalled can help, something like:
let logToConsole = false
browser.runtime.onInstalled.addListener(evt => {
logToConsole = evt.temporary
});
function log(...args) {
if (logToConsole) console.log(...args)
}
@Septh Nice one! Thank you, Stephan!
Hi, the extension is generating a lot of noise in the browser console, which is a real burden when trying to debug my own code. Could you please disable this in the production build? 🙏