Skip to content
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

Feature request: Provide an "is debug" signal #2809

Open
gibson042 opened this issue Aug 14, 2017 · 1 comment
Open

Feature request: Provide an "is debug" signal #2809

gibson042 opened this issue Aug 14, 2017 · 1 comment

Comments

@gibson042
Copy link

@Krinkle is introducing Karma to the jQuery test suite, and it looks like our custom context file will be fairly complex. To avoid code duplication, I'd like to reuse it for a custom debug file, but we cannot because there's apparently no documented way to detect that it's being used for debug.

Expected behaviour

Something like an %IS_DEBUG% directive that gets replaced with true or false so debug-specific processing can happen dynamically.

Actual behaviour

We have to use something like /^[/]debug\b/.test(location.pathname), but I don't think /debug.html is actually part of your public API (though it is mentioned on the troubleshooting page).

@EzraBrooks
Copy link
Collaborator

This seems simple enough. Doing an additional replace when pages are served and replacing %IS_DEBUG% with the value of isRequestingDebugFile might do the trick, since that value tracks whether the location is debug.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants