Redirect and keep my favicon

老子叫甜甜 提交于 2019-12-06 06:35:01

问题


I was wondering how facebook redirects keeps its favicon when you click a link on facebook its open new tab with the FB favicon

I am wondering how could this be accomplished

Its not iframe so how could i do such thing

Where I should start ? And while the redirect there is a URL called maybe it does everything

Regards


回答1:


Are you using Google Chrome. I'm pretty sure you are referring to a known bug. See this bug which was merged into this bug.

What steps will reproduce the problem?

  1. Visit site with /favicon.ico (e.g. facebook.com)
  2. Receive a redirect from this domain to a new domain without a /favicon.ico
  3. The favicon for the new url is inherited from the last domain.

What is the expected result?

Favicon is blank.

What happens instead?

Favicon is inherited from last domain.

Other information:

I discovered this as facebook.com does not link directly to external sites, but logs the url then redirects to it. I reproduced the issue on localhost using the 'redirect' statement in the ruby web-framework 'Sinatra'.




回答2:


Your browser stores the favicon and groups it with domain name of the site your visiting. In other words, once you've loaded facebook once, it will show up on all facebook pages.



来源:https://stackoverflow.com/questions/8935205/redirect-and-keep-my-favicon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!