mozilla / security-advisor-shield-study

Mozilla Public License 2.0
2 stars 7 forks source link

Refresh panel content when page load initiated #58

Closed casebenton closed 7 years ago

casebenton commented 7 years ago

Previously the panel content was only refreshed when a page completed loading all elements, and whenever the active tab changed. This caused #55 to occur for sites with slow-loading page content, as the panel content wasn't refreshed until all page elements were completely loaded.

I've added an additional "ready" listener so that the panel content is refreshed right away when a page starts loading, but without waiting for all of the 3rd party content to load. "Pageshow" is the only listener that fires when a cached page is loaded, so I needed to keep this listener as well. That created a situation where non-cached pages could have 2 panel refreshes (one with "ready" when loading starts, another with "pageshow" when loading finishes) so I have a helper method for the "pageshow" handler that only calls the method for a panel refresh if the loaded page is coming from the cache.

@Osmose r?

Osmose commented 7 years ago

/me passes the review to @groovecoder if he's available :D

groovecoder commented 7 years ago

Works well, and the code looks good to me.