add official Chrome feature demos

This commit is contained in:
2026-06-14 15:22:32 +08:00
parent 500217f2fd
commit de690f85fa
32 changed files with 2376 additions and 567 deletions
+14
View File
@@ -0,0 +1,14 @@
console.warn("Demo warning: this page intentionally includes diagnosable issues.");
const longTaskButton = document.querySelector("#long-task");
const taskResult = document.querySelector("#task-result");
longTaskButton.addEventListener("click", () => {
const start = performance.now();
while (performance.now() - start < 650) {
Math.sqrt(Math.random() * Number.MAX_SAFE_INTEGER);
}
const duration = Math.round(performance.now() - start);
taskResult.textContent = `已触发约 ${duration}ms 的主线程长任务。`;
console.error("Demo error: long task was triggered for DevTools MCP inspection.");
});