tophf 2 недель назад
Родитель
Сommit
2afee345eb
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      src/injected/web/requests.js

+ 4 - 3
src/injected/web/requests.js

@@ -59,18 +59,19 @@ addHandlers({
     }
     const { type } = msg;
     const upload = getOwnProp(msg, UPLOAD);
-    const cb = req.cb[upload][type];
+    const cb = req.cb[upload ? 1 : 0][type];
     if (!upload && type === 'loadend') {
       delete idMap[req.id];
     }
-    if (!cb && type !== ERROR)
-      return;
     if (hasOwnProperty(msg, ERROR)) {
       msg = msg[ERROR];
       msg = new SafeDOMException(msg[0], msg[1]);
       if (cb) cb(msg); else log(ERROR, displayNames[req.scriptId], msg);
       return;
     }
+    if (!cb) {
+      return;
+    }
     const { data } = msg;
     const {
       [kResponse]: response,