themattray / cordova-plugin-wkwebviewxhrfix Goto Github PK
View Code? Open in Web Editor NEWProvides a fix for local file access under Cordova and WKWebView
License: MIT License
Provides a fix for local file access under Cordova and WKWebView
License: MIT License
Hi, I'm trying to build Ionic 4 app with this plugin, but I'm getting this error:
/Users/myuser/Library/Developer/Xcode/DerivedData/myapp-giqixmsbhehpswfduojlqgwhobgy/Build/Intermediates.noindex/myapp.build/Debug-iphonesimulator/myapp.build/Objects-normal/x86_64/CDVWKWebViewEngine+FileXhrFix.d --serialize-diagnostics
/Users/myuser/Library/Developer/Xcode/DerivedData/myapp-giqixmsbhehpswfduojlqgwhobgy/Build/Intermediates.noindex/myapp.build/Debug-iphonesimulator/myapp.build/Objects-normal/x86_64/CDVWKWebViewEngine+FileXhrFix.dia -c
/Users/myuser/dev/myapp/myapp-ionic/platforms/ios/myapp/Plugins/cordova-plugin-wkwebviewxhrfix/CDVWKWebViewEngine+FileXhrFix.m -o
/Users/myuser/Library/Developer/Xcode/DerivedData/myapp-giqixmsbhehpswfduojlqgwhobgy/Build/Intermediates.noindex/myapp.build/Debug-iphonesimulator/myapp.build/Objects-normal/x86_64/CDVWKWebViewEngine+FileXhrFix.o
In file included from /Users/myuser/dev/myapp/myapp-ionic/platforms/ios/myapp/Plugins/cordova-plugin-wkwebviewxhrfix/CDVWKWebViewEngine+FileXhrFix.m:9:
/Users/myuser/dev/myapp/myapp-ionic/platforms/ios/myapp/Plugins/cordova-plugin-wkwebviewxhrfix/CDVWKWebViewEngine+FileXhrFix.h:9:9: fatal error:
'CDVWKWebViewEngine.h' file not found
#import "CDVWKWebViewEngine.h"
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
** BUILD FAILED **
For reference, here is my ionic info
Ionic:
Ionic CLI : 5.4.2 (/Users/myuser/.nvm/versions/node/v10.16.3/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.11.7
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.1.1
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 8.1.0, browser 6.0.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 16 other plugins)
Utility:
cordova-res : 0.6.0 (update available: 0.8.1)
native-run : 0.2.8 (update available: 0.3.0)
System:
Android SDK Tools : 26.1.1 (/Users/myuser/Library/Android/sdk)
ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v10.16.3 (/Users/myuser/.nvm/versions/node/v10.16.3/bin/node)
npm : 6.13.2
OS : macOS Catalina
Xcode : Xcode 11.2.1 Build version 11B500
Installation of this plugin creates this problem platforms/ios/FlyingPlane/Plugins/cordova-plugin-wkwebviewxhrfix/CDVWKWebViewEngine+FileXhrFix.h:9:9
in Xcode
and it's not possible to build the project.
Hell
I tried to use your plugin by simply doing the following steps:
cordova create meh
cd meh
cordova plugin add
cordova plugin add cordova-plugin-wkwebview-engine
cordova plugin add https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix
...
open platforms/ios/HelloCordova.xcodeproj
set the Team etc. and run it ..
Starting the "App" I get the Following output on the Console:
2017-06-07 12:42:39.503145+0200 HelloCordova[1100:213448] Apache Cordova native platform version 4.4.0 is starting.
2017-06-07 12:42:39.504039+0200 HelloCordova[1100:213448] Multi-tasking -> Device: YES, App: YES
2017-06-07 12:42:39.510696+0200 HelloCordova[1100:213448]
Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file
2017-06-07 12:42:39.582128+0200 HelloCordova[1100:213448] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2017-06-07 12:42:39.583733+0200 HelloCordova[1100:213448] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
2017-06-07 12:42:39.584235+0200 HelloCordova[1100:213448] CDVWKWebViewEngine will reload WKWebView if required on resume
2017-06-07 12:42:39.584301+0200 HelloCordova[1100:213448] Using WKWebView
2017-06-07 12:42:39.585179+0200 HelloCordova[1100:213448] [CDVTimer][handleopenurl] 0.101030ms
2017-06-07 12:42:39.587276+0200 HelloCordova[1100:213448] [CDVTimer][intentandnavigationfilter] 2.018988ms
2017-06-07 12:42:39.587426+0200 HelloCordova[1100:213448] [CDVTimer][gesturehandler] 0.082016ms
2017-06-07 12:42:39.587475+0200 HelloCordova[1100:213448] CDVPlugin class WKWebViewXHRFix (pluginName: wkwebviewxhrfix) does not exist.
2017-06-07 12:42:39.587504+0200 HelloCordova[1100:213448] [CDVTimer][wkwebviewxhrfix] 0.036955ms
2017-06-07 12:42:39.587538+0200 HelloCordova[1100:213448] [CDVTimer][TotalPluginStartup] 2.490997ms
Any Ideas ?
Would it suffice to simply put the lines:
@try {
[configuration.preferences setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"];
}
@catch (NSException *exception) {}
@try {
[configuration setValue:@TRUE forKey:@"allowUniversalAccessFromFileURLs"];
}
@catch (NSException *exception) {}
in CDVWKWebViewEngine.m after
configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
Hello
I Addes both Plugins to our Projekt ..
cordova-plugin-wkwebview-engine 1.1.3 "Cordova WKWebView Engine"
cordova-plugin-wkwebviewxhrfix 0.1.0 "WKWebView XHR Fix"
But trying to access anything via File-Url does not work . like
$.get('file://P307.cimd.json', function(data) {
iclInterface.cimd = JSON.parse(data);
alert("Did load JSOn File");
}, 'text')
.fail(function(data) {alert(data);
console.error("FAIL");
});
in this case I get no output ..
Needs to be updated for new Cordova iOS release!
Hi, I am using:
cordova iOS 5.1.1
'https://github.com/apache/cordova-plugin-wkwebview-engine'
'https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix'
config.xml:
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
Right now I am facing issue that there are no cookies in request headers for any http request. With WebView there was no such issue. How can i fix it?
For our ebook (which loads epub files from remote server) app, we have to migrate to WKWebview and we are using this plugin along with cordova-plugin-wkwebview-engine. Our cordova iOS is 5.1.1.
Everything builds well, no CORS issue etc. in the simulator. The library and ePUB files also load perfectly in the simulator.
But, when the app is run from device (iPhone XR, 14.2), the app runs well Except the library. None of the book cover images are shown and the epub files are downloading (evident from console) but when opened shows a blank page. The safari web inspector says cannot load resources, operation not permitted.
Any help will be highly appreciated.
Wouldn't we get a rejection?
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.