Observation: I am running an SPA in Polymer and when I open internal links in new background tabs in chrome, the pages don't finish loading (ajax and all) until I focus on the tab.
Questions: What is chrome waiting for user focus to do -or- What is Polymer waiting for before it finishes rendering the page and sending ajax requests?
Bonus: How can I open a dev tools panel targeting a tab I have opened in the background to observe what is/isn't happening?
Bonus Answer: If you open dev tools on a tab, navigate away from the tab, then refresh the dev tools, the associated tab will also refresh and simulate having been opened in the backgroun.
Here is how it can be done. To make a background tab active in Google Chrome automatically, you need to do the following. Press and hold Ctrl + Shift keys together on the keyboard, and only then click the link that you want to switch to immediately.
If you're in full screen mode, your toolbar will be hidden by default. This is the most common reason for it to disappear. To leave full screen mode: On a PC, press F11 on your keyboard.
This feature is enabled by default in Chrome and works in the background without needing the user's input. Tab Freezing only suspends unused tabs when system memory is running low. The tabs continue to appear in the tab strip and reload when clicked.
As noted on Chrome Tricks, to get a count of tabs in each window, right click on any tab and select Move Tab to Another Window. Save this answer. Show activity on this post. Just close the window and open Chrome again to load the tabs into history (if you have history enabled).
In Polymer, core-ajax
with the auto
attribute set to true
uses Polymer job
utility (source). Polymer's job utility uses the requestAnimationFrame()
function (source). According to here and here, chrome pauses on this function completely when the tab is inactive.
Solution: By removing the auto attribute from my core-ajax
elements and manually calling the go()
method on the ready event, I was able to get my pages to fully load in the background.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With