Add mimetype to XHR call

This silences warnings about the JSON files being ill-formed
This commit is contained in:
ispedals 2016-06-18 18:29:49 -04:00
parent 5e0ac4e8ea
commit 28de6a4d6e

View File

@ -237,6 +237,7 @@ class Translator {
static loadData(url, callback) { static loadData(url, callback) {
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
xhr.overrideMimeType("application/json");
xhr.addEventListener('load', () => callback(xhr.responseText)); xhr.addEventListener('load', () => callback(xhr.responseText));
xhr.open('GET', chrome.extension.getURL(url), true); xhr.open('GET', chrome.extension.getURL(url), true);
xhr.send(); xhr.send();