fix(iOS): injectedJavaScriptBeforeContentLoaded now runs when messaging is not enabled (#1286)

This commit is contained in:
Salvatore Randazzo
2020-04-07 09:59:52 -07:00
committed by GitHub
parent fda1794035
commit 571fb8df79
+4 -4
View File
@@ -1245,14 +1245,14 @@ static NSDictionary* customCertificatesForHost;
name:MessageHandlerName];
[wkWebViewConfig.userContentController addUserScript:self.postMessageScript];
}
// FIXME: For a separate (minor) PR: these two shouldn't be gated by messagingEnabled; just keeping consistency with previous behaviour.
if (self.atStartScript) {
[wkWebViewConfig.userContentController addUserScript:self.atStartScript];
}
if (self.atEndScript) {
[wkWebViewConfig.userContentController addUserScript:self.atEndScript];
}
}
// Whether or not messaging is enabled, add the startup script if it exists.
if (self.atStartScript) {
[wkWebViewConfig.userContentController addUserScript:self.atStartScript];
}
}
- (NSURLRequest *)requestForSource:(id)json {