The user wants to show a different popup window in their Chrome extension based on whether the user is logged in or not. Currently, they are using JavaScript to achieve this, but there is a noticeable delay causing the original page to flash before switching to the correct popup window.
To solve this issue, we can leverage the chrome.storage
API to persist the user's login status and the chrome.browserAction.setPopup()
method to dynamically set the popup window based on the stored login status. This way, the correct popup window will be shown immediately without any delay.
Ask anything...