FEATURE: Use display: browser in webmanifest for iOS devices

Since iOS doesn't have a back button and can have issues on log in.

See https://twitter.com/firt/status/1021477243909033984
This commit is contained in:
Rafael dos Santos Silva 2018-08-15 23:36:08 -03:00
parent 7b412727bb
commit c8b5e6baae

View File

@ -19,10 +19,12 @@ class MetadataController < ApplicationController
end
file_info = get_file_info(logo)
display = request.user_agent =~ /iPad|iPhone/ ? 'browser' : 'standalone'
manifest = {
name: SiteSetting.title,
short_name: SiteSetting.title,
display: 'standalone',
display: display,
orientation: 'any',
start_url: Discourse.base_uri.present? ? "#{Discourse.base_uri}/" : '.',
background_color: "##{ColorScheme.hex_for_name('secondary')}",