An odd thing I've never seen or had occur in all the years of web dev:

The other day I got some code from Git-Hub and added it to my index page.

I decided not to use the code and removed it.

I then noticed that the Git-Hub favicon image is being displayed in my Chrome tab for this dev page.

How could this possibly happen? There is no code for this in the page and that icon is not on my server (I have never added any favicon for this project.)

The only thing I can possibly think of is that it's some kind of memory issue in my machine (but that makes no sense either.)

Has anyone ever seen something like this? It's not a huge issue, it's just a cloned, dev page; I would like to understand why it's happening, though.

Thank you in advance!

Dani AI

Generated

Short answer: this is almost always the browser, not a mysterious file on your server. Chrome keeps a local favicon cache (a small SQLite DB) and browsers will also look for a site icon at the root by default — so the icon you saw can persist even after you remove HTML or files from your site. 's suggestion (an injected link) is plausible and is right that Chrome behaves differently here. (chromium.googlesource.com)

Quick checklist to diagnose (fast, repeatable):

  • View the raw page source (Ctrl+U) — if a <link> or a manifest is present it will show up there; use DevTools → Elements to see anything injected at runtime.
  • Try a different browser or an Incognito window to rule out profile cache. ()
  • Open DevTools → Network and look for requests named "favicon" or "/favicon.ico" — note that DevTools sometimes does not show the browser’s favicon fetch, so absence in Network doesn't prove the browser didn't use a cached icon. (stackoverflow.com)

Practical fixes that work in the field:

  • Cache-bust: change the favicon URL (rename the file or append a version query string) so Chrome treats it as a new resource. This is the safest developer-side fix. (stackoverflow.com)
  • Force-clear Chrome’s favicon cache: fully quit Chrome and remove the Favicons file from your profile (Chrome stores favicons in that DB), then restart Chrome — that forces a rebuild. Use this only for local testing. (stackoverflow.com)
  • For production, serve a canonical /favicon.ico and set sensible Cache-Control headers; change the filename on deliberate updates so visitors won't keep stale icons.

One more note about the GitHub/captcha behaviour you described: audit any third‑party scripts you paste in (check script src attributes, form action URLs, and any dynamic DOM changes in DevTools). When testing untrusted code, use an isolated environment or host a inspected copy locally — that avoids surprises like redirects or injected assets.

Recommended Answers

All 6 Replies

Maybe the Github javascript injected <link rel="shortcut icon" href="blah blah blah"> into your webpage, and your browser cached that (as it does with favicons).

Dani,

Yes, that may be it.

The other odd behavior with that code from Github: I was experimenting with captcha scripts. I added one from Github. After I configured it and ran it (on a registration form,) it returned and loaded the Github homepage. I thought "Why is that happening and allowed to happen with someone's code hosted on Github? Is this captcha code altered to do this?"

I reviewed that captcha code: no links to Github or anything like that.

It's all a bit of a mystery at this point. But, I will always hesitate with Github now and will not waste my dev time trying to figure out what they're up to.

Thank you for your reply. I appreciate it :)

Question about cached pages, browser:

This page I'm working with is .php

I am now seeing (reviewing cached pages in Chrome, cookies, etc) that .php pages do so seem to be saved. I never knew that. Is this true?

If this is the case, is there a way to flush .php pages from browser memory, if they are being stored somewhere?

Thanks!

Part of this seems to be a Chrome issue.

I created a simple favicon, uploaded to the server, and added it to the page in question; it will not update in Chrome (still shows the Github favicon.) It actually displays the new favicon in IE (and FF,) which surprised me as I never use IE, save for browser testing. Chrome dissapoints me sometimes :(

Getting codes form github key getting allthing from that platform. Bacause you will mind for this icon that a Github admark

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.