FEATURE: Allow admins to control PWA display mode per user agent

This commit is contained in:
Rafael dos Santos Silva
2018-10-26 13:47:22 -03:00
parent fb15e04e48
commit 2450f178ca
3 changed files with 26 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class MetadataController < ApplicationController
end
file_info = get_file_info(logo)
display = request.user_agent =~ /iPad|iPhone/ ? 'browser' : 'standalone'
display = Regexp.new(SiteSetting.pwa_display_browser_regex).match(request.user_agent) ? 'browser' : 'standalone'
manifest = {
name: SiteSetting.title,