Add favicons only in Firefox

This commit is contained in:
tophf 2017-05-17 01:09:31 +03:00
parent 9228a22c6c
commit 4250f89ed3
4 changed files with 12 additions and 9 deletions

12
dom.js
View File

@ -11,6 +11,18 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection])
} }
} }
// add favicon in Firefox
if (/Firefox/.test(navigator.userAgent)) {
for (const size of [128, 38, 32, 19, 16]) {
document.head.appendChild($element({
tag: 'link',
rel: 'icon',
href: `/images/icon/${size}.png`,
sizes: size + 'x' + size,
}));
}
}
function onDOMready() { function onDOMready() {
if (document.readyState != 'loading') { if (document.readyState != 'loading') {

View File

@ -1,9 +1,6 @@
<html id="stylus"> <html id="stylus">
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<link rel="icon" href="/images/icon/128.png" sizes="128x128">
<link rel="icon" href="/images/icon/32.png" sizes="32x32">
<link rel="icon" href="/images/icon/16.png" sizes="16x16">
<script src="dom.js"></script> <script src="dom.js"></script>
<script src="messaging.js"></script> <script src="messaging.js"></script>

View File

@ -3,9 +3,6 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title i18n-text="manageTitle"></title> <title i18n-text="manageTitle"></title>
<link rel="icon" href="/images/icon/128.png" sizes="128x128">
<link rel="icon" href="/images/icon/32.png" sizes="32x32">
<link rel="icon" href="/images/icon/16.png" sizes="16x16">
<link rel="stylesheet" href="manage.css"> <link rel="stylesheet" href="manage.css">
<link rel="stylesheet" href="msgbox/msgbox.css"> <link rel="stylesheet" href="msgbox/msgbox.css">

View File

@ -3,9 +3,6 @@
<head> <head>
<title i18n-text-append="optionsHeading">Stylus </title> <title i18n-text-append="optionsHeading">Stylus </title>
<link rel="stylesheet" href="index.css"> <link rel="stylesheet" href="index.css">
<link rel="icon" href="/images/icon/128.png" sizes="128x128">
<link rel="icon" href="/images/icon/32.png" sizes="32x32">
<link rel="icon" href="/images/icon/16.png" sizes="16x16">
<script src="/dom.js"></script> <script src="/dom.js"></script>
<script src="/messaging.js"></script> <script src="/messaging.js"></script>
<script src="/localization.js"></script> <script src="/localization.js"></script>