{"record":{"id":"5377732850c8c3d0","repo":"garrytan/gstack","slug":"usage-browse-inspect-selector-all-histor","errorCode":null,"errorMessage":"Usage: browse inspect [selector] [--all] [--history]\\nOr pick an element in the Chrome sidebar first.","messagePattern":"Usage: browse inspect \\[selector\\] \\[--all\\] \\[--history\\]\\\\nOr pick an element in the Chrome sidebar first\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/read-commands.ts","lineNumber":583,"sourceCode":"        if (history.length === 0) return '(no style modifications)';\n        return history.map((m, i) =>\n          `[${i}] ${m.selector} { ${m.property}: ${m.oldValue} → ${m.newValue} } (${m.source}, ${m.method})`\n        ).join('\\n');\n      }\n\n      // If no selector given, check for stored inspector data\n      if (!selector) {\n        // Access stored inspector data from the server's in-memory state\n        // The server stores this when the extension picks an element via POST /inspector/pick\n        const stored = (bm as any)._inspectorData;\n        const storedTs = (bm as any)._inspectorTimestamp;\n        if (stored) {\n          const stale = storedTs && (Date.now() - storedTs > 60000);\n          let output = formatInspectorResult(stored, { includeUA });\n          if (stale) output = '⚠ Data may be stale (>60s old)\\n\\n' + output;\n          return output;\n        }\n        throw new Error('Usage: browse inspect [selector] [--all] [--history]\\nOr pick an element in the Chrome sidebar first.');\n      }\n\n      // Direct inspection by selector\n      const result = await inspectElement(page, selector, { includeUA });\n      // Store for later retrieval\n      (bm as any)._inspectorData = result;\n      (bm as any)._inspectorTimestamp = Date.now();\n      return formatInspectorResult(result, { includeUA });\n    }\n\n    case 'media': {\n      const { extractMedia } = await import('./media-extract');\n      const target = bm.getActiveFrameOrPage();\n      const filter = args.includes('--images') ? 'images' as const\n        : args.includes('--videos') ? 'videos' as const\n        : args.includes('--audio') ? 'audio' as const\n        : undefined;\n      const selectorArg = args.find(a => !a.startsWith('--'));","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/read-commands.ts#L565-L601","documentation":"Error \"Usage: browse inspect [selector] [--all] [--history]\\nOr pick an element in the Chrome sidebar first.\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/read-commands.ts:583 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}