Created
August 18, 2016 07:53
-
-
Save icai/2b9380422780fa4b96f7c8e4a6563a05 to your computer and use it in GitHub Desktop.
simulated Loading, trigger favicon loading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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