-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmha-diagnostics-loader.js
More file actions
24 lines (21 loc) · 895 Bytes
/
Copy pathmha-diagnostics-loader.js
File metadata and controls
24 lines (21 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const DIAGNOSTICS_BOOT_STYLE_ID = "mha-diagnostics-boot-style";
if (!document.getElementById(DIAGNOSTICS_BOOT_STYLE_ID)) {
const style = document.createElement("style");
style.id = DIAGNOSTICS_BOOT_STYLE_ID;
style.textContent = `
mha-diagnostics-panel:not(:defined) {
display: block;
inline-size: 100%;
min-block-size: 100dvh;
background: linear-gradient(135deg, #171b30, #242844);
}
`;
document.head.append(style);
}
const diagnosticsUrl = new URL("./src/diagnostics/diagnostics-panel.js", import.meta.url);
const frontendVersion = new URL(import.meta.url).searchParams.get("v");
if (frontendVersion) diagnosticsUrl.searchParams.set("v", frontendVersion);
import(diagnosticsUrl.href).catch(error => {
console.error("[MHA Insights] Failed to load the diagnostics panel.", error);
document.getElementById(DIAGNOSTICS_BOOT_STYLE_ID)?.remove();
});