Pre-quantum icon gone

User Help for Mozilla Firefox
Post Reply
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Pre-quantum icon gone

Post by Odin2 »

The favicon for my pinned tab for http://www.corporateofficeowl.com/ has disappeared after my transitioning to Quantum--and I'd like to put it back. I'm aware of the Favicon Detector extension, but don't know how to use this to solve. I'm willing to do coding, but have no coding experience, so I would need instructions or an instructional link. Can you help?
User avatar
mightyglydd
Posts: 9813
Joined: November 4th, 2006, 7:07 pm
Location: Hollywood Ca.

Re: Pre-quantum icon gone

Post by mightyglydd »

That site doesn't have a favicion in Fx or Chrome...
#KeepFightingMichael and Alex.
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Re: Pre-quantum icon gone

Post by Odin2 »

Very strange, as I referred to this site very often over many years, always with a Fx favicon, until I moved to Quantum.
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Re: Pre-quantum icon gone

Post by Odin2 »

If there is no Fx favicon, can I add one? (Note my limited knowledge, as disclosed above.)
lasardo
Posts: 182
Joined: September 9th, 2018, 1:41 pm

Re: Pre-quantum icon gone

Post by lasardo »

This extension lets you pick an emoji to use for a favicon , hopefully it being a pinned tab won't make it not work: https://addons.mozilla.org/en-US/firefox/addon/favioli/ More background on that extension: https://eligrey.com/blog/favioli/
morat
Posts: 6435
Joined: February 3rd, 2009, 6:29 pm

Re: Pre-quantum icon gone

Post by morat »

Here is a user script that works with sites without a favicon in Chrome and Firefox Quantum.

HTTP sites can use HTTP or HTTPS favicons. HTTPS sites require HTTPS favicons.

Code: Select all

// ==UserScript==
// @name         Change Favicon
// @match        https://tinyapps.org/
// @match        http://custombuttons.sourceforge.net/forum/index.php
// @match        http://subsimple.com/bookmarklets/jsbuilder.htm
// @grant        none
// ==/UserScript==

(function () {

  "use strict";

  var metas = document.getElementsByTagName("meta");
  for (var i = 0; i < metas.length; i++) {
    if (metas[i].httpEquiv && metas[i].httpEquiv.toLowerCase() == "cache-control") {
      metas[i].parentNode.removeChild(metas[i]);
    }
    if (metas[i].httpEquiv && metas[i].httpEquiv.toLowerCase() == "refresh") {
      metas[i].content = "0;URL=about:blank";
    }
  }

  // create favicon
  var link = document.createElement("link");
  link.rel = "shortcut icon";
  link.type = "image/x-icon";
  switch (document.domain) {
    case "tinyapps.org":                  link.href = "https://tiny.cc/favicon.ico";          break;
    case "custombuttons.sourceforge.net": link.href = "https://sourceforge.net/favicon.ico";  break;
    case "subsimple.com":                 link.href = "https://tampermonkey.net/favicon.ico"; break;
    default:
      link.href = "https://www.google.com/favicon.ico";
      break;
  }

  // remove existing favicons
  var links = document.getElementsByTagName("head")[0].getElementsByTagName("link");
  for (var i = 0; i < links.length; i++) {
    if (links[i].href == link.href) {
      break;
    }
    if (links[i].rel == "shortcut icon" || links[i].rel == "icon") {
      document.getElementsByTagName("head")[0].removeChild(links[i]);
    }
  }

  // add favicon to head
  document.getElementsByTagName("head")[0].appendChild(link);

  // force browser to acknowledge
  var shim = document.createElement("iframe");
  shim.width = shim.height = 0;
  document.body.appendChild(shim);
  shim.src = "icon";
  document.body.removeChild(shim);

})();
Reference
http://superuser.com/questions/93056
http://userscripts-mirror.org/scripts/review/42247
Odin2
Posts: 801
Joined: March 10th, 2012, 8:08 pm

Re: Pre-quantum icon gone

Post by Odin2 »

Lasardo, your suggested add-on worked like a charm (once I figured out how to use it--some documentation would be helpful). The choice of images is outstanding. Many thanks!
Post Reply