-
Notifications
You must be signed in to change notification settings - Fork 934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow enable programmatically #416
Comments
It also doesn't work in other runtimes that don't have localstorage (ExtendScript for example, a JS for controlling Adobe applications) |
For those who can't wait, like me ;-) I did a little change in my fork that allows to lately enable namespaces. see: https://github.com/dtomasi/debug/commit/f64af5669b2cb2184d99ac4d25cf4d216df78f2b Within the initialization of my script I use something like that: // Get the Module not the function it exposes
var debugModule = require('debug');
// Set storage to null. This stops the use of localStorage within my bundle
debugModule.storage = null;
// Disable all
debugModule.disable();
if (myConfig.debug) {
debugModule.enable(myConfig.debug);
} Cheers |
@dtomasi We're heading towards dynamic debug instances in #440. But tangentially related:
This is particularly frightening! Obscurity DOES NOT EQUAL security!!! If you have secret values or code then they should be secured behind server-side API calls, and not bundled with client-side code. |
This now works in debug v3. Please open a new issue for any future troubles. |
It would be nice to enable debug in browsers programmatically.
I would prefer something like that:
The solution to use localStorge does not work in Safari´s private mode anyway. Would be nice to have also the debug messages there ...
Also it would be nice to have the ability to deny enabling debug by setting localStorage.debug. The source code of my current project is only provided in a uglified version to protect my intellectual property and business secret. I don´t want anyone can enable debug information by setting localStorage.debug to '*'.
The text was updated successfully, but these errors were encountered: