Giter Site home page Giter Site logo

apache / cordova-plugin-wkwebview-engine Goto Github PK

View Code? Open in Web Editor NEW
613.0 59.0 363.0 226 KB

[DEPRECATED] Apache Cordova wkwebview engine plugin

License: Apache License 2.0

Objective-C 82.18% JavaScript 17.82%
cordova csharp cplusplus library objective-c java nodejs javascript mobile

cordova-plugin-wkwebview-engine's Introduction

AppVeyor Travis CI
Build status Build Status

Cordova WKWebView Engine

This plugin makes Cordova use the WKWebView component instead of the default UIWebView component, and is installable only on a system with the iOS 9.0 SDK.

In iOS 9, Apple has fixed the issue present through iOS 8 where you cannot load locale files using file://, and must resort to using a local webserver. However, you are still not able to use XHR from the file:// protocol without CORS enabled on your server.

Deprecation Notice

This plugin is now deprecated as it's implementation has been moved to cordova-ios platform making this plugin redundent. When migrating to cordova-ios@6, you should remove this plugin.

This plugin should still work as is on [email protected] for the foreseeable future, however it is recommended to remove this plugin and upgrade to cordova-ios@6 or later.

Installation

This plugin needs cordova-ios 4.0.0 - 5.x. This plugin is not supported on cordova-ios >6.0.0.

To install the current release:

cordova create wkwvtest my.project.id wkwvtest
cd wkwvtest
cordova platform add ios@4
cordova plugin add cordova-plugin-wkwebview-engine

To test the development version:

cordova create wkwvtest my.project.id wkwvtest
cd wkwvtest
cordova platform add https://github.com/apache/cordova-ios.git#master
cordova plugin add https://github.com/apache/cordova-plugin-wkwebview-engine.git#master

You also must have at least Xcode 7 (iOS 9 SDK) installed. Check your Xcode version by running:

xcode-select --print-path

Required Permissions

WKWebView may not fully launch (the deviceready event may not fire) unless if the following is included in config.xml. This should already be installed by Cordova in your platform config.xml when the plugin is installed.

config.xml

<feature name="CDVWKWebViewEngine">
  <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>

<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

If using cordova-ios >= 5.1.0, it is recommended to include the following preference tag to only use the WKWebView which is a requirement for new App submissions to the AppStore:

<preference name="WKWebViewOnly" value="true" />

Notes

This plugin creates a shared WKProcessPool which ensures the cookie sharing happens correctly across WKWebView instances. CDVWKProcessPoolFactory class can be used to obtain the shared WKProcessPool instance if app creates WKWebView outside of this plugin.

On an iOS 8 system, Apache Cordova during runtime will switch to using the UIWebView engine instead of using this plugin. If you want to use WKWebView on both iOS 8 and iOS 9 platforms, you will have to resort to using a local webserver.

We have an experimental plugin that does this. You would use that plugin instead of this one.

Application Transport Security (ATS) in iOS 9

Starting with cordova-cli 5.4.0, it will support automatic conversion of the <access> tags in config.xml to Application Transport Security ATS directives.

Upgrade to at least version 5.4.0 of the cordova-cli to use this new functionality.

Enabling Navigation Gestures ("Swipe Navigation")

In order to allow swiping backwards and forwards in browser history like Safari does, you can set the following preference in your config.xml:

<preference name="AllowBackForwardNavigationGestures" value="true" />

You can also set this preference dynamically from JavaScript:

window.WkWebView.allowsBackForwardNavigationGestures(true)
window.WkWebView.allowsBackForwardNavigationGestures(false)

Disabling 3D Touch Link Previews

In order to disable preview popups when hard pressing links in iOS, you can set the following preference in your config.xml:

<preference name="Allow3DTouchLinkPreview" value="false" />

Limitations

If you are upgrading from UIWebView, please note the limitations of using WKWebView as outlined in our issue tracker.

Apple Issues

The AllowInlineMediaPlayback preference will not work because of this Apple bug. This bug has been fixed in iOS 10.

Supported Platforms

  • iOS

cordova-plugin-wkwebview-engine's People

Contributors

alsorokin avatar anandvnath avatar audreyso avatar bhariharan avatar breautek avatar ccorcos avatar cjpearson avatar dpogue avatar erisu avatar filmaj avatar fkoester avatar hector-romero avatar janpio avatar jcesarmobile avatar jonathanli2 avatar kelvinhokk avatar laidig avatar lucatorella avatar macdonst avatar machinaexphilip avatar mccraigmccraig avatar nauzer avatar nikhilkh avatar niklasmerz avatar nilsd avatar purplecabbage avatar shazron avatar stevengill avatar tabrindle avatar timbru31 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-wkwebview-engine's Issues

this class is not key value coding-compliant for the key _alwaysRunsAtForegroundPriority.

Bug Report

Problem

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x117e17320> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _alwaysRunsAtForegroundPriority.'

What is expected to happen?

app work normal

What does actually happen?

this problem cause app can't work

Information

when i run this plugin in [email protected] & [email protected]

Command or Code

run this plugin in [email protected] & [email protected]

Environment, Platform, Device

ios 12.2

Version information

cordova-plugin-wkwebview-engine @ 1.1.4
[email protected]
[email protected]

Checklist

  • [ x] I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • [ x] I included all the necessary information above

Tests failing on local (Travis, non-SauceLabs) iOS 10 device

https://travis-ci.org/apache/cordova-plugin-wkwebview-engine/jobs/547260689

