Skip to content

Instantly share code, notes, and snippets.

@icai
Created August 18, 2016 07:53
Show Gist options
  • Save icai/2b9380422780fa4b96f7c8e4a6563a05 to your computer and use it in GitHub Desktop.
Save icai/2b9380422780fa4b96f7c8e4a6563a05 to your computer and use it in GitHub Desktop.
simulated Loading, trigger favicon loading
var oldDone = Nprogress.done;
Nprogress.done = function(){
var setfmSrc = function(dom, url){
dom.src = url;
};
var fm = document.getElementById('triggerloading');
var url = "/favicon.ico"; // ping page;
if(fm){
setfmSrc(fm, url);
} else{
fm = document.createElement('iframe');
fm.id = "triggerloading";
fm.className="sr-only";
document.body.appendChild(fm);
setfmSrc(fm, url);
}
oldDone();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment