Browse Source

Merge pull request #2273 from nextcloud/457

ONLYOFFICE fix iOS 16.1
Marino Faggiana 2 years ago
parent
commit
cdea7fa18e

+ 4 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -3617,7 +3617,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 4;
+				CURRENT_PROJECT_VERSION = 0;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -3641,7 +3641,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 4.5.6;
+				MARKETING_VERSION = 4.5.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "";
 				SDKROOT = iphoneos;
@@ -3680,7 +3680,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 4;
+				CURRENT_PROJECT_VERSION = 0;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -3702,7 +3702,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 4.5.6;
+				MARKETING_VERSION = 4.5.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "";
 				SDKROOT = iphoneos;

+ 5 - 1
iOSClient/Viewer/NCViewerNextcloudText/NCViewerNextcloudText.swift

@@ -52,7 +52,11 @@ class NCViewerNextcloudText: UIViewController, WKNavigationDelegate, WKScriptMes
         config.websiteDataStore = WKWebsiteDataStore.nonPersistent()
         let contentController = config.userContentController
         contentController.add(self, name: "DirectEditingMobileInterface")
-
+        //FIXME: ONLYOFFICE Due to the WK Shared Workers issue the editors cannot be opened on the devices with iOS 16.1.
+        if editor == NCGlobal.shared.editorOnlyoffice {
+            let dropSharedWorkersScript = WKUserScript(source: "delete window.SharedWorker;", injectionTime: WKUserScriptInjectionTime.atDocumentStart, forMainFrameOnly: false)
+            config.userContentController.addUserScript(dropSharedWorkersScript)
+        }
         webView = WKWebView(frame: CGRect.zero, configuration: config)
         webView.navigationDelegate = self
         view.addSubview(webView)