aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r--ext/bg/js/util.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index 8a21b264..124438ed 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -113,11 +113,15 @@ function loadJson(url) {
const xhr = new XMLHttpRequest();
xhr.addEventListener('load', () => resolve(JSON.parse(xhr.responseText)));
xhr.addEventListener('error', () => reject('failed to execute network request'));
- xhr.open('GET', chrome.extension.getURL(url));
+ xhr.open('GET', url);
xhr.send();
});
}
+function loadJsonInt(url) {
+ return loadJson(chrome.extension.getURL(url));
+}
+
function importJsonDb(indexUrl, indexLoaded, termsLoaded, kanjiLoaded) {
const indexDir = indexUrl.slice(0, indexUrl.lastIndexOf('/'));
return loadJson(indexUrl).then(index => {