SVG favicon Mozilla fix

SVG favicon doesn't appear in Firefox prior to 41 version Motty Katan(c) 15-09-2015 last updated 15-09-2015

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           SVG favicon Mozilla fix
// @name:fr        SVG favicon Mozilla correction
// @description    SVG favicon doesn't appear in Firefox prior to 41 version Motty Katan(c) 15-09-2015 last updated 15-09-2015
// @description:fr    On ne voit pas des SVG favicons dans les versions de Firefox qui précèdaient 41 Motty Katan(c) 15-09-2015 dernière mise à jour 15-09-2015
// @version 1.0.1
// @include       *
// @namespace https://greatest.deepsurf.us/users/14985
// ==/UserScript==
(function(){
	var isFirefox = navigator.userAgent.match(/Firefox\/(\d\d\.\d)/);
	if (isFirefox && isFirefox[1]<41){
		var oChildren = document.head.children;
		var i = -1;
		while (++i < oChildren.length && (oChildren[i].tagName != 'LINK' || (!oChildren[i].getAttribute('rel') || oChildren[i].getAttribute('rel').indexOf("icon")===-1) || (!oChildren[i].getAttribute('href') || oChildren[i].getAttribute('href').substr(-3).toLowerCase()=="svg") )){}	
		if (typeof(oChildren[i])!="undefined"){
			//refresh it since a svg file can delete previous icon
			oChildren[i].href = oChildren[i].href;
		}	
	}
})();