Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
Content scripts difference between Firefox and Chrome: not able to get API data

I'm fetching data on Arxiv.org's api with my chrome extension.

The following code works when executed:

  • [x] Popup on Chrome
  • [x] Content script on Chrome
  • [x] Popup on Firefox
  • [ ] Content script on Firefox <- why is that, how can I debug?

If it is of any help, content_script.js is triggered on https://arxiv.org/abs/1801.06146

// content_script.js
$.get(`https://export.arxiv.org/api/query`, { id_list: "1801.06146" })
    .done((data) => {
        console.log("done");
        console.log(data);
    })
    .fail((jqXHR, textStatus, errorThrown) => {
        console.log("fail");
        console.log({ jqXHR, textStatus, errorThrown });
    });

The FF failure looks like:

jserror

// manifest.json
"permissions": [
    "https://arxiv.org/*",
    "https://proceedings.neurips.cc/*",
    "https://openaccess.thecvf.com/*",
    "tabs",
    "activeTab",
    "storage",
    "unlimitedStorage",
    "downloads"
  ],
  "content_scripts": [
    {
      "matches": [
        "*://arxiv.org/*",
        "*://*.arxiv-vanity.com/*",
        "*://proceedings.neurips.cc/*",
        "*://openaccess.thecvf.com/*"
      ],
      "run_at": "document_start",
      "js": [
        "src/shared/jquery.min.js",
        "src/shared/utils.min.js",
        "src/content_scripts/content_script.js"
      ],
      "css": [
        "src/content_scripts/downloadButton.css",
        "src/content_scripts/loader.css",
        "src/content_scripts/content_script.css"
      ]
    }
  ]
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Actually the error is not very useful but I figured the problem out: adding "https://export.arxiv.org/*", to the manifest's permissions.

For some reason (?) Chrome allows https://export.arxiv.org/api/... declaring https://arxiv.org/* but not Firefox

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!