Add SuperRPA integration guide, simple extension and standalone replay page
Some checks failed
Tests / Tests (push) Has been cancelled
ESLint Check / ESLint Check and Report Upload (push) Has been cancelled
Prettier Check / Format Check (push) Has been cancelled
Prettier Check / Format Code (push) Has been cancelled
ESLint Check / Build Base for Bundle Size Comparison (push) Has been cancelled
Some checks failed
Tests / Tests (push) Has been cancelled
ESLint Check / ESLint Check and Report Upload (push) Has been cancelled
Prettier Check / Format Check (push) Has been cancelled
Prettier Check / Format Code (push) Has been cancelled
ESLint Check / Build Base for Bundle Size Comparison (push) Has been cancelled
- docs/integration/superrpa-integration.zh_CN.md: complete integration guide - rrweb-simple-ext/: minimal Chrome extension for page recording - replay.html: standalone drag-and-drop replay viewer - CLAUDE.md: project instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
25
rrweb-simple-ext/background.js
Normal file
25
rrweb-simple-ext/background.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// background.js - service worker
|
||||
const events = [];
|
||||
let recording = false;
|
||||
let activeTabId = null;
|
||||
|
||||
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
if (msg.action === 'startRecording') {
|
||||
events.length = 0;
|
||||
recording = true;
|
||||
activeTabId = msg.tabId;
|
||||
chrome.tabs.sendMessage(msg.tabId, { action: 'startRecord' });
|
||||
sendResponse({ ok: true });
|
||||
} else if (msg.action === 'stopRecording') {
|
||||
recording = false;
|
||||
chrome.tabs.sendMessage(activeTabId, { action: 'stopRecord' });
|
||||
sendResponse({ ok: true, eventCount: events.length });
|
||||
} else if (msg.action === 'getEvents') {
|
||||
sendResponse({ events: events });
|
||||
} else if (msg.action === 'event') {
|
||||
events.push(msg.data);
|
||||
} else if (msg.action === 'getStatus') {
|
||||
sendResponse({ recording, eventCount: events.length });
|
||||
}
|
||||
return true;
|
||||
});
|
||||
Reference in New Issue
Block a user