Reputation: 6849
I have a Chrome extension. Currently, when the extension opens, an $.ajax request is made using JQuery. Based on the results of the request, the extension popup will then format and display the request data. My solution is functional, but user experience is lacking because every time my extension is clicked, I'm displaying a little "loading" message for 1-2 seconds while the ajax request is made.
Is there any way to perform this $.ajax request BEFORE my extension is opened? Perhaps when the browser opens, or when the tab opens? It would be wonderful if the $.ajax request could be made before the popup is opened, so as soon as the user clicks my extension, the data is immediately displayed - no "loading" message.
Upvotes: 1
Views: 435
Reputation: 18534
Use Background\Event Pages for making $.ajax request
right after loading extension and before click of browser popup and you can format your popup page before click as well.
You need to use message communication if changes are to be passed from background
to popup
page.
Upvotes: 2