Hi,
In manifest v2 inline javascript can be injected and executed synchronously by using a document.append(<script element>). But in manifest v3 due to CSP restrictions, an inline script can be injected by only using asynchronous scripting API.
We have a use case of executing an inline script on the click action of an HTML element and need to wait for the inline script execution to complete before updating the UI.
However, due to the asynchronous nature of scripting API, the code that updates UI is not getting blocked until inline script execution. We don't have control of UI updating code. It is inside a web page.
Ex:- HTML link with the text "Open", on click action text will be updated to "Close". Before text updation, the inline script has to run.
Please let me know if there is a way to make inline script execution synchronous.
Regards,
Vinod.