Explorar el Código

injectedJavaScriptBeforeContentLoaded should run even if messaging is not enabled

Salvatore Randazzo hace 5 años
padre
commit
4cbb8cf7dc
Se han modificado 1 ficheros con 6 adiciones y 6 borrados
  1. 6
    6
      ios/RNCWebView.m

+ 6
- 6
ios/RNCWebView.m Ver fichero

@@ -200,12 +200,12 @@ static NSDictionary* customCertificatesForHost;
200 200
 
201 201
     WKUserScript *script = [[WKUserScript alloc] initWithSource:source injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
202 202
     [wkWebViewConfig.userContentController addUserScript:script];
203
-      
204
-    if (_injectedJavaScriptBeforeContentLoaded) {
205
-      // If user has provided an injectedJavascript prop, execute it at the start of the document
206
-      WKUserScript *injectedScript = [[WKUserScript alloc] initWithSource:_injectedJavaScriptBeforeContentLoaded injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
207
-      [wkWebViewConfig.userContentController addUserScript:injectedScript];
208
-    }
203
+  }
204
+
205
+  if (_injectedJavaScriptBeforeContentLoaded) {
206
+    // If user has provided an injectedJavascript prop, execute it at the start of the document
207
+    WKUserScript *injectedScript = [[WKUserScript alloc] initWithSource:_injectedJavaScriptBeforeContentLoaded injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
208
+    [wkWebViewConfig.userContentController addUserScript:injectedScript];
209 209
   }
210 210
 
211 211
   wkWebViewConfig.allowsInlineMediaPlayback = _allowsInlineMediaPlayback;