** BUILD SUCCEEDED **
Deploying to simulator
Running command: /private/var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/tmp-2870cc3iyqjtQ38y/node_modules/ios-sim/bin/ios-sim launch /private/var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/tmp-2870cc3iyqjtQ38y/platforms/ios/build/emulator/HelloCordova.app --devicetypeid com.apple.CoreSimulator.SimDeviceType.iPhone-XR, 12.2 --log /private/var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/tmp-2870cc3iyqjtQ38y/platforms/ios/cordova/console.log --exit
[ios-sim] io.cordova.hellocordova: 3226
[ios-sim] logPath: /private/var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/tmp-2870cc3iyqjtQ38y/platforms/ios/cordova/console.log
Simulator successfully started via `ios-sim`.
Error: waitForConnection: Seems like device not connected to local server in 540 secs
Error: waitForConnection: Seems like device not connected to local server in 540 secs
    at Timeout.setTimeout (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:429:28)
    at ontimeout (timers.js:386:11)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)
From previous event:
    at ParamedicRunner.waitForConnection (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:426:18)
    at Q.promise (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:246:38)
    at Q.all.Q.then (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:244:38)
From previous event:
    at Q.then.then.then (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:234:25)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
From previous event:
    at ParamedicRunner.runLocalTests (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:257:14)
    at ParamedicRunner.runTests (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:345:25)
    at Q.then.then.then (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:89:29)
From previous event:
    at ParamedicRunner.run (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:75:14)
    at Object.exports.run (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:477:19)
    at Object.<anonymous> (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/main.js:184:15)

Content dimensions incorrect at startup on iPhone X

As described in this original issue #53, the document body's first child is incorrectly sized when starting the application. The issue is gone after rotating the device and back to original orientation. The body dimensions appear to be always correct though.
This only occurs on iPhone X and likes.

A fix for this issue, provided in #45, was recently reverted in #107

集成wkwebView 上以后我要把插件迁移到另一个项目中报错

- (void)createGapView
{
    CGRect webViewBounds = self.view.bounds;

    webViewBounds.origin = self.view.bounds.origin;
    
    UIView *view  = [self newCordovaViewWithFrame:webViewBounds];
    
    if ([view isKindOfClass:[WKWebView class]]) {
      //  self.webView = (WKWebView*)view;
    }
    
    
    
    self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
    
    [self.view addSubview:self.webView];
    [self.view sendSubviewToBack:self.webView];
}

        self.webView = (WKWebView*)view;这句代码一直崩溃,*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DOTabMenuViewController setWebView:]: unrecognized selector sent to instance 0x104c205d0'

Missing keywords for integrating with plugin search

Bug Report

Problem

Missing keywords "ecosystem:cordova" in package.json. This plugin cannot be searched out on Cordova Plugin Search: https://cordova.apache.org/plugins/?q=cordova-plugin-wkwebview-engine&platforms=cordova-ios

What is expected to happen?

Open the url: https://cordova.apache.org/plugins/?q=cordova-plugin-wkwebview-engine&platforms=cordova-ios
The plugin "cordova-plugin-wkwebview-engine" should be found.

What does actually happen?

Cordova Plugin Search cannot find this plugin.

Information

According to Cordova documentation: https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html#integrating-with-plugin-search
The keywords "ecosystem:cordova" is required for integrating with Plugin Search.

Command or Code

Environment, Platform, Device

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

input with value will auto focus in wkwebview

when i change uiwebview to wkwebview, if input which has value in the page, it will auto focus when i go this page.
(if input which has no value , it don't auto focus) this is what i hope.
so i don't want it auto focus, how could solve this problem?

Getting Duplicate Symbol Error

I installed the plugin on my ionic 4 but when i try to build ios i got following errors:

Please helP

❌ duplicate symbol OBJC_IVAR$_CDVWKWebViewEngine._engineWebView in

CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7d6602b988850a64ca207ba0ff58e01cc.o
CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7944c6edd8caffceca19e29d2ab11634d.o

❌ duplicate symbol OBJC_IVAR$_CDVWKWeakScriptMessageHandler._scriptMessageHandler in

CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7d6602b988850a64ca207ba0ff58e01cc.o
CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7944c6edd8caffceca19e29d2ab11634d.o

❌ duplicate symbol OBJC_IVAR$_CDVWKWebViewEngine._weakScriptMessageHandler in

CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7d6602b988850a64ca207ba0ff58e01cc.o
CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7944c6edd8caffceca19e29d2ab11634d.o

❌ duplicate symbol OBJC_CLASS$_CDVWKWeakScriptMessageHandler in

CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7d6602b988850a64ca207ba0ff58e01cc.o
CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7944c6edd8caffceca19e29d2ab11634d.o

❌ duplicate symbol OBJC_METACLASS$_CDVWKWeakScriptMessageHandler in

CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7d6602b988850a64ca207ba0ff58e01cc.o
CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7944c6edd8caffceca19e29d2ab11634d.o

❌ duplicate symbol OBJC_CLASS$_CDVWKWebViewEngine in

CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7d6602b988850a64ca207ba0ff58e01cc.o
CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7d6602b988850a64ca207ba0ff58e01cc.o

❌ duplicate symbol OBJC_METACLASS$_CDVWKWebViewEngine in

CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7d6602b988850a64ca207ba0ff58e01cc.o
CDVWKWebViewEngine-07751f6d526f52a1b46a4e7e94d910b7944c6edd8caffceca19e29d2ab11634d.o

❌ duplicate symbol OBJC_CLASS$_CDVWKWebViewUIDelegate in

CDVWKWebViewUIDelegate-07751f6d526f52a1b46a4e7e94d910b72bbdb68849c7d95efb2ad1d736bf81ed.o
CDVWKWebViewUIDelegate-07751f6d526f52a1b46a4e7e94d910b7cc254382ae625c2ac87481a8eadc30a9.o

❌ duplicate symbol OBJC_METACLASS$_CDVWKWebViewUIDelegate in

CDVWKWebViewUIDelegate-07751f6d526f52a1b46a4e7e94d910b72bbdb68849c7d95efb2ad1d736bf81ed.o
CDVWKWebViewUIDelegate-07751f6d526f52a1b46a4e7e94d910b7cc254382ae625c2ac87481a8eadc30a9.o

❌ duplicate symbol OBJC_IVAR$_CDVWKWebViewUIDelegate._title in

CDVWKWebViewUIDelegate-07751f6d526f52a1b46a4e7e94d910b72bbdb68849c7d95efb2ad1d736bf81ed.o
CDVWKWebViewUIDelegate-07751f6d526f52a1b46a4e7e94d910b7cc254382ae625c2ac87481a8eadc30a9.o

❌ duplicate symbol OBJC_METACLASS$_CDVWKProcessPoolFactory in

CDVWKProcessPoolFactory-07751f6d526f52a1b46a4e7e94d910b725bb3f9e3183e9148a0fb89c1412e903.o
CDVWKProcessPoolFactory-07751f6d526f52a1b46a4e7e94d910b7db0f0d90d4b9a9a62b2f859d1dadf899.o

❌ duplicate symbol OBJC_IVAR$_CDVWKProcessPoolFactory._sharedPool in

CDVWKProcessPoolFactory-07751f6d526f52a1b46a4e7e94d910b7db0f0d90d4b9a9a62b2f859d1dadf899.o
CDVWKProcessPoolFactory-07751f6d526f52a1b46a4e7e94d910b725bb3f9e3183e9148a0fb89c1412e903.o

❌ ld: 14 duplicate symbols for architecture arm64

❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)

