[ 
https://issues.apache.org/jira/browse/CB-10269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Andersen updated CB-10269:
--------------------------------
    Attachment: ios-wkwebview-exec.js

I've had some success working around this issue by adding this [modified 
ios-wkwebview-exec.js|^ios-wkwebview-exec.js] to 
{{merges/ios/plugins/cordova-plugin-wkwebview-engine/src/www/ios}} so that it 
replaces the one that currently ships with the plugin.  The only modification 
I've made is to check for the WKWebView before replacing the "cordova/exec" 
module:

{code}
// Temporary work around for https://issues.apache.org/jira/browse/CB-10269 
until it is fixed
   if (window.webkit && window.webkit.messageHandlers && 
window.webkit.messageHandlers.cordova && 
window.webkit.messageHandlers.cordova.postMessage) {
      // unregister the old bridge
      cordova.define.remove('cordova/exec');
      // redefine bridge to our new bridge
      cordova.define("cordova/exec", function (require, exports, module) {
         module.exports = execProxy;
      });
   }
{code}

> [iOS 8] cordova-plugin-wkwebview-engine breaks Cordova iOS 4.0.0 under iOS 8
> ----------------------------------------------------------------------------
>
>                 Key: CB-10269
>                 URL: https://issues.apache.org/jira/browse/CB-10269
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin WKWebViewEngine
>    Affects Versions: 4.0.0
>         Environment: Cordova tools 5.4.1
> Cordova iOS platform 4.0.1
> iOS Simulator 8.4
> cordova-plugin-wkwebview-engine plugin
>            Reporter: Ivan Karpan
>            Priority: Critical
>              Labels: cordova-ios-4.1.0
>         Attachments: ios-wkwebview-exec.js
>
>
> When launching on iOS 8.4 simulator the following error breaks JS execution 
> early on:
> ios-wkwebview-exec.js:127 TypeError: undefined is not an object (evaluating 
> 'window.webkit.messageHandlers')
> So inclusion of 'cordova-plugin-wkwebview-engine' plugin breaks support of 
> iOS versions previous to 9.0. I assume ios-wkwebview-exec.js should have 
> environment checks before using WKWebView bridge...
> Exclusion of the same plugin breaks the project at all. Are there any 
> fallback mechanics in place?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to