-
Notifications
You must be signed in to change notification settings - Fork 69
3.0 loads from file:/// instead of localhost:8080 #125
Comments
@Manduro mmm interesting, can I see the config.xml? |
@manucorporat Here you go: <?xml version='1.0' encoding='utf-8'?>
<widget android-packageName="(...)" android-versionCode="(...)" id="(...)" ios-CFBundleIdentifier="(...)" ios-CFBundleVersion="(...)" version="(...)" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>(...)</name>
<description>(...)</description>
<author email="(...)" href="(...)">(...)</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="tel:*" />
<allow-intent href="mailto:*" />
<allow-intent href="sms:*" />
<allow-intent href="webcal://(...)/*" />
<allow-intent href="https://(...)/*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-targetSdkVersion" value="23" />
<preference name="android-minSdkVersion" value="16" />
<preference name="AndroidLaunchMode" value="singleInstance" />
<preference name="SplashScreen" value="screen" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
<preference name="SuppressesLongPressGesture" value="true" />
<preference name="StatusBarStyle" value="blacktranslucent" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<chcp>
<config-file url="(...)/chcp.json" />
<native-interface version="3" />
<auto-download enabled="false" />
<auto-install enabled="false" />
</chcp>
<platform name="ios">
<allow-navigation href="tel:*" />
<allow-navigation href="mailto:*" />
<allow-navigation href="sms:*" />
<allow-navigation href="webcal://(...)/*" />
<allow-navigation href="https://(...)/*" />
<allow-navigation href="http://localhost:8080/*"/>
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<preference name="Orientation" value="all" />
<preference name="BackupWebStorage" value="local" />
<config-file parent="CFBundleDisplayName" target="*-Info.plist">
<string>(...)</string>
</config-file>
<config-file parent="CFBundleDevelopmentRegion" target="*-Info.plist">
<string>nl-NL</string>
</config-file>
<config-file parent="CFBundleLocalizations" target="*-Info.plist">
<array>
<string>nl-NL</string>
</array>
</config-file>
<config-file parent="LSApplicationQueriesSchemes" target="*-Info.plist">
<array>
<string>fb</string>
<string>twitter</string>
<string>gplus</string>
<string>pintrest</string>
<string>instagram</string>
<string>youtube</string>
<string>vnd.youtube</string>
<string>yelp</string>
<string>linkedin</string>
<string>tumblr</string>
<string>whatsapp</string>
<string>snapchat</string>
<string>comgooglemaps</string>
<string>amazon</string>
<string>skype</string>
<string>googledrive</string>
<string>itms-apps</string>
</array>
</config-file>
<config-file parent="UISupportedInterfaceOrientations" mode="replace" target="*-Info.plist">
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</config-file>
<config-file parent="UISupportedInterfaceOrientations~ipad" mode="replace" target="*-Info.plist">
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</config-file>
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
<icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
</platform>
<platform name="android">
<config-file parent="./application" target="AndroidManifest.xml">
<meta-data android:name="android.max_aspect" android:value="2.1" />
</config-file>
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
</platform>
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
<plugin name="com-sarriaroman-photoviewer" spec="~1.1.10" />
<plugin name="com.verso.cordova.clipboard" spec="https://github.com/VersoSolutions/CordovaClipboard.git" />
<plugin name="cordova-custom-config" spec="~3.1.4" />
<plugin name="cordova-hot-code-push-plugin" spec="~1.5.2" />
<plugin name="cordova-plugin-camera" spec="~2.4.0">
<variable name="CAMERA_USAGE_DESCRIPTION" value="(...)" />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="(...)" />
</plugin>
<plugin name="cordova-plugin-console" spec="~1.0.6" />
<plugin name="cordova-plugin-contacts" spec="~2.3.0">
<variable name="CONTACTS_USAGE_DESCRIPTION" value="(...)" />
</plugin>
<plugin name="cordova-plugin-crosswalk-webview" spec="~2.3.0">
<variable name="XWALK_VERSION" value="23+" />
<variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+" />
<variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect" />
<variable name="XWALK_MODE" value="embedded" />
<variable name="XWALK_MULTIPLEAPK" value="true" />
</plugin>
<plugin name="cordova-plugin-datepicker" spec="~0.9.3" />
<plugin name="cordova-plugin-device" spec="~1.1.5" />
<plugin name="cordova-plugin-file" spec="~4.3.2" />
<plugin name="cordova-plugin-file-transfer" spec="~1.6.2" />
<plugin name="cordova-plugin-inappbrowser" spec="~1.7.0" />
<plugin name="cordova-plugin-mixpanel" spec="~2.3.4" />
<plugin name="cordova-plugin-network-information" spec="~1.3.2" />
<plugin name="cordova-plugin-splashscreen" spec="~4.0.2" />
<plugin name="cordova-plugin-statusbar" spec="~2.2.2" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.2" />
<plugin name="cordova-plugin-wkwebview-engine" spec="https://github.com/driftyco/cordova-plugin-wkwebview-engine.git" />
<plugin name="cordova-sqlite-storage" spec="~1.5.3" />
<plugin name="ionic-plugin-deeplinks" spec="https://github.com/driftyco/ionic-plugin-deeplinks.git">
<variable name="URL_SCHEME" value="(...)" />
<variable name="DEEPLINK_SCHEME" value="https" />
<variable name="DEEPLINK_HOST" value="(...)" />
<variable name="ANDROID_PATH_PREFIX" value="/" />
</plugin>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
<plugin name="phonegap-plugin-push" spec="~1.10.2">
<variable name="SENDER_ID" value="(...)" />
</plugin>
<engine name="android" spec="~6.2.1" />
<engine name="ios" spec="~4.3.1" />
</widget> |
have you tried removing the plugin/ and platform/ folder and recreating cordova from scratch? |
I'm also having this problem. I tried deleting the plugin and platform folders, but that didn't help. Interestingly it works fine when I run on the iOS simulator, but when I actually load to a real device it loads from file. |
@smithgeek never seen this before, could you create a repo that reproduces the issue? |
I have exact same problem. Removing pulgin and platforms folder did not help |
I'm with same problem. In https://github.com/apache/cordova-plugin-wkwebview-engine repo README, have this message: "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." I think CORS is causing this problem, but I don't find a fix for it. |
I am having the same issue with the current master @manucorporat . As they are saying, it works on the simulator but on the device it will not work. The simulator is using localhost, the device is not. I have been trying to look into it. It looks like the polyfill is running and saying that it is injected, but for some reason it's not being used. I am investigating further. |
I have found the problem but I won't be able to try to solve it until maybe tomorrow. @manucorporat In CDVWKWebVewEngine the method - (id)loadRequest:(NSURLRequest*)request is called on the simulator but never called on the device. Because of this all relative paths on the simulator are under localhost but relative paths on the device are under file:// |
It looks like this issue is caused by incompatibilities with code pushing plugins. see #160 |
So everybody here having problems are using code pushing plugins? |
@manucorporat Yes, seems so! |
@Manduro read my comment here: #160 (comment) |
I'm still seeing this issue even after removing the code push plugin. I tried clearing plugins/ and platforms/ just in case. I included my config.xml; let me know if there's anything else I should provide.
|
When trying out Ionic's WKWebView 3.0, I noticed that requests to a server still contain
Origin: null
, instead of theOrigin: localhost:8080
I expected. Upon further inspection it is clear that the app is loaded fromfile:///...
instead ofhttp://localhost:8080
.I'm now using the following modification to
wk-plugin.js
to make it loadlocalhost:8080
correctly:Could this be caused by some other plugin I'm using?
The text was updated successfully, but these errors were encountered: