* Report that this content script is loaded and ready.
()
| 260 | * Report that this content script is loaded and ready. |
| 261 | */ |
| 262 | function reportReady() { |
| 263 | console.log(LOG_PREFIX, '内容脚本已就绪'); |
| 264 | const message = { |
| 265 | type: 'CONTENT_SCRIPT_READY', |
| 266 | source: SCRIPT_SOURCE, |
| 267 | step: null, |
| 268 | payload: {}, |
| 269 | error: null, |
| 270 | }; |
| 271 | Promise.resolve(chrome.runtime.sendMessage(message)) |
| 272 | .then((response) => { |
| 273 | console.log(LOG_PREFIX, 'CONTENT_SCRIPT_READY sent successfully', { response, url: location.href }); |
| 274 | }) |
| 275 | .catch((err) => { |
| 276 | console.error(LOG_PREFIX, 'CONTENT_SCRIPT_READY send failed', err?.message || err, { url: location.href }); |
| 277 | }); |
| 278 | } |
| 279 | |
| 280 | /** |
| 281 | * Report step completion. |
no outgoing calls
no test coverage detected