Also combine options and extra in CrossOrigin.ajax and in call from $.cache.

Fixes bugs from 71896af275ba612384e41bc05ab3c5acf78e9cbf.
This commit is contained in:
ccd0 2019-03-24 04:49:41 -07:00
parent 19c7e73d14
commit 2c4b77e8d7
2 changed files with 7 additions and 7 deletions

View File

@ -97,7 +97,8 @@ $.whenModified = (url, bucket, cb, options={}) ->
($.lastModified[bucket] or= {})[url0] = @getResponseHeader('Last-Modified')
cb.call @
timeout
}, {headers}
headers
}
r
do ->

View File

@ -87,18 +87,17 @@ CrossOrigin =
# Attempts to fetch `url` in JSON format using cross-origin privileges, if available.
# Interface is a subset of that of $.ajax.
# Options:
# `options.onloadend` - called with the returned object as `this` on success or error/abort/timeout.
# `options.timeout` - time limit for request
# `extra.headers` - request headers
# `onloadend` - called with the returned object as `this` on success or error/abort/timeout.
# `timeout` - time limit for request
# `headers` - request headers
# Returned object properties:
# `status` - HTTP status (0 if connection not successful)
# `statusText` - HTTP status text
# `response` - decoded response body
# `abort` - function for aborting the request (silently fails on some platforms)
# `getResponseHeader` - function for reading response headers
ajax: (url, options={}, extra={}) ->
{onloadend, timeout} = options
{headers} = extra
ajax: (url, options={}) ->
{onloadend, timeout, headers} = options
<% if (type === 'userscript') { %>
unless GM?.xmlHttpRequest? or GM_xmlhttpRequest?