Sync connection between the content script and the background

81 views
Skip to first unread message

Andrey Tamarkin

unread,
Nov 12, 2024, 6:16:08 AMNov 12
to Chromium Extensions
Hello,

I want to send a sync message from the content script to the background (which means that I want the code in the content script to wait for the response from the background). Is this possible?

Thanks

woxxom

unread,
Nov 12, 2024, 6:39:50 AMNov 12
to Chromium Extensions, Andrey Tamarkin
There's no way to send a synchronous message i.e. pause the entire environment of the tab while waiting for the response. If you want to get configuration data at document_start synchronously there are some workarounds. Please describe what specifically you are trying to do in detail or show your code.
Reply all
Reply to author
Forward
0 new messages