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

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

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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.

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

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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;
		}	
	}
})();