(result)
| 323 | } |
| 324 | |
| 325 | function summarizeMessageResultForDebug(result) { |
| 326 | if (result === undefined) return 'undefined'; |
| 327 | if (result === null) return 'null'; |
| 328 | if (typeof result !== 'object') return JSON.stringify(result); |
| 329 | const summary = {}; |
| 330 | for (const key of ['ok', 'error', 'stopped', 'source', 'step']) { |
| 331 | if (key in result) summary[key] = result[key]; |
| 332 | } |
| 333 | if (result.payload && typeof result.payload === 'object') { |
| 334 | summary.payloadKeys = Object.keys(result.payload); |
| 335 | } |
| 336 | return JSON.stringify(summary); |
| 337 | } |
| 338 | |
| 339 | function sendTabMessageWithTimeout(tabId, source, message, responseTimeoutMs = getContentScriptResponseTimeoutMs(message)) { |
| 340 | return new Promise((resolve, reject) => { |
no outgoing calls
no test coverage detected