Skip to content

Commit

Permalink
Changes for v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manish2788 committed Sep 8, 2020
1 parent 9212243 commit 2451db1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
```
<dependency id="cordova-plugin-wkwebview-engine" />
```
Alternatively you can use this plugin's version 2.1.4

## Supported Platforms

* iOS
Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 1 addition & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-plugin-wkwebview-file-xhr"
version="2.1.4">
version="3.0.0">
<name>Cordova WKWebView File XHR Plugin</name>
<description>This plugin includes the Apache Cordova WKWebView plugin and resolves XHR Cross-Origin Resource Sharing (CORS) constraints.</description>
<license>UPL 1.0</license>
<keywords>cordova,wkwebview,webview</keywords>
<repo>https://github.com/oracle/cordova-plugin-wkwebview-file-xhr.git</repo>
<dependency id="cordova-plugin-wkwebview-engine" />
<engines>
<engine name="cordova-ios" version=">=4.0.0" />
<engine name="apple-ios" version=">=9.0" />
Expand Down
12 changes: 6 additions & 6 deletions src/www/ios/xhr-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
{
Expand Down

0 comments on commit 2451db1

Please sign in to comment.