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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to