apache / cordova-plugin-wkwebview-engine Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Apache Cordova wkwebview engine plugin
License: Apache License 2.0
[DEPRECATED] Apache Cordova wkwebview engine plugin
License: Apache License 2.0
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
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:
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?
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)
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.
The cookie is set by WKWebView shows in Safari inspector and it can be accessed through document.cookie
.
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 ""
.
The Set-Cookie
header is present in the response that is passed onto the WKWebView.
Load the app using a custom scheme (e.g. myscheme
).
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)
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.
In Safari inspector check the request & response presence in the Network
tab
Open Storage
tab and validate the cookie returned in the header is missing
Type document.cookie
in console and it will return ""
Optional: type document.cookie="foo=bar"
and validate it remains empty
iPhone device or simulator -- happens anywhere.
cordova-cli 9.0.0
cordova-ios 4.5.5
Xcode 10.2.1
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.
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.
I expected to be able to debug from Safari.
iPad Pro 9.7in
iOS 12.4
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 .
I can turn the canvas data into base64
via canvas.toDataUrl()
successfully, and get the correct base64 string.
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.
const imageDraw = document.getElementById('canvasContain');
if (imageDraw) {
let imgURI = imageDraw.toDataURL('image/png');// throw error
console.log('img uri: ');
console.log(imgURI);
}
Platform: iOS, xcode 10.2.1
Device: iPhone simulator or the real iPhone, iOS 12.2
cordova: 8.0.0
cordova-ios: 4.5.4
cordova-plugin-wkwebview-engine: 1.1.4
iOS: 12.2
xcode: 10.2.1
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:
Our stack:
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
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.
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)
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.
inputAccessoryView or native keyboard should not be shown on calling element.focus() on a read only input element
inputAccessoryView is shown on focusing on an read only input element
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);
iPhone
iOS: 12.1.1
Cordova: 8.1.2
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
Steps to reproduce:
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.
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
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.
Cordova Plugin Search cannot find this plugin.
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.
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.
On iOS devices we have page A -> page B -> page C -> page D
, and in the page D
we are calling history.go(-3)
.
go back to the page A
go back to the page C
.
And the same js code works perfect on Android devices.
Platform: iOS, xcode 10.2.1
Device: iPhone simulator or the real iPhone, iOS 12.2
cordova: 8.0.0
cordova-ios: 4.5.4
cordova-plugin-wkwebview-engine: 1.1.4
iOS: 12.2
xcode: 10.2.1
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.
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.
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
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.
Hi, I am using cordova for my iOS app. Why WKWebView has 20pt offset?
WKWebView: 0x10a043a00; frame = (0 0; 375 667)
WKContentView: 0x10a044000; frame = (0 0; 375 647)
667 - 647 = 20
iPhone 6 Plus iOS 12.1
{
"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"
]
}
}
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:
AllowBackForwardNavigationGestures = false
window.WkWebView.allowsBackForwardNavigationGestures(true)
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?
set it true , wkwebview has white space( statusbar height ) on the bottom
how to solve
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x117e17320> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _alwaysRunsAtForegroundPriority.'
app work normal
this problem cause app can't work
when i run this plugin in [email protected] & [email protected]
run this plugin in [email protected] & [email protected]
ios 12.2
cordova-plugin-wkwebview-engine @ 1.1.4
[email protected]
[email protected]
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?
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:
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.
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?
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
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.
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
Now it will report error:
Failed to load resource: unsupported URL
when using cdvfile
with WKWebView. Same problem see https://stackoverflow.com/questions/42760400/unsupported-url-error-for-a-cdvfile
Do you have any plan to support it?
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.
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.
N/A
iPad running iOS 12.3.1
<plugin name="cordova-plugin-statusbar" spec="^2.4.3"/>
<plugin name="cordova-plugin-wkwebview-engine" spec="^1.2.0"/>
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?
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.
iPhone 6S iOS 12
iPhone XS iOS 12
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
The DisallowOverscroll preference doesn't disable bounce for all elements that scroll. Similar issue here https://github.com/ionic-team/ionic/issues/11844 where the elements glitch. The solution appears to be to disable all elements with overflow:scroll: https://github.com/ionic-team/ionic/issues/11844#issuecomment-391996908. Can anyone confirm this?
Thanks
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.
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
.
Infinite loop in didFailNavigation
.
Should not infinite loop.
Infinite loop with failed loads of the error URL.
PR should be forthcoming that basically copies this apache/cordova-ios#334. I'll link it to this when I submit it.
As described. It seemed to depend a bit on timing, so I can't easily provide a code sample that consistently replicated the issue.
Various different iOS devices and simulators.
cordova-plugin-wkwebview-engine - 1.1.4
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?
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.
When we are navigating(routing) between the pages continuously , suddenly we are getting white screen.
Getting white screen
Console Error from x-code : Error Route: InvalidStateError: The object is in an invalid state.
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).
Got white screen while navigating inside the app.
IOS, Mobile App, Iphone 6s
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" />
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)
Here's a video of this happening:
https://drive.google.com/file/d/1PXkIu2Q5b0GDSrzKyrm_okyg2ciCVewK/view?usp=sharing
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:
Keyboard should show when focusing an element. ie:
document.querySelector('input').focus()
Keyboard does not show when focusing on an input element.
IOS 12.2
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
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
这个插件怎么用啊
WKWebView for cookie synchronization management, there is no perfect solution ???
There seems to be no preference available to disable the preview popups shown when hard pressing links on iOS.
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.
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
- (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'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.