Files
testing-tool/entrypoints/content.ts
T
雨霖铃 4213e70697 feat: update package.json to remove lint-staged, add eslint configuration and dependencies
feat: add state management for recording in RecordeReplayPage component

refactor: remove bridge and storage services as they are no longer needed

chore: update tsconfig.json for improved type checking and module resolution

fix: update downloadHtml function to use eventWithTime type and improve formatting

fix: add error logging in formatWithZone function for better debugging
2026-01-31 18:00:01 +08:00

29 lines
966 B
TypeScript

import '../.wxt/types/imports.d.ts';
import { browser } from 'wxt/browser';
export default defineContentScript({
// matches: ['*://*.google.com/*'],
matches: ['<all_urls>'],
runAt: 'document_start',
main() {
console.log('Content script loaded successfully', { id: browser.runtime.id });
chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => {
if (message.type === 'START_RECORD') {
// startRecord();
console.log('Start recording command received in content script');
sendResponse({ status: 'Recording started' });
} else if (message.type === 'STOP_RECORD') {
// stopRecord();
console.log('Stop recording command received in content script');
sendResponse({ status: 'Recording stopped' });
} else {
console.log('Unknown command received in content script');
sendResponse({ status: 'Unknown command' });
}
return true;
});
},
});