Open or close Responsive Design Mode (RDM)
browser_responsive_modeOpen, close or query Firefox Responsive Design Mode for a tab. MEASURED details that matter: (1) the entry point is ResponsiveUIManager.openIfNeeded(window, tab, {trigger}) from module "devtools/client/responsive/manager" — that module IS…
Instructions
Open, close or query Firefox Responsive Design Mode for a tab. MEASURED details that matter: (1) the entry point is ResponsiveUIManager.openIfNeeded(window, tab, {trigger}) from module "devtools/client/responsive/manager" — that module IS the manager instance, not a container; (2) the window argument MUST come from Services.wm.getMostRecentWindow("navigator:browser"); passing gBrowser.ownerGlobal through the DevTools loader fails with "can't access property gBrowser, window is undefined"; (3) the manager must be cached on the chrome window — a fresh DevToolsLoader cannot see a UI opened through another loader, so closing would silently do nothing. IMPORTANT: iframe.rdm-toolbar is a PERMANENT node in the browser document — it stays after closing, so never use its presence to decide whether RDM is active. Use the responsive-mode class on the browser container (or the manager isActiveForTab) instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | What to do | |
| context | No | Tab (default: the active tab) |