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