WKWebView doesn't react on clicks (iframe) while UIWebView does - iOS

Issue Type

  • Bug Report
  • Feature Request
  • Support Question

Description

WKWebView doesn't react on clicks (iframe) while UIWebView does
Similar question:
https://stackoverflow.com/questions/51175746/wkwebview-doesnt-react-on-clicks-while-uiwebview-does?answertab=oldest#tab-top

Information

Steps to reproduce:

  1. Create new cordova project
  2. Test it on UIWebView - It's working
  3. Test it on WKWebView - not working

Command or Code

cordova create hello com.example.hello HelloWorld
cd HelloWorld
cordova platform add ios

Open project in Xcode and change receivedEvent: function from index.html file accordingly
(Just adding simple DFP add - js api)

receivedEvent: function(id) {
                googletag.cmd.push(function() {
			googletag.defineSlot('/271507443/patuljak-aplikacija-b2', 
			[300, 250],
			'here').addService(googletag.pubads()).setCollapseEmptyDiv(true);
			
			googletag.pubads().enableSingleRequest();
			googletag.enableServices();
			googletag.display('here');
		});
}

create empty div in body of index.html file

<div id="here"></div>

Add to head of index.html file

<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
  <script>
  	var googletag = googletag || {};
  	googletag.cmd = googletag.cmd || [];
  </script>

Run project in xcode... Everything should be running fine in UIWebView.

Now, add WKWebView plugin

cordova plugin add cordova-plugin-wkwebview-engine

After successful installation, you should have, inside config.xml file:

<feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> 

Run project again, it is not possible to click on add in WKWebView

If wkwebview plugin removed everything works fine again.
Working OK in browser too.

Environment, Platform, Device

Version information

  • 9.0.0 ([email protected])
  • Mac OS High Sierra 10.13.6 (17G65)
  • Xcode Version 10.1 (10B61)
  • iPhone XS, iPhone 5SE, iPhone 6S

Checklist

  • I searched for already existing GitHub issues about this
  • I updated all Cordova tooling to their most recent version
  • I included all the necessary information above

Cannot load `file://` html templates

My apps loads html files as templates. I needed to add the below in order for this to work.

[configuration.preferences setValue:@YES forKey:@"allowFileAccessFromFileURLs"];

Is there any better solution than patching the plugin? Thanks

Getting white screen(IOS App) after using the app for around 5 minutes.

Bug Report

When we are navigating(routing) between the pages continuously , suddenly we are getting white screen.

Problem

Getting white screen
Console Error from x-code : Error Route: InvalidStateError: The object is in an invalid state.

What is expected to happen?

When we click on the any button which is suppose to redirect to other page, It is showing whitescreen instead of the actual page it should navigate(show).

What does actually happen?

Got white screen while navigating inside the app.

Information

Command or Code

Environment, Platform, Device

IOS, Mobile App, Iphone 6s

Version information

We are generating the build from build.phonegap.com

Here is config which we are using :

<plugin name="cordova-plugin-wkwebview-engine"/>
<plugin name="cordova-plugin-wkwebviewxhrfix" spec="https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix" />
<feature name="CDVWKWebViewEngine">
      <param name="ios-package" value="CDVWKWebViewEngine" />
 </feature>
 <access origin="http://localhost:8080/*" />
 <allow-navigation href="http://localhost:8080/*" />
 <allow-navigation href="*" />
 <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
 <preference name="ScrollEnabled" value="true" />

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Calling focus() on a read only input shows unwanted input accessory view bar

Bug Report

Problem

When calling focus() on a read only input element in its touchstart handler, an unwanted inputAccessoryView(prev, next and done bar) is shown at bottom of the screen. This happens only in wkwebview and works fine with UIWebview.

What is expected to happen?

inputAccessoryView or native keyboard should not be shown on calling element.focus() on a read only input element

What does actually happen?

inputAccessoryView is shown on focusing on an read only input element

inputAccessoryView_2

Command or Code

Steps to reproduce the issue:

