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

Function safeSendMessage

util/communication_utils.js:6–24  ·  view source on GitHub ↗
(message, callback)

Source from the content-addressed store, hash-verified

4 * Safe message sending with error handling
5 */
6export function safeSendMessage(message, callback) {
7 try {
8 if (chrome.runtime && chrome.runtime.sendMessage) {
9 chrome.runtime.sendMessage(message, function(response) {
10 if (chrome.runtime.lastError) {
11 console.log('Chrome runtime error:', chrome.runtime.lastError.message);
12 return;
13 }
14 if (callback && typeof callback === 'function') {
15 callback(response);
16 }
17 });
18 } else {
19 console.log('Chrome runtime API not available');
20 }
21 } catch (error) {
22 console.log('Error sending message:', error);
23 }
24}
25
26/**
27 * Initialize page-to-content communication for Selenium API

Callers 4

clickListenerFunction · 0.85
inputListenerFunction · 0.85
initializeRecordingFunction · 0.85
notifyContentScriptReadyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected