MCPcopy Index your code
hub / github.com/InverseUI/InverseUI-Recorder / captureInitialState

Function captureInitialState

modules/recording.js:21–41  ·  view source on GitHub ↗
(tabId)

Source from the content-addressed store, hash-verified

19 * This ensures the generated code can reproduce the same starting conditions
20 */
21export async function captureInitialState(tabId) {
22 try {
23 console.log('📸 Capturing initial webpage state...');
24
25 // Request initial state from content script
26 const response = await chrome.tabs.sendMessage(tabId, {
27 type: 'GET_INITIAL_STATE'
28 });
29
30 if (response && response.success) {
31 console.log('✅ Initial state captured:', response.state);
32 return response.state;
33 } else {
34 console.warn('⚠️ Failed to capture initial state from content script');
35 return null;
36 }
37 } catch (error) {
38 console.error('❌ Error capturing initial state:', error);
39 return null;
40 }
41}
42
43/**
44 * Create initial actions based on captured webpage state

Callers 1

startFreshRecordingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected