@@ -3,6 +3,7 @@ sap.ui.define(["jquery.sap.global", "sap/ui/core/ElementMetadata"],
3
3
"use strict" ;
4
4
5
5
var configurationInfo = sap . ui . getCore ( ) . getConfiguration ( ) ;
6
+ var BaseConfig = sap . ui . require ( 'sap/base/config/_Configuration' ) ;
6
7
7
8
// ================================================================================
8
9
// Technical Information
@@ -54,6 +55,42 @@ sap.ui.define(["jquery.sap.global", "sap/ui/core/ElementMetadata"],
54
55
return formattedLibraries ;
55
56
}
56
57
58
+ /**
59
+ * Returns information whether the framework is in debug mode.
60
+ * @returns {boolean }
61
+ * @private
62
+ */
63
+
64
+ function _getDebugModeInfo ( ) {
65
+ // check URI param
66
+ var vDebugInfo = BaseConfig . get ( {
67
+ name : 'sapUiDebug' ,
68
+ type : BaseConfig . Type . String ,
69
+ defaultValue : false ,
70
+ external : true ,
71
+ freeze : true
72
+ } ) ;
73
+
74
+ // check local storage
75
+ try {
76
+ vDebugInfo = vDebugInfo || window . localStorage . getItem ( 'sap-ui-debug' ) ;
77
+ } catch ( e ) {
78
+ // access to localStorage might be disallowed
79
+ }
80
+
81
+ // normalize vDebugInfo; afterwards, it either is a boolean or a string not representing a boolean
82
+ if ( typeof vDebugInfo === 'string' ) {
83
+ if ( / ^ (?: f a l s e | t r u e | x | X ) $ / . test ( vDebugInfo ) ) {
84
+ vDebugInfo = vDebugInfo !== 'false' ;
85
+ }
86
+ } else {
87
+ vDebugInfo = ! ! vDebugInfo ;
88
+ }
89
+
90
+ return vDebugInfo ;
91
+ }
92
+
93
+
57
94
/**
58
95
* Gets all the relevant information for the framework.
59
96
* @returns {Object }
@@ -71,8 +108,8 @@ sap.ui.define(["jquery.sap.global", "sap/ui/core/ElementMetadata"],
71
108
applicationHREF : window . location . href ,
72
109
documentTitle : document . title ,
73
110
documentMode : document . documentMode || "" ,
74
- debugMode : jQuery . sap . debug ( ) ,
75
- statistics : jQuery . sap . statistics ( )
111
+ debugMode : _getDebugModeInfo ( ) ,
112
+ statistics : [ ]
76
113
} ,
77
114
78
115
configurationBootstrap : window [ "sap-ui-config" ] || Object . create ( null ) ,
0 commit comments