Skip to content

Commit 71d5a09

Browse files
authored
Prevent Firefox from using apple-touch-icon (#10402)
* Prevent Firefox from using apple-touch-icon The opaque background does not work well in Firefox which uses the icon as a "rich icon". Prevent this by not specifying it in HTML. Real Apple devices will still request the icon on the static path. Fixes: #10394 Also adjust gitignore so app.ini.sample becomes searchable and fixed a variable name in app.ini.sample. * fix gitignore
1 parent 9ed4aee commit 71d5a09

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ coverage.all
4949

5050
/bin
5151
/dist
52-
/custom
52+
/custom/*
53+
!/custom/conf
54+
/custom/conf/*
55+
!/custom/conf/app.ini.sample
5356
/data
5457
/indexers
5558
/log

custom/conf/app.ini.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd
217217
PROTOCOL = http
218218
DOMAIN = localhost
219219
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
220-
; when STATIC_URL_PREFIX is empty it will follow APP_URL
220+
; when STATIC_URL_PREFIX is empty it will follow ROOT_URL
221221
STATIC_URL_PREFIX =
222222
; The address to listen on. Either a IPv4/IPv6 address or the path to a unix socket.
223223
HTTP_ADDR = 0.0.0.0

routers/routes/routes.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,10 @@ func RegisterRoutes(m *macaron.Macaron) {
10021002
}
10031003
})
10041004

1005+
m.Get("/apple-touch-icon.png", func(ctx *context.Context) {
1006+
ctx.Redirect(path.Join(setting.StaticURLPrefix, "img/apple-touch-icon.png"), 301)
1007+
})
1008+
10051009
// Progressive Web App
10061010
m.Get("/manifest.json", templates.JSONRenderer(), func(ctx *context.Context) {
10071011
ctx.HTML(200, "pwa/manifest_json")

templates/base/head.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
};
9797
</script>
9898
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png">
99-
<link rel="apple-touch-icon" href="{{StaticUrlPrefix}}/img/apple-touch-icon.png">
10099
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/gitea-safari.svg" color="#609926">
101100
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css">
102101
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous">

0 commit comments

Comments
 (0)