Create a basic cordova ios app using the below link:
https://cordova.apache.org/docs/en/latest/guide/cli/

Install wkwebview as described in "Installation" section in the below link:
https://github.com/apache/cordova-plugin-wkwebview-engine

Add a readonly input field in the body:
<input id="tstInput" type="text" value = "text here" readonly/>

Add touch start event handler for readonly input inside onDeviceReady function:

function tstInput_onTouchStart(event) {
        event.preventDefault();
        var input = event.target;
        input.focus();
        input.select();
      }
      
      document.getElementById('tstInput').addEventListener('touchstart', tstInput_onTouchStart, false);

Environment, Platform, Device

iPhone

Version information

iOS: 12.1.1
Cordova: 8.1.2

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Layout issue since moving from 1.1.4 to 1.2.0

Bug Report

Problem

What is expected to happen?

On 1.1.4 when opening my Cordova/PhoneGap app on an iPad running iOS 12.3.1 the status bar is correctly displayed where its height is enough to show the clock, date, battery percentage, etc as it should.

What does actually happen?

Since moving to 1.2.0 when opening my Cordova/PhoneGap app, the status bar is incorrectly displayed with a height almost double what it should be.

comparison

Information

  • I believe this code may be the culprit: 81eeade
    • CB-13987: (ios) Fix WKWebView doesn't layout properly at launch on iPhone X
  • Can applying this new setting be overwritten?
  • What about an iPad running iOS 11 or greater that doesn't require this iPhone X display change?

Command or Code

N/A

Environment, Platform, Device

iPad running iOS 12.3.1

Version information

<plugin name="cordova-plugin-statusbar" spec="^2.4.3"/>
<plugin name="cordova-plugin-wkwebview-engine" spec="^1.2.0"/>

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Calling history.go(-3) goes back only one time

Bug Report

Problem

On iOS devices we have page A -> page B -> page C -> page D, and in the page D we are calling history.go(-3).

What is expected to happen?

go back to the page A

What does actually happen?

go back to the page C.

And the same js code works perfect on Android devices.

Information

Command or Code

Environment, Platform, Device

Platform: iOS, xcode 10.2.1

Device: iPhone simulator or the real iPhone, iOS 12.2

Version information

cordova: 8.0.0
cordova-ios: 4.5.4
cordova-plugin-wkwebview-engine: 1.1.4
iOS: 12.2
xcode: 10.2.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Layout abnormal under iPhone X+

Description

After installing and using this plug-in, there is an abnormal phenomenon in iPhone X; The bottom tab will move up.

IPhone 6,7,8 is Normal.

Config

<feature name="CDVWKWebViewEngine">
      <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

(iOS) Infinite Loop when a "NSURLErrorCancelled -999" is received on didFailLoadWithError

Bug Report

Basically identical to the issue described in apache/cordova-ios#334, but for WKWebView.

If you cancel navigation in shouldOverrideLoadWithRequest in a plugin, and then do [webViewEngine loadRequest...] to load something else, if you get the timing just right, it will go into an infinite loop in didFailNavigation.

Problem

Infinite loop in didFailNavigation.

What is expected to happen?

Should not infinite loop.

What does actually happen?

Infinite loop with failed loads of the error URL.

Information

PR should be forthcoming that basically copies this apache/cordova-ios#334. I'll link it to this when I submit it.

Command or Code

As described. It seemed to depend a bit on timing, so I can't easily provide a code sample that consistently replicated the issue.

Environment, Platform, Device

Various different iOS devices and simulators.

Version information

cordova-plugin-wkwebview-engine - 1.1.4

Checklist

  • [ x ] I searched for existing GitHub issues
  • [ x ] I updated all Cordova tooling to most recent version
  • [ x ] I included all the necessary information above

Tests failing on iOS 12.2

https://travis-ci.org/apache/cordova-plugin-wkwebview-engine/jobs/547260692

cordova-paramedic: Tests failed to complete; ending appium session. The error is:
Error: [context("WEBVIEW_4435.2")] Error response status: 13, UnknownError - An unknown server-side error occurred while processing the command. Selenium error: An unknown server-side error occurred while processing the command. Original error: Remote debugger error with code '-32601': 'Page' domain was not found
    at exports.newError (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/node_modules/wd/lib/utils.js:152:13)
    at /Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/node_modules/wd/lib/callbacks.js:36:19
    at /Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/node_modules/wd/lib/webdriver.js:194:5
    at Request._callback (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/node_modules/wd/lib/http-utils.js:89:7)
    at Request.self.callback (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/node_modules/request/request.js:185:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/node_modules/request/request.js:1161:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
From previous event:
    at ParamedicSauceLabs.runSauceTests (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/ParamedicSauceLabs.js:459:14)
    at ParamedicRunner.runTests (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:337:58)
    at Q.then.then.then (/Users/travis/.nvm/versions/node/v6.17.1/lib/node_modules/cordova-paramedic/lib/paramedic.js:89:29)

Unclear what is happening.

WKWebview Won't Load

I receive the following error when I have wk webview installed:

Failed to load resource: file:///var/containers/Bundle/Application/39F29CF9-4A2F-4A20-A296-0CAE487974B3/my.app/www/plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview.js The requested URL was not found on this server.

Failed to load resource: file:///var/containers/Bundle/Application/39F29CF9-4A2F-4A20-A296-0CAE487974B3/my.app/www/plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview-exec.js The requested URL was not found on this server.

Error: Module cordova-plugin-wkwebview-engine.ios-wkwebview-exec does not exist.

I have the following in my config.xml

<feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

I noticed when I run cordova build ios, the 2 js files in the plugins folder get created, then deleted. Not sure why. Every other plugin is working fine.

White Screen with WKSuspendInBackground set to false

In short, the app is showing a white overlay when brought to foreground from background.

Our users are complaining about seeing the app in all white. The below steps are the only way I was able to recreate the issue. Please note that users observed this issue even without opening any external window from app as suggested in the below steps. These steps are to easily recreate the issue so that we can think of a fix.

Steps to recreate:

  1. Launch the app
  2. Open any external window from app. For eg: inAppbrowser or open a pdf using documentViewer/file2 plugins
  3. Put the app in background
  4. Wait for iOS to send a suspend signal
  5. Relaunch the app. Up on dismissing the external window (for example clicking on Done button) you will see the white overlay screen on the app.

Exact recreation steps in a Video: (The phone you are seeing on the left in this video is a real device)
You can skip the video from 30 seconds to 3 minutes to save some of your valuable time :)
https://youtu.be/gryhObPDDfA
At the end of the Video observe how Chrome inspect can actually see the screen and all the html entities are in place!

