Use modern JSON instead of old JSONP
This commit is contained in:
parent
b749b0a4b9
commit
d17af82b2a
Binary file not shown.
11
package.json
11
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "interlanguage-checker",
|
||||
"version": "1.10.28",
|
||||
"version": "1.11.0",
|
||||
"description": "Check the consistency of MediaWiki interlanguage links in a simple overview.",
|
||||
"author": "Felix W. Dekker",
|
||||
"browser": "dist/bundle.js",
|
||||
|
@ -15,19 +15,16 @@
|
|||
"dev:server": "grunt dev:server",
|
||||
"deploy": "grunt deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"fetch-jsonp": "^1.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "^1.3.0",
|
||||
"grunt": "^1.4.0",
|
||||
"grunt-cli": "^1.4.2",
|
||||
"grunt-contrib-clean": "^2.0.0",
|
||||
"grunt-contrib-copy": "^1.0.0",
|
||||
"grunt-contrib-watch": "^1.1.0",
|
||||
"grunt-focus": "^1.0.0",
|
||||
"grunt-text-replace": "^0.4.0",
|
||||
"grunt-webpack": "^4.0.2",
|
||||
"webpack": "^5.33.2",
|
||||
"grunt-webpack": "^4.0.3",
|
||||
"webpack": "^5.35.1",
|
||||
"webpack-cli": "^4.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import fetchJsonp from "fetch-jsonp";
|
||||
import {couldNotConnectMessage, mergeStates} from "./Shared";
|
||||
|
||||
|
||||
|
@ -351,9 +350,9 @@ export class MediaWiki {
|
|||
* @return {Promise<Object>} the API's response
|
||||
*/
|
||||
request(params) {
|
||||
const url = this.origin + this.apiPath + "?format=json&" + new URLSearchParams(params).toString();
|
||||
const url = this.origin + this.apiPath + "?format=json&origin=*&" + new URLSearchParams(params).toString();
|
||||
console.debug(`Requesting from ${this.origin}${this.apiPath} with params`, params, "at", url);
|
||||
return fetchJsonp(url)
|
||||
return fetch(url)
|
||||
.then(it => it.json())
|
||||
.catch(() => {
|
||||
throw new Error(couldNotConnectMessage);
|
||||
|
|
Loading…
Reference in New Issue