v155 · extensions · developer tool
Graceful degradation playbook
Chrome 155 gives extension developers something they never had: a deterministic moment to fall back. Pick the capability you were using chrome.debugger for; get the restricted-environment alternative, the manifest permissions it needs, and the attach-rejection handler that catches the two stable error strings — copy-ready.
1 · What were you attaching a debugger for?
2 · The code to ship
manifest + fallback
3 · The attach handler every debugger extension needs now
async function attachOrFallback(tabId) {
try {
await chrome.debugger.attach({ tabId }, "1.3");
return { mode: "debugger" };
} catch (e) {
// Chrome 155+ deterministic policy rejections:
if (e.message === "Host access is restricted by policy." ||
e.message === "Screenshot capture is restricted by policy.") {
return { mode: "restricted", reason: e.message };
}
throw e; // real failures (bad tab, already attached...) still surface
}
}
Pre-155 there was nothing reliable to catch here — attach succeeded and commands failed later, one by one. Watch that difference in the simulator.