Here is a sample git repository that is helpful: (This is ionic tabs starter + cordova documentViewer, fileTransfer plugins + WKSuspendInBackground set to false)
https://github.com/write2sv/whitescreen_issue_ionic

My Ionic Info:
Ionic:

ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.1 ([email protected])
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 7 otherplugins)

System:

Android SDK Tools : 26.1.1 (/Users/shaggy/Library/Android/sdk)
ios-deploy : 1.9.2
ios-sim : 5.0.13
NodeJS : v8.4.0 (/usr/local/bin/node)
npm : 3.10.8
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000

I hope some one can help me figure out where the issue is.

not working with jQuery Mobile

Seeing Apple is deprecating the default webview and moving to wkwebview I'm trying to implement this plugin in my project. I'm using jQuery Mobile with Phonegap Build and when the plugin is included in my project, links won't open and all show "Error loading page".

Any idea how to fix this?

WKwebview cannot load resources outside of app directory

Hello

I know this might not be the proper place because it may purely be a WKwebview bug, anyway if anyone has experienced this issue, knows about a possible work-around, or can point me to a more appropriate support I will be interested. Thanks.

(originally posted on stack-overflow)

As UIWebview is now deprecated we started to use the WKwebview. We added cordova-plugin-wkwebview-engine as described here: https://cordova.apache.org/news/2018/08/01/future-cordova-ios-webview.html (and also cordova-plugin-wkwebview-file-xhr)

1 - First, our app is built and shipped including assets (icons, images, etc) whose path looks like:
file:///var/containers/Bundle/Application/[APP_ID]/[APP_NAME]/www/files/project/home/iconA.svg

These assets are correctly displayed.

2 - Then on startup the app also checks with our backend if there is any update available. If some assets have been updated, then the app downloads them in the data directory. The path to the above asset becomes:
file:///var/mobile/Containers/Data/Application/[APP_ID]/Library/NoCloud//V1/files/project/home/iconA.svg

...but these assets are not displayed.

NB1: In both cases, the resource is declared in a background-image css property.
NB2: We've been using this process for years with success with the former UIwebview.

In the network panel of Safari's web inspector, the resource appears in red, with a red message indicating that an error occurred while trying to load it. There is no error code, nothing technical to help, no more specific than this fuzzy message...

I ran some tests and it appears that the resource is present on the file system at the given path. (Using cordova-plugin-file I can output the svg content).

So, first conclusion would be that the WKwebview cannot access resources outside of app directory? As anyone any information, experience to share?

Any help would be greatly appreaciated.

Cookies are not set/stored in iOS

Since we upgraded from the old UIWebView engine, we are not able to authenticate our users (using an external auth service), as none of the cookies sent by the APIs are being set in the this web view.

This is a major blocker for us and have been trying to determine what a good course of action is. If our assumptions are correct that cookies are not supported with this web view (which is very strange), we are going to try:

  • Proxy (not sure if you recommend a good plugin for this)
  • Native fetch (not sure if you recommend a good plugin for this)

Our stack:

  • Cordova
  • React
  • Fetch for calls

Why WKWebView has 20pt offset?

Bug Report

Problem

What is expected to happen?

Hi, I am using cordova for my iOS app. Why WKWebView has 20pt offset?

What does actually happen?

wkwebview-20px

Information

WKWebView: 0x10a043a00; frame = (0 0; 375 667)
WKContentView: 0x10a044000; frame = (0 0; 375 647)
667 - 647 = 20

Command or Code

Environment, Platform, Device

iPhone 6 Plus iOS 12.1

Version information

{
"dependencies": {
        "code-push": "^2.0.6",
        "cordova-android": "^7.1.4",
        "cordova-ios": "^4.5.5",
        "cordova-plugin-add-swift-support": "^1.7.2",
        "cordova-plugin-camera": "^4.0.3",
        "cordova-plugin-code-push": "^1.11.17",
        "cordova-plugin-compat": "^1.2.0",
        "cordova-plugin-device": "^2.0.2",
        "cordova-plugin-dialogs": "^2.0.1",
        "cordova-plugin-file": "^4.3.3",
        "cordova-plugin-file-transfer": "^1.6.3",
        "cordova-plugin-jcore": "^1.2.7",
        "cordova-plugin-qrscanner": "^2.6.0",
        "cordova-plugin-splashscreen": "^5.0.2",
        "cordova-plugin-whitelist": "^1.3.3",
        "cordova-plugin-wkwebview-engine": "^1.1.4",
        "cordova-plugin-zip": "^3.1.0",
        "cordova-sms-plugin": "^0.1.13",
        "jpush-phonegap-plugin": "^3.6.3"
    },
    "cordova": {
        "plugins": {
            "cordova-plugin-camera": {},
            "cordova-plugin-whitelist": {},
            "cordova-plugin-qrscanner": {},
            "cordova-sms-plugin": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-wkwebview-engine": {},
            "cordova-plugin-code-push": {},
            "cordova-plugin-file": {},
            "cordova-plugin-file-transfer": {},
            "cordova-plugin-zip": {},
            "jpush-phonegap-plugin": {
                "APP_KEY": "516c01129ec34e64ec5e462d",
                "CHANNEL": "developer-default"
            }
        },
        "platforms": [
            "android",
            "ios"
        ]
    }
}

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

