MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / setDebugInfo

Function setDebugInfo

src/main.js:452–480  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

450}
451
452async function setDebugInfo() {
453 const { version, versionCode } = BuildInfo;
454
455 const userAgent = navigator.userAgent;
456 const language = navigator.language;
457
458 // Extract Android version
459 const androidMatch = userAgent.match(/Android\s([0-9.]+)/);
460 const androidVersion = androidMatch ? androidMatch[1] : "Unknown";
461
462 // Extract Chrome/WebView version
463 const chromeMatch = userAgent.match(/Chrome\/([0-9.]+)/);
464 const webviewVersion = chromeMatch ? chromeMatch[1] : "Unknown";
465 const webviewMajor = Number.parseInt(webviewVersion, 10);
466 const minWebviewMajor = window.__ACODE_MIN_WEBVIEW_MAJOR__ || 84;
467 const webviewStatus =
468 Number.isFinite(webviewMajor) && webviewMajor < minWebviewMajor
469 ? ` (minimum supported: ${minWebviewMajor})`
470 : "";
471
472 const info = [
473 `App: v${version} (${versionCode})`,
474 `Android: ${androidVersion}`,
475 `WebView: ${webviewVersion}${webviewStatus}`,
476 `Language: ${language}`,
477 ].join("\n");
478
479 document.body.setAttribute("data-version", info);
480}
481
482function getUpdateMessage(count) {
483 return count === 1

Callers 1

onDeviceReadyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected