One more change for favicon manager
It seems that chrome works better with a slightly higher timeout and when href is changed only in timeout
This commit is contained in:
parent
3e6ec019b5
commit
d7e3cc09ec
|
@ -11,16 +11,17 @@ manager.prototype.getHeadTag = ->
|
||||||
manager.prototype.setFavicon = (href) ->
|
manager.prototype.setFavicon = (href) ->
|
||||||
head = @getHeadTag()
|
head = @getHeadTag()
|
||||||
|
|
||||||
if oldLink = @getLinkTag()
|
oldLink = @getLinkTag()
|
||||||
head.removeChild(oldLink)
|
|
||||||
|
|
||||||
link = @createLinkTag()
|
link = @createLinkTag()
|
||||||
head.appendChild(link)
|
head.appendChild(link)
|
||||||
|
|
||||||
link.setAttribute('href', href)
|
|
||||||
setTimeout ->
|
setTimeout ->
|
||||||
link.setAttribute('href', href)
|
link.setAttribute('href', href)
|
||||||
, 1
|
, 10
|
||||||
|
|
||||||
|
if oldLink
|
||||||
|
head.removeChild(oldLink)
|
||||||
|
|
||||||
manager.prototype.getLinkTag = ->
|
manager.prototype.getLinkTag = ->
|
||||||
links = @getHeadTag().getElementsByTagName('link')
|
links = @getHeadTag().getElementsByTagName('link')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user