WIP
This commit is contained in:
parent
57a426f4f2
commit
0ed936438c
@ -124,7 +124,7 @@ class Yomichan {
|
|||||||
callAnkiApi(action, data, callback) {
|
callAnkiApi(action, data, callback) {
|
||||||
if (this.options.enableAnkiConnect) {
|
if (this.options.enableAnkiConnect) {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.addEventListener('load', () => callback(JSON.parse(xhr.responseText)));
|
xhr.addEventListener('loadend', () => callback(xhr.responseText ? JSON.parse(xhr.responseText) : null));
|
||||||
xhr.open('POST', 'http://127.0.0.1:8888');
|
xhr.open('POST', 'http://127.0.0.1:8888');
|
||||||
xhr.withCredentials = true;
|
xhr.withCredentials = true;
|
||||||
xhr.setRequestHeader('Content-Type', 'text/json');
|
xhr.setRequestHeader('Content-Type', 'text/json');
|
||||||
|
Loading…
Reference in New Issue
Block a user