mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:19:27 +08:00
FEATURE: Enable offline browsing and fullscreen PWA in iOS by default
This commit is contained in:
parent
3f49b13e5f
commit
3053c6d95e
|
@ -1975,7 +1975,7 @@ uncategorized:
|
|||
hidden: true
|
||||
|
||||
pwa_display_browser_regex:
|
||||
default: "iPad|iPhone"
|
||||
default: "a^"
|
||||
hidden: true
|
||||
|
||||
app_association_android:
|
||||
|
|
|
@ -55,20 +55,20 @@ RSpec.describe MetadataController do
|
|||
expect(manifest["display"]).to eq("standalone")
|
||||
end
|
||||
|
||||
it 'defaults to display browser for iPhone' do
|
||||
get "/manifest.webmanifest", params: {}, headers: { 'USER-AGENT' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1' }
|
||||
manifest = JSON.parse(response.body)
|
||||
expect(manifest["display"]).to eq("browser")
|
||||
end
|
||||
|
||||
it 'can be changed to display standalone for iPhones using a site setting' do
|
||||
SiteSetting.pwa_display_browser_regex = "a^" # this never matches
|
||||
|
||||
it 'defaults to display standalone for iPhone' do
|
||||
get "/manifest.webmanifest", params: {}, headers: { 'USER-AGENT' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1' }
|
||||
manifest = JSON.parse(response.body)
|
||||
expect(manifest["display"]).to eq("standalone")
|
||||
end
|
||||
|
||||
it 'can be changed to display browser for iPhones using a site setting' do
|
||||
SiteSetting.pwa_display_browser_regex = "iPhone"
|
||||
|
||||
get "/manifest.webmanifest", params: {}, headers: { 'USER-AGENT' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1' }
|
||||
manifest = JSON.parse(response.body)
|
||||
expect(manifest["display"]).to eq("browser")
|
||||
end
|
||||
|
||||
it 'uses the short_title if it is set' do
|
||||
title = 'FooBarBaz Forum'
|
||||
SiteSetting.title = title
|
||||
|
|
Loading…
Reference in New Issue
Block a user