[
https://issues.apache.org/jira/browse/CB-11074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15262278#comment-15262278
]
ASF GitHub Bot commented on CB-11074:
-------------------------------------
Github user ephemer commented on the pull request:
https://github.com/apache/cordova-plugin-wkwebview-engine/pull/7#issuecomment-215453411
As I commented in the base repo, this PR doesn't do what it says it does
yet.
@shazron is it normal to change the settings after the WebView has already
been inited? When? It seems like this feature (of changing settings after init)
is creating unnecessary work for us.
My preferred approach would be to init the CDVPlugin/WebViewEngine
instance, but not the WKWebView immediately, because for that to work, we need
the commandDelegate to be set. The problem with that approach is that this
check in `CDVViewController.m` will fail, causing `self.webViewEngine` to
fallback to UIWebView:
if (!self.webViewEngine || ![self.webViewEngine
conformsToProtocol:@protocol(CDVWebViewEngineProtocol)] || ![self.webViewEngine
canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]]) {
self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass)
alloc] initWithFrame:bounds];
}
The only thing I can image that would work in the current
`CDVViewController.m` structure is that we init a WKWebView with default
options on `init`, then re-init the WKWebView in `pluginInitialize` with the
user's actual settings, because it's only then that `commandDelegate.settings`
is finally available.
> WKWebView configuration is not considered
> -----------------------------------------
>
> Key: CB-11074
> URL: https://issues.apache.org/jira/browse/CB-11074
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin WKWebViewEngine
> Environment: ios
> Reporter: Alexis Kofman
> Priority: Critical
> Labels: ios, triaged
>
> Regarding the code of WKWebView.h, WKWebViewConfiguration seems to be a
> readonly property.
> {code}
> @property (nonatomic, readonly, copy) WKWebViewConfiguration *configuration;
> {code}
> But in this plugin, we are trying to update the WKWebView configuration after
> initialising it and it looks like all this part is not considered :
> https://github.com/apache/cordova-plugin-wkwebview-engine/blob/master/src/ios/CDVWKWebViewEngine.m#L146-L150
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]