@linear_non/stellar-kit 3.0.11 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/Application.js +5 -1
- package/package.json +1 -1
- package/plugins/Observer.js +1 -1
- package/utils/debug.js +12 -0
package/core/Application.js
CHANGED
|
@@ -213,6 +213,10 @@ export class ApplicationManager {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
await this._waitDOM()
|
|
216
|
+
|
|
217
|
+
// Auto-enable debug mode from ?debug URL param
|
|
218
|
+
Debug.init()
|
|
219
|
+
|
|
216
220
|
Debug.log(
|
|
217
221
|
"APP",
|
|
218
222
|
"DOM ready with",
|
|
@@ -310,4 +314,4 @@ export class ApplicationManager {
|
|
|
310
314
|
if (document.readyState !== "loading") return Promise.resolve()
|
|
311
315
|
return new Promise(res => document.addEventListener("DOMContentLoaded", res, { once: true }))
|
|
312
316
|
}
|
|
313
|
-
}
|
|
317
|
+
}
|
package/package.json
CHANGED
package/plugins/Observer.js
CHANGED
package/utils/debug.js
CHANGED
|
@@ -18,9 +18,21 @@ function fmt(scope) {
|
|
|
18
18
|
*
|
|
19
19
|
* - Controlled via kitStore.flags.isDebug
|
|
20
20
|
* - No-op when debug is off
|
|
21
|
+
* - Call Debug.init() to auto-enable via ?debug URL param
|
|
21
22
|
*/
|
|
22
23
|
|
|
23
24
|
export const Debug = {
|
|
25
|
+
/**
|
|
26
|
+
* Auto-enable debug mode if the URL contains a `?debug` query parameter.
|
|
27
|
+
* e.g. `https://example.com/?debug=1` or `?debug`
|
|
28
|
+
* Call this early (e.g. in Application.initialize).
|
|
29
|
+
*/
|
|
30
|
+
init() {
|
|
31
|
+
const params = new URLSearchParams(window.location.search)
|
|
32
|
+
if (params.has("debug")) {
|
|
33
|
+
this.enable()
|
|
34
|
+
}
|
|
35
|
+
},
|
|
24
36
|
enable() {
|
|
25
37
|
kitStore.flags.isDebug = true
|
|
26
38
|
},
|