-
Notifications
You must be signed in to change notification settings - Fork 362
CB-11074: Ensure settings from config.xml are taken into consideration #8
Conversation
I also commented on #7. To solve this problem, instead of having to instantiate WKWebView twice here, I think we can safely move all initializing code from the initWithFrame, to pluginInitialize: cordova-plugin-wkwebview-engine/src/ios/CDVWKWebViewEngine.m Lines 50 to 64 in 33a7517
As I mentioned in #7, we still need updateWithInfo. The rest of your approach is sound. |
@shazron in that case we'd have to remove the If we can do without the I'd also rename If we just inited the WKWebView once in
Specifically this is due to the following code in
As far as I can see, the only clean solution to this would be to pass |
I'm creating failing unit tests for this first, I think we have passed the point where we can argue about the implementation, but we need objective verification: https://issues.apache.org/jira/browse/CB-11496 |
I commented on #7, updateWithInfo needs to be changed to not allow updating the WKWebViewConfiguration, because you can't update it at runtime -- I objectively verified this in the updated unit tests. In your commit -- basically we need |
Please see #13, and let's continue discussion there. |
Please provide feedback on #13, I will be pulling that in soon. |
#7 is also supposed to address this issue, but in my tests it didn't work.
This pull request presents a workaround that requires two WKWebView instances to be inited (only one is kept and used for the app though). This isn't supposed to be merged as is, it's more a proof of concept and designed to provide exposure to the workaround if others users need this fix urgently.
@shazron the logic presented in this PR would have been made more complicated via the updateWithInfo: method, which as far as I could see is unused, so I removed it for now. Other than that, what do you think about this as general direction?
As I commented in #7, the best approach for this would be to change
CDVViewController.m
to pass in the settings directly on init, or to rearrange the check logic there. That is a longer-term solution. In the meantime, maybe we can get by with the approach presented here.