INNER CODE UNIT · JavaScript

onError

mozilla/firefox-translations · extension/controller/backgroundScript.js:117

const onError = error => {
  // this means frame is already unloaded. Even though we check it, race conditions are still possible
  if (error.message.endsWith("Could not establish connection. Receiving end does not exist.")) {
    console.warn(error);
  } else throw error;
}

const submitPing = tabId => {
  if (pingByTab.has(tabId)) {
    getTelemetry(tabId).submit();
    pingByTab.delete(tabId);
  }
  telemetryByTab.delete(tabId);
  translationRequestsByTab.delete(tabId);
  outboundRequestsByTab.delete(tabId);
}

// eslint-disable-next-line max-lines-per-function,complexity

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…