Skip to content

Firefox: No translator paths provided when importing a generic web page #720

Description

@Brimborion

Description

The JabRef Browser Extension fails to import some generic web pages when no specific Zotero translator appears to be detected.

For the example below, the extension popup remains stuck on:

Searching for bibliographic data...

The extension console reports:

JabRef: Error handling message in background.js Error: No translator paths provided

and:

Failed to send popupOpened message Error: No translator paths provided

Example URL

https://www.martinfowler.com/articles/exploring-gen-ai/tdd-in-the-agent-loop.html

Steps to reproduce

  1. Open the URL above in Firefox.
  2. Click the JabRef Browser Extension button.
  3. The popup remains stuck on Searching for bibliographic data....
  4. Inspect the extension via about:debugging.
  5. The extension console reports Error: No translator paths provided.

Expected behavior

If no specific translator is available for the page, the extension should fall back to importing it as a simple web page reference instead of leaving the popup stuck.

Additional observations

  • Importing an arXiv article with the same JabRef Browser Extension installation works correctly.
  • Importing the example URL with the Zotero Firefox extension also works correctly.
  • Zotero creates a web-page entry containing fields such as title, author, website title, URL, access date, abstract, and snapshot.
  • This suggests that the communication between Firefox and JabRef is working correctly.
  • The issue therefore appears to be specific to pages for which the JabRef Browser Extension does not find an applicable translator.

Possible cause

Looking at the handling of translatorsInfo, an empty translator array may be treated differently from a missing or undefined translatorsInfo.

If translatorsInfo is [], a check such as:

if (!info.translatorsInfo)

does not match, because an empty array is truthy in JavaScript/TypeScript.

If execution then reaches code that expects at least one translator, this could explain the observed:

Error: No translator paths provided

It may therefore be worth checking whether the fallback condition should also handle an empty translator array, for example:

if (!info?.translatorsInfo?.length)

so that pages without an applicable translator are handled by the simple web-page fallback.

This is only a suggested cause based on the observed behavior and the current control flow.

Environment

  • JabRef: 5.15
  • JabRef Browser Extension: 3.2.2
  • Firefox: 154.0
  • OS: macOS Tahoe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions