: Chrome prerender "Non-Empty Browsing Instance" I'm experimenting with Chrome rel="prerender". On one specific site, the page I'm suggesting gets prerendered, but is then loaded again, not switched
I'm experimenting with Chrome rel="prerender". On one specific site, the page I'm suggesting gets prerendered, but is then loaded again, not switched when the link is clicked. As reported on chrome://net-internals/#prerender, the reason for failing is listed as Non-Empty Browsing Instance.
I've tried searching for some explanation about this particular problem, but haven't found any. Does anyone have any experience or ideas what causes Non-Empty Browsing Instance, and how to fix it?
More posts by @Fox8124981
2 Comments
Sorted by latest first Latest Oldest Best
Non-Empty Browsing Instance appears if you have 2 windows of Chrome open. Keep a single window open and you will not get this error.
After experimenting and fixing it, the "Non-Empty Browsing Instance" seems to be triggered by JavaScript changing DOM in the prerendered page.
The way to solve it is to block such JS until the document is visible. Hint:
var visibility = {
isHidden: function() {
if ('hidden' in document) return document.hidden;
return false;
}
};
if (visibility.isHidden()) document.addEventListener('visibilitychange', startWhenVisible);
else startStuff();
function startWhenVisible(){
if (!visibility.isHidden()) {
document.removeEventListener('visibilitychange', startWhenVisible);
startStuff();
}
}
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.