Let the default responseType in $.ajax always be "json" regardless of URL.
This commit is contained in:
parent
4801013380
commit
a94d76d84b
@ -77,7 +77,6 @@ Report =
|
||||
for [name, url] in urls
|
||||
do (name, url) ->
|
||||
$.ajax url,
|
||||
responseType: 'json'
|
||||
onloadend: ->
|
||||
results.push [name, @response or {error: ''}]
|
||||
if results.length is urls.length
|
||||
|
||||
@ -52,7 +52,7 @@ $.ajax = do ->
|
||||
|
||||
(url, options={}, extra={}) ->
|
||||
{type, whenModified, bypassCache, upCallbacks, form} = extra
|
||||
options.responseType ?= 'json' if /\.json$/.test url
|
||||
options.responseType ?= 'json'
|
||||
# XXX https://forums.lanik.us/viewtopic.php?f=64&t=24173&p=78310
|
||||
url = url.replace /^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'
|
||||
if whenModified
|
||||
|
||||
@ -90,7 +90,7 @@ CrossOrigin =
|
||||
unless GM?.xmlHttpRequest? or GM_xmlhttpRequest?
|
||||
if bypassCache
|
||||
$.cleanCache (url2) -> url2 is url
|
||||
if (req = $.cache url, cb, responseType: 'json')
|
||||
if (req = $.cache url, cb)
|
||||
$.on req, 'abort error', -> cb.call({})
|
||||
else
|
||||
cb.call {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user