Hi All,
I have a use case in which a modal will show on screen whenever a certain criteria is met. I tried different approaches but none of them seem to be working.
Approach 1: registerContentScripts, unregisterContentScripts
The issue that I faced with this approach is the modal is not showing immediately. I need to reload the tab in order to show the popup but I want to show right away once the criteria is fulfilled. The unregisterContentScripts() is working as expected. I am able to unregister the content scripts on close button click in the modal.
Approach 2: executeScript
Using this I was able to immediately show the popup which is the expected behaviour but there is no way to remove the content script. So, when the criteria is again fulfilled it is throwing me error mentioning that the identifiers are already declared.
Please help me in resolving this issue. I am looking forward to any suggestions that will make it work.
Thanks