NSInvalidArgumentException on startup

Hi Everyone,

I've just added this plugin to my project, and believe I have everything configured correctly, but I'm getting this error on startup:

2019-04-11 10:01:35.137283+0200 hileadzz[9463:11123455] [DYMTLInitPlatform] platform initialization successful
2019-04-11 10:01:35.246345+0200 hileadzz[9463:11123318] Apache Cordova native platform version 4.5.5 is starting.
2019-04-11 10:01:35.247113+0200 hileadzz[9463:11123318] Multi-tasking -> Device: YES, App: YES
2019-04-11 10:01:35.252567+0200 hileadzz[9463:11123318] -[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x2820c8400
2019-04-11 10:01:35.253295+0200 hileadzz[9463:11123318] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x2820c8400'
*** First throw call stack:
(0x1ea355ea4 0x1e9525a50 0x1ea26eb14 0x1ea35b7bc 0x1ea35d46c 0x102804980 0x1026d6dc8 0x216f2d890 0x216f2dcc0 0x21752c128 0x21752c6d0 0x21753d6d8 0x10280915c 0x1026d6ae4 0x2174ebca0 0x2174ed408 0x2174f2e54 0x216d8e93c 0x216d975bc 0x216d8e5b8 0x216d8ef58 0x216d8d058 0x216d8cd04 0x216d91ec4 0x216d92e24 0x216d91d7c 0x216d96c68 0x2174f134c 0x2170dc244 0x1ecd8c9d4 0x1ecd9779c 0x1ecd96e94 0x1034e4dc8 0x1034e8a10 0x1ecdcba9c 0x1ecdcb728 0x1ecdcbd44 0x1ea2e60e0 0x1ea2e6060 0x1ea2e5944 0x1ea2e0810 0x1ea2e00e0 0x1ec559584 0x2174f4c00 0x1026d69dc 0x1e9d9ebb4)
libc++abi.dylib: terminating with uncaught exception of type NSException

Any ideas?

My setup:

I have these in my config.xml:

<plugin name="cordova-plugin-wkwebview-engine" spec="^1.1.4" />
<feature name="CDVWKWebViewEngine"> 
<param name="ios-package" value="CDVWKWebViewEngine" /> 
</feature> 
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

And the following environment:

Plugin: 1.1.4
Cordova: 8.1.2 ([email protected])
Xcode: 10.1
iOS 12.1.4

Unknown limitation of Canvas.toDataUrl()

Bug Report

Problem

I'm developing a function that users can edit images via canvas tag, and save the edited image from canvas to their phone persistent storage.

I use canvas.toDataUrl() to turn the canvas data into base64, and use the plugin cordova-save-image-gallery to save the base64 string to phone persistent storage .

What is expected to happen?

I can turn the canvas data into base64 via canvas.toDataUrl() successfully, and get the correct base64 string.

What does actually happen?

When I use a 600 * 772 png, of 42kb size, canvas.toDataUrl() THROW AN ERROR and provide NO error detail.

When I use a 64 * 48 png, of 2.61kb size, canvas.toDataUrl() RUNS SUCCESSFULLY.

When I use a 600 * 772 png, of 42kb size, and REMOVE THIS PLUGIN, canvas.toDataUrl() RUNS SUCCESSFULLY, too.

Information

Command or Code

const imageDraw = document.getElementById('canvasContain');
if (imageDraw) {

  let imgURI = imageDraw.toDataURL('image/png');// throw error

  console.log('img uri: ');
  console.log(imgURI);
}

Environment, Platform, Device

Platform: iOS, xcode 10.2.1

Device: iPhone simulator or the real iPhone, iOS 12.2

Version information

cordova: 8.0.0
cordova-ios: 4.5.4
cordova-plugin-wkwebview-engine: 1.1.4
iOS: 12.2
xcode: 10.2.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

window.open won't work

I'm not sure why but as soon as I install this plugin window.open(url, '_blank') and without _blank stops worknig.

I have this in my config.xml

    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-navigation href="*" />

It works without the wkwebview plugin.

Related open issue on apache issue tracker.

Selectively enable back OR forward navigation gestures?

There are scenarios where pages may want to allow a forward navigation gesture whilst disabling back, for example, in an app with multiple top-level routes:

- Top-level-route-1 (forward only)
  - Sub route 1 (back or forward)
    - Sub route 2 (back or forward)
- Top-level-route-2 (forward only)
  - Sub route 3 (back or forward)
    - Sub route 4 (back or forward)

In an app with multiple top-level routes, the current behaviour allows swiping back to navigate between top level routes - IMO this breaks the logical organisation of routes in the application structure where top-level routes are independent. additionally, I believe that this could cause confusion for users as it breaks the usual iOS app expectations.

tldr; The current AllowBackForwardNavigationGestures creates a behaviour which is more like a website than an app. Improving the configuration to enable forward whilst disabling back (or vice versa) allows for more 'app-like' navigation and is a step away from the uncanny valley of Cordova apps.

Issue waking app and running JS in background from VOIP notification

I have an app the requires silent notifications and it seems impossible to do this as of now with wkwebview and I am curious if it will ever be. With WkWebview, it seems that starting an app from a killed state does not work. Will this ever be available? Or is this an inherent issue with WkWebview needing to run on the main UI thread? If that is the issue, will it be possible for there to be a JSContext bridge that allows loading all the plugins JS apis to be made available "headless" with a custom file that can be declared for handling logic.

Everything works great with UiWebView, my app properly starts in the background if not already running and successfully loads the view and runs any javascript necessary. But I cant use UiWebView because of performance issues when there are multiple videos on a page in my app.

WKWebView - app over statusbar

iPhone 6S iOS 12
schermata 2019-01-13 alle 19 19 41
iPhone XS iOS 12
schermata 2019-01-13 alle 22 35 30

I'm using cordova-plugin-wkwebview-engine development version and jQuery Mobile.
The app header remains above the status bar, I tried to use the statusbar plugin with overlaysWebView(false) but this seems to be developed for UIWebView.

When imposed the status bar starts correctly, then if I open an external link, or exit the app without closing it, it seems to lose the setting and overlaps. This also happens with iOS 9 and 11. iOS 10 I have not tested it.

Should I wait for the plugin plugin-plugin-statusbar update to fix this?

cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-labs-wkwebview-engine-localhost 0.5.1 "Cordova WKWebView Engine with http server (localhost) support"
cordova-labs-local-webserver 2.4.0 "CordovaLocalWebServer"
cordova-plugin-wkwebview-engine 1.1.5-dev "Cordova WKWebView Engine"

Solution: the problem was caused by the plugin cordova-plugin-admob-free

iphone x

on iphone X viewport is set to 354x724 instead of 375x812
css rules fail to determine it's iphone x
when AdMob.showBanner is called viewport switches to correct values

Two versions of localStorate

Just leaving this here for anyone using this plugin and having issues with localStorage not being consistent between page navigations (location.href changes). We were having this issue for quite a while in our app and as a workaround (hack) opted in to save entire localStorage to sqlite and restore from it when the next page loads. There might be already a ticket for the issue on the issue tracker and possibly a solution how to avoid this condition but on a quick search I could not find one there.

I tested the case in isolation on a simple cordova (HelloWorld app) and was able to recreate the problem on and iOS 9.3, iOS 10.2 but not on iOS 12.

iOS 12 and playing media fullscreen in WKWebView causes crash

I am having a crashing issue in my iOS Cordova app that happens after going fullscreen in a video a couple times, much like these issues:
apache/cordova-plugin-inappbrowser#298
youtube/youtube-ios-player-helper#322

I was hoping that by using WKWebView that the crashing issue I am experiencing in my app would be fixed, but it still persists, although it seems that WKWebView is somewhat more resilient and handles the crash more gracefully. XCode at least is now providing a response:

wkwebview-issue2
wkwebview-issue

I know this is not a direct issue with the plugin, but is anyone else experiencing this problem or have work arounds? Is this a bug in iOS 12?

WKWebView does not update document.cookie

Bug Report

Problem

I have an iOS Cordova application where I need to intercept requests. I have extended CDVWKWebViewEngine to set a custom scheme handler

- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings{
    WKWebViewConfiguration *configuration = [super createConfigurationFromSettings:settings];
    
    [configuration setURLSchemeHandler:self forURLScheme:@"myapp"];
    
    return configuration;
}

My Cordova app loads using that scheme in order to intercept the first (and following) requests. I have the following in my config.xml file

<content src="myapp://host.domain.com/app/" />
<allow-navigation href="myapp://*/*" />

After intercepting and the request in startURLSchemeTask, I massage the request as required, replace myapp with https and send it using NSURLSessionDataTask.

Upon receiving the response I just pass it on to the WKWebView. When a response contains a Set-Cookie header I expect the cookie to be set by the WKWebView.

Example cookie header:
Set-Cookie: foo=bar; Domain=host.domain.com; Path=/

However the Safari inspector shows no cookie and document.cookie is always empty.

What is expected to happen?

The cookie is set by WKWebView shows in Safari inspector and it can be accessed through document.cookie.

What does actually happen?

The cookie is not shown in Safari inspector and document.cookie returns empty. In fact just trying to do document.cookie="name=value" directly in the Safari inspector does nothing -- document.cookie still returns "".

Information

The Set-Cookie header is present in the response that is passed onto the WKWebView.
Screenshot 2019-06-19 at 16 43 14

Command or Code

  1. Load the app using a custom scheme (e.g. myscheme).

  2. Attach and open the Safari inspector and validate window.origin starts with mycheme://... and that document.domain is correct (host.domain.com in my example)

  3. Perform a XHR request to a myscheme://url that returns a cookie like in the example above. Intercept the request, change the scheme to https, send it using NSURLSessionDataTask and return the response to WKWebView.

  4. In Safari inspector check the request & response presence in the Network tab

  5. Open Storage tab and validate the cookie returned in the header is missing

  6. Type document.cookie in console and it will return ""

  7. Optional: type document.cookie="foo=bar" and validate it remains empty

Environment, Platform, Device

iPhone device or simulator -- happens anywhere.

Version information

cordova-cli 9.0.0
cordova-ios 4.5.5
Xcode 10.2.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Scroll to top for bottom TextField not working.

Hi,
I had tried this plugin for one of my Project.
It is working well but one of issue that I am getting is when my Input element is at bottom, My page isn't scroll it up.
Anybody with same issue?
It'll be great if I can any have solution or help of it.

Does this plugin still work?

I've added this plugin to my Cordova project for iOS, but it seems to have no effect. Is it it still working with the latest iOS version/Xcode, etc?

I have verified that the plugin in installed in my config.xml file:

<plugin name="cordova-plugin-wkwebview-engine" spec="^1.1.4" />

And also that these directives are installed:

<feature name="CDVWKWebViewEngine"> <param name="ios-package" value="CDVWKWebViewEngine" /> </feature> <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

But, when I recompile and install on my iPhone 6s, I get this in the log:

Using UIWebView

Any ideas?

This is my setup:

Plugin: 1.1.4
Cordova: 8.1.2 ([email protected])
Xcode: 10.1
iOS 12.1.4

Could not signal service com.apple.WebKit.WebContent in ios 11.4.1

I used meteor and debug in ios 11.4.1. Something is error. The application is white page in device. I think we have problem in webview. Please help me.

2018-09-13 17:41:09.912442+0700 IDLdev[1236:301325] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service 2018-09-13 17:41:09.913603+0700 IDLdev[1236:301325] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service

iPhone X initial height issue

I'm experiencing an issue where the height is incorrect on launch, but is corrected when I rotate the screen to landscape and back to portrait.
img_1574

Purpose of window.WkWebView.allowsBackForwardNavigationGestures() (or bug?)

Related to #51

What is the intended purpose of window.WkWebView.allowsBackForwardNavigationGestures()?

1 - To programatically enable back/forward navigation for the app per session
2 - To programatically enable back/forward on a per-page basis

If it is indeed 2 (which I initially believed, but I now doubt...) it seems the there is a bug:

  • On app entry point page AllowBackForwardNavigationGestures = false
  • Navigate to some sub route
    • Route triggers window.WkWebView.allowsBackForwardNavigationGestures(true)
    • user can perform swipe navigation to go back... BUT
      • The page the user swipes back to is white/empty/blank....

So I'm assuming that the purpose of this feature is 1 (above), probably only tracks history when enabled and because it's enabled after a page navigation occurs there's no history of the previous page?

Autofill not working correctly

Bug Report

I'm not 100% sure if this is a bug with the cordova plugin, the WKWebView itself, or just cordova in general, but I think it makes the most sense to report here.

Problem

On iOS (12.1.4), using the default keychain password manager, when I hit the login page for a hosted web app, I am prompted to login with a stored password. I click the suggest password from the keyboard, and nothing happens - the fields are not filled in. If however I click the key icon, and choose a username/password from the list, these are indeed filled in on the page.

If I change to a different password manager - such as 1password - the problem goes away.

if I try logging in to the hosted web app "normally" in safari on my mobile instead, it works correctly there too.

Version information

I'm on the latest WKWebView plugin. (1.1.4). I'm on 4.5.5 of the cordova-ios platform, but I have also tried upgrading to 5.0.0, which doesn't make any difference.
Cordova version 8.0.0

Checklist

  • [x ] I searched for existing GitHub issues
  • [x ] I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above

When closing keyboard, content doesn't scroll back leaving ehite space in place of keyboard

Hi, this issue started with latest osx/xcode updates, nothing changed in code, and exactly same code and cordova/wkwebivew version worked fine a month ago. Now building the same code gives following issue, it is also described here:

https://forum.mendixcloud.com/link/questions/91916

Removing wkwebview fixes this issue

(I am not using any custom keyboard plugins)

Screenshots:
img_0019

img_0017

img_0018

Here's a video of this happening:

https://drive.google.com/file/d/1PXkIu2Q5b0GDSrzKyrm_okyg2ciCVewK/view?usp=sharing

Canvas gets tainted when drawn with an image using the custom scheme

Details:
We are migrating from UIWebview to wkWebview for iOS, we got in to problem where Canvas gets tainted when loaded with an image using the custom scheme

Problem
For iOS, we are using setURLSchemeHandler to load the resources from Library folder. Resources (images, videos, pdfs etc) are loaded fine after doing necessary additions to meta tag to allow the new custom scheme being used. How ever canvas is getting tainted when we draw the image using the custom scheme and throws security CORS error when tried to get the canvas data using toDataURL.

I see error message "SecurityError: The operation is insecure." on call to toDataURL in console.

I know wkwebview is having issues( or strict) with CORS but as per document (https://cordova.apache.org/docs/en/latest/guide/appdev/whitelist/) this issue should not occur even for Canvas with access origin='*' setting and custom scheme file loading, when its working fine for other elements.

Note: toDataURL works fine when Image element being drawn is set with base64 data instead of url with custom scheme

Environment:
iPad pro with iOS 12.1.3
cordova-plugin-wkwebview-engine : 1.1.4

Is this a bug in the cordova-plugin-wkwebview-engine?

How to verify this plugin is working as expected?

I'm wanting to experiment with this plugin to test performance metrics. That being said, how can I verify that it, indeed, is installed and delivering our application with the latest WKWebView engine?

Keyboard not showing on focus for IOS 12.2

Bug Report

Problem

Whit the new release of IOS 12.2 there seems to be an issue when focusing, the keyboard does not seem to show.

Here is a link to stackoverflow question regarding this problem:

What is expected to happen?

Keyboard should show when focusing an element. ie:

document.querySelector('input').focus()

What does actually happen?

Keyboard does not show when focusing on an input element.

Environment, Platform, Device

IOS 12.2

Version information

Checklist

  • [ ✅] I searched for existing GitHub issues
  • [ ✅] I updated all Cordova tooling to most recent version
  • [ ✅] I included all the necessary information above

Debugging from Safari Web Inspector not working

Bug Report

Problem

With UIWebView I could debug from from Safari (see console outputs etc). I just installed cordova-plugin-wkwebview-engine and now debugging from Safari (12.0.3) is not available.

What is expected to happen?

I expected to be able to debug from Safari.

Environment, Platform, Device

iPad Pro 9.7in
iOS 12.4

Version information

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.