From bb6fea0bea4cf3cbc179389416bada021d73b819 Mon Sep 17 00:00:00 2001 From: Patrick Luby Date: Fri, 29 Dec 2023 11:06:18 -0500 Subject: [PATCH] Set window.savedUIState to false in iOS app When building the iOS app, the %SAVED_UI_STATE% does not get replaced with a quoted string during the build and the resulting unquoted string causes document loading to stop. Also, eliminate warnings when running in Xcode by adding missing CFBundleTypeRole entries in the iOS app's Info.plist. Signed-off-by: Patrick Luby Change-Id: Ie398955241a078be45af28e54c49387ff673870b --- browser/html/cool.html.m4 | 5 ++++- ios/Mobile/Info.plist.in | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/browser/html/cool.html.m4 b/browser/html/cool.html.m4 index a138e3677..a43ae6ce8 100644 --- a/browser/html/cool.html.m4 +++ b/browser/html/cool.html.m4 @@ -140,7 +140,10 @@ var Base64ToArrayBuffer = function(base64Str) { window.fullyLoadedAndReady = true; }, false); -window.savedUIState = %SAVED_UI_STATE%; +m4_ifelse(IOSAPP,[true], + [ window.savedUIState = false;], + [ window.savedUIState = %SAVED_UI_STATE%;]) + window.isLocalStorageAllowed = (function() { var str = 'localstorage_test'; try { diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in index 65167f51c..e31339aec 100644 --- a/ios/Mobile/Info.plist.in +++ b/ios/Mobile/Info.plist.in @@ -21,6 +21,8 @@ CFBundleTypeName OpenDocument Text + CFBundleTypeRole + Editor LSHandlerRank Owner LSItemContentTypes @@ -31,6 +33,8 @@ CFBundleTypeName OpenDocument Flat Text + CFBundleTypeRole + Editor LSHandlerRank Default LSItemContentTypes @@ -127,6 +131,8 @@ CFBundleTypeName OpenDocument Presentation + CFBundleTypeRole + Editor LSHandlerRank Owner LSItemContentTypes