This module for WinRT JavaScript-based applications adds a property to the Debug
global object that you can query to detect if the application is running with the Debug build configuration selected, allowing conditional execution of JavaScript code in a Windows Store app.
The JavaScript Debug Symbols for WinRT module is available on nuget.org via the package WinRT-JsDebugSymbols
.
To install WinRT-JsDebugSymbols, run the following command in the Package Manager Console:
PM> Install-Package WinRT-JsDebugSymbols
Add a reference to the debugSymbols.js script in the header section of the default.html file:
<script src="/js/debugSymbols.js"></script>
Now you can query the Debug.isDebugBuild
property during the execution of the Windows Store app to determine if the app is running a Debug build or not.
// Example:
// Show a dialog box with details of any unhandled
// exceptions occurring in the application, only for
// Debug builds.
if (Debug.isDebugBuild) {
WinJS.Application.onerror = function (e) {
var dialog = new Windows.UI.Popups.MessageDialog(
e.detail.stack, e.detail.message);
dialog.showAsync().done();
return true;
};
}
Click on the Releases tab on GitHub.
Copyright © 2012 C. Augusto Proiete & Contributors - Provided under the Apache License, Version 2.0.