Browse Source

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: https://github.com/go-gitea/gitea/issues/10394

Also adjust gitignore so app.ini.sample becomes searchable and fixed a
variable name in app.ini.sample.

* fix gitignore
tags/v1.12.0-dev
silverwind GitHub 5 years ago
parent
commit
4533997d55
3 changed files with 8 additions and 2 deletions
  1. +4
    -1
      .gitignore
  2. +4
    -0
      routers/routes/routes.go
  3. +0
    -1
      templates/base/head.tmpl

+ 4
- 1
.gitignore View File

@@ -49,7 +49,10 @@ coverage.all

/bin
/dist
/custom
/custom/*
!/custom/conf
/custom/conf/*
!/custom/conf/app.ini.sample
/data
/indexers
/log


+ 4
- 0
routers/routes/routes.go View File

@@ -1002,6 +1002,10 @@ func RegisterRoutes(m *macaron.Macaron) {
}
})

m.Get("/apple-touch-icon.png", func(ctx *context.Context) {
ctx.Redirect(path.Join(setting.StaticURLPrefix, "img/apple-touch-icon.png"), 301)
})

// Progressive Web App
m.Get("/manifest.json", templates.JSONRenderer(), func(ctx *context.Context) {
ctx.HTML(200, "pwa/manifest_json")


+ 0
- 1
templates/base/head.tmpl View File

@@ -96,7 +96,6 @@
};
</script>
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png">
<link rel="apple-touch-icon" href="{{StaticUrlPrefix}}/img/apple-touch-icon.png">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/gitea-safari.svg" color="#609926">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous">


Loading…
Cancel
Save