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

This commit is contained in:
Salvatore Randazzo 2020-04-07 12:59:52 -04:00 committed by GitHub
parent fda1794035
commit 571fb8df79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

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 {