From 2451db1a2f0eefe65f86b857acc2357ef1a4eae6 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Tue, 8 Sep 2020 19:52:09 +0530 Subject: [PATCH] Changes for v3.0.0 --- CHANGELOG.md | 6 +++++- README.md | 10 ++++++++-- package.json | 2 +- plugin.xml | 3 +-- src/www/ios/xhr-polyfill.js | 12 ++++++------ 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1170054..16e36ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,15 @@ # Change Log +## cordova-plugin-wkwebview-file-xhr v3.0.0 (09/09/2020) +* Upgraded to support cordova-ios 6.0 by removing dependency from wkwebview engine. (issue #55) +* Fix HEADERS_RECEIVED const typo (issue #37). + ## cordova-plugin-wkwebview-file-xhr v2.1.3 (11/22/2019) * Rectifcation of Object.toString incorrect behavior with FormData polyfil (issue #39). * Fix for double encoding of URL UTF-8 params (issue #41). ## cordova-plugin-wkwebovew-file-xhr v2.1.2 (10/22/2019) * Support for xhr content served from application data directory in addition to the application package . (issue #45) -* Simulating file not found condition was firing the HEADERS_RECIEVED ready state change before setting the response status code (issue #33) +* Simulating file not found condition was firing the HEADERS_RECEIVED ready state change before setting the response status code (issue #33) ## cordova-plugin-wkwebview-file-xhr v2.1.1 (01/18/2018) * XMLHttpRequest setRequestHeader normalizes the value pair to string types (issue #13). diff --git a/README.md b/README.md index ee5257a..7475329 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# cordova-plugin-wkwebview-file-xhr 2.1.4 +# cordova-plugin-wkwebview-file-xhr 3.0.0 ## About the cordova-plugin-wkwebview-file-xhr @@ -16,6 +16,12 @@ Plugin installation requires Cordova 4+ and iOS 9+. It will install the Apache C cordova plugin add cordova-plugin-wkwebview-file-xhr ``` +Note : If your cordova-ios version is less than 6.0.0. You need to add following dependency to plugin.xml +``` + +``` +Alternatively you can use this plugin's version 2.1.4 + ## Supported Platforms * iOS @@ -28,7 +34,7 @@ var xhr = new XMLHttpRequest(); xhr.addEventListener("loadend", function(evt) { var data = this.responseText; - document.getElementById("myregion").innerHtml = data; + document.getElementById("myregion").innerHTML = data; }); xhr.open("GET", "js/views/customers.html"); diff --git a/package.json b/package.json index 1324abe..aa7e196 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-wkwebview-file-xhr", - "version": "2.1.4", + "version": "3.0.0", "description": "Cordova WKWebView File XHR Plugin", "cordova": { "id": "cordova-plugin-wkwebview-file-xhr", diff --git a/plugin.xml b/plugin.xml index d088290..8f5f260 100644 --- a/plugin.xml +++ b/plugin.xml @@ -21,13 +21,12 @@ + version="3.0.0"> Cordova WKWebView File XHR Plugin This plugin includes the Apache Cordova WKWebView plugin and resolves XHR Cross-Origin Resource Sharing (CORS) constraints. UPL 1.0 cordova,wkwebview,webview https://github.com/oracle/cordova-plugin-wkwebview-file-xhr.git - diff --git a/src/www/ios/xhr-polyfill.js b/src/www/ios/xhr-polyfill.js index fff0210..c9cb0f7 100644 --- a/src/www/ios/xhr-polyfill.js +++ b/src/www/ios/xhr-polyfill.js @@ -190,7 +190,7 @@ reqContext.status = 404; reqContext.responseText = "File Not Found"; - reqContext.dispatchReadyStateChangeEvent(2); // HEADERS_RECIEVED + reqContext.dispatchReadyStateChangeEvent(2); // HEADERS_RECEIVED reqContext.dispatchReadyStateChangeEvent(3); // LOADING reqContext.dispatchProgressEvent("progress"); @@ -215,7 +215,7 @@ reqContext.statusText = "OK"; reqContext.responseURL = reqContext.url; - reqContext.dispatchReadyStateChangeEvent(2); // HEADERS_RECIEVED + reqContext.dispatchReadyStateChangeEvent(2); // HEADERS_RECEIVED reqContext.dispatchReadyStateChangeEvent(3); // LOADING reqContext.dispatchProgressEvent("progress", respSize); reqContext.dispatchReadyStateChangeEvent(4); // DONE @@ -654,7 +654,7 @@ var respSize = rspTypeHandler.responseSize(); - reqContext.dispatchReadyStateChangeEvent(2); //HEADERS_RECIEVED + reqContext.dispatchReadyStateChangeEvent(2); //HEADERS_RECEIVED reqContext.dispatchReadyStateChangeEvent(3); //LOADING reqContext.dispatchProgressEvent("progress", respSize); reqContext.dispatchReadyStateChangeEvent(4); //DONE @@ -679,7 +679,7 @@ reqContext.responseText = error; } - reqContext.dispatchReadyStateChangeEvent(2); //HEADERS_RECIEVED + reqContext.dispatchReadyStateChangeEvent(2); //HEADERS_RECEIVED reqContext.dispatchReadyStateChangeEvent(3); //LOADING reqContext.dispatchProgressEvent("progress"); reqContext.dispatchReadyStateChangeEvent(4); //DONE @@ -781,7 +781,7 @@ DelegateHandler._readystatechangeEventRelay = function (reqContext, delegate, event) { - if (delegate.readyState > 1) // readyState gt HEADERS_RECIEVED + if (delegate.readyState > 1) // readyState gt HEADERS_RECEIVED { if (Object.keys(reqContext.responseHeaders).length === 0) DelegateHandler._parseResponseHeaders(delegate, reqContext.responseHeaders); @@ -1019,7 +1019,7 @@ // define readonly const properties - ["UNSENT", "OPENED", "HEADERS_RECIEVED", "LOADING", "DONE"].forEach(function (propName, i) + ["UNSENT", "OPENED", "HEADERS_RECEIVED", "LOADING", "DONE"].forEach(function (propName, i) { Object.defineProperty(window.XMLHttpRequest.prototype, propName, {