Skip to content

TagSpaces is an offline, open source, document manager with tagging support

remove cordova-plugin-ios-xhr plugin && path

stanimir8c05f43ccd39
diff --git a/app/services/cordova-io.ts b/app/services/cordova-io.ts
index 1a7a84775..e6091d637 100644
--- a/app/services/cordova-io.ts
+++ b/app/services/cordova-io.ts
@@ -17,7 +17,6 @@
*/
/* globals cordova */
-import path from 'path';
import AppConfig from '../config';
import { b64toBlob } from '../utils/misc';
import {
@@ -184,10 +183,16 @@ export default class CordovaIO {
) {
} else {
localPath = AppConfig.isCordovaiOS
+ ? (cordova.file.documentsDirectory + '/' + localPath).replace(
+ ':/',
+ ':///'
+ )
+ : 'file:///' + localPath;
+ /*localPath = AppConfig.isCordovaiOS
? path
.join(cordova.file.documentsDirectory, localPath)
.replace(':/', ':///')
- : 'file:///' + localPath;
+ : 'file:///' + localPath;*/
}
localPath = encodeURI(localPath);
return new Promise((resolve, reject) => {
diff --git a/cordova/config.xml b/cordova/config.xml
index dd3e666bb..63a5a6056 100644
--- a/cordova/config.xml
+++ b/cordova/config.xml
@@ -25,8 +25,8 @@
<icon density="xxxhdpi" src="res/icon/android/mipmap-xxxhdpi/ic_launcher.png" />
</platform>
<platform name="ios">
- <preference name="NativeXHRLogging" value="full" />
- <preference name="allowFileAccessFromFileURLs" value="true" />
+ <!--<preference name="NativeXHRLogging" value="full" />
+ <preference name="allowFileAccessFromFileURLs" value="true" />-->
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
diff --git a/cordova/package.json b/cordova/package.json
index 0221673b0..c417ebf7d 100644
--- a/cordova/package.json
+++ b/cordova/package.json
@@ -34,8 +34,7 @@
},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
- },
- "cordova-plugin-ios-xhr": {}
+ }
},
"platforms": [
"ios",
diff --git a/cordova/platforms/android/android.json b/cordova/platforms/android/android.json
index 7b1e6868a..259a0a5eb 100644
--- a/cordova/platforms/android/android.json
+++ b/cordova/platforms/android/android.json
@@ -136,9 +136,6 @@
"ANDROID_SUPPORT_V4_VERSION": "27.+",
"PACKAGE_NAME": "org.tagspaces.iosn"
},
- "cordova-plugin-ios-xhr": {
- "PACKAGE_NAME": "org.tagspaces.iosn"
- },
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "org.tagspaces.iosn"
},
@@ -412,7 +409,6 @@
"cordova-plugin-camera": "4.1.0",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-opener2": "3.0.4",
- "cordova-plugin-ios-xhr": "1.0.0",
"cordova-plugin-whitelist": "1.3.4",
"es6-promise-plugin": "4.2.2",
"cordova-plugin-x-socialsharing": "5.6.8"
diff --git a/cordova/platforms/ios/TagSpaces Beta.xcodeproj/project.pbxproj b/cordova/platforms/ios/TagSpaces Beta.xcodeproj/project.pbxproj
index c71d9474b..0e820b79b 100755
--- a/cordova/platforms/ios/TagSpaces Beta.xcodeproj/project.pbxproj
+++ b/cordova/platforms/ios/TagSpaces Beta.xcodeproj/project.pbxproj
@@ -8,33 +8,31 @@
/* Begin PBXBuildFile section */
0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0207DA571B56EA530066E2B4 /* Images.xcassets */; };
- 073D3A66C8A14898B5F5AAA8 /* CDVFile.m in Sources */ = {isa = PBXBuildFile; fileRef = BDC2833C0F2540B087F62B68 /* CDVFile.m */; };
- 0940D5A501F243598C325D9C /* APPMethodMagic.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B1B5B7F089C41D9A04D6AF8 /* APPMethodMagic.m */; };
- 0ACEAA81A1B14DA4B4FA9AFA /* NSString+SSURLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ADA41A099364A258EB86F89 /* NSString+SSURLEncoding.m */; };
- 0F8082FF83914F9E99A8E6D9 /* APPBackgroundMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 6381CA026ADE485E85CF5328 /* APPBackgroundMode.m */; };
- 178E338704A14BA391229723 /* CDVJpegHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2274DB4084444354AF26BD03 /* CDVJpegHeaderWriter.m */; };
+ 1577D690B47B40AEA3286936 /* CDVJpegHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 56512B9507304562BFFB8453 /* CDVJpegHeaderWriter.m */; };
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
- 2794900EFA364A07A3234448 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B627557606EC4D94B186F4A8 /* ImageIO.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 2ABBBAE151AB4DD89C762B9A /* UIImage+CropScaleOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDD656DD5EF748EA935D819C /* UIImage+CropScaleOrientation.m */; };
+ 240ECC77DE3B4E7B80E053E8 /* CDVLocalFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D28D9DB1C5F4F2499398EDA /* CDVLocalFilesystem.m */; };
301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; settings = {ATTRIBUTES = (Required, ); }; };
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; };
302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; };
- 3E4DC195C1A64C2AA34CE787 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = C4858AF80EB94C94A3E67277 /* CDVDevice.m */; };
- 430C7B3D05C048A096EEA69E /* CDVCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = CE7B6C93B0294D46AD5AA880 /* CDVCamera.m */; };
- 4D1E218B45B54839AF8A4C80 /* SocialSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 73DA06C8C94841398C49D286 /* SocialSharing.m */; };
- 5593FE35FC014E8EB4C8FF96 /* CDVAssetLibraryFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 263BC8106989436B955E4FC6 /* CDVAssetLibraryFilesystem.m */; };
- 57799DD2E84042B9A09D1654 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BCF389046F64001AA186149 /* AVFoundation.framework */; };
- 587BBEE867EE42B5809AA535 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E00A3FA792DB4C7BB23D704E /* MessageUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 662326DD3A2144F295072559 /* appbeep.wav in Resources */ = {isa = PBXBuildFile; fileRef = F8411ABEAD054E28AFE89BE1 /* appbeep.wav */; };
- 6A26D0286D2D44649751831C /* FileOpener2.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D7F2F2B4E544B19880DFF3E /* FileOpener2.m */; };
- 6AD3555421354B1DAE56A40C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D93A5BB27654D45B91A9D84 /* WebKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 39BCCDC1AC364E0F8310A30D /* NSString+SSURLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = A7DF037EC1B94E5A95653B6C /* NSString+SSURLEncoding.m */; };
+ 3B1C5F0E73914566A892C78A /* CDVAssetLibraryFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = D980043523D7410FA5AE4CD0 /* CDVAssetLibraryFilesystem.m */; };
+ 3D5914FD54224D9087EF88F8 /* APPMethodMagic.m in Sources */ = {isa = PBXBuildFile; fileRef = D79EC8FE6E814EA4996B515C /* APPMethodMagic.m */; };
+ 3D7AD0AE733244ACB712973D /* SocialSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = BB33BEF46E124B06B48B87DA /* SocialSharing.m */; };
+ 3DF6F22901A645839A9E17BF /* CDVCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = B40B67B536314F5CBF952C22 /* CDVCamera.m */; };
6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; };
- 7E8728346F8943BCA0B46625 /* CDVLocalFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 59713991817F4F1787F20396 /* CDVLocalFilesystem.m */; };
- 8A4DB4E42EE14F7487AC9E86 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D74AB46CD060414FAC9DDD2A /* CoreLocation.framework */; };
- A9835C228DA94823929396D7 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA27B0E06994A878E9EEC74 /* Downloader.swift */; };
- AB59D1DB06D44EA8B7BFB28B /* CDVWKWebViewFileXhr.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BB0C8C5A9D8404F9C8724CB /* CDVWKWebViewFileXhr.m */; };
- EC70D655085243AD9EBC277D /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DDE2902540E54E83AE8E4C22 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 6B8081000F1746D49EC2E3A4 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2DC7AA16CA944CBBFBC8BCC /* MessageUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 729086FDE87E4A0E9B99BB86 /* UIImage+CropScaleOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 86DA890E0CDB46898A379CC2 /* UIImage+CropScaleOrientation.m */; };
+ 839CAD58CE174C8EBDEF981C /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8379BCCD89DF4F058252F1A6 /* ImageIO.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 9F1A49DBBFC146FBB7BDB662 /* APPBackgroundMode.m in Sources */ = {isa = PBXBuildFile; fileRef = A731D50597544612A0255F16 /* APPBackgroundMode.m */; };
+ B9D46DA43EFA44B0B5DC01D4 /* CDVFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 01FEEE69945A4AB1B2FA395C /* CDVFile.m */; };
+ BE73B23822EA458D8E15536D /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FB5EBD3675471488EBD97E /* CoreLocation.framework */; };
+ E1D962892435495EB75FF9E9 /* appbeep.wav in Resources */ = {isa = PBXBuildFile; fileRef = 03E30E833A3C49229F9C2B34 /* appbeep.wav */; };
+ E4197D693C5F4ABE887725AD /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 839A4AD3AA4B43BF94E5773C /* CDVDevice.m */; };
+ E62937C0945745969C2A9839 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8FD1A6A17474C7982956D8A /* Downloader.swift */; };
+ F3871362E1424CB29AF9A19A /* FileOpener2.m in Sources */ = {isa = PBXBuildFile; fileRef = 22740C13FC9948B08280617A /* FileOpener2.m */; };
+ F569F4F20F6E47AE8E65EE21 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 081BFEDB82284076B118C48C /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ F98D902808A2467DA7634DD3 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 606068C273E44FB5AD5F33C0 /* AVFoundation.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -62,21 +60,17 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
- 01F70CA7BFB447AEA7504E5B /* CDVAssetLibraryFilesystem.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVAssetLibraryFilesystem.h; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.h"; sourceTree = "<group>"; };
+ 01FEEE69945A4AB1B2FA395C /* CDVFile.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVFile.m; path = "cordova-plugin-file/CDVFile.m"; sourceTree = "<group>"; };
0207DA571B56EA530066E2B4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "TagSpaces Beta/Images.xcassets"; sourceTree = SOURCE_ROOT; };
- 0B54D4831CED447FA1D057A1 /* CDVFile.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVFile.h; path = "cordova-plugin-file/CDVFile.h"; sourceTree = "<group>"; };
- 0BB0C8C5A9D8404F9C8724CB /* CDVWKWebViewFileXhr.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVWKWebViewFileXhr.m; path = "cordova-plugin-ios-xhr/CDVWKWebViewFileXhr.m"; sourceTree = "<group>"; };
- 0DA27B0E06994A878E9EEC74 /* Downloader.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = Downloader.swift; path = com.whebcraft.cordova.plugin.downloader/Downloader.swift; sourceTree = "<group>"; };
- 1803FA2A4F354A51A1E8AD5B /* CDVCamera.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVCamera.h; path = "cordova-plugin-camera/CDVCamera.h"; sourceTree = "<group>"; };
- 1889382C5E50427C9844CA42 /* APPBackgroundMode.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = APPBackgroundMode.h; path = "cordova-plugin-background-mode/APPBackgroundMode.h"; sourceTree = "<group>"; };
+ 03E30E833A3C49229F9C2B34 /* appbeep.wav */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; path = appbeep.wav; sourceTree = "<group>"; };
+ 081BFEDB82284076B118C48C /* Social.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
+ 158154AFD77A4734BF869483 /* CDVCamera.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVCamera.h; path = "cordova-plugin-camera/CDVCamera.h"; sourceTree = "<group>"; };
1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* TagSpaces Beta.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TagSpaces Beta.app"; sourceTree = BUILT_PRODUCTS_DIR; };
- 1D7F2F2B4E544B19880DFF3E /* FileOpener2.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = FileOpener2.m; path = "cordova-plugin-file-opener2/FileOpener2.m"; sourceTree = "<group>"; };
- 2274DB4084444354AF26BD03 /* CDVJpegHeaderWriter.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVJpegHeaderWriter.m; path = "cordova-plugin-camera/CDVJpegHeaderWriter.m"; sourceTree = "<group>"; };
- 263BC8106989436B955E4FC6 /* CDVAssetLibraryFilesystem.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVAssetLibraryFilesystem.m; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.m"; sourceTree = "<group>"; };
+ 22740C13FC9948B08280617A /* FileOpener2.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = FileOpener2.m; path = "cordova-plugin-file-opener2/FileOpener2.m"; sourceTree = "<group>"; };
+ 29779DD62E7F4FF390B1DE2E /* APPMethodMagic.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = APPMethodMagic.h; path = "cordova-plugin-background-mode/APPMethodMagic.h"; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 2D93A5BB27654D45B91A9D84 /* WebKit.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
@@ -86,37 +80,38 @@
3047A5101AB8059700498E2A /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; };
3047A5111AB8059700498E2A /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; };
32CA4F630368D1EE00C91783 /* TagSpaces Beta-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TagSpaces Beta-Prefix.pch"; sourceTree = "<group>"; };
- 3866EF2A67C9488F86969AD0 /* SocialSharing.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = SocialSharing.h; path = "cordova-plugin-x-socialsharing/SocialSharing.h"; sourceTree = "<group>"; };
- 4ADA41A099364A258EB86F89 /* NSString+SSURLEncoding.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "NSString+SSURLEncoding.m"; path = "cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m"; sourceTree = "<group>"; };
- 4B1B5B7F089C41D9A04D6AF8 /* APPMethodMagic.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = APPMethodMagic.m; path = "cordova-plugin-background-mode/APPMethodMagic.m"; sourceTree = "<group>"; };
- 59713991817F4F1787F20396 /* CDVLocalFilesystem.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVLocalFilesystem.m; path = "cordova-plugin-file/CDVLocalFilesystem.m"; sourceTree = "<group>"; };
- 6381CA026ADE485E85CF5328 /* APPBackgroundMode.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = APPBackgroundMode.m; path = "cordova-plugin-background-mode/APPBackgroundMode.m"; sourceTree = "<group>"; };
+ 36CEBC09AC684329A12F596A /* FileOpener2.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = FileOpener2.h; path = "cordova-plugin-file-opener2/FileOpener2.h"; sourceTree = "<group>"; };
+ 3E091FD985F34684A9D1B6CA /* CDVJpegHeaderWriter.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVJpegHeaderWriter.h; path = "cordova-plugin-camera/CDVJpegHeaderWriter.h"; sourceTree = "<group>"; };
+ 44E0EE8EACB646139EF3DD85 /* CDVExif.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVExif.h; path = "cordova-plugin-camera/CDVExif.h"; sourceTree = "<group>"; };
+ 56512B9507304562BFFB8453 /* CDVJpegHeaderWriter.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVJpegHeaderWriter.m; path = "cordova-plugin-camera/CDVJpegHeaderWriter.m"; sourceTree = "<group>"; };
+ 606068C273E44FB5AD5F33C0 /* AVFoundation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
+ 6452D894C4F64A0F9CC0704A /* UIImage+CropScaleOrientation.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "UIImage+CropScaleOrientation.h"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.h"; sourceTree = "<group>"; };
6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CDVLaunchScreen.storyboard; path = "TagSpaces Beta/CDVLaunchScreen.storyboard"; sourceTree = SOURCE_ROOT; };
- 703105E50C7446A695B09E6C /* CDVExif.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVExif.h; path = "cordova-plugin-camera/CDVExif.h"; sourceTree = "<group>"; };
- 73DA06C8C94841398C49D286 /* SocialSharing.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = SocialSharing.m; path = "cordova-plugin-x-socialsharing/SocialSharing.m"; sourceTree = "<group>"; };
- 75AA9FFA794C4A6197805DE0 /* UIImage+CropScaleOrientation.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "UIImage+CropScaleOrientation.h"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.h"; sourceTree = "<group>"; };
- 8BCF389046F64001AA186149 /* AVFoundation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
+ 6C36E724E390494A9B00B208 /* APPBackgroundMode.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = APPBackgroundMode.h; path = "cordova-plugin-background-mode/APPBackgroundMode.h"; sourceTree = "<group>"; };
+ 73BC1B4D1E464034B53C54D0 /* CDVAssetLibraryFilesystem.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVAssetLibraryFilesystem.h; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.h"; sourceTree = "<group>"; };
+ 7B38D1EE76CC47B1A7E3491C /* CDVLocalFilesystem.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVLocalFilesystem.h; path = "cordova-plugin-file/CDVLocalFilesystem.h"; sourceTree = "<group>"; };
+ 81122252461C4E34A5FC214C /* CDVFile.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVFile.h; path = "cordova-plugin-file/CDVFile.h"; sourceTree = "<group>"; };
+ 8379BCCD89DF4F058252F1A6 /* ImageIO.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
+ 839A4AD3AA4B43BF94E5773C /* CDVDevice.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVDevice.m; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; };
+ 86DA890E0CDB46898A379CC2 /* UIImage+CropScaleOrientation.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "UIImage+CropScaleOrientation.m"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.m"; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* TagSpaces Beta-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "TagSpaces Beta-Info.plist"; path = "TagSpaces Beta/TagSpaces Beta-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; };
- A24E29C7B1D04E61B4BA0386 /* CDVJpegHeaderWriter.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVJpegHeaderWriter.h; path = "cordova-plugin-camera/CDVJpegHeaderWriter.h"; sourceTree = "<group>"; };
- B627557606EC4D94B186F4A8 /* ImageIO.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
- BB8B200A0E05445C9F780B0C /* APPMethodMagic.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = APPMethodMagic.h; path = "cordova-plugin-background-mode/APPMethodMagic.h"; sourceTree = "<group>"; };
- BDC2833C0F2540B087F62B68 /* CDVFile.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVFile.m; path = "cordova-plugin-file/CDVFile.m"; sourceTree = "<group>"; };
- C026AEA90EAB44CC8E9A7EE9 /* CDVWKWebViewFileXhr.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVWKWebViewFileXhr.h; path = "cordova-plugin-ios-xhr/CDVWKWebViewFileXhr.h"; sourceTree = "<group>"; };
- C4858AF80EB94C94A3E67277 /* CDVDevice.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVDevice.m; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; };
- C6AB2400EEBD4874BB3A5D7D /* CDVLocalFilesystem.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVLocalFilesystem.h; path = "cordova-plugin-file/CDVLocalFilesystem.h"; sourceTree = "<group>"; };
- CDD656DD5EF748EA935D819C /* UIImage+CropScaleOrientation.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "UIImage+CropScaleOrientation.m"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.m"; sourceTree = "<group>"; };
- CE7B6C93B0294D46AD5AA880 /* CDVCamera.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVCamera.m; path = "cordova-plugin-camera/CDVCamera.m"; sourceTree = "<group>"; };
- D331E749193D4C8186B50627 /* NSString+SSURLEncoding.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "NSString+SSURLEncoding.h"; path = "cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h"; sourceTree = "<group>"; };
- D74AB46CD060414FAC9DDD2A /* CoreLocation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
- DDE2902540E54E83AE8E4C22 /* Social.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
- E00A3FA792DB4C7BB23D704E /* MessageUI.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
- E3F82EDC930C4C80865A5BBC /* FileOpener2.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = FileOpener2.h; path = "cordova-plugin-file-opener2/FileOpener2.h"; sourceTree = "<group>"; };
+ 937E2D3803954F6D82558591 /* CDVDevice.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVDevice.h; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; };
+ 9D28D9DB1C5F4F2499398EDA /* CDVLocalFilesystem.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVLocalFilesystem.m; path = "cordova-plugin-file/CDVLocalFilesystem.m"; sourceTree = "<group>"; };
+ A2FED609D5684357801286D3 /* NSString+SSURLEncoding.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "NSString+SSURLEncoding.h"; path = "cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h"; sourceTree = "<group>"; };
+ A731D50597544612A0255F16 /* APPBackgroundMode.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = APPBackgroundMode.m; path = "cordova-plugin-background-mode/APPBackgroundMode.m"; sourceTree = "<group>"; };
+ A7DF037EC1B94E5A95653B6C /* NSString+SSURLEncoding.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "NSString+SSURLEncoding.m"; path = "cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m"; sourceTree = "<group>"; };
+ AE336A362B314EA5839D442A /* SocialSharing.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = SocialSharing.h; path = "cordova-plugin-x-socialsharing/SocialSharing.h"; sourceTree = "<group>"; };
+ B40B67B536314F5CBF952C22 /* CDVCamera.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVCamera.m; path = "cordova-plugin-camera/CDVCamera.m"; sourceTree = "<group>"; };
+ B8FD1A6A17474C7982956D8A /* Downloader.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = Downloader.swift; path = com.whebcraft.cordova.plugin.downloader/Downloader.swift; sourceTree = "<group>"; };
+ BB33BEF46E124B06B48B87DA /* SocialSharing.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = SocialSharing.m; path = "cordova-plugin-x-socialsharing/SocialSharing.m"; sourceTree = "<group>"; };
+ C2DC7AA16CA944CBBFBC8BCC /* MessageUI.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
+ D79EC8FE6E814EA4996B515C /* APPMethodMagic.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = APPMethodMagic.m; path = "cordova-plugin-background-mode/APPMethodMagic.m"; sourceTree = "<group>"; };
+ D980043523D7410FA5AE4CD0 /* CDVAssetLibraryFilesystem.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVAssetLibraryFilesystem.m; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.m"; sourceTree = "<group>"; };
EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
- F7AAE5A7C89546EB81D8F2F6 /* CDVDevice.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVDevice.h; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "TagSpaces Beta/config.xml"; sourceTree = "<group>"; };
- F8411ABEAD054E28AFE89BE1 /* appbeep.wav */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; path = appbeep.wav; sourceTree = "<group>"; };
+ F9FB5EBD3675471488EBD97E /* CoreLocation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -125,12 +120,11 @@
buildActionMask = 2147483647;
files = (
301BF552109A68D80062928A /* libCordova.a in Frameworks */,
- 2794900EFA364A07A3234448 /* ImageIO.framework in Frameworks */,
- 8A4DB4E42EE14F7487AC9E86 /* CoreLocation.framework in Frameworks */,
- 57799DD2E84042B9A09D1654 /* AVFoundation.framework in Frameworks */,
- 6AD3555421354B1DAE56A40C /* WebKit.framework in Frameworks */,
- EC70D655085243AD9EBC277D /* Social.framework in Frameworks */,
- 587BBEE867EE42B5809AA535 /* MessageUI.framework in Frameworks */,
+ 839CAD58CE174C8EBDEF981C /* ImageIO.framework in Frameworks */,
+ BE73B23822EA458D8E15536D /* CoreLocation.framework in Frameworks */,
+ F98D902808A2467DA7634DD3 /* AVFoundation.framework in Frameworks */,
+ F569F4F20F6E47AE8E65EE21 /* Social.framework in Frameworks */,
+ 6B8081000F1746D49EC2E3A4 /* MessageUI.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -193,7 +187,7 @@
3047A50E1AB8057F00498E2A /* config */,
8D1107310486CEB800E47090 /* TagSpaces Beta-Info.plist */,
6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */,
- F8411ABEAD054E28AFE89BE1 /* appbeep.wav */,
+ 03E30E833A3C49229F9C2B34 /* appbeep.wav */,
);
name = Resources;
path = "TagSpaces Beta/Resources";
@@ -202,12 +196,11 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
- B627557606EC4D94B186F4A8 /* ImageIO.framework */,
- D74AB46CD060414FAC9DDD2A /* CoreLocation.framework */,
- 8BCF389046F64001AA186149 /* AVFoundation.framework */,
- 2D93A5BB27654D45B91A9D84 /* WebKit.framework */,
- DDE2902540E54E83AE8E4C22 /* Social.framework */,
- E00A3FA792DB4C7BB23D704E /* MessageUI.framework */,
+ 8379BCCD89DF4F058252F1A6 /* ImageIO.framework */,
+ F9FB5EBD3675471488EBD97E /* CoreLocation.framework */,
+ 606068C273E44FB5AD5F33C0 /* AVFoundation.framework */,
+ 081BFEDB82284076B118C48C /* Social.framework */,
+ C2DC7AA16CA944CBBFBC8BCC /* MessageUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -234,34 +227,32 @@
307C750510C5A3420062BCA9 /* Plugins */ = {
isa = PBXGroup;
children = (
- 0DA27B0E06994A878E9EEC74 /* Downloader.swift */,
- C4858AF80EB94C94A3E67277 /* CDVDevice.m */,
- F7AAE5A7C89546EB81D8F2F6 /* CDVDevice.h */,
- 6381CA026ADE485E85CF5328 /* APPBackgroundMode.m */,
- 4B1B5B7F089C41D9A04D6AF8 /* APPMethodMagic.m */,
- 1889382C5E50427C9844CA42 /* APPBackgroundMode.h */,
- BB8B200A0E05445C9F780B0C /* APPMethodMagic.h */,
- CDD656DD5EF748EA935D819C /* UIImage+CropScaleOrientation.m */,
- CE7B6C93B0294D46AD5AA880 /* CDVCamera.m */,
- 2274DB4084444354AF26BD03 /* CDVJpegHeaderWriter.m */,
- 75AA9FFA794C4A6197805DE0 /* UIImage+CropScaleOrientation.h */,
- 1803FA2A4F354A51A1E8AD5B /* CDVCamera.h */,
- A24E29C7B1D04E61B4BA0386 /* CDVJpegHeaderWriter.h */,
- 703105E50C7446A695B09E6C /* CDVExif.h */,
- BDC2833C0F2540B087F62B68 /* CDVFile.m */,
- 59713991817F4F1787F20396 /* CDVLocalFilesystem.m */,
- 263BC8106989436B955E4FC6 /* CDVAssetLibraryFilesystem.m */,
- 0B54D4831CED447FA1D057A1 /* CDVFile.h */,
- C6AB2400EEBD4874BB3A5D7D /* CDVLocalFilesystem.h */,
- 01F70CA7BFB447AEA7504E5B /* CDVAssetLibraryFilesystem.h */,
- 1D7F2F2B4E544B19880DFF3E /* FileOpener2.m */,
- E3F82EDC930C4C80865A5BBC /* FileOpener2.h */,
- 0BB0C8C5A9D8404F9C8724CB /* CDVWKWebViewFileXhr.m */,
- C026AEA90EAB44CC8E9A7EE9 /* CDVWKWebViewFileXhr.h */,
- 4ADA41A099364A258EB86F89 /* NSString+SSURLEncoding.m */,
- 73DA06C8C94841398C49D286 /* SocialSharing.m */,
- D331E749193D4C8186B50627 /* NSString+SSURLEncoding.h */,
- 3866EF2A67C9488F86969AD0 /* SocialSharing.h */,
+ B8FD1A6A17474C7982956D8A /* Downloader.swift */,
+ 839A4AD3AA4B43BF94E5773C /* CDVDevice.m */,
+ 937E2D3803954F6D82558591 /* CDVDevice.h */,
+ A731D50597544612A0255F16 /* APPBackgroundMode.m */,
+ D79EC8FE6E814EA4996B515C /* APPMethodMagic.m */,
+ 6C36E724E390494A9B00B208 /* APPBackgroundMode.h */,
+ 29779DD62E7F4FF390B1DE2E /* APPMethodMagic.h */,
+ 86DA890E0CDB46898A379CC2 /* UIImage+CropScaleOrientation.m */,
+ B40B67B536314F5CBF952C22 /* CDVCamera.m */,
+ 56512B9507304562BFFB8453 /* CDVJpegHeaderWriter.m */,
+ 6452D894C4F64A0F9CC0704A /* UIImage+CropScaleOrientation.h */,
+ 158154AFD77A4734BF869483 /* CDVCamera.h */,
+ 3E091FD985F34684A9D1B6CA /* CDVJpegHeaderWriter.h */,
+ 44E0EE8EACB646139EF3DD85 /* CDVExif.h */,
+ 01FEEE69945A4AB1B2FA395C /* CDVFile.m */,
+ 9D28D9DB1C5F4F2499398EDA /* CDVLocalFilesystem.m */,
+ D980043523D7410FA5AE4CD0 /* CDVAssetLibraryFilesystem.m */,
+ 81122252461C4E34A5FC214C /* CDVFile.h */,
+ 7B38D1EE76CC47B1A7E3491C /* CDVLocalFilesystem.h */,
+ 73BC1B4D1E464034B53C54D0 /* CDVAssetLibraryFilesystem.h */,
+ 22740C13FC9948B08280617A /* FileOpener2.m */,
+ 36CEBC09AC684329A12F596A /* FileOpener2.h */,
+ A7DF037EC1B94E5A95653B6C /* NSString+SSURLEncoding.m */,
+ BB33BEF46E124B06B48B87DA /* SocialSharing.m */,
+ A2FED609D5684357801286D3 /* NSString+SSURLEncoding.h */,
+ AE336A362B314EA5839D442A /* SocialSharing.h */,
);
name = Plugins;
path = "TagSpaces Beta/Plugins";
@@ -359,7 +350,7 @@
302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */,
0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */,
6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */,
- 662326DD3A2144F295072559 /* appbeep.wav in Resources */,
+ E1D962892435495EB75FF9E9 /* appbeep.wav in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -391,20 +382,19 @@
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */,
- A9835C228DA94823929396D7 /* Downloader.swift in Sources */,
- 3E4DC195C1A64C2AA34CE787 /* CDVDevice.m in Sources */,
- 0F8082FF83914F9E99A8E6D9 /* APPBackgroundMode.m in Sources */,
- 0940D5A501F243598C325D9C /* APPMethodMagic.m in Sources */,
- 2ABBBAE151AB4DD89C762B9A /* UIImage+CropScaleOrientation.m in Sources */,
- 430C7B3D05C048A096EEA69E /* CDVCamera.m in Sources */,
- 178E338704A14BA391229723 /* CDVJpegHeaderWriter.m in Sources */,
- 073D3A66C8A14898B5F5AAA8 /* CDVFile.m in Sources */,
- 7E8728346F8943BCA0B46625 /* CDVLocalFilesystem.m in Sources */,
- 5593FE35FC014E8EB4C8FF96 /* CDVAssetLibraryFilesystem.m in Sources */,
- 6A26D0286D2D44649751831C /* FileOpener2.m in Sources */,
- AB59D1DB06D44EA8B7BFB28B /* CDVWKWebViewFileXhr.m in Sources */,
- 0ACEAA81A1B14DA4B4FA9AFA /* NSString+SSURLEncoding.m in Sources */,
- 4D1E218B45B54839AF8A4C80 /* SocialSharing.m in Sources */,
+ E62937C0945745969C2A9839 /* Downloader.swift in Sources */,
+ E4197D693C5F4ABE887725AD /* CDVDevice.m in Sources */,
+ 9F1A49DBBFC146FBB7BDB662 /* APPBackgroundMode.m in Sources */,
+ 3D5914FD54224D9087EF88F8 /* APPMethodMagic.m in Sources */,
+ 729086FDE87E4A0E9B99BB86 /* UIImage+CropScaleOrientation.m in Sources */,
+ 3DF6F22901A645839A9E17BF /* CDVCamera.m in Sources */,
+ 1577D690B47B40AEA3286936 /* CDVJpegHeaderWriter.m in Sources */,
+ B9D46DA43EFA44B0B5DC01D4 /* CDVFile.m in Sources */,
+ 240ECC77DE3B4E7B80E053E8 /* CDVLocalFilesystem.m in Sources */,
+ 3B1C5F0E73914566A892C78A /* CDVAssetLibraryFilesystem.m in Sources */,
+ F3871362E1424CB29AF9A19A /* FileOpener2.m in Sources */,
+ 39BCCDC1AC364E0F8310A30D /* NSString+SSURLEncoding.m in Sources */,
+ 3D7AD0AE733244ACB712973D /* SocialSharing.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -428,7 +418,6 @@
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
- DEVELOPMENT_TEAM = DLK22E2679;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
diff --git a/cordova/platforms/ios/TagSpaces Beta.xcworkspace/xcshareddata/xcschemes/TagSpaces Beta.xcscheme b/cordova/platforms/ios/TagSpaces Beta.xcworkspace/xcshareddata/xcschemes/TagSpaces Beta.xcscheme
index ea8c0e532..7ae666f35 100644
--- a/cordova/platforms/ios/TagSpaces Beta.xcworkspace/xcshareddata/xcschemes/TagSpaces Beta.xcscheme
+++ b/cordova/platforms/ios/TagSpaces Beta.xcworkspace/xcshareddata/xcschemes/TagSpaces Beta.xcscheme
@@ -27,6 +27,8 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@@ -36,8 +38,8 @@
ReferencedContainer = "container:TagSpaces Beta.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <Testables>
- </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -59,6 +61,8 @@
ReferencedContainer = "container:TagSpaces Beta.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -81,7 +85,7 @@
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
- buildConfiguration = "Debug"
+ buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
diff --git a/cordova/platforms/ios/TagSpaces Beta.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate b/cordova/platforms/ios/TagSpaces Beta.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate
index d93ab9d70..cc06acc90 100644
Binary files a/cordova/platforms/ios/TagSpaces Beta.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate and b/cordova/platforms/ios/TagSpaces Beta.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/cordova/platforms/ios/TagSpaces Beta/Plugins/cordova-plugin-ios-xhr/CDVWKWebViewFileXhr.h b/cordova/platforms/ios/TagSpaces Beta/Plugins/cordova-plugin-ios-xhr/CDVWKWebViewFileXhr.h
deleted file mode 100644
index 0a729e6e5..000000000
--- a/cordova/platforms/ios/TagSpaces Beta/Plugins/cordova-plugin-ios-xhr/CDVWKWebViewFileXhr.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2016, 2017 Oracle and/or its affiliates.
- *
- * The Universal Permissive License (UPL), Version 1.0
- *
- * Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
- * software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
- * all copyright rights in the Software, and any and all patent rights owned or freely licensable by each
- * licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor,
- * or (ii) the Larger Works (as defined below), to deal in both
- *
- *
- * (a) the Software, and
- *
- * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
- * (each a “Larger Work” to which the Software is contributed by such licensors),
- *
- * without restriction, including without limitation the rights to copy, create derivative works of, display,
- * perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and
- * have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other
- * terms.
- *
- * This license is subject to the following condition:
- *
- * The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL
- * must be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#import <Foundation/Foundation.h>
-#import <Cordova/CDVPlugin.h>
-#import <WebKit/WebKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CDVWKWebViewFileXhr : CDVPlugin<WKScriptMessageHandler, NSURLSessionDelegate>
-
-/* Exec API */
-- (void)readAsText:(CDVInvokedUrlCommand*)command;
-- (void)readAsArrayBuffer:(CDVInvokedUrlCommand*)command;
-- (void) getConfig:(CDVInvokedUrlCommand*)command;
-
-@property (nonatomic, assign) BOOL allowsInsecureLoads;
-@property (nonatomic, strong) NSString * interceptRemoteRequests;
-//added
-@property (nonatomic, assign) BOOL allowFileAccessFromFileURLs;
-@property (nonatomic, assign) BOOL allowUniversalAccessFromFileURLs;
-
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/TagSpaces Beta/Plugins/cordova-plugin-ios-xhr/CDVWKWebViewFileXhr.m b/cordova/platforms/ios/TagSpaces Beta/Plugins/cordova-plugin-ios-xhr/CDVWKWebViewFileXhr.m
deleted file mode 100644
index ba9f1bf88..000000000
--- a/cordova/platforms/ios/TagSpaces Beta/Plugins/cordova-plugin-ios-xhr/CDVWKWebViewFileXhr.m
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * Copyright (c) 2016, 2017 Oracle and/or its affiliates.
- *
- * The Universal Permissive License (UPL), Version 1.0
- *
- * Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
- * software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
- * all copyright rights in the Software, and any and all patent rights owned or freely licensable by each
- * licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor,
- * or (ii) the Larger Works (as defined below), to deal in both
- *
- *
- * (a) the Software, and
- *
- * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
- * (each a “Larger Work” to which the Software is contributed by such licensors),
- *
- * without restriction, including without limitation the rights to copy, create derivative works of, display,
- * perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and
- * have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other
- * terms.
- *
- * This license is subject to the following condition:
- *
- * The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL
- * must be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#import "CDVWKWebViewFileXhr.h"
-#import <Cordova/CDV.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-
-@implementation NSDictionary(CDVWKWebViewFileXhr)
-
-/**
- Convenience method to return a NSString from a dictionary
-
- @param key The key to return
- @return The value as a String, or nil
- */
-- (nullable NSString *) cdvwkStringForKey:(NSString *)key
-{
- NSObject* val = self[key];
- if (val == nil)
- return nil;
- if ([val isKindOfClass:NSString.class])
- return (NSString *)val;
- return [NSString stringWithFormat:@"%@",val];
-}
-@end
-
-@interface CDVWKWebViewFileXhr()
-
-@property (nonatomic, retain) NSURLSession *urlSession;
-@property (nonatomic, retain) NSString *nativeXHRLogging;
-
-@end
-
-
-
-@implementation CDVWKWebViewFileXhr
-
--(void) pluginInitialize {
- [super pluginInitialize];
-
- if (![self.webView isKindOfClass:WKWebView.class])
- return;
-
- WKWebView *wkWebView = (WKWebView *) self.webView;
-
- // added : allowFileAccessFromFileURLs allowUniversalAccessFromFileURLs
- NSString *value = [self.commandDelegate.settings cdvwkStringForKey:@"allowfileaccessfromfileurls"];
-
- if (value != nil && [value isEqualToString:@"true"]){
- _allowFileAccessFromFileURLs = YES;
- NSLog(@"WARNING: File access allowed due to preference allowFileAccessFromFileURLs=true");
- }else{
- _allowFileAccessFromFileURLs = NO;
- }
- [wkWebView.configuration.preferences setValue:@(_allowFileAccessFromFileURLs) forKey:@"allowFileAccessFromFileURLs"];
-
- value = [self.commandDelegate.settings cdvwkStringForKey:@"allowuniversalaccessfromfileurls"];
- if (value != nil && [value isEqualToString:@"true"]){
- _allowUniversalAccessFromFileURLs = YES;
- NSLog(@"WARNING: Universal access allowed due to preference allowUniversalAccessFromFileURLs=true");
- }else{
- _allowUniversalAccessFromFileURLs = NO;
- }
- [wkWebView.configuration setValue:@(_allowUniversalAccessFromFileURLs) forKey:@"allowUniversalAccessFromFileURLs"];
-
- // note: settings translates all preferences to lower case
- value = [self.commandDelegate.settings cdvwkStringForKey:@"allowuntrustedcerts"];
- if (value != nil && [value compare:@"on" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
- _allowsInsecureLoads = YES;
- NSLog(@"WARNING: NativeXHR is allowing untrusted certificates due to preference AllowUntrustedCerts=on");
- }
-
- value = [self.commandDelegate.settings cdvwkStringForKey:@"interceptremoterequests"];
- if (value != nil &&
- ([value compare:@"all" options:NSCaseInsensitiveSearch] == NSOrderedSame ||
- [value compare:@"secureOnly" options:NSCaseInsensitiveSearch] == NSOrderedSame ||
- [value compare:@"none" options:NSCaseInsensitiveSearch] == NSOrderedSame)) {
- _interceptRemoteRequests = value;
- } else {
- _interceptRemoteRequests = @"secureOnly";
- }
-
- value = [self.commandDelegate.settings cdvwkStringForKey:@"nativexhrlogging"];
- if (value != nil &&
- ([value compare:@"none" options:NSCaseInsensitiveSearch] == NSOrderedSame ||
- [value compare:@"full" options:NSCaseInsensitiveSearch] == NSOrderedSame)) {
- _nativeXHRLogging = value;
- } else {
- _nativeXHRLogging = @"none";
- }
-
-
- if ([_interceptRemoteRequests compare:@"all" options:NSCaseInsensitiveSearch] == NSOrderedSame ||
- [_interceptRemoteRequests compare:@"secureOnly" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
-
- NSURLSessionConfiguration *sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
- [sessionConfiguration setRequestCachePolicy:NSURLRequestReloadIgnoringCacheData];
- self.urlSession = [NSURLSession sessionWithConfiguration:sessionConfiguration delegate:self delegateQueue:nil]; // FortityFalsePositive
- [wkWebView.configuration.userContentController addScriptMessageHandler:self name:@"nativeXHR"];
-
- }
-}
-
-- (void) dispose {
-
- if ([self.webView isKindOfClass:WKWebView.class]) {
-
- WKWebView *wkWebView = (WKWebView *) self.webView;
- [wkWebView.configuration.userContentController removeScriptMessageHandlerForName:@"nativeXHR"];
- }
- [super dispose];
-
-}
-/*!
- * @param uri target relative file from the XMLHttpRequest polyfill
- * @return URL relative to the main bundle's www folder if no file:// prefix is provided. Otherwise the file url is used as is to support /Library paths
- */
--(NSURL*)getWebContentResourceURL: (NSString*) uri
-{
- NSURL *targetURL = nil;
-
- if ([uri hasPrefix: @"file://"] || [uri hasPrefix: @"FILE://"])
- {
- targetURL = [NSURL URLWithString:uri];
- }
- else
- {
- NSURL *baseURL = [[NSBundle mainBundle] resourceURL];
- NSString *wwwuri = [NSString stringWithFormat:@"www/%@", uri];
- targetURL = [NSURL URLWithString:wwwuri relativeToURL:baseURL];
- }
-
- return targetURL;
-}
-
-/*!
- * @discussion Verifying the standardized path of the target URL is under the www
- * folder of the main bundle or under the application /Library folder
- *
- * @param targetURL target file under either the www folder of the main bundle or under the application /Library folder
- * @return true if the targetURL is within the www folder in the main bundle or under the application /Library folder
- */
--(BOOL)isWebContentResourceSecure: (NSURL*) targetURL
-{
- NSURL *baseURL = [NSURL URLWithString:@"www" relativeToURL:[[NSBundle mainBundle] resourceURL]];
- NSString *basePath = [baseURL absoluteString];
- NSString *targetPath = [[targetURL standardizedURL] absoluteString];
-
- return [targetPath hasPrefix:basePath] ||
- [targetPath hasPrefix:[[NSURL fileURLWithPath:
- [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]] absoluteString]];
-}
-
-/*!
- * @discussion Cordova API command impl that reads and return file data as a javascript string
- * @param command NSArray* arguments[0] - NSString* uri
- */
-- (void)readAsText:(CDVInvokedUrlCommand*)command
-{
- NSString *uri = [command.arguments.firstObject isKindOfClass: NSString.class] ? command.arguments.firstObject : nil;
- if (uri.length == 0) {
- // this catches nil value or empty string
- [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:404] callbackId:command.callbackId];
- return;
- }
-
- NSURL *targetURL = [self getWebContentResourceURL:uri];
-
- if (![self isWebContentResourceSecure:targetURL]) {
-
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION messageAsInt:404];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-
- } else {
-
- __weak CDVWKWebViewFileXhr* weakSelf = self;
- [self.commandDelegate runInBackground:^ {
-
- NSData* data = [[NSData alloc] initWithContentsOfURL:targetURL];
- CDVPluginResult* result = nil;
-
- if (data != nil) {
- NSString* str = [[NSString alloc] initWithBytesNoCopy:(void*)[data bytes] length:[data length] encoding:NSUTF8StringEncoding freeWhenDone:NO];
-
- // Check that UTF8 conversion did not fail.
- if (str != nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:str];
- result.associatedObject = data;
- }
- }
-
- if (result == nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:404];
- }
-
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }];
- }
-}
-
-/*!
- * @discussion Cordova API command impl that reads and return file data as a javascript arraybuffer
- * @param command NSArray* arguments[0] - NSString* uri
- */
-- (void)readAsArrayBuffer:(CDVInvokedUrlCommand*)command
-{
- NSString *uri = [command.arguments.firstObject isKindOfClass: NSString.class] ? command.arguments.firstObject : nil;
- if (uri.length == 0) {
- // this catches nil value or empty string
- [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:404] callbackId:command.callbackId];
- return;
- }
- NSURL *targetURL = [self getWebContentResourceURL:uri];
-
- if (![self isWebContentResourceSecure:targetURL]) {
-
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION messageAsInt:404];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-
- } else {
-
- __weak CDVWKWebViewFileXhr* weakSelf = self;
- [self.commandDelegate runInBackground:^ {
-
- NSData* data = [[NSData alloc] initWithContentsOfURL:targetURL];
-
- CDVPluginResult* result = nil;
- if (data != nil) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArrayBuffer:data];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:404];
- }
-
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }];
- }
-}
-
-- (void)getConfig:(CDVInvokedUrlCommand*)command {
-
- NSDictionary *dict = @{
- @"InterceptRemoteRequests" : _interceptRemoteRequests,
- @"NativeXHRLogging" : _nativeXHRLogging
- };
-
- [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dict] callbackId:command.callbackId];
-}
-
-
-- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
- completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler {
-
- if (_allowsInsecureLoads) {
- SecTrustRef serverTrust = challenge.protectionSpace.serverTrust;
- if (serverTrust) {
- CFDataRef exceptions = SecTrustCopyExceptions (serverTrust);
- SecTrustSetExceptions (serverTrust, exceptions);
- CFRelease (exceptions);
- completionHandler (NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:serverTrust]); // FortityFalsePositive
-
- return;
- }
- }
- completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
-}
-
-
-// MARK: - WKScriptMessageHandler
-
-/**
- * Performs an asynchronous network load of the requested resource using native networking routines.
- *
- * The request is described in the body parameter as a dictionary. The supported keys are outlined below
- *
- * Name | Kind | Required | Description | Allowed Values
- * --- | --- | --- | --- | ---
- * id | string | true | A unique id used for callbacks | any valid non-empty string
- * callback | string | true | a javascript function that will be invoked on callbacks | any valid javascript function
- * url | string | true | The URL to load | A valid URL
- * method | string | false | The http method | Valid HTTP method. Defaults to GET
- * headers | object {string, string} | false | Additional request headers |
- * body | string (base 64 encoded) | false | The http request body |
- * timeout | number | false | Request timeout (seconds) | any positive value
- *
- * The callback function takes two arguments. The first argument is the unique identifier supplied in the request
- * object. The second argument is a java object defining the HTTP result.
- */
-- (void) performNativeXHR:(NSDictionary<NSString *, id> *) body inWebView:(WKWebView *) webView {
-
- NSString *requestId = [body cdvwkStringForKey:@"id"];
- NSString *callbackFunction = [body cdvwkStringForKey:@"callback"];
- NSString *urlString = [body cdvwkStringForKey:@"url"];
- NSString *method = [body cdvwkStringForKey:@"method"];
-
- __weak WKWebView* weakWebView = webView;
-
- void(^sendResult)(NSDictionary *) = ^void(NSDictionary *result) {
- dispatch_async(dispatch_get_main_queue(), ^{
-
- NSError *jsonError;
- NSData* json = [NSJSONSerialization dataWithJSONObject:result options:0 error:&jsonError];
-
- if (jsonError != nil) {
- NSLog(@"NativeXHR: Failed to encode response to json: %@", jsonError.localizedDescription); // FortityFalsePositive
-
- NSString *script = [NSString stringWithFormat:@"try { %@('%@', {'error' : 'json serialization failed'}) } catch (e) { }", callbackFunction, requestId];
- [weakWebView evaluateJavaScript:script completionHandler:nil];
- return;
- }
-
- NSString *script = [NSString stringWithFormat:@"try { %@('%@', %@) } catch (e) { }", callbackFunction, requestId, [[NSString alloc] initWithData:json encoding:NSUTF8StringEncoding]];
- [weakWebView evaluateJavaScript:script completionHandler:nil];
-
- });
- };
-
-
- if (requestId.length == 0 || callbackFunction.length == 0 ) {
- NSLog(@"NativeXHR: Required parameters id and callback url were not supplied.");
- return;
- }
-
- if (urlString.length == 0) {
- return sendResult( @{ @"error" : @"Invalid url"});
- }
-
- NSURL *url = [NSURL URLWithString:urlString];
-
- if (![url.scheme.lowercaseString isEqualToString:@"http"] && ![url.scheme.lowercaseString isEqualToString:@"https"]) {
- NSString *msg = [NSString stringWithFormat:@"NativeXHR: Invalid url scheme '%@'; only http and https are supported by NativeXHR", url.scheme];
- return sendResult( @{ @"error" : msg});
- }
-
- __block NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
- if (method.length)
- request.HTTPMethod = [method uppercaseString];
-
- id val = [body objectForKey:@"timeout"];
- if ([val isKindOfClass:NSNumber.class]) {
- request.timeoutInterval = [(NSNumber *) val doubleValue];
- }
-
-
- val = [body objectForKey:@"headers"];
- if ([val isKindOfClass:NSDictionary.class]) {
- [(NSDictionary *) val enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
- if (![key isKindOfClass:NSString.class] || ![obj isKindOfClass:NSString.class])
- return;
- [request setValue:(NSString *)obj forHTTPHeaderField:(NSString *)key];
- }];
- }
-
- NSString *body64 = [body cdvwkStringForKey:@"body"];
- if (body64.length) {
- request.HTTPBody = [[NSData alloc] initWithBase64EncodedString:body64 options:0];
- }
-
- NSURLSessionDataTask *task = [self.urlSession dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { // FortityFalsePositive
-
- NSMutableDictionary* result = [NSMutableDictionary dictionary];
-
- if (data != nil) {
- result[@"data"] = [[NSString alloc] initWithData:[data base64EncodedDataWithOptions:0] encoding:NSUTF8StringEncoding];
- }
- if (response != nil) {
- NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
- dictionary[@"expectedContentLength"] = @(response.expectedContentLength);
- dictionary[@"suggestedFileName"] = response.suggestedFilename;
- dictionary[@"mimeType"] = response.MIMEType;
- dictionary[@"url"] = response.URL.absoluteString;
- dictionary[@"textEncodingName"] = response.textEncodingName;
- if ([response isKindOfClass:NSHTTPURLResponse.class]) {
- NSHTTPURLResponse* urlResponse = (NSHTTPURLResponse *) response;
- dictionary[@"allHeaderFields"] = urlResponse.allHeaderFields;
- dictionary[@"statusCode"] = @(urlResponse.statusCode);
- dictionary[@"localizedStatusCode"] = [NSHTTPURLResponse localizedStringForStatusCode:urlResponse.statusCode];
- }
-
- result[@"response"] = dictionary;
- }
-
- if (error != nil) {
- result[@"error"] = [error localizedDescription];
- result[@"underlyingErrorCode"] = @(error.code);
- }
- sendResult(result);
- }];
-
- task.taskDescription = requestId;
- [task resume];
-}
-
-- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
-
- if (![message.name isEqualToString:@"nativeXHR"] || ![message.body isKindOfClass:NSDictionary.class]) {
- NSLog(@"NativeXHR: Invalid script message '%@' with body '%@' received. Ignoring.", message.name, message.body);
- return;
- }
- __weak __typeof(message.webView) weakWebView = message.webView;
- NSDictionary<NSString *, id> *body = message.body;
-
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- [self performNativeXHR:body inWebView:weakWebView];
- });
-
-}
-
-@end
-
-NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/TagSpaces Beta/config.xml b/cordova/platforms/ios/TagSpaces Beta/config.xml
index 123b15bcc..0461abe51 100644
--- a/cordova/platforms/ios/TagSpaces Beta/config.xml
+++ b/cordova/platforms/ios/TagSpaces Beta/config.xml
@@ -45,10 +45,6 @@
<feature name="FileOpener2">
<param name="ios-package" value="FileOpener2" />
</feature>
- <feature name="CDVWKWebViewFileXhr">
- <param name="ios-package" value="CDVWKWebViewFileXhr" />
- <param name="onload" value="true" />
- </feature>
<feature name="SocialSharing">
<param name="ios-package" value="SocialSharing" />
<param name="onload" value="true" />
@@ -87,6 +83,4 @@
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
- <preference name="NativeXHRLogging" value="full" />
- <preference name="allowFileAccessFromFileURLs" value="true" />
</widget>
diff --git a/cordova/platforms/ios/frameworks.json b/cordova/platforms/ios/frameworks.json
index 6dc84e887..e430f8008 100644
--- a/cordova/platforms/ios/frameworks.json
+++ b/cordova/platforms/ios/frameworks.json
@@ -2,7 +2,6 @@
"ImageIO.framework": 1,
"CoreLocation.framework": 1,
"AVFoundation.framework": 1,
- "WebKit.framework": 1,
"Social.framework": 1,
"MessageUI.framework": 1
}
\ No newline at end of file
diff --git a/cordova/platforms/ios/ios.json b/cordova/platforms/ios/ios.json
index 44e72154d..b1f31b22e 100644
--- a/cordova/platforms/ios/ios.json
+++ b/cordova/platforms/ios/ios.json
@@ -36,10 +36,6 @@
"xml": "<feature name=\"FileOpener2\"><param name=\"ios-package\" value=\"FileOpener2\" /></feature>",
"count": 1
},
- {
- "xml": "<feature name=\"CDVWKWebViewFileXhr\"><param name=\"ios-package\" value=\"CDVWKWebViewFileXhr\" /><param name=\"onload\" value=\"true\" /></feature>",
- "count": 1
- },
{
"xml": "<feature name=\"SocialSharing\"><param name=\"ios-package\" value=\"SocialSharing\" /><param name=\"onload\" value=\"true\" /></feature>",
"count": 1
@@ -90,9 +86,6 @@
"cordova-plugin-file-opener2": {
"PACKAGE_NAME": "org.tagspaces.iosn"
},
- "cordova-plugin-ios-xhr": {
- "PACKAGE_NAME": "org.tagspaces.iosn"
- },
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "org.tagspaces.iosn"
},
@@ -345,30 +338,6 @@
"cordova.plugins.fileOpener2"
]
},
- {
- "id": "cordova-plugin-ios-xhr.formdata-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.xhr-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.fetch-bootstrap",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.fetch-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
{
"id": "es6-promise-plugin.Promise",
"file": "plugins/es6-promise-plugin/www/promise.js",
@@ -391,7 +360,6 @@
"cordova-plugin-camera": "4.1.0",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-opener2": "3.0.4",
- "cordova-plugin-ios-xhr": "1.0.0",
"cordova-plugin-whitelist": "1.3.4",
"es6-promise-plugin": "4.2.2",
"cordova-plugin-x-socialsharing": "5.6.8"
diff --git a/cordova/platforms/ios/platform_www/cordova_plugins.js b/cordova/platforms/ios/platform_www/cordova_plugins.js
index f47ca9ffa..8a50dbbfb 100644
--- a/cordova/platforms/ios/platform_www/cordova_plugins.js
+++ b/cordova/platforms/ios/platform_www/cordova_plugins.js
@@ -238,30 +238,6 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"cordova.plugins.fileOpener2"
]
},
- {
- "id": "cordova-plugin-ios-xhr.formdata-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.xhr-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.fetch-bootstrap",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.fetch-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
{
"id": "es6-promise-plugin.Promise",
"file": "plugins/es6-promise-plugin/www/promise.js",
@@ -284,7 +260,6 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"cordova-plugin-camera": "4.1.0",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-opener2": "3.0.4",
- "cordova-plugin-ios-xhr": "1.0.0",
"cordova-plugin-whitelist": "1.3.4",
"es6-promise-plugin": "4.2.2",
"cordova-plugin-x-socialsharing": "5.6.8"
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js
deleted file mode 100644
index 79dbf5c89..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js
+++ /dev/null
@@ -1,10 +0,0 @@
-cordova.define("cordova-plugin-ios-xhr.fetch-bootstrap", function(require, exports, module) {
-'use strict';
-
-(function ()
-{
- var _fetch = window.fetch;
- window.fetch = undefined;
-})();
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js
deleted file mode 100644
index ea01fe5aa..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js
+++ /dev/null
@@ -1,365 +0,0 @@
-cordova.define("cordova-plugin-ios-xhr.formdata-polyfill", function(require, exports, module) {
-/*
- * Copyright (c) 2018 Oracle and/or its affiliates.
- *
- * The Universal Permissive License (UPL), Version 1.0
- *
- * Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
- * software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
- * all copyright rights in the Software, and any and all patent rights owned or freely licensable by each
- * licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor,
- * or (ii) the Larger Works (as defined below), to deal in both
- *
- *
- * (a) the Software, and
- *
- * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
- * (each a “Larger Work” to which the Software is contributed by such licensors),
- *
- * without restriction, including without limitation the rights to copy, create derivative works of, display,
- * perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and
- * have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other
- * terms.
- *
- * This license is subject to the following condition:
- *
- * The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL
- * must be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Native Safari FormData only implements the append method. This polyfill is used in
- * tandem with the xhr-polyfill.
- *
- * Two additional functions in this FormData implementation:
- * 1) __getNative - returns the native Safari FormData object.
- * 2) __getRequestParts - returns a promise resolving an object {contentType:string, body:string}.
- */
-'use strict';
-(function ()
-{
- function __FormData(formElement)
- {
- this._map = new Map();
-
- if (!HTMLFormElement.prototype.isPrototypeOf(formElement))
- return;
-
- var elements = formElement.elements;
- for (var i = 0; i < elements.length; i++)
- {
- var element = elements[i];
-
- var name = element.name ? element.name : element.id;
- if (!name)
- continue;
-
- if (element.type === 'file')
- {
- for (var file of element.files)
- this.append(name, file);
- }
- else if (['select-multiple', 'select-one'].indexOf(element.value) > -1)
- {
- for (var option of element.selectedOptions)
- this.append(name, option);
- }
- else if (['checkbox', 'radio'].indexOf(element.value) > -1 && element.checked)
- {
- this.append(name, element.value);
- }
- else
- {
- this.append(name, element.value);
- }
- }
- }
-
- if( 'Symbol' in window && typeof Symbol() === 'symbol'){
- Object.defineProperty( __FormData.prototype, Symbol.toStringTag, {
- get : function(){
- return 'FormData';
- }
- });
- }
-
- __FormData.prototype.get = function (name)
- {
- var values = this.getAll(name);
-
- if (values && values.length > 0)
- return values[0];
- else
- return undefined;
- };
-
- __FormData.prototype.getAll = function (name)
- {
- var map = this._map;
- var values = map.get(name);
- if (!values)
- values = [];
-
- return values;
- };
-
- __FormData.prototype.set = function (name, value, filename)
- {
- var map = this._map;
-
- if (value && Blob.prototype.isPrototypeOf(value))
- {
- if (!filename)
- filename = "Blob";
-
- Object.defineProperty(value, "name", {value: filename});
- }
-
- map.set(name, [value]);
- };
-
-
- __FormData.prototype.append = function (name, value, filename)
- {
- var map = this._map;
- var values = map.get(name);
-
- this.set(name, value, filename);
- if (values)
- {
- values.push(map.get(name)[0]);
- map.set(name, values);
- }
- };
-
- __FormData.prototype.delete = function (name)
- {
- var map = this._map;
- map.delete(name);
- };
-
- __FormData.prototype.has = function (name)
- {
- var map = this._map;
- return map.has(name);
- };
-
- __FormData.prototype.keys = function ()
- {
- var map = this._map;
- return map.keys();
- };
-
- __FormData.prototype.values = function ()
- {
- var map = this._map;
- var allvalues = [];
-
- var vit = map.values();
- var entry = vit.next();
- while (entry && !entry.done)
- {
- var values = entry.value;
- for (var i = 0; i < values.length; i++)
- allvalues.push(values[i]);
-
- entry = vit.next();
- }
-
- return __FormData._makeIterator(allvalues);
- };
-
- __FormData.prototype.entries = function ()
- {
- var map = this._map;
- var allentries = [];
-
- for (var key of map.keys())
- {
- var values = map.get(key);
- for (var i = 0; i < values.length; i++)
- {
- allentries.push([key, values[i]]);
- }
- }
-
- return __FormData._makeIterator(allentries);
- };
-
- __FormData.prototype.forEach = function(callback)
- {
- var eit = this.entries();
- var entry = eit.next();
- while(!entry.done)
- {
- callback.call(this, entry.value[1], entry.value[0], this);
- entry = eit.next();
- }
- };
-
- __FormData.prototype.toString = function ()
- {
- return "[object FormData]";
- };
-
- __FormData.prototype.__getRequestParts = function ()
- {
- var promise = new Promise(function (resolve)
- {
- __FormData._getRequestValues(this.entries()).then(function (entries)
- {
- var parts = __FormData._getMultipartRequest(entries);
-
- resolve(parts);
- });
- }.bind(this));
-
- return promise;
- };
-
- __FormData.prototype.__getNative = function ()
- {
- var fd = new window._FormData();
- var eit = this.entries();
- var entry = eit.next();
- while (!entry.done)
- {
- if (entry.value[1] && Blob.prototype.isPrototypeOf(entry.value[1]))
- fd.append(entry.value[0], entry.value[1], entry.value[1].name);
- else
- fd.append(entry.value[0], entry.value[1]);
-
- entry = eit.next();
- }
-
- return fd;
- };
-
- __FormData._getMultipartRequest = function (entries)
- {
- var boundary = "----cordovaPluginWkwebviewFileXhrFormdata" + Math.random().toString(32);
- var parts = {"contentType": "multipart/form-data; boundary=" + boundary, body: ""};
- var bodyEntries = [];
-
- for (var i = 0; i < entries.length; i++)
- {
- var entry = entries[i];
- for (var data of __FormData._generateMultipartFormData(entry, boundary))
- bodyEntries.push(data);
- }
-
- bodyEntries.push("--" + boundary + "--");
- parts.body = new Blob(bodyEntries, {type: "application/octet-stream"});
-
- return parts;
- };
-
- __FormData._makeIterator = function (array)
- {
- var i = 0;
- return {
- next: function ()
- {
- if (i < array.length)
- return {done: false, value: array[i++]};
- else
- return {done: true, value: undefined};
- }
- };
- };
-
- __FormData._getRequestValues = function (entriesIterator)
- {
- var promises = [];
- var entry = entriesIterator.next();
- while (!entry.done)
- {
- promises.push(__FormData._normalizeEntry(entry));
- entry = entriesIterator.next();
- }
-
- return Promise.all(promises);
- };
-
- __FormData._normalizeEntry = function (entry)
- {
- var promise = new Promise(function (resolve)
- {
-
- var name = entry.value[0];
- var value = entry.value[1];
-
- if (value &&
- (Blob.prototype.isPrototypeOf(value) ||
- File.prototype.isPrototypeOf(value)))
- {
-
- var filename = value.name;
- var type = value.type ? value.type : "application/octet-binary;";
- var reader = new FileReader();
- var resolve;
-
- reader.onload = function ()
- {
- resolve({name: name, value: reader.result, filename: filename, type: type});
- };
-
- reader.onerror = function ()
- {
- resolve({name: name, value: reader.error, filename: filename, type: type});
- };
-
- reader.readAsArrayBuffer(value);
- }
- else
- {
- promise = resolve({name: name, value: value});
- }
- });
-
- return promise;
- };
-
- __FormData._generateMultipartFormData = function (entry, boundary)
- {
- var data = [];
-
- data.push("--" + boundary + "\r\n");
- if (!entry['filename'])
- {
- data.push('content-disposition: form-data; name="');
- data.push(entry.name);
- data.push('"\r\n');
- data.push('\r\n');
- data.push(entry.value);
- data.push("\r\n");
- }
- else
- {
- // Describe it as form data
- data.push('content-disposition: form-data; name="');
- data.push(entry.name)
- data.push('"; filename="');
- data.push(entry.filename);
- data.push('"\r\n');
- data.push('Content-Type: ');
- data.push(entry.type);
- data.push('\r\n\r\n');
- data.push(entry.value);
- data.push('\r\n');
- }
-
- return data;
- };
-
- window._FormData = window.FormData;
- window.FormData = __FormData;
-})();
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js
deleted file mode 100644
index 7b5fce803..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js
+++ /dev/null
@@ -1,464 +0,0 @@
-cordova.define("cordova-plugin-ios-xhr.fetch-polyfill", function(require, exports, module) {
-(function(self) {
- 'use strict';
-
- if (self.fetch) {
- return
- }
-
- var support = {
- searchParams: 'URLSearchParams' in self,
- iterable: 'Symbol' in self && 'iterator' in Symbol,
- blob: 'FileReader' in self && 'Blob' in self && (function() {
- try {
- new Blob()
- return true
- } catch(e) {
- return false
- }
- })(),
- formData: 'FormData' in self,
- arrayBuffer: 'ArrayBuffer' in self
- }
-
- if (support.arrayBuffer) {
- var viewClasses = [
- '[object Int8Array]',
- '[object Uint8Array]',
- '[object Uint8ClampedArray]',
- '[object Int16Array]',
- '[object Uint16Array]',
- '[object Int32Array]',
- '[object Uint32Array]',
- '[object Float32Array]',
- '[object Float64Array]'
- ]
-
- var isDataView = function(obj) {
- return obj && DataView.prototype.isPrototypeOf(obj)
- }
-
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
- }
- }
-
- function normalizeName(name) {
- if (typeof name !== 'string') {
- name = String(name)
- }
- if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name')
- }
- return name.toLowerCase()
- }
-
- function normalizeValue(value) {
- if (typeof value !== 'string') {
- value = String(value)
- }
- return value
- }
-
- // Build a destructive iterator for the value list
- function iteratorFor(items) {
- var iterator = {
- next: function() {
- var value = items.shift()
- return {done: value === undefined, value: value}
- }
- }
-
- if (support.iterable) {
- iterator[Symbol.iterator] = function() {
- return iterator
- }
- }
-
- return iterator
- }
-
- function Headers(headers) {
- this.map = {}
-
- if (headers instanceof Headers) {
- headers.forEach(function(value, name) {
- this.append(name, value)
- }, this)
- } else if (Array.isArray(headers)) {
- headers.forEach(function(header) {
- this.append(header[0], header[1])
- }, this)
- } else if (headers) {
- Object.getOwnPropertyNames(headers).forEach(function(name) {
- this.append(name, headers[name])
- }, this)
- }
- }
-
- Headers.prototype.append = function(name, value) {
- name = normalizeName(name)
- value = normalizeValue(value)
- var oldValue = this.map[name]
- this.map[name] = oldValue ? oldValue+','+value : value
- }
-
- Headers.prototype['delete'] = function(name) {
- delete this.map[normalizeName(name)]
- }
-
- Headers.prototype.get = function(name) {
- name = normalizeName(name)
- return this.has(name) ? this.map[name] : null
- }
-
- Headers.prototype.has = function(name) {
- return this.map.hasOwnProperty(normalizeName(name))
- }
-
- Headers.prototype.set = function(name, value) {
- this.map[normalizeName(name)] = normalizeValue(value)
- }
-
- Headers.prototype.forEach = function(callback, thisArg) {
- for (var name in this.map) {
- if (this.map.hasOwnProperty(name)) {
- callback.call(thisArg, this.map[name], name, this)
- }
- }
- }
-
- Headers.prototype.keys = function() {
- var items = []
- this.forEach(function(value, name) { items.push(name) })
- return iteratorFor(items)
- }
-
- Headers.prototype.values = function() {
- var items = []
- this.forEach(function(value) { items.push(value) })
- return iteratorFor(items)
- }
-
- Headers.prototype.entries = function() {
- var items = []
- this.forEach(function(value, name) { items.push([name, value]) })
- return iteratorFor(items)
- }
-
- if (support.iterable) {
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries
- }
-
- function consumed(body) {
- if (body.bodyUsed) {
- return Promise.reject(new TypeError('Already read'))
- }
- body.bodyUsed = true
- }
-
- function fileReaderReady(reader) {
- return new Promise(function(resolve, reject) {
- reader.onload = function() {
- resolve(reader.result)
- }
- reader.onerror = function() {
- reject(reader.error)
- }
- })
- }
-
- function readBlobAsArrayBuffer(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsArrayBuffer(blob)
- return promise
- }
-
- function readBlobAsText(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsText(blob)
- return promise
- }
-
- function readArrayBufferAsText(buf) {
- var view = new Uint8Array(buf)
- var chars = new Array(view.length)
-
- for (var i = 0; i < view.length; i++) {
- chars[i] = String.fromCharCode(view[i])
- }
- return chars.join('')
- }
-
- function bufferClone(buf) {
- if (buf.slice) {
- return buf.slice(0)
- } else {
- var view = new Uint8Array(buf.byteLength)
- view.set(new Uint8Array(buf))
- return view.buffer
- }
- }
-
- function Body() {
- this.bodyUsed = false
-
- this._initBody = function(body) {
- this._bodyInit = body
- if (!body) {
- this._bodyText = ''
- } else if (typeof body === 'string') {
- this._bodyText = body
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
- this._bodyBlob = body
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
- this._bodyFormData = body
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this._bodyText = body.toString()
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
- this._bodyArrayBuffer = bufferClone(body.buffer)
- // IE 10-11 can't handle a DataView body.
- this._bodyInit = new Blob([this._bodyArrayBuffer])
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
- this._bodyArrayBuffer = bufferClone(body)
- } else {
- throw new Error('unsupported BodyInit type')
- }
-
- if (!this.headers.get('content-type')) {
- if (typeof body === 'string') {
- this.headers.set('content-type', 'text/plain;charset=UTF-8')
- } else if (this._bodyBlob && this._bodyBlob.type) {
- this.headers.set('content-type', this._bodyBlob.type)
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
- }
- }
- }
-
- if (support.blob) {
- this.blob = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
-
- if (this._bodyBlob) {
- return Promise.resolve(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as blob')
- } else {
- return Promise.resolve(new Blob([this._bodyText]))
- }
- }
-
- this.arrayBuffer = function() {
- if (this._bodyArrayBuffer) {
- return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
- } else {
- return this.blob().then(readBlobAsArrayBuffer)
- }
- }
- }
-
- this.text = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
-
- if (this._bodyBlob) {
- return readBlobAsText(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as text')
- } else {
- return Promise.resolve(this._bodyText)
- }
- }
-
- if (support.formData) {
- this.formData = function() {
- return this.text().then(decode)
- }
- }
-
- this.json = function() {
- return this.text().then(JSON.parse)
- }
-
- return this
- }
-
- // HTTP methods whose capitalization should be normalized
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
-
- function normalizeMethod(method) {
- var upcased = method.toUpperCase()
- return (methods.indexOf(upcased) > -1) ? upcased : method
- }
-
- function Request(input, options) {
- options = options || {}
- var body = options.body
-
- if (input instanceof Request) {
- if (input.bodyUsed) {
- throw new TypeError('Already read')
- }
- this.url = input.url
- this.credentials = input.credentials
- if (!options.headers) {
- this.headers = new Headers(input.headers)
- }
- this.method = input.method
- this.mode = input.mode
- if (!body && input._bodyInit != null) {
- body = input._bodyInit
- input.bodyUsed = true
- }
- } else {
- this.url = String(input)
- }
-
- this.credentials = options.credentials || this.credentials || 'omit'
- if (options.headers || !this.headers) {
- this.headers = new Headers(options.headers)
- }
- this.method = normalizeMethod(options.method || this.method || 'GET')
- this.mode = options.mode || this.mode || null
- this.referrer = null
-
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
- throw new TypeError('Body not allowed for GET or HEAD requests')
- }
- this._initBody(body)
- }
-
- Request.prototype.clone = function() {
- return new Request(this, { body: this._bodyInit })
- }
-
- function decode(body) {
- var form = new FormData()
- body.trim().split('&').forEach(function(bytes) {
- if (bytes) {
- var split = bytes.split('=')
- var name = split.shift().replace(/\+/g, ' ')
- var value = split.join('=').replace(/\+/g, ' ')
- form.append(decodeURIComponent(name), decodeURIComponent(value))
- }
- })
- return form
- }
-
- function parseHeaders(rawHeaders) {
- var headers = new Headers()
- rawHeaders.split(/\r?\n/).forEach(function(line) {
- var parts = line.split(':')
- var key = parts.shift().trim()
- if (key) {
- var value = parts.join(':').trim()
- headers.append(key, value)
- }
- })
- return headers
- }
-
- Body.call(Request.prototype)
-
- function Response(bodyInit, options) {
- if (!options) {
- options = {}
- }
-
- this.type = 'default'
- this.status = 'status' in options ? options.status : 200
- this.ok = this.status >= 200 && this.status < 300
- this.statusText = 'statusText' in options ? options.statusText : 'OK'
- this.headers = new Headers(options.headers)
- this.url = options.url || ''
- this._initBody(bodyInit)
- }
-
- Body.call(Response.prototype)
-
- Response.prototype.clone = function() {
- return new Response(this._bodyInit, {
- status: this.status,
- statusText: this.statusText,
- headers: new Headers(this.headers),
- url: this.url
- })
- }
-
- Response.error = function() {
- var response = new Response(null, {status: 0, statusText: ''})
- response.type = 'error'
- return response
- }
-
- var redirectStatuses = [301, 302, 303, 307, 308]
-
- Response.redirect = function(url, status) {
- if (redirectStatuses.indexOf(status) === -1) {
- throw new RangeError('Invalid status code')
- }
-
- return new Response(null, {status: status, headers: {location: url}})
- }
-
- self.Headers = Headers
- self.Request = Request
- self.Response = Response
-
- self.fetch = function(input, init) {
- return new Promise(function(resolve, reject) {
- var request = new Request(input, init)
- var xhr = new XMLHttpRequest()
-
- xhr.onload = function() {
- var options = {
- status: xhr.status,
- statusText: xhr.statusText,
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
- }
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
- var body = 'response' in xhr ? xhr.response : xhr.responseText
- resolve(new Response(body, options))
- }
-
- xhr.onerror = function() {
- reject(new TypeError('Network request failed'))
- }
-
- xhr.ontimeout = function() {
- reject(new TypeError('Network request failed'))
- }
-
- xhr.open(request.method, request.url, true)
-
- if (request.credentials === 'include') {
- xhr.withCredentials = true
- }
-
- if ('responseType' in xhr && support.blob) {
- xhr.responseType = 'blob'
- }
-
- request.headers.forEach(function(value, name) {
- xhr.setRequestHeader(name, value)
- })
-
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
- })
- }
- self.fetch.polyfill = true
-})(typeof self !== 'undefined' ? self : this);
-
-});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js
deleted file mode 100644
index e553ba26a..000000000
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js
+++ /dev/null
@@ -1,1249 +0,0 @@
-cordova.define("cordova-plugin-ios-xhr.xhr-polyfill", function(require, exports, module) {
-/*
- * Copyright (c) 2018 Oracle and/or its affiliates.
- *
- * The Universal Permissive License (UPL), Version 1.0
- *
- * Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
- * software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
- * all copyright rights in the Software, and any and all patent rights owned or freely licensable by each
- * licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor,
- * or (ii) the Larger Works (as defined below), to deal in both
- *
- *
- * (a) the Software, and
- *
- * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
- * (each a “Larger Work” to which the Software is contributed by such licensors),
- *
- * without restriction, including without limitation the rights to copy, create derivative works of, display,
- * perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and
- * have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other
- * terms.
- *
- * This license is subject to the following condition:
- *
- * The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL
- * must be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-'use strict';
-(function ()
-{
-
-
- var exec = require('cordova/exec');
-
- // Handles native file:// XHR GET requests
- function FileHandler(reqContext, config)
- {
- this._reqContext = reqContext;
- this._config = config;
- }
-
- FileHandler._getMimeType = function (reqContext)
- {
- if (reqContext.overrideMimeType)
- return reqContext.overrideMimeType;
- else if (reqContext.responseHeaders['content-type'])
- return reqContext.responseHeaders['content-type'];
-
- var url = reqContext.url;
- var ext = url.substr(url.lastIndexOf('.'));
- return FileHandler._EXT_TO_MIME[ext] ? FileHandler._EXT_TO_MIME[ext] : "";
- };
-
- FileHandler.getHandlerForResponseType = function (reqContext)
- {
- var responseType = reqContext.responseType;
- if (FileHandler._RESPONSE_HANDLERS[responseType])
- return FileHandler._RESPONSE_HANDLERS[responseType];
- else
- return FileHandler._RESPONSE_HANDLERS["text"];
- };
-
- FileHandler._EXT_TO_MIME = {
- ".img": "image/jpeg",
- ".png": "image/png",
- ".gif": "image/gif",
- ".xml": "application/xml",
- ".xsl": "application/xml",
- ".html": "text/html",
- ".htm": "text/html",
- ".svg": "image/svg+xml",
- ".svgz": "image/svg+xml",
- ".json": "application/json",
- ".js": "application/javascript"
- };
-
- FileHandler._RESPONSE_HANDLERS =
- {
- "text":
- {
- action: "readAsText",
- properties: ["response", "responseText"],
- convert: function (mimeType, r)
- {
- this._size = r["length"];
- return r;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- },
- "arraybuffer":
- {
- action: "readAsArrayBuffer",
- properties: ["response"],
- convert: function (mimeType, r)
- {
- this._size = r["byteLength"];
- return r;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- },
- "json":
- {
- action: "readAsText",
- properties: ["response"],
- convert: function (mimeType, r)
- {
- this._size = r["length"];
- try
- {
- r = JSON.parse(r);
- }
- catch (e)
- {
- }
-
- return r;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- },
- "document":
- {
- action: "readAsText",
- properties: ["response", "responseXML"],
- convert: function (mimeType, r)
- {
- this._size = r["length"];
- try
- {
- r = new DOMParser().parseFromString(r, "text/xml");
- }
- catch (e)
- {
- }
- return r;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- },
- "blob":
- {
- action: "readAsArrayBuffer",
- properties: ["response"],
- convert: function (mimeType, r)
- {
- var blob = new Blob([r], {"type": mimeType});
- this._size = blob.size;
- return blob;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- }
- };
-
- FileHandler.prototype._isTraceLoggingEnabled = function ()
- {
- return this._config["NativeXHRLogging"] === "full";
- };
-
- FileHandler._presend = function (reqContext)
- {
- reqContext.dispatchReadyStateChangeEvent(1); // OPEN
- reqContext.dispatchProgressEvent("loadstart");
- // no upload events for a GET
- };
-
- FileHandler._error = function (reqContext, e)
- {
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native file XHR Response: Unable to find file %o\n%o", reqContext.url, e);
-
- reqContext.status = 404;
- reqContext.responseText = "File Not Found";
-
- reqContext.dispatchReadyStateChangeEvent(2); // HEADERS_RECIEVED
- reqContext.dispatchReadyStateChangeEvent(3); // LOADING
- reqContext.dispatchProgressEvent("progress");
-
- reqContext.dispatchReadyStateChangeEvent(4); // DONE
- reqContext.dispatchProgressEvent("error");
- reqContext.dispatchProgressEvent("loadend");
- };
-
- FileHandler._success = function (reqContext, rspTypeHandler, result)
- {
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native file XHR Response:\n%o\n", reqContext.url, result);
-
- var mimeType = FileHandler._getMimeType(reqContext);
- var convertedResult = rspTypeHandler.convert(mimeType, result);
-
- var respSize = rspTypeHandler.responseSize();
- for (var i = 0; i < rspTypeHandler.properties.length; i++)
- reqContext[rspTypeHandler.properties[i]] = convertedResult;
-
- reqContext.status = 200;
- reqContext.statusText = "OK";
- reqContext.responseURL = reqContext.url;
-
- reqContext.dispatchReadyStateChangeEvent(2); // HEADERS_RECIEVED
- reqContext.dispatchReadyStateChangeEvent(3); // LOADING
- reqContext.dispatchProgressEvent("progress", respSize);
- reqContext.dispatchReadyStateChangeEvent(4); // DONE
- reqContext.dispatchProgressEvent("load", respSize);
- reqContext.dispatchProgressEvent("loadend", respSize);
- };
-
- FileHandler.prototype.send = function ()
- {
- var reqContext = this._reqContext;
- var rspTypeHandler = FileHandler.getHandlerForResponseType(reqContext);
-
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native file XHR Request:\n%o", reqContext.url);
-
- FileHandler._presend(reqContext);
-
- exec(FileHandler._success.bind(this, reqContext, rspTypeHandler),
- FileHandler._error.bind(this, reqContext),
- "CDVWKWebViewFileXhr", rspTypeHandler.action, [reqContext.url]);
- };
-
- // handles http and https native XHR requests
- function HttpHandler(reqContext, config)
- {
- this._reqContext = reqContext;
- this._config = config;
- }
-
- HttpHandler._generateId = function ()
- {
- return [performance.now().toString(16), Math.random().toString(16)].join("-"); // FortifyFalsePositive
- };
-
- HttpHandler._convertTextToBinaryBase64String = function(mimeType, text)
- {
- var blob = new Blob([text], {type: mimeType});
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
- var base64str = btoa(reader.result);
- resolve(base64str);
- };
- reader.onerror = function ()
- {
- var base64str = btoa(reader.error);
- reject(base64str);
- };
- });
-
- reader.readAsBinaryString(blob);
-
- return promise;
- };
-
- HttpHandler._REQUEST_HANDLERS =
- {
- "": {
- convert: function (reqContext)
- {
- return Promise.resolve(null);
- }
- },
- "ArrayBuffer": {
- convert: function (reqContext)
- {
- var body = reqContext.requestData;
-
- var type = reqContext.requestHeaders['content-type'];
- if (!type)
- type = reqContext.requestHeaders['content-type'] = "application/octet-binary;";
-
- var blob = new Blob([body], {type: type});
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
- var base64str = btoa(reader.result);
- resolve(base64str);
- };
- reader.onerror = function ()
- {
- var base64str = btoa(reader.error);
- reject(base64str);
- };
- });
-
- reader.readAsBinaryString(blob);
-
- return promise;
- }
- },
- "FormData": {
- convert: function (reqContext)
- {
- var body = reqContext.requestData;
- var promise = new Promise(function (resolve, reject)
- {
- var contentType = reqContext.requestHeaders["content-type"];
-
- // FormData polyfill - request the body and context-type
- body.__getRequestParts().then(function (parts)
- {
- if (!contentType)
- reqContext.requestHeaders["content-type"] = parts.contentType;
-
- var reader = new FileReader();
- reader.onload = function ()
- {
- var base64str = btoa(reader.result);
- resolve(base64str);
- };
- reader.onerror = function ()
- {
- var base64str = btoa(reader.error);
- reject(base64str);
- };
-
- reader.readAsBinaryString(parts.body);
- });
- });
-
- return promise;
- }
- },
- "Blob": {
- convert: function (reqContext)
- {
- if (!reqContext.requestHeaders["content-type"])
- reqContext.requestHeaders["content-type"] = "application/octet-binary;";
-
- var body = reqContext.requestData;
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
- var base64str = btoa(reader.result);
- resolve(base64str);
- };
- reader.onerror = function ()
- {
- var base64str = btoa(reader.error);
- reject(base64str);
- };
- });
-
- reader.readAsBinaryString(body);
-
- return promise;
- }
- },
- "string": {
- convert: function (reqContext)
- {
- if (!reqContext.requestHeaders["content-type"])
- reqContext.requestHeaders["content-type"] = "text/plain;";
-
- var body = reqContext.requestData;
- var mimeType = reqContext.requestHeaders["content-type"];
- return HttpHandler._convertTextToBinaryBase64String(mimeType, body);
- }
- },
- "Object": {
- convert: function (reqContext)
- {
- if (!reqContext.requestHeaders["content-type"])
- reqContext.requestHeaders["content-type"] = "application/json;";
-
- var body = JSON.stringify(reqContext.requestData);
- var mimeType = reqContext.requestHeaders["content-type"];
- return HttpHandler._convertTextToBinaryBase64String(mimeType, body);
- }
- },
- "Document": {
- convert: function (reqContext)
- {
- if (!reqContext.requestHeaders["content-type"])
- reqContext.requestHeaders["content-type"] = "application/xhtml+xml;";
-
- var body = reqContext.requestData;
- var serializer = new XMLSerializer();
- var body = serializer.serializeToString(body);
- var mimeType = reqContext.requestHeaders["content-type"];
- return HttpHandler._convertTextToBinaryBase64String(mimeType, body);
- }
- }
- };
-
- HttpHandler._convertEncode64StringToText = function(mimeType, encoding, r)
- {
- var binaryString = atob(r);
- var byteNumbers = new Array(binaryString.length);
- for (var i = 0; i < binaryString.length; i++)
- byteNumbers[i] = binaryString.charCodeAt(i);
-
- var byteArray = new Uint8Array(byteNumbers);
-
- var blob = new Blob([byteArray], {type: mimeType});
-
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
-
- resolve(reader.result);
- };
- reader.onerror = function ()
- {
- reject(reader.error);
- };
- });
-
- reader.readAsText(blob, encoding);
- return promise;
- };
-
- HttpHandler._convertEncode64StringToArrayBuffer = function (mimeType, encoding, r)
- {
- var binaryString = atob(r);
- var byteNumbers = new Array(binaryString.length);
- for (var i = 0; i < binaryString.length; i++)
- byteNumbers[i] = binaryString.charCodeAt(i);
-
- var byteArray = new Uint8Array(byteNumbers);
-
- var blob = new Blob([byteArray], {type: mimeType});
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
-
- resolve(reader.result);
- };
- reader.onerror = function ()
- {
- reject(reader.error);
- };
- });
- reader.readAsArrayBuffer(blob);
- return promise;
- };
-
- HttpHandler._RESPONSE_HANDLERS = {
- "text": {
- convert: HttpHandler._convertEncode64StringToText
- },
- "arraybuffer": {
- convert: HttpHandler._convertEncode64StringToArrayBuffer
- },
- "blob": {
- convert: HttpHandler._convertEncode64StringToArrayBuffer
- },
- "json": {
- convert: HttpHandler._convertEncode64StringToText
- },
- "document": {
- convert: HttpHandler._convertEncode64StringToText
- }
- };
-
- HttpHandler._UNDERLYING_ERROR_CODES = {
- NSURLErrorUnknown: -1,
- NSURLErrorCancelled: -999,
- NSURLErrorBadURL: -1000,
- NSURLErrorTimedOut: -1001,
- NSURLErrorUnsupportedURL: -1002,
- NSURLErrorCannotFindHost: -1003,
- NSURLErrorCannotConnectToHost: -1004,
- NSURLErrorNetworkConnectionLost: -1005,
- NSURLErrorDNSLookupFailed: -1006,
- NSURLErrorHTTPTooManyRedirects: -1007,
- NSURLErrorResourceUnavailable: -1008,
- NSURLErrorNotConnectedToInternet: -1009,
- NSURLErrorRedirectToNonExistentLocation: -1010,
- NSURLErrorBadServerResponse: -1011,
- NSURLErrorUserCancelledAuthentication: -1012,
- NSURLErrorUserAuthenticationRequired: -1013,
- NSURLErrorZeroByteResource: -1014,
- NSURLErrorCannotDecodeRawData: -1015,
- NSURLErrorCannotDecodeContentData: -1016,
- NSURLErrorCannotParseResponse: -1017,
- NSURLErrorAppTransportSecurityRequiresSecureConnection: -1022,
- NSURLErrorFileDoesNotExist: -1100,
- NSURLErrorFileIsDirectory: -1101,
- NSURLErrorNoPermissionsToReadFile: -1102,
- NSURLErrorDataLengthExceedsMaximum: -1103,
- NSURLErrorFileOutsideSafeArea: -1104,
- NSURLErrorSecureConnectionFailed: -1200,
- NSURLErrorServerCertificateHasBadDate: -1201,
- NSURLErrorServerCertificateUntrusted: -1202,
- NSURLErrorServerCertificateHasUnknownRoot: -1203,
- NSURLErrorServerCertificateNotYetValid: -1204,
- NSURLErrorClientCertificateRejected: -1205,
- NSURLErrorClientCertificateRequired: -1206,
- NSURLErrorCannotLoadFromNetwork: -2000,
- NSURLErrorCannotCreateFile: -3000,
- NSURLErrorCannotOpenFile: -3001,
- NSURLErrorCannotCloseFile: -3002,
- NSURLErrorCannotWriteToFile: -3003,
- NSURLErrorCannotRemoveFile: -3004,
- NSURLErrorCannotMoveFile: -3005,
- NSURLErrorDownloadDecodingFailedMidStream: -3006,
- NSURLErrorDownloadDecodingFailedToComplete: -3007,
- NSURLErrorInternationalRoamingOff: -1018,
- NSURLErrorCallIsActive: -1019,
- NSURLErrorDataNotAllowed: -1020,
- NSURLErrorRequestBodyStreamExhausted: -1021,
- NSURLErrorBackgroundSessionRequiresSharedContainer: -995,
- NSURLErrorBackgroundSessionInUseByAnotherProcess: -996,
- NSURLErrorBackgroundSessionWasDisconnected: -997
- };
-
- HttpHandler._getHandlerForRequestBodyType = function (reqContext)
- {
- var body = reqContext.requestData;
- if (!body)
- return HttpHandler._REQUEST_HANDLERS[""];
- else if (typeof body === "string")
- return HttpHandler._REQUEST_HANDLERS["string"];
- else if (Blob.prototype.isPrototypeOf(body))
- return HttpHandler._REQUEST_HANDLERS["Blob"];
- else if (FormData.prototype.isPrototypeOf(body))
- return HttpHandler._REQUEST_HANDLERS["FormData"];
- else if (ArrayBuffer.prototype.isPrototypeOf(body) ||
- body.buffer)
- return HttpHandler._REQUEST_HANDLERS["ArrayBuffer"];
- else if (Document.prototype.isPrototypeOf(body))
- return HttpHandler._REQUEST_HANDLERS["Document"];
- else
- return HttpHandler._REQUEST_HANDLERS["Object"];
- };
-
- HttpHandler._getHandlerForResponseType = function (reqContext)
- {
- var responseType = reqContext.responseType;
- if (HttpHandler._RESPONSE_HANDLERS[responseType])
- return HttpHandler._RESPONSE_HANDLERS[responseType];
- else
- return HttpHandler._RESPONSE_HANDLERS["text"];
- };
-
- HttpHandler.prototype._isTraceLoggingEnabled = function ()
- {
- return this._config["NativeXHRLogging"] === "full";
- };
-
- HttpHandler._resolveUri = function (uri)
- {
- if (uri.indexOf("://") > -1)
- return uri;
-
- var resolver = document.createElement("a");
- document.body.appendChild(resolver);
- resolver.href = uri;
- var absoluteUri = resolver.href;
- resolver.parentNode.removeChild(resolver);
- return absoluteUri;
- };
-
- HttpHandler.prototype.send = function ()
- {
- var reqContext = this._reqContext;
- var id = HttpHandler._generateId();
-
- if (reqContext.user && reqContext.password)
- {
- var token = [reqContext.user, reqContext.password].join(":");
- reqContext.requestHeaders["authorization"] = ["Basic", btoa(token)].join(" ");
- }
-
- window.__nativeXHRResponseQueue.set(id, this);
-
- var handler = HttpHandler._getHandlerForRequestBodyType(reqContext);
- handler.convert(reqContext).then(function (bodyAsBase64String)
- {
- var requestDataSize = bodyAsBase64String ? bodyAsBase64String.length : 0;
- reqContext.requestData = undefined;
-
- var timeoutInSecs = (isNaN(reqContext.timeout) ? undefined : (reqContext.timeout / 1000));
-
- var reqPayLoad = {id: id, callback: "nativeXHRResponse",
- url: HttpHandler._resolveUri(reqContext.url), method: reqContext.method,
- headers: reqContext.requestHeaders,
- body: bodyAsBase64String, timeout: timeoutInSecs};
-
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native XHR Request:\n %o", reqPayLoad);
-
- HttpHandler._presend(reqContext, requestDataSize);
-
- window.webkit.messageHandlers.nativeXHR.postMessage(reqPayLoad);
- }.bind(this)).catch(HttpHandler._error.bind(this, reqContext));
- };
-
- HttpHandler._presend = function (reqContext, requestDataSize)
- {
- reqContext.dispatchReadyStateChangeEvent(1); // OPEN
- reqContext.dispatchProgressEvent("loadstart");
-
- // simulate upload progress events
- reqContext.dispatchUploadProgressEvent("loadstart");
- reqContext.dispatchUploadProgressEvent("progress", requestDataSize);
- reqContext.dispatchUploadProgressEvent("load", requestDataSize);
- reqContext.dispatchUploadProgressEvent("loadend", requestDataSize);
- };
-
- HttpHandler._success = function (reqContext, payload, mimeType, result)
- {
- var rspTypeHandler = FileHandler.getHandlerForResponseType(reqContext);
- var convertedResult = rspTypeHandler.convert(mimeType, result);
-
- // normalize header keys to lower case.
- var responseHeaders = payload.response.allHeaderFields;
- var normalizedHeaders = {};
- var keys = Object.keys(responseHeaders);
- for (var i = 0; i < keys.length; i++)
- {
- var key = keys[i];
- normalizedHeaders[key.toLowerCase()] = responseHeaders[key];
- }
-
- reqContext.responseHeaders = normalizedHeaders;
-
- reqContext.responseURL = payload.response.url;
- reqContext.status = payload.response.statusCode;
- reqContext.statusText = payload.response.localizedStatusCode;
-
- for (var i = 0; i < rspTypeHandler.properties.length; i++)
- reqContext[rspTypeHandler.properties[i]] = convertedResult;
-
- var respSize = rspTypeHandler.responseSize();
-
- reqContext.dispatchReadyStateChangeEvent(2); //HEADERS_RECIEVED
- reqContext.dispatchReadyStateChangeEvent(3); //LOADING
- reqContext.dispatchProgressEvent("progress", respSize);
- reqContext.dispatchReadyStateChangeEvent(4); //DONE
-
- reqContext.dispatchProgressEvent("load", respSize);
- reqContext.dispatchProgressEvent("loadend", respSize);
- };
-
- HttpHandler._error = function (reqContext, error, underlyingErrorCode)
- {
- var isTimeout = (HttpHandler._UNDERLYING_ERROR_CODES.NSURLErrorTimedOut === underlyingErrorCode);
-
- if (isTimeout)
- {
- reqContext.status = 0;
- reqContext.statusText = reqContext.responseText = null;
- }
- else
- {
- reqContext.status = 400;
- reqContext.statusText = "Bad Request";
- reqContext.responseText = error;
- }
-
- reqContext.dispatchReadyStateChangeEvent(2); //HEADERS_RECIEVED
- reqContext.dispatchReadyStateChangeEvent(3); //LOADING
- reqContext.dispatchProgressEvent("progress");
- reqContext.dispatchReadyStateChangeEvent(4); //DONE
-
- if (isTimeout)
- reqContext.dispatchProgressEvent("timeout");
- else
- reqContext.dispatchProgressEvent("error");
-
- reqContext.dispatchProgressEvent("loadend");
- };
-
-
- HttpHandler.prototype.load = function (payload)
- {
- var reqContext = this._reqContext;
-
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native XHR Response:\n%o", payload);
-
- if (payload.error)
- HttpHandler._error(reqContext, payload.error, payload['underlyingErrorCode']);
- else
- {
- var handler = HttpHandler._getHandlerForResponseType(reqContext);
- var mimeType = payload.response.mimeType;
- if (reqContext.overrideMimeType) // look for overrideMimeType
- mimeType = reqContext.overrideMimeType;
- else if (payload.response.allHeaderFields && payload.response.allHeaderFields["content-type"])
- mimeType = payload.response.allHeaderFields["content-type"];
-
- var encoding = payload.response.textEncodingName ? payload.response.textEncodingName : "UTF-8";
-
- handler.convert(mimeType, encoding, payload.data).then(HttpHandler._success.bind(this,
- reqContext, payload, mimeType));
- }
- };
-
- window.__nativeXHRResponseQueue = new Map();
- window.nativeXHRResponse = function (id, payload)
- {
- try
- {
- var handler = window.__nativeXHRResponseQueue.get(id);
- payload["id"] = id;
- handler.load(payload);
- }
- catch (e)
- {
- console.log("xhr-polyfill.js - exception delivering request %o\n%o", id, e);
- }
- finally
- {
- window.__nativeXHRResponseQueue.delete(id);
- }
- };
-
- // sends the request using JS native XMLHttpRequest
- function DelegateHandler(reqContext, config)
- {
- this._reqContext = reqContext;
- this._reqContext.delegate = new window._XMLHttpRequest();
- this._config = config;
- }
-
- DelegateHandler._FROM_PROPERTIES = ["response", "responseText", "responseXML", "responseURL",
- "status", "statusText"];
-
- DelegateHandler._TO_PROPERTIES = ["responseType", "timeout", "withCredentials"];
-
- DelegateHandler._parseResponseHeaders = function (delegate, toHeaders)
- {
- var fromHeaders = delegate.getAllResponseHeaders().split(/\r?\n/);
- for (var i = 0; i < fromHeaders.length; i++)
- {
- var tokens = fromHeaders[i];
- var n = tokens.indexOf(": ");
- if (n > -1)
- {
- var key = tokens.substr(0, n).toLowerCase();
- var value = tokens.substr(n + 2);
- toHeaders[key] = value;
- }
- }
- };
-
- DelegateHandler._progressEventRelay = function (reqContext, event)
- {
- var respSize = isNaN(event.totalSize) ? 0 : event.totalSize;
- reqContext.dispatchProgressEvent(event.type, respSize);
- };
-
- DelegateHandler._uploadProgressEventRelay = function (reqContext, event)
- {
- var respSize = isNaN(event.totalSize) ? 0 : event.totalSize;
- reqContext.dispatchUploadProgressEvent(event.type, respSize);
- };
-
- DelegateHandler._readystatechangeEventRelay = function (reqContext, delegate, event)
- {
-
- if (delegate.readyState > 1) // readyState gt HEADERS_RECIEVED
- {
- if (Object.keys(reqContext.responseHeaders).length === 0)
- DelegateHandler._parseResponseHeaders(delegate, reqContext.responseHeaders);
-
- for (var i = 0; i < DelegateHandler._FROM_PROPERTIES.length; i++)
- {
- try
- {
- reqContext[DelegateHandler._FROM_PROPERTIES[i]] = delegate[DelegateHandler._FROM_PROPERTIES[i]];
- }
- catch (e)
- {
- }
- }
-
- reqContext.dispatchReadyStateChangeEvent(delegate.readyState);
- }
- };
-
- DelegateHandler.prototype.send = function ()
- {
- var reqContext = this._reqContext;
- var delegate = reqContext.delegate;
-
- delegate.onreadystatechange = DelegateHandler._readystatechangeEventRelay.bind(delegate,
- reqContext, delegate);
- ["ontimeout", "onloadstart", "onprogress", "onabort", "onerror", "onload",
- "onloadend"].forEach(function (eventType)
- {
- delegate[eventType] = DelegateHandler._progressEventRelay.bind(delegate, reqContext);
- delegate.upload[eventType] = DelegateHandler._uploadProgressEventRelay.bind(delegate,
- reqContext);
- });
-
- if (reqContext.overrideMimeType)
- delegate.overrideMimeType(reqContext.overrideMimeType);
-
- delegate.open(reqContext.method, reqContext.url, reqContext.async, reqContext.user,
- reqContext.password);
-
- for (var i = 0; i < DelegateHandler._TO_PROPERTIES.length; i++)
- delegate[DelegateHandler._TO_PROPERTIES[i]] = reqContext[DelegateHandler._TO_PROPERTIES[i]];
-
- var keys = Object.keys(reqContext.requestHeaders);
- for (var i = 0; i < keys.length; i++)
- delegate.setRequestHeader(keys[i], reqContext.requestHeaders[keys[i]]);
-
- var requestData = reqContext.requestData;
- reqContext.requestData = undefined;
-
- // returns a native FormData from the plugin's polyfill
- if (FormData.prototype.isPrototypeOf(requestData))
- requestData = requestData.__getNative();
-
- delegate.send(requestData);
- };
-
- function HandlerFactory()
- {
- }
-
- HandlerFactory._getConfig = function ()
- {
- var promise;
- if (HandlerFactory._config)
- {
- promise = Promise.resolve(HandlerFactory._config);
- }
- else
- {
- promise = new Promise(function (done)
- {
- function success(result)
- {
- HandlerFactory._config = result;
- done(HandlerFactory._config);
- }
-
- function error()
- {
- HandlerFactory._config = {"InterceptRemoteRequests": "secureOnly",
- "NativeXHRLogging": "none"};
- done(HandlerFactory._config);
- }
-
- exec(success, error, "CDVWKWebViewFileXhr", "getConfig", []);
- });
-
- }
-
- return promise;
- };
-
- HandlerFactory.getHandler = function (context)
- {
- var promise = new Promise(function (resolve)
- {
- HandlerFactory._getConfig().then(function (config)
- {
- var interceptRemoteRequests = config["InterceptRemoteRequests"];
-
- if (context.interceptRemoteRequests) // backdoor to override per instance
- interceptRemoteRequests = context.interceptRemoteRequests;
-
- if ("GET" === context.method && typeof context.url === "string" &&
- ((context.url.indexOf("://") === -1 && window.location.protocol === "file:") ||
- (context.url.toLowerCase().startsWith("file://"))))
- {
- resolve(new FileHandler(context, config));
- }
- else
- {
- if ("all" === interceptRemoteRequests ||
- ("secureOnly" === interceptRemoteRequests && context.url.startsWith("https://")))
- resolve(new HttpHandler(context, config));
- else
- resolve(new DelegateHandler(context, config));
- }
- });
- });
-
- return promise;
- };
-
- function _XMLHttpRequestUpload()
- {
- this._context = {"listeners": {}};
- }
-
- _XMLHttpRequestUpload.prototype.removeEventListener = function (type, listener)
- {
- var listeners = this._context.listeners;
- if (!listener)
- listeners[type] = [];
- else
- {
- var lset = listeners[type] ? listeners[type] : [];
- var i = lset.indexOf(listener);
- if (i > -1)
- lset.splice(i, 1);
- }
- };
-
- _XMLHttpRequestUpload.prototype.addEventListener = function (type, listener)
- {
- if (!listener)
- return;
-
- var listeners = this._context.listeners;
- var lset = listeners[type];
- if (!lset)
- lset = listeners[type] = [];
-
- if (lset.indexOf(listeners) < 0)
- lset.push(listener);
- };
-
- _XMLHttpRequestUpload.prototype.dispatchEvent = function (event)
- {
- if (!event)
- return;
-
- var type = event.type;
- var listeners = this._context.listeners;
- var lset = listeners[type] ? listeners[type] : [];
-
- // call property listeners
- var listener = this._context[["on", type].join("")];
- if (listener)
- {
- try
- {
- listener.call(this, event);
- }
- catch (e)
- {
- console.log("xhr-polyfill.js - exception delivering upload event %o\n%o", event, e);
- }
- }
- };
-
- /** @type {?} */
- window._XMLHttpRequest = window.XMLHttpRequest;
- window.XMLHttpRequest = function ()
- {
- this._context = {delegate: null, requestHeaders: {}, responseHeaders: {},
- listeners: {}, readyState: 0, responseType: "text", withCredentials: false,
- upload: new _XMLHttpRequestUpload(), status: 0};
-
- this._context.dispatchProgressEvent = function (req, type, respSize)
- {
- if (isNaN(respSize))
- respSize = 0;
-
- var event = document.createEvent("Event");
- event.initEvent(type, false, false);
- ["total", "totalSize", "loaded", "position"].forEach(function (propName)
- {
- Object.defineProperty(event, propName, {value: respSize});
- });
- Object.defineProperty(event, "lengthComputable", {value: respSize === 0 ? false : true});
-
- req.dispatchEvent(event);
- }.bind(this._context, this);
-
- this._context.dispatchReadyStateChangeEvent = function (req, readyState)
- {
- var event = document.createEvent("Event");
- event.initEvent("readystatechange", false, false);
-
- this.readyState = readyState;
- req.dispatchEvent(event);
- }.bind(this._context, this);
-
- this._context.dispatchUploadProgressEvent = function (type, reqSize)
- {
- // no body sent on a GET request
- if (this.method === "GET")
- return;
-
- if (isNaN(reqSize))
- reqSize = 0;
-
- var event = document.createEvent("Event");
- event.initEvent(type, false, false);
- ["total", "totalSize", "loaded", "position"].forEach(function (propName)
- {
- Object.defineProperty(event, propName, {value: reqSize});
- });
- Object.defineProperty(event, "lengthComputable", {value: reqSize === 0 ? false : true});
-
- this.upload.dispatchEvent(event);
- }.bind(this._context);
- };
-
-
- // define readonly const properties
- ["UNSENT", "OPENED", "HEADERS_RECEIVED", "LOADING", "DONE"].forEach(function (propName, i)
- {
- Object.defineProperty(window.XMLHttpRequest.prototype, propName,
- {
- "get": function ()
- {
- return i;
- }
- });
- });
-
- // define readonly properties.
- ["readyState", "response", "responseText", "responseURL", "responseXML",
- "status", "statusText", "upload"].forEach(function (propName)
- {
- Object.defineProperty(window.XMLHttpRequest.prototype, propName,
- {
- "get": function ()
- {
- return this._context[propName];
- }
- });
- });
-
-// define read/write properties
- ["responseType", "timeout", "withCredentials"].forEach(function (propName)
- {
- Object.defineProperty(window.XMLHttpRequest.prototype, propName,
- {
- "get": function ()
- {
- return this._context[propName];
- },
- "set": function (value)
- {
- this._context[propName] = value;
- }
- });
- });
-
- // define read/write readychange event listener properties
- Object.defineProperty(window.XMLHttpRequest.prototype, "onreadystatechange",
- {
- "get": function ()
- {
- return this._context["onreadystatechange"];
- },
- "set": function (value)
- {
- if (typeof value === "function")
- this._context["onreadystatechange"] = value;
- }
- });
-
- // define read/write event progress listener properties
- ["ontimeout", "onloadstart", "onprogress", "onabort", "onerror", "onload", "onloadend"].forEach(
- function (propName)
- {
- Object.defineProperty(window.XMLHttpRequest.prototype, propName,
- {
- "get": function ()
- {
- return this._context[propName];
- },
- "set": function (value)
- {
- if (typeof value === "function")
- this._context[propName] = value;
- }
- });
-
- Object.defineProperty(_XMLHttpRequestUpload.prototype, propName,
- {
- "get": function ()
- {
- return this._context[propName];
- },
- "set": function (value)
- {
- if (typeof value === "function")
- this._context[propName] = value;
- }
- });
- });
-
- window.XMLHttpRequest.prototype.setRequestHeader = function (header, value)
- {
- // normalize value pair to strings
- header = String(header).toLowerCase();;
- value = String(value);
- this._context.requestHeaders[header] = value;
- };
-
- window.XMLHttpRequest.prototype.abort = function ()
- {
- if (this._context["delegate"])
- this._context.delegate.abort();
- };
-
- window.XMLHttpRequest.prototype.getResponseHeader = function (name)
- {
- name = name.toLowerCase();
- return this._context.responseHeaders[name];
- };
-
- window.XMLHttpRequest.prototype.overrideMimeType = function (mimetype)
- {
- return this._context.overrideMimeType = mimetype;
- };
-
- window.XMLHttpRequest.prototype.getAllResponseHeaders = function ()
- {
- var responseHeaders = this._context.responseHeaders;
- var names = Object.keys(responseHeaders);
- var list = [];
- for (var i = 0; i < names.length; i++)
- list.push([names[i], responseHeaders[names[i]]].join(":"));
-
- return list.join("\n");
- };
-
- window.XMLHttpRequest.prototype.removeEventListener = function (type, listener)
- {
- var listeners = this._context.listeners;
- if (!listener)
- listeners[type] = [];
- else
- {
- var lset = listeners[type] ? listeners[type] : [];
- var i = lset.indexOf(listener);
- if (i > -1)
- lset.splice(i, 1);
- }
- };
-
- window.XMLHttpRequest.prototype.addEventListener = function (type, listener)
- {
- if (!listener)
- return;
-
- var listeners = this._context.listeners;
- var lset = listeners[type];
- if (!lset)
- lset = listeners[type] = [];
-
- if (lset.indexOf(listeners) < 0)
- lset.push(listener);
- };
-
- window.XMLHttpRequest.prototype.dispatchEvent = function (event)
- {
- if (!event)
- return;
-
- var type = event.type;
- var listeners = this._context.listeners;
- var lset = listeners[type] ? listeners[type] : [];
-
- // call property listeners
- var listener = this._context[["on", type].join("")];
- if (listener)
- {
- try
- {
- listener.call(this, event);
- }
- catch (e)
- {
- console.log("xhr-polyfill.js - exception delivering event %o\n%o", event, e);
- }
- }
-
- // call listeners registered via addEventListener
- for (var i = 0; i < lset.length; i++)
- {
- listener = lset[i];
- if (listener)
- {
- try
- {
- listener.call(this, event);
- }
- catch (e)
- {
- console.log("xhr-polyfill.js - exception delivering event %o\n%o", event, e);
- }
- }
- }
- };
-
- window.XMLHttpRequest.prototype.open = function (method, url, async, user, password)
- {
- this._context.method = !method ? "GET" : method.toUpperCase(); // FortifyFalsePositive
- this._context.url = url;
- this._context.async = async === undefined ? true : async;
- this._context.user = user;
- this._context.password = password;
- };
-
- window.XMLHttpRequest.prototype.send = function (data)
- {
- if ("GET" !== this._context.method && "HEAD" !== this._context.method)
- this._context.requestData = data;
-
- HandlerFactory.getHandler(this._context).then(function (handler)
- {
- handler.send();
- });
- };
-
- /**
- * Override plugin config settings per request instance for the "InterceptRemoteRequests"
- * config param.
- *
- * @param {string} value enumerations are: "all", "secureOnly", "none".
- */
- window.XMLHttpRequest.prototype.__setInterceptRemoteRequests = function (value)
- {
- if (["all", "secureOnly", "none"].indexOf(value) > -1)
- {
- this._context.interceptRemoteRequests = value;
- }
- };
-
-})();
-
-});
diff --git a/cordova/platforms/ios/www/cordova_plugins.js b/cordova/platforms/ios/www/cordova_plugins.js
index f47ca9ffa..8a50dbbfb 100644
--- a/cordova/platforms/ios/www/cordova_plugins.js
+++ b/cordova/platforms/ios/www/cordova_plugins.js
@@ -238,30 +238,6 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"cordova.plugins.fileOpener2"
]
},
- {
- "id": "cordova-plugin-ios-xhr.formdata-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.xhr-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.fetch-bootstrap",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
- {
- "id": "cordova-plugin-ios-xhr.fetch-polyfill",
- "file": "plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js",
- "pluginId": "cordova-plugin-ios-xhr",
- "runs": true
- },
{
"id": "es6-promise-plugin.Promise",
"file": "plugins/es6-promise-plugin/www/promise.js",
@@ -284,7 +260,6 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"cordova-plugin-camera": "4.1.0",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-opener2": "3.0.4",
- "cordova-plugin-ios-xhr": "1.0.0",
"cordova-plugin-whitelist": "1.3.4",
"es6-promise-plugin": "4.2.2",
"cordova-plugin-x-socialsharing": "5.6.8"
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js b/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js
deleted file mode 100644
index 79dbf5c89..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/fetch-bootstrap.js
+++ /dev/null
@@ -1,10 +0,0 @@
-cordova.define("cordova-plugin-ios-xhr.fetch-bootstrap", function(require, exports, module) {
-'use strict';
-
-(function ()
-{
- var _fetch = window.fetch;
- window.fetch = undefined;
-})();
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js b/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js
deleted file mode 100644
index ea01fe5aa..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/formdata-polyfill.js
+++ /dev/null
@@ -1,365 +0,0 @@
-cordova.define("cordova-plugin-ios-xhr.formdata-polyfill", function(require, exports, module) {
-/*
- * Copyright (c) 2018 Oracle and/or its affiliates.
- *
- * The Universal Permissive License (UPL), Version 1.0
- *
- * Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
- * software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
- * all copyright rights in the Software, and any and all patent rights owned or freely licensable by each
- * licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor,
- * or (ii) the Larger Works (as defined below), to deal in both
- *
- *
- * (a) the Software, and
- *
- * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
- * (each a “Larger Work” to which the Software is contributed by such licensors),
- *
- * without restriction, including without limitation the rights to copy, create derivative works of, display,
- * perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and
- * have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other
- * terms.
- *
- * This license is subject to the following condition:
- *
- * The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL
- * must be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Native Safari FormData only implements the append method. This polyfill is used in
- * tandem with the xhr-polyfill.
- *
- * Two additional functions in this FormData implementation:
- * 1) __getNative - returns the native Safari FormData object.
- * 2) __getRequestParts - returns a promise resolving an object {contentType:string, body:string}.
- */
-'use strict';
-(function ()
-{
- function __FormData(formElement)
- {
- this._map = new Map();
-
- if (!HTMLFormElement.prototype.isPrototypeOf(formElement))
- return;
-
- var elements = formElement.elements;
- for (var i = 0; i < elements.length; i++)
- {
- var element = elements[i];
-
- var name = element.name ? element.name : element.id;
- if (!name)
- continue;
-
- if (element.type === 'file')
- {
- for (var file of element.files)
- this.append(name, file);
- }
- else if (['select-multiple', 'select-one'].indexOf(element.value) > -1)
- {
- for (var option of element.selectedOptions)
- this.append(name, option);
- }
- else if (['checkbox', 'radio'].indexOf(element.value) > -1 && element.checked)
- {
- this.append(name, element.value);
- }
- else
- {
- this.append(name, element.value);
- }
- }
- }
-
- if( 'Symbol' in window && typeof Symbol() === 'symbol'){
- Object.defineProperty( __FormData.prototype, Symbol.toStringTag, {
- get : function(){
- return 'FormData';
- }
- });
- }
-
- __FormData.prototype.get = function (name)
- {
- var values = this.getAll(name);
-
- if (values && values.length > 0)
- return values[0];
- else
- return undefined;
- };
-
- __FormData.prototype.getAll = function (name)
- {
- var map = this._map;
- var values = map.get(name);
- if (!values)
- values = [];
-
- return values;
- };
-
- __FormData.prototype.set = function (name, value, filename)
- {
- var map = this._map;
-
- if (value && Blob.prototype.isPrototypeOf(value))
- {
- if (!filename)
- filename = "Blob";
-
- Object.defineProperty(value, "name", {value: filename});
- }
-
- map.set(name, [value]);
- };
-
-
- __FormData.prototype.append = function (name, value, filename)
- {
- var map = this._map;
- var values = map.get(name);
-
- this.set(name, value, filename);
- if (values)
- {
- values.push(map.get(name)[0]);
- map.set(name, values);
- }
- };
-
- __FormData.prototype.delete = function (name)
- {
- var map = this._map;
- map.delete(name);
- };
-
- __FormData.prototype.has = function (name)
- {
- var map = this._map;
- return map.has(name);
- };
-
- __FormData.prototype.keys = function ()
- {
- var map = this._map;
- return map.keys();
- };
-
- __FormData.prototype.values = function ()
- {
- var map = this._map;
- var allvalues = [];
-
- var vit = map.values();
- var entry = vit.next();
- while (entry && !entry.done)
- {
- var values = entry.value;
- for (var i = 0; i < values.length; i++)
- allvalues.push(values[i]);
-
- entry = vit.next();
- }
-
- return __FormData._makeIterator(allvalues);
- };
-
- __FormData.prototype.entries = function ()
- {
- var map = this._map;
- var allentries = [];
-
- for (var key of map.keys())
- {
- var values = map.get(key);
- for (var i = 0; i < values.length; i++)
- {
- allentries.push([key, values[i]]);
- }
- }
-
- return __FormData._makeIterator(allentries);
- };
-
- __FormData.prototype.forEach = function(callback)
- {
- var eit = this.entries();
- var entry = eit.next();
- while(!entry.done)
- {
- callback.call(this, entry.value[1], entry.value[0], this);
- entry = eit.next();
- }
- };
-
- __FormData.prototype.toString = function ()
- {
- return "[object FormData]";
- };
-
- __FormData.prototype.__getRequestParts = function ()
- {
- var promise = new Promise(function (resolve)
- {
- __FormData._getRequestValues(this.entries()).then(function (entries)
- {
- var parts = __FormData._getMultipartRequest(entries);
-
- resolve(parts);
- });
- }.bind(this));
-
- return promise;
- };
-
- __FormData.prototype.__getNative = function ()
- {
- var fd = new window._FormData();
- var eit = this.entries();
- var entry = eit.next();
- while (!entry.done)
- {
- if (entry.value[1] && Blob.prototype.isPrototypeOf(entry.value[1]))
- fd.append(entry.value[0], entry.value[1], entry.value[1].name);
- else
- fd.append(entry.value[0], entry.value[1]);
-
- entry = eit.next();
- }
-
- return fd;
- };
-
- __FormData._getMultipartRequest = function (entries)
- {
- var boundary = "----cordovaPluginWkwebviewFileXhrFormdata" + Math.random().toString(32);
- var parts = {"contentType": "multipart/form-data; boundary=" + boundary, body: ""};
- var bodyEntries = [];
-
- for (var i = 0; i < entries.length; i++)
- {
- var entry = entries[i];
- for (var data of __FormData._generateMultipartFormData(entry, boundary))
- bodyEntries.push(data);
- }
-
- bodyEntries.push("--" + boundary + "--");
- parts.body = new Blob(bodyEntries, {type: "application/octet-stream"});
-
- return parts;
- };
-
- __FormData._makeIterator = function (array)
- {
- var i = 0;
- return {
- next: function ()
- {
- if (i < array.length)
- return {done: false, value: array[i++]};
- else
- return {done: true, value: undefined};
- }
- };
- };
-
- __FormData._getRequestValues = function (entriesIterator)
- {
- var promises = [];
- var entry = entriesIterator.next();
- while (!entry.done)
- {
- promises.push(__FormData._normalizeEntry(entry));
- entry = entriesIterator.next();
- }
-
- return Promise.all(promises);
- };
-
- __FormData._normalizeEntry = function (entry)
- {
- var promise = new Promise(function (resolve)
- {
-
- var name = entry.value[0];
- var value = entry.value[1];
-
- if (value &&
- (Blob.prototype.isPrototypeOf(value) ||
- File.prototype.isPrototypeOf(value)))
- {
-
- var filename = value.name;
- var type = value.type ? value.type : "application/octet-binary;";
- var reader = new FileReader();
- var resolve;
-
- reader.onload = function ()
- {
- resolve({name: name, value: reader.result, filename: filename, type: type});
- };
-
- reader.onerror = function ()
- {
- resolve({name: name, value: reader.error, filename: filename, type: type});
- };
-
- reader.readAsArrayBuffer(value);
- }
- else
- {
- promise = resolve({name: name, value: value});
- }
- });
-
- return promise;
- };
-
- __FormData._generateMultipartFormData = function (entry, boundary)
- {
- var data = [];
-
- data.push("--" + boundary + "\r\n");
- if (!entry['filename'])
- {
- data.push('content-disposition: form-data; name="');
- data.push(entry.name);
- data.push('"\r\n');
- data.push('\r\n');
- data.push(entry.value);
- data.push("\r\n");
- }
- else
- {
- // Describe it as form data
- data.push('content-disposition: form-data; name="');
- data.push(entry.name)
- data.push('"; filename="');
- data.push(entry.filename);
- data.push('"\r\n');
- data.push('Content-Type: ');
- data.push(entry.type);
- data.push('\r\n\r\n');
- data.push(entry.value);
- data.push('\r\n');
- }
-
- return data;
- };
-
- window._FormData = window.FormData;
- window.FormData = __FormData;
-})();
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js b/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js
deleted file mode 100644
index 7b5fce803..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/whatwg-fetch-2.0.3.js
+++ /dev/null
@@ -1,464 +0,0 @@
-cordova.define("cordova-plugin-ios-xhr.fetch-polyfill", function(require, exports, module) {
-(function(self) {
- 'use strict';
-
- if (self.fetch) {
- return
- }
-
- var support = {
- searchParams: 'URLSearchParams' in self,
- iterable: 'Symbol' in self && 'iterator' in Symbol,
- blob: 'FileReader' in self && 'Blob' in self && (function() {
- try {
- new Blob()
- return true
- } catch(e) {
- return false
- }
- })(),
- formData: 'FormData' in self,
- arrayBuffer: 'ArrayBuffer' in self
- }
-
- if (support.arrayBuffer) {
- var viewClasses = [
- '[object Int8Array]',
- '[object Uint8Array]',
- '[object Uint8ClampedArray]',
- '[object Int16Array]',
- '[object Uint16Array]',
- '[object Int32Array]',
- '[object Uint32Array]',
- '[object Float32Array]',
- '[object Float64Array]'
- ]
-
- var isDataView = function(obj) {
- return obj && DataView.prototype.isPrototypeOf(obj)
- }
-
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
- }
- }
-
- function normalizeName(name) {
- if (typeof name !== 'string') {
- name = String(name)
- }
- if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name')
- }
- return name.toLowerCase()
- }
-
- function normalizeValue(value) {
- if (typeof value !== 'string') {
- value = String(value)
- }
- return value
- }
-
- // Build a destructive iterator for the value list
- function iteratorFor(items) {
- var iterator = {
- next: function() {
- var value = items.shift()
- return {done: value === undefined, value: value}
- }
- }
-
- if (support.iterable) {
- iterator[Symbol.iterator] = function() {
- return iterator
- }
- }
-
- return iterator
- }
-
- function Headers(headers) {
- this.map = {}
-
- if (headers instanceof Headers) {
- headers.forEach(function(value, name) {
- this.append(name, value)
- }, this)
- } else if (Array.isArray(headers)) {
- headers.forEach(function(header) {
- this.append(header[0], header[1])
- }, this)
- } else if (headers) {
- Object.getOwnPropertyNames(headers).forEach(function(name) {
- this.append(name, headers[name])
- }, this)
- }
- }
-
- Headers.prototype.append = function(name, value) {
- name = normalizeName(name)
- value = normalizeValue(value)
- var oldValue = this.map[name]
- this.map[name] = oldValue ? oldValue+','+value : value
- }
-
- Headers.prototype['delete'] = function(name) {
- delete this.map[normalizeName(name)]
- }
-
- Headers.prototype.get = function(name) {
- name = normalizeName(name)
- return this.has(name) ? this.map[name] : null
- }
-
- Headers.prototype.has = function(name) {
- return this.map.hasOwnProperty(normalizeName(name))
- }
-
- Headers.prototype.set = function(name, value) {
- this.map[normalizeName(name)] = normalizeValue(value)
- }
-
- Headers.prototype.forEach = function(callback, thisArg) {
- for (var name in this.map) {
- if (this.map.hasOwnProperty(name)) {
- callback.call(thisArg, this.map[name], name, this)
- }
- }
- }
-
- Headers.prototype.keys = function() {
- var items = []
- this.forEach(function(value, name) { items.push(name) })
- return iteratorFor(items)
- }
-
- Headers.prototype.values = function() {
- var items = []
- this.forEach(function(value) { items.push(value) })
- return iteratorFor(items)
- }
-
- Headers.prototype.entries = function() {
- var items = []
- this.forEach(function(value, name) { items.push([name, value]) })
- return iteratorFor(items)
- }
-
- if (support.iterable) {
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries
- }
-
- function consumed(body) {
- if (body.bodyUsed) {
- return Promise.reject(new TypeError('Already read'))
- }
- body.bodyUsed = true
- }
-
- function fileReaderReady(reader) {
- return new Promise(function(resolve, reject) {
- reader.onload = function() {
- resolve(reader.result)
- }
- reader.onerror = function() {
- reject(reader.error)
- }
- })
- }
-
- function readBlobAsArrayBuffer(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsArrayBuffer(blob)
- return promise
- }
-
- function readBlobAsText(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsText(blob)
- return promise
- }
-
- function readArrayBufferAsText(buf) {
- var view = new Uint8Array(buf)
- var chars = new Array(view.length)
-
- for (var i = 0; i < view.length; i++) {
- chars[i] = String.fromCharCode(view[i])
- }
- return chars.join('')
- }
-
- function bufferClone(buf) {
- if (buf.slice) {
- return buf.slice(0)
- } else {
- var view = new Uint8Array(buf.byteLength)
- view.set(new Uint8Array(buf))
- return view.buffer
- }
- }
-
- function Body() {
- this.bodyUsed = false
-
- this._initBody = function(body) {
- this._bodyInit = body
- if (!body) {
- this._bodyText = ''
- } else if (typeof body === 'string') {
- this._bodyText = body
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
- this._bodyBlob = body
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
- this._bodyFormData = body
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this._bodyText = body.toString()
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
- this._bodyArrayBuffer = bufferClone(body.buffer)
- // IE 10-11 can't handle a DataView body.
- this._bodyInit = new Blob([this._bodyArrayBuffer])
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
- this._bodyArrayBuffer = bufferClone(body)
- } else {
- throw new Error('unsupported BodyInit type')
- }
-
- if (!this.headers.get('content-type')) {
- if (typeof body === 'string') {
- this.headers.set('content-type', 'text/plain;charset=UTF-8')
- } else if (this._bodyBlob && this._bodyBlob.type) {
- this.headers.set('content-type', this._bodyBlob.type)
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
- }
- }
- }
-
- if (support.blob) {
- this.blob = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
-
- if (this._bodyBlob) {
- return Promise.resolve(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as blob')
- } else {
- return Promise.resolve(new Blob([this._bodyText]))
- }
- }
-
- this.arrayBuffer = function() {
- if (this._bodyArrayBuffer) {
- return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
- } else {
- return this.blob().then(readBlobAsArrayBuffer)
- }
- }
- }
-
- this.text = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
-
- if (this._bodyBlob) {
- return readBlobAsText(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as text')
- } else {
- return Promise.resolve(this._bodyText)
- }
- }
-
- if (support.formData) {
- this.formData = function() {
- return this.text().then(decode)
- }
- }
-
- this.json = function() {
- return this.text().then(JSON.parse)
- }
-
- return this
- }
-
- // HTTP methods whose capitalization should be normalized
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
-
- function normalizeMethod(method) {
- var upcased = method.toUpperCase()
- return (methods.indexOf(upcased) > -1) ? upcased : method
- }
-
- function Request(input, options) {
- options = options || {}
- var body = options.body
-
- if (input instanceof Request) {
- if (input.bodyUsed) {
- throw new TypeError('Already read')
- }
- this.url = input.url
- this.credentials = input.credentials
- if (!options.headers) {
- this.headers = new Headers(input.headers)
- }
- this.method = input.method
- this.mode = input.mode
- if (!body && input._bodyInit != null) {
- body = input._bodyInit
- input.bodyUsed = true
- }
- } else {
- this.url = String(input)
- }
-
- this.credentials = options.credentials || this.credentials || 'omit'
- if (options.headers || !this.headers) {
- this.headers = new Headers(options.headers)
- }
- this.method = normalizeMethod(options.method || this.method || 'GET')
- this.mode = options.mode || this.mode || null
- this.referrer = null
-
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
- throw new TypeError('Body not allowed for GET or HEAD requests')
- }
- this._initBody(body)
- }
-
- Request.prototype.clone = function() {
- return new Request(this, { body: this._bodyInit })
- }
-
- function decode(body) {
- var form = new FormData()
- body.trim().split('&').forEach(function(bytes) {
- if (bytes) {
- var split = bytes.split('=')
- var name = split.shift().replace(/\+/g, ' ')
- var value = split.join('=').replace(/\+/g, ' ')
- form.append(decodeURIComponent(name), decodeURIComponent(value))
- }
- })
- return form
- }
-
- function parseHeaders(rawHeaders) {
- var headers = new Headers()
- rawHeaders.split(/\r?\n/).forEach(function(line) {
- var parts = line.split(':')
- var key = parts.shift().trim()
- if (key) {
- var value = parts.join(':').trim()
- headers.append(key, value)
- }
- })
- return headers
- }
-
- Body.call(Request.prototype)
-
- function Response(bodyInit, options) {
- if (!options) {
- options = {}
- }
-
- this.type = 'default'
- this.status = 'status' in options ? options.status : 200
- this.ok = this.status >= 200 && this.status < 300
- this.statusText = 'statusText' in options ? options.statusText : 'OK'
- this.headers = new Headers(options.headers)
- this.url = options.url || ''
- this._initBody(bodyInit)
- }
-
- Body.call(Response.prototype)
-
- Response.prototype.clone = function() {
- return new Response(this._bodyInit, {
- status: this.status,
- statusText: this.statusText,
- headers: new Headers(this.headers),
- url: this.url
- })
- }
-
- Response.error = function() {
- var response = new Response(null, {status: 0, statusText: ''})
- response.type = 'error'
- return response
- }
-
- var redirectStatuses = [301, 302, 303, 307, 308]
-
- Response.redirect = function(url, status) {
- if (redirectStatuses.indexOf(status) === -1) {
- throw new RangeError('Invalid status code')
- }
-
- return new Response(null, {status: status, headers: {location: url}})
- }
-
- self.Headers = Headers
- self.Request = Request
- self.Response = Response
-
- self.fetch = function(input, init) {
- return new Promise(function(resolve, reject) {
- var request = new Request(input, init)
- var xhr = new XMLHttpRequest()
-
- xhr.onload = function() {
- var options = {
- status: xhr.status,
- statusText: xhr.statusText,
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
- }
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
- var body = 'response' in xhr ? xhr.response : xhr.responseText
- resolve(new Response(body, options))
- }
-
- xhr.onerror = function() {
- reject(new TypeError('Network request failed'))
- }
-
- xhr.ontimeout = function() {
- reject(new TypeError('Network request failed'))
- }
-
- xhr.open(request.method, request.url, true)
-
- if (request.credentials === 'include') {
- xhr.withCredentials = true
- }
-
- if ('responseType' in xhr && support.blob) {
- xhr.responseType = 'blob'
- }
-
- request.headers.forEach(function(value, name) {
- xhr.setRequestHeader(name, value)
- })
-
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
- })
- }
- self.fetch.polyfill = true
-})(typeof self !== 'undefined' ? self : this);
-
-});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js b/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js
deleted file mode 100644
index e553ba26a..000000000
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-ios-xhr/src/www/ios/xhr-polyfill.js
+++ /dev/null
@@ -1,1249 +0,0 @@
-cordova.define("cordova-plugin-ios-xhr.xhr-polyfill", function(require, exports, module) {
-/*
- * Copyright (c) 2018 Oracle and/or its affiliates.
- *
- * The Universal Permissive License (UPL), Version 1.0
- *
- * Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
- * software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
- * all copyright rights in the Software, and any and all patent rights owned or freely licensable by each
- * licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor,
- * or (ii) the Larger Works (as defined below), to deal in both
- *
- *
- * (a) the Software, and
- *
- * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
- * (each a “Larger Work” to which the Software is contributed by such licensors),
- *
- * without restriction, including without limitation the rights to copy, create derivative works of, display,
- * perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and
- * have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other
- * terms.
- *
- * This license is subject to the following condition:
- *
- * The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL
- * must be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-'use strict';
-(function ()
-{
-
-
- var exec = require('cordova/exec');
-
- // Handles native file:// XHR GET requests
- function FileHandler(reqContext, config)
- {
- this._reqContext = reqContext;
- this._config = config;
- }
-
- FileHandler._getMimeType = function (reqContext)
- {
- if (reqContext.overrideMimeType)
- return reqContext.overrideMimeType;
- else if (reqContext.responseHeaders['content-type'])
- return reqContext.responseHeaders['content-type'];
-
- var url = reqContext.url;
- var ext = url.substr(url.lastIndexOf('.'));
- return FileHandler._EXT_TO_MIME[ext] ? FileHandler._EXT_TO_MIME[ext] : "";
- };
-
- FileHandler.getHandlerForResponseType = function (reqContext)
- {
- var responseType = reqContext.responseType;
- if (FileHandler._RESPONSE_HANDLERS[responseType])
- return FileHandler._RESPONSE_HANDLERS[responseType];
- else
- return FileHandler._RESPONSE_HANDLERS["text"];
- };
-
- FileHandler._EXT_TO_MIME = {
- ".img": "image/jpeg",
- ".png": "image/png",
- ".gif": "image/gif",
- ".xml": "application/xml",
- ".xsl": "application/xml",
- ".html": "text/html",
- ".htm": "text/html",
- ".svg": "image/svg+xml",
- ".svgz": "image/svg+xml",
- ".json": "application/json",
- ".js": "application/javascript"
- };
-
- FileHandler._RESPONSE_HANDLERS =
- {
- "text":
- {
- action: "readAsText",
- properties: ["response", "responseText"],
- convert: function (mimeType, r)
- {
- this._size = r["length"];
- return r;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- },
- "arraybuffer":
- {
- action: "readAsArrayBuffer",
- properties: ["response"],
- convert: function (mimeType, r)
- {
- this._size = r["byteLength"];
- return r;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- },
- "json":
- {
- action: "readAsText",
- properties: ["response"],
- convert: function (mimeType, r)
- {
- this._size = r["length"];
- try
- {
- r = JSON.parse(r);
- }
- catch (e)
- {
- }
-
- return r;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- },
- "document":
- {
- action: "readAsText",
- properties: ["response", "responseXML"],
- convert: function (mimeType, r)
- {
- this._size = r["length"];
- try
- {
- r = new DOMParser().parseFromString(r, "text/xml");
- }
- catch (e)
- {
- }
- return r;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- },
- "blob":
- {
- action: "readAsArrayBuffer",
- properties: ["response"],
- convert: function (mimeType, r)
- {
- var blob = new Blob([r], {"type": mimeType});
- this._size = blob.size;
- return blob;
- },
- responseSize: function ()
- {
- return isNaN(this._size) ? 0 : this._size;
- }
- }
- };
-
- FileHandler.prototype._isTraceLoggingEnabled = function ()
- {
- return this._config["NativeXHRLogging"] === "full";
- };
-
- FileHandler._presend = function (reqContext)
- {
- reqContext.dispatchReadyStateChangeEvent(1); // OPEN
- reqContext.dispatchProgressEvent("loadstart");
- // no upload events for a GET
- };
-
- FileHandler._error = function (reqContext, e)
- {
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native file XHR Response: Unable to find file %o\n%o", reqContext.url, e);
-
- reqContext.status = 404;
- reqContext.responseText = "File Not Found";
-
- reqContext.dispatchReadyStateChangeEvent(2); // HEADERS_RECIEVED
- reqContext.dispatchReadyStateChangeEvent(3); // LOADING
- reqContext.dispatchProgressEvent("progress");
-
- reqContext.dispatchReadyStateChangeEvent(4); // DONE
- reqContext.dispatchProgressEvent("error");
- reqContext.dispatchProgressEvent("loadend");
- };
-
- FileHandler._success = function (reqContext, rspTypeHandler, result)
- {
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native file XHR Response:\n%o\n", reqContext.url, result);
-
- var mimeType = FileHandler._getMimeType(reqContext);
- var convertedResult = rspTypeHandler.convert(mimeType, result);
-
- var respSize = rspTypeHandler.responseSize();
- for (var i = 0; i < rspTypeHandler.properties.length; i++)
- reqContext[rspTypeHandler.properties[i]] = convertedResult;
-
- reqContext.status = 200;
- reqContext.statusText = "OK";
- reqContext.responseURL = reqContext.url;
-
- reqContext.dispatchReadyStateChangeEvent(2); // HEADERS_RECIEVED
- reqContext.dispatchReadyStateChangeEvent(3); // LOADING
- reqContext.dispatchProgressEvent("progress", respSize);
- reqContext.dispatchReadyStateChangeEvent(4); // DONE
- reqContext.dispatchProgressEvent("load", respSize);
- reqContext.dispatchProgressEvent("loadend", respSize);
- };
-
- FileHandler.prototype.send = function ()
- {
- var reqContext = this._reqContext;
- var rspTypeHandler = FileHandler.getHandlerForResponseType(reqContext);
-
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native file XHR Request:\n%o", reqContext.url);
-
- FileHandler._presend(reqContext);
-
- exec(FileHandler._success.bind(this, reqContext, rspTypeHandler),
- FileHandler._error.bind(this, reqContext),
- "CDVWKWebViewFileXhr", rspTypeHandler.action, [reqContext.url]);
- };
-
- // handles http and https native XHR requests
- function HttpHandler(reqContext, config)
- {
- this._reqContext = reqContext;
- this._config = config;
- }
-
- HttpHandler._generateId = function ()
- {
- return [performance.now().toString(16), Math.random().toString(16)].join("-"); // FortifyFalsePositive
- };
-
- HttpHandler._convertTextToBinaryBase64String = function(mimeType, text)
- {
- var blob = new Blob([text], {type: mimeType});
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
- var base64str = btoa(reader.result);
- resolve(base64str);
- };
- reader.onerror = function ()
- {
- var base64str = btoa(reader.error);
- reject(base64str);
- };
- });
-
- reader.readAsBinaryString(blob);
-
- return promise;
- };
-
- HttpHandler._REQUEST_HANDLERS =
- {
- "": {
- convert: function (reqContext)
- {
- return Promise.resolve(null);
- }
- },
- "ArrayBuffer": {
- convert: function (reqContext)
- {
- var body = reqContext.requestData;
-
- var type = reqContext.requestHeaders['content-type'];
- if (!type)
- type = reqContext.requestHeaders['content-type'] = "application/octet-binary;";
-
- var blob = new Blob([body], {type: type});
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
- var base64str = btoa(reader.result);
- resolve(base64str);
- };
- reader.onerror = function ()
- {
- var base64str = btoa(reader.error);
- reject(base64str);
- };
- });
-
- reader.readAsBinaryString(blob);
-
- return promise;
- }
- },
- "FormData": {
- convert: function (reqContext)
- {
- var body = reqContext.requestData;
- var promise = new Promise(function (resolve, reject)
- {
- var contentType = reqContext.requestHeaders["content-type"];
-
- // FormData polyfill - request the body and context-type
- body.__getRequestParts().then(function (parts)
- {
- if (!contentType)
- reqContext.requestHeaders["content-type"] = parts.contentType;
-
- var reader = new FileReader();
- reader.onload = function ()
- {
- var base64str = btoa(reader.result);
- resolve(base64str);
- };
- reader.onerror = function ()
- {
- var base64str = btoa(reader.error);
- reject(base64str);
- };
-
- reader.readAsBinaryString(parts.body);
- });
- });
-
- return promise;
- }
- },
- "Blob": {
- convert: function (reqContext)
- {
- if (!reqContext.requestHeaders["content-type"])
- reqContext.requestHeaders["content-type"] = "application/octet-binary;";
-
- var body = reqContext.requestData;
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
- var base64str = btoa(reader.result);
- resolve(base64str);
- };
- reader.onerror = function ()
- {
- var base64str = btoa(reader.error);
- reject(base64str);
- };
- });
-
- reader.readAsBinaryString(body);
-
- return promise;
- }
- },
- "string": {
- convert: function (reqContext)
- {
- if (!reqContext.requestHeaders["content-type"])
- reqContext.requestHeaders["content-type"] = "text/plain;";
-
- var body = reqContext.requestData;
- var mimeType = reqContext.requestHeaders["content-type"];
- return HttpHandler._convertTextToBinaryBase64String(mimeType, body);
- }
- },
- "Object": {
- convert: function (reqContext)
- {
- if (!reqContext.requestHeaders["content-type"])
- reqContext.requestHeaders["content-type"] = "application/json;";
-
- var body = JSON.stringify(reqContext.requestData);
- var mimeType = reqContext.requestHeaders["content-type"];
- return HttpHandler._convertTextToBinaryBase64String(mimeType, body);
- }
- },
- "Document": {
- convert: function (reqContext)
- {
- if (!reqContext.requestHeaders["content-type"])
- reqContext.requestHeaders["content-type"] = "application/xhtml+xml;";
-
- var body = reqContext.requestData;
- var serializer = new XMLSerializer();
- var body = serializer.serializeToString(body);
- var mimeType = reqContext.requestHeaders["content-type"];
- return HttpHandler._convertTextToBinaryBase64String(mimeType, body);
- }
- }
- };
-
- HttpHandler._convertEncode64StringToText = function(mimeType, encoding, r)
- {
- var binaryString = atob(r);
- var byteNumbers = new Array(binaryString.length);
- for (var i = 0; i < binaryString.length; i++)
- byteNumbers[i] = binaryString.charCodeAt(i);
-
- var byteArray = new Uint8Array(byteNumbers);
-
- var blob = new Blob([byteArray], {type: mimeType});
-
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
-
- resolve(reader.result);
- };
- reader.onerror = function ()
- {
- reject(reader.error);
- };
- });
-
- reader.readAsText(blob, encoding);
- return promise;
- };
-
- HttpHandler._convertEncode64StringToArrayBuffer = function (mimeType, encoding, r)
- {
- var binaryString = atob(r);
- var byteNumbers = new Array(binaryString.length);
- for (var i = 0; i < binaryString.length; i++)
- byteNumbers[i] = binaryString.charCodeAt(i);
-
- var byteArray = new Uint8Array(byteNumbers);
-
- var blob = new Blob([byteArray], {type: mimeType});
- var reader = new FileReader();
- var promise = new Promise(function (resolve, reject)
- {
- reader.onload = function ()
- {
-
- resolve(reader.result);
- };
- reader.onerror = function ()
- {
- reject(reader.error);
- };
- });
- reader.readAsArrayBuffer(blob);
- return promise;
- };
-
- HttpHandler._RESPONSE_HANDLERS = {
- "text": {
- convert: HttpHandler._convertEncode64StringToText
- },
- "arraybuffer": {
- convert: HttpHandler._convertEncode64StringToArrayBuffer
- },
- "blob": {
- convert: HttpHandler._convertEncode64StringToArrayBuffer
- },
- "json": {
- convert: HttpHandler._convertEncode64StringToText
- },
- "document": {
- convert: HttpHandler._convertEncode64StringToText
- }
- };
-
- HttpHandler._UNDERLYING_ERROR_CODES = {
- NSURLErrorUnknown: -1,
- NSURLErrorCancelled: -999,
- NSURLErrorBadURL: -1000,
- NSURLErrorTimedOut: -1001,
- NSURLErrorUnsupportedURL: -1002,
- NSURLErrorCannotFindHost: -1003,
- NSURLErrorCannotConnectToHost: -1004,
- NSURLErrorNetworkConnectionLost: -1005,
- NSURLErrorDNSLookupFailed: -1006,
- NSURLErrorHTTPTooManyRedirects: -1007,
- NSURLErrorResourceUnavailable: -1008,
- NSURLErrorNotConnectedToInternet: -1009,
- NSURLErrorRedirectToNonExistentLocation: -1010,
- NSURLErrorBadServerResponse: -1011,
- NSURLErrorUserCancelledAuthentication: -1012,
- NSURLErrorUserAuthenticationRequired: -1013,
- NSURLErrorZeroByteResource: -1014,
- NSURLErrorCannotDecodeRawData: -1015,
- NSURLErrorCannotDecodeContentData: -1016,
- NSURLErrorCannotParseResponse: -1017,
- NSURLErrorAppTransportSecurityRequiresSecureConnection: -1022,
- NSURLErrorFileDoesNotExist: -1100,
- NSURLErrorFileIsDirectory: -1101,
- NSURLErrorNoPermissionsToReadFile: -1102,
- NSURLErrorDataLengthExceedsMaximum: -1103,
- NSURLErrorFileOutsideSafeArea: -1104,
- NSURLErrorSecureConnectionFailed: -1200,
- NSURLErrorServerCertificateHasBadDate: -1201,
- NSURLErrorServerCertificateUntrusted: -1202,
- NSURLErrorServerCertificateHasUnknownRoot: -1203,
- NSURLErrorServerCertificateNotYetValid: -1204,
- NSURLErrorClientCertificateRejected: -1205,
- NSURLErrorClientCertificateRequired: -1206,
- NSURLErrorCannotLoadFromNetwork: -2000,
- NSURLErrorCannotCreateFile: -3000,
- NSURLErrorCannotOpenFile: -3001,
- NSURLErrorCannotCloseFile: -3002,
- NSURLErrorCannotWriteToFile: -3003,
- NSURLErrorCannotRemoveFile: -3004,
- NSURLErrorCannotMoveFile: -3005,
- NSURLErrorDownloadDecodingFailedMidStream: -3006,
- NSURLErrorDownloadDecodingFailedToComplete: -3007,
- NSURLErrorInternationalRoamingOff: -1018,
- NSURLErrorCallIsActive: -1019,
- NSURLErrorDataNotAllowed: -1020,
- NSURLErrorRequestBodyStreamExhausted: -1021,
- NSURLErrorBackgroundSessionRequiresSharedContainer: -995,
- NSURLErrorBackgroundSessionInUseByAnotherProcess: -996,
- NSURLErrorBackgroundSessionWasDisconnected: -997
- };
-
- HttpHandler._getHandlerForRequestBodyType = function (reqContext)
- {
- var body = reqContext.requestData;
- if (!body)
- return HttpHandler._REQUEST_HANDLERS[""];
- else if (typeof body === "string")
- return HttpHandler._REQUEST_HANDLERS["string"];
- else if (Blob.prototype.isPrototypeOf(body))
- return HttpHandler._REQUEST_HANDLERS["Blob"];
- else if (FormData.prototype.isPrototypeOf(body))
- return HttpHandler._REQUEST_HANDLERS["FormData"];
- else if (ArrayBuffer.prototype.isPrototypeOf(body) ||
- body.buffer)
- return HttpHandler._REQUEST_HANDLERS["ArrayBuffer"];
- else if (Document.prototype.isPrototypeOf(body))
- return HttpHandler._REQUEST_HANDLERS["Document"];
- else
- return HttpHandler._REQUEST_HANDLERS["Object"];
- };
-
- HttpHandler._getHandlerForResponseType = function (reqContext)
- {
- var responseType = reqContext.responseType;
- if (HttpHandler._RESPONSE_HANDLERS[responseType])
- return HttpHandler._RESPONSE_HANDLERS[responseType];
- else
- return HttpHandler._RESPONSE_HANDLERS["text"];
- };
-
- HttpHandler.prototype._isTraceLoggingEnabled = function ()
- {
- return this._config["NativeXHRLogging"] === "full";
- };
-
- HttpHandler._resolveUri = function (uri)
- {
- if (uri.indexOf("://") > -1)
- return uri;
-
- var resolver = document.createElement("a");
- document.body.appendChild(resolver);
- resolver.href = uri;
- var absoluteUri = resolver.href;
- resolver.parentNode.removeChild(resolver);
- return absoluteUri;
- };
-
- HttpHandler.prototype.send = function ()
- {
- var reqContext = this._reqContext;
- var id = HttpHandler._generateId();
-
- if (reqContext.user && reqContext.password)
- {
- var token = [reqContext.user, reqContext.password].join(":");
- reqContext.requestHeaders["authorization"] = ["Basic", btoa(token)].join(" ");
- }
-
- window.__nativeXHRResponseQueue.set(id, this);
-
- var handler = HttpHandler._getHandlerForRequestBodyType(reqContext);
- handler.convert(reqContext).then(function (bodyAsBase64String)
- {
- var requestDataSize = bodyAsBase64String ? bodyAsBase64String.length : 0;
- reqContext.requestData = undefined;
-
- var timeoutInSecs = (isNaN(reqContext.timeout) ? undefined : (reqContext.timeout / 1000));
-
- var reqPayLoad = {id: id, callback: "nativeXHRResponse",
- url: HttpHandler._resolveUri(reqContext.url), method: reqContext.method,
- headers: reqContext.requestHeaders,
- body: bodyAsBase64String, timeout: timeoutInSecs};
-
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native XHR Request:\n %o", reqPayLoad);
-
- HttpHandler._presend(reqContext, requestDataSize);
-
- window.webkit.messageHandlers.nativeXHR.postMessage(reqPayLoad);
- }.bind(this)).catch(HttpHandler._error.bind(this, reqContext));
- };
-
- HttpHandler._presend = function (reqContext, requestDataSize)
- {
- reqContext.dispatchReadyStateChangeEvent(1); // OPEN
- reqContext.dispatchProgressEvent("loadstart");
-
- // simulate upload progress events
- reqContext.dispatchUploadProgressEvent("loadstart");
- reqContext.dispatchUploadProgressEvent("progress", requestDataSize);
- reqContext.dispatchUploadProgressEvent("load", requestDataSize);
- reqContext.dispatchUploadProgressEvent("loadend", requestDataSize);
- };
-
- HttpHandler._success = function (reqContext, payload, mimeType, result)
- {
- var rspTypeHandler = FileHandler.getHandlerForResponseType(reqContext);
- var convertedResult = rspTypeHandler.convert(mimeType, result);
-
- // normalize header keys to lower case.
- var responseHeaders = payload.response.allHeaderFields;
- var normalizedHeaders = {};
- var keys = Object.keys(responseHeaders);
- for (var i = 0; i < keys.length; i++)
- {
- var key = keys[i];
- normalizedHeaders[key.toLowerCase()] = responseHeaders[key];
- }
-
- reqContext.responseHeaders = normalizedHeaders;
-
- reqContext.responseURL = payload.response.url;
- reqContext.status = payload.response.statusCode;
- reqContext.statusText = payload.response.localizedStatusCode;
-
- for (var i = 0; i < rspTypeHandler.properties.length; i++)
- reqContext[rspTypeHandler.properties[i]] = convertedResult;
-
- var respSize = rspTypeHandler.responseSize();
-
- reqContext.dispatchReadyStateChangeEvent(2); //HEADERS_RECIEVED
- reqContext.dispatchReadyStateChangeEvent(3); //LOADING
- reqContext.dispatchProgressEvent("progress", respSize);
- reqContext.dispatchReadyStateChangeEvent(4); //DONE
-
- reqContext.dispatchProgressEvent("load", respSize);
- reqContext.dispatchProgressEvent("loadend", respSize);
- };
-
- HttpHandler._error = function (reqContext, error, underlyingErrorCode)
- {
- var isTimeout = (HttpHandler._UNDERLYING_ERROR_CODES.NSURLErrorTimedOut === underlyingErrorCode);
-
- if (isTimeout)
- {
- reqContext.status = 0;
- reqContext.statusText = reqContext.responseText = null;
- }
- else
- {
- reqContext.status = 400;
- reqContext.statusText = "Bad Request";
- reqContext.responseText = error;
- }
-
- reqContext.dispatchReadyStateChangeEvent(2); //HEADERS_RECIEVED
- reqContext.dispatchReadyStateChangeEvent(3); //LOADING
- reqContext.dispatchProgressEvent("progress");
- reqContext.dispatchReadyStateChangeEvent(4); //DONE
-
- if (isTimeout)
- reqContext.dispatchProgressEvent("timeout");
- else
- reqContext.dispatchProgressEvent("error");
-
- reqContext.dispatchProgressEvent("loadend");
- };
-
-
- HttpHandler.prototype.load = function (payload)
- {
- var reqContext = this._reqContext;
-
- if (this._isTraceLoggingEnabled())
- console.log("xhr-polyfill.js - native XHR Response:\n%o", payload);
-
- if (payload.error)
- HttpHandler._error(reqContext, payload.error, payload['underlyingErrorCode']);
- else
- {
- var handler = HttpHandler._getHandlerForResponseType(reqContext);
- var mimeType = payload.response.mimeType;
- if (reqContext.overrideMimeType) // look for overrideMimeType
- mimeType = reqContext.overrideMimeType;
- else if (payload.response.allHeaderFields && payload.response.allHeaderFields["content-type"])
- mimeType = payload.response.allHeaderFields["content-type"];
-
- var encoding = payload.response.textEncodingName ? payload.response.textEncodingName : "UTF-8";
-
- handler.convert(mimeType, encoding, payload.data).then(HttpHandler._success.bind(this,
- reqContext, payload, mimeType));
- }
- };
-
- window.__nativeXHRResponseQueue = new Map();
- window.nativeXHRResponse = function (id, payload)
- {
- try
- {
- var handler = window.__nativeXHRResponseQueue.get(id);
- payload["id"] = id;
- handler.load(payload);
- }
- catch (e)
- {
- console.log("xhr-polyfill.js - exception delivering request %o\n%o", id, e);
- }
- finally
- {
- window.__nativeXHRResponseQueue.delete(id);
- }
- };
-
- // sends the request using JS native XMLHttpRequest
- function DelegateHandler(reqContext, config)
- {
- this._reqContext = reqContext;
- this._reqContext.delegate = new window._XMLHttpRequest();
- this._config = config;
- }
-
- DelegateHandler._FROM_PROPERTIES = ["response", "responseText", "responseXML", "responseURL",
- "status", "statusText"];
-
- DelegateHandler._TO_PROPERTIES = ["responseType", "timeout", "withCredentials"];
-
- DelegateHandler._parseResponseHeaders = function (delegate, toHeaders)
- {
- var fromHeaders = delegate.getAllResponseHeaders().split(/\r?\n/);
- for (var i = 0; i < fromHeaders.length; i++)
- {
- var tokens = fromHeaders[i];
- var n = tokens.indexOf(": ");
- if (n > -1)
- {
- var key = tokens.substr(0, n).toLowerCase();
- var value = tokens.substr(n + 2);
- toHeaders[key] = value;
- }
- }
- };
-
- DelegateHandler._progressEventRelay = function (reqContext, event)
- {
- var respSize = isNaN(event.totalSize) ? 0 : event.totalSize;
- reqContext.dispatchProgressEvent(event.type, respSize);
- };
-
- DelegateHandler._uploadProgressEventRelay = function (reqContext, event)
- {
- var respSize = isNaN(event.totalSize) ? 0 : event.totalSize;
- reqContext.dispatchUploadProgressEvent(event.type, respSize);
- };
-
- DelegateHandler._readystatechangeEventRelay = function (reqContext, delegate, event)
- {
-
- if (delegate.readyState > 1) // readyState gt HEADERS_RECIEVED
- {
- if (Object.keys(reqContext.responseHeaders).length === 0)
- DelegateHandler._parseResponseHeaders(delegate, reqContext.responseHeaders);
-
- for (var i = 0; i < DelegateHandler._FROM_PROPERTIES.length; i++)
- {
- try
- {
- reqContext[DelegateHandler._FROM_PROPERTIES[i]] = delegate[DelegateHandler._FROM_PROPERTIES[i]];
- }
- catch (e)
- {
- }
- }
-
- reqContext.dispatchReadyStateChangeEvent(delegate.readyState);
- }
- };
-
- DelegateHandler.prototype.send = function ()
- {
- var reqContext = this._reqContext;
- var delegate = reqContext.delegate;
-
- delegate.onreadystatechange = DelegateHandler._readystatechangeEventRelay.bind(delegate,
- reqContext, delegate);
- ["ontimeout", "onloadstart", "onprogress", "onabort", "onerror", "onload",
- "onloadend"].forEach(function (eventType)
- {
- delegate[eventType] = DelegateHandler._progressEventRelay.bind(delegate, reqContext);
- delegate.upload[eventType] = DelegateHandler._uploadProgressEventRelay.bind(delegate,
- reqContext);
- });
-
- if (reqContext.overrideMimeType)
- delegate.overrideMimeType(reqContext.overrideMimeType);
-
- delegate.open(reqContext.method, reqContext.url, reqContext.async, reqContext.user,
- reqContext.password);
-
- for (var i = 0; i < DelegateHandler._TO_PROPERTIES.length; i++)
- delegate[DelegateHandler._TO_PROPERTIES[i]] = reqContext[DelegateHandler._TO_PROPERTIES[i]];
-
- var keys = Object.keys(reqContext.requestHeaders);
- for (var i = 0; i < keys.length; i++)
- delegate.setRequestHeader(keys[i], reqContext.requestHeaders[keys[i]]);
-
- var requestData = reqContext.requestData;
- reqContext.requestData = undefined;
-
- // returns a native FormData from the plugin's polyfill
- if (FormData.prototype.isPrototypeOf(requestData))
- requestData = requestData.__getNative();
-
- delegate.send(requestData);
- };
-
- function HandlerFactory()
- {
- }
-
- HandlerFactory._getConfig = function ()
- {
- var promise;
- if (HandlerFactory._config)
- {
- promise = Promise.resolve(HandlerFactory._config);
- }
- else
- {
- promise = new Promise(function (done)
- {
- function success(result)
- {
- HandlerFactory._config = result;
- done(HandlerFactory._config);
- }
-
- function error()
- {
- HandlerFactory._config = {"InterceptRemoteRequests": "secureOnly",
- "NativeXHRLogging": "none"};
- done(HandlerFactory._config);
- }
-
- exec(success, error, "CDVWKWebViewFileXhr", "getConfig", []);
- });
-
- }
-
- return promise;
- };
-
- HandlerFactory.getHandler = function (context)
- {
- var promise = new Promise(function (resolve)
- {
- HandlerFactory._getConfig().then(function (config)
- {
- var interceptRemoteRequests = config["InterceptRemoteRequests"];
-
- if (context.interceptRemoteRequests) // backdoor to override per instance
- interceptRemoteRequests = context.interceptRemoteRequests;
-
- if ("GET" === context.method && typeof context.url === "string" &&
- ((context.url.indexOf("://") === -1 && window.location.protocol === "file:") ||
- (context.url.toLowerCase().startsWith("file://"))))
- {
- resolve(new FileHandler(context, config));
- }
- else
- {
- if ("all" === interceptRemoteRequests ||
- ("secureOnly" === interceptRemoteRequests && context.url.startsWith("https://")))
- resolve(new HttpHandler(context, config));
- else
- resolve(new DelegateHandler(context, config));
- }
- });
- });
-
- return promise;
- };
-
- function _XMLHttpRequestUpload()
- {
- this._context = {"listeners": {}};
- }
-
- _XMLHttpRequestUpload.prototype.removeEventListener = function (type, listener)
- {
- var listeners = this._context.listeners;
- if (!listener)
- listeners[type] = [];
- else
- {
- var lset = listeners[type] ? listeners[type] : [];
- var i = lset.indexOf(listener);
- if (i > -1)
- lset.splice(i, 1);
- }
- };
-
- _XMLHttpRequestUpload.prototype.addEventListener = function (type, listener)
- {
- if (!listener)
- return;
-
- var listeners = this._context.listeners;
- var lset = listeners[type];
- if (!lset)
- lset = listeners[type] = [];
-
- if (lset.indexOf(listeners) < 0)
- lset.push(listener);
- };
-
- _XMLHttpRequestUpload.prototype.dispatchEvent = function (event)
- {
- if (!event)
- return;
-
- var type = event.type;
- var listeners = this._context.listeners;
- var lset = listeners[type] ? listeners[type] : [];
-
- // call property listeners
- var listener = this._context[["on", type].join("")];
- if (listener)
- {
- try
- {
- listener.call(this, event);
- }
- catch (e)
- {
- console.log("xhr-polyfill.js - exception delivering upload event %o\n%o", event, e);
- }
- }
- };
-
- /** @type {?} */
- window._XMLHttpRequest = window.XMLHttpRequest;
- window.XMLHttpRequest = function ()
- {
- this._context = {delegate: null, requestHeaders: {}, responseHeaders: {},
- listeners: {}, readyState: 0, responseType: "text", withCredentials: false,
- upload: new _XMLHttpRequestUpload(), status: 0};
-
- this._context.dispatchProgressEvent = function (req, type, respSize)
- {
- if (isNaN(respSize))
- respSize = 0;
-
- var event = document.createEvent("Event");
- event.initEvent(type, false, false);
- ["total", "totalSize", "loaded", "position"].forEach(function (propName)
- {
- Object.defineProperty(event, propName, {value: respSize});
- });
- Object.defineProperty(event, "lengthComputable", {value: respSize === 0 ? false : true});
-
- req.dispatchEvent(event);
- }.bind(this._context, this);
-
- this._context.dispatchReadyStateChangeEvent = function (req, readyState)
- {
- var event = document.createEvent("Event");
- event.initEvent("readystatechange", false, false);
-
- this.readyState = readyState;
- req.dispatchEvent(event);
- }.bind(this._context, this);
-
- this._context.dispatchUploadProgressEvent = function (type, reqSize)
- {
- // no body sent on a GET request
- if (this.method === "GET")
- return;
-
- if (isNaN(reqSize))
- reqSize = 0;
-
- var event = document.createEvent("Event");
- event.initEvent(type, false, false);
- ["total", "totalSize", "loaded", "position"].forEach(function (propName)
- {
- Object.defineProperty(event, propName, {value: reqSize});
- });
- Object.defineProperty(event, "lengthComputable", {value: reqSize === 0 ? false : true});
-
- this.upload.dispatchEvent(event);
- }.bind(this._context);
- };
-
-
- // define readonly const properties
- ["UNSENT", "OPENED", "HEADERS_RECEIVED", "LOADING", "DONE"].forEach(function (propName, i)
- {
- Object.defineProperty(window.XMLHttpRequest.prototype, propName,
- {
- "get": function ()
- {
- return i;
- }
- });
- });
-
- // define readonly properties.
- ["readyState", "response", "responseText", "responseURL", "responseXML",
- "status", "statusText", "upload"].forEach(function (propName)
- {
- Object.defineProperty(window.XMLHttpRequest.prototype, propName,
- {
- "get": function ()
- {
- return this._context[propName];
- }
- });
- });
-
-// define read/write properties
- ["responseType", "timeout", "withCredentials"].forEach(function (propName)
- {
- Object.defineProperty(window.XMLHttpRequest.prototype, propName,
- {
- "get": function ()
- {
- return this._context[propName];
- },
- "set": function (value)
- {
- this._context[propName] = value;
- }
- });
- });
-
- // define read/write readychange event listener properties
- Object.defineProperty(window.XMLHttpRequest.prototype, "onreadystatechange",
- {
- "get": function ()
- {
- return this._context["onreadystatechange"];
- },
- "set": function (value)
- {
- if (typeof value === "function")
- this._context["onreadystatechange"] = value;
- }
- });
-
- // define read/write event progress listener properties
- ["ontimeout", "onloadstart", "onprogress", "onabort", "onerror", "onload", "onloadend"].forEach(
- function (propName)
- {
- Object.defineProperty(window.XMLHttpRequest.prototype, propName,
- {
- "get": function ()
- {
- return this._context[propName];
- },
- "set": function (value)
- {
- if (typeof value === "function")
- this._context[propName] = value;
- }
- });
-
- Object.defineProperty(_XMLHttpRequestUpload.prototype, propName,
- {
- "get": function ()
- {
- return this._context[propName];
- },
- "set": function (value)
- {
- if (typeof value === "function")
- this._context[propName] = value;
- }
- });
- });
-
- window.XMLHttpRequest.prototype.setRequestHeader = function (header, value)
- {
- // normalize value pair to strings
- header = String(header).toLowerCase();;
- value = String(value);
- this._context.requestHeaders[header] = value;
- };
-
- window.XMLHttpRequest.prototype.abort = function ()
- {
- if (this._context["delegate"])
- this._context.delegate.abort();
- };
-
- window.XMLHttpRequest.prototype.getResponseHeader = function (name)
- {
- name = name.toLowerCase();
- return this._context.responseHeaders[name];
- };
-
- window.XMLHttpRequest.prototype.overrideMimeType = function (mimetype)
- {
- return this._context.overrideMimeType = mimetype;
- };
-
- window.XMLHttpRequest.prototype.getAllResponseHeaders = function ()
- {
- var responseHeaders = this._context.responseHeaders;
- var names = Object.keys(responseHeaders);
- var list = [];
- for (var i = 0; i < names.length; i++)
- list.push([names[i], responseHeaders[names[i]]].join(":"));
-
- return list.join("\n");
- };
-
- window.XMLHttpRequest.prototype.removeEventListener = function (type, listener)
- {
- var listeners = this._context.listeners;
- if (!listener)
- listeners[type] = [];
- else
- {
- var lset = listeners[type] ? listeners[type] : [];
- var i = lset.indexOf(listener);
- if (i > -1)
- lset.splice(i, 1);
- }
- };
-
- window.XMLHttpRequest.prototype.addEventListener = function (type, listener)
- {
- if (!listener)
- return;
-
- var listeners = this._context.listeners;
- var lset = listeners[type];
- if (!lset)
- lset = listeners[type] = [];
-
- if (lset.indexOf(listeners) < 0)
- lset.push(listener);
- };
-
- window.XMLHttpRequest.prototype.dispatchEvent = function (event)
- {
- if (!event)
- return;
-
- var type = event.type;
- var listeners = this._context.listeners;
- var lset = listeners[type] ? listeners[type] : [];
-
- // call property listeners
- var listener = this._context[["on", type].join("")];
- if (listener)
- {
- try
- {
- listener.call(this, event);
- }
- catch (e)
- {
- console.log("xhr-polyfill.js - exception delivering event %o\n%o", event, e);
- }
- }
-
- // call listeners registered via addEventListener
- for (var i = 0; i < lset.length; i++)
- {
- listener = lset[i];
- if (listener)
- {
- try
- {
- listener.call(this, event);
- }
- catch (e)
- {
- console.log("xhr-polyfill.js - exception delivering event %o\n%o", event, e);
- }
- }
- }
- };
-
- window.XMLHttpRequest.prototype.open = function (method, url, async, user, password)
- {
- this._context.method = !method ? "GET" : method.toUpperCase(); // FortifyFalsePositive
- this._context.url = url;
- this._context.async = async === undefined ? true : async;
- this._context.user = user;
- this._context.password = password;
- };
-
- window.XMLHttpRequest.prototype.send = function (data)
- {
- if ("GET" !== this._context.method && "HEAD" !== this._context.method)
- this._context.requestData = data;
-
- HandlerFactory.getHandler(this._context).then(function (handler)
- {
- handler.send();
- });
- };
-
- /**
- * Override plugin config settings per request instance for the "InterceptRemoteRequests"
- * config param.
- *
- * @param {string} value enumerations are: "all", "secureOnly", "none".
- */
- window.XMLHttpRequest.prototype.__setInterceptRemoteRequests = function (value)
- {
- if (["all", "secureOnly", "none"].indexOf(value) > -1)
- {
- this._context.interceptRemoteRequests = value;
- }
- };
-
-})();
-
-});
diff --git a/cordova/platforms/platforms.json b/cordova/platforms/platforms.json
deleted file mode 100644
index 529d635ef..000000000
--- a/cordova/platforms/platforms.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "android": "6.2.3"
-}
\ No newline at end of file