Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion core/Request.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ Object {
request.done = this._context.wrapNativeCallback(request.done)
if (request.error)
request.error = this._context.wrapNativeCallback(request.error)
this._context.backend.ajax(this, request)
var xhr = this._context.backend.ajax(this, request)
if (xhr)
(this._activeXhrs || (this._activeXhrs = [])).push(xhr)
return xhr
}

/**abort all in-flight requests created by this Request instance*/
function abortAll() {
var xhrs = this._activeXhrs
if (!xhrs) return
this._activeXhrs = []
for (var i = 0; i < xhrs.length; i++) {
var xhr = xhrs[i]
if (xhr && xhr.readyState !== 4) {
try { xhr.abort() } catch (e) {}
}
}
}
}
2 changes: 2 additions & 0 deletions platform/html5/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,8 @@ exports.ajax = function(ui, request) {
xhr.send(request.data)
else
xhr.send()

return xhr
}

exports.fingerprint = function(ctx, fingerprint) {
Expand Down
Loading