Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

351
Vistas
"web_accessible_resources" manifest key is ignored if respective resources are injected into a file URL page

Recently my MV3 extension stopped working (although it was working before). After some research I found out that injected scripts/CSS fail to load despite they're listed in web_accessible_resources manifest key. These necessary resources are injected by my content script via document.createElement. It's worth noting that this problem only arises if these resources are injected into a page with a local file (file://) opened; there is no problem on http:// pages.

I get net::ERR_BLOCKED_BY_CLIENT error for all injected resources: Blocked Error message

Below is "web_accessible_resources" key in my manifest:

...
"web_accessible_resources": [
  {
    "resources": [
      "harviewer/*",
      "connection.js"
    ],
    "matches": [
      "<all_urls>"
    ]
  }
],
...

AFAIU it is correct, otherwise I'd get another error message like this: enter image description here

"Allow access to file URLS" checkbox is checked for the extension: enter image description here

I have no adblock-like extensions installed. Also I've tried to clear browser cache, with no luck.

So is it a bug or a feature? The current Chrome Dev docs don't mention such behaviour.

I've made a MCVE that reproduces the problem.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Yes, confirming this nasty behaviour in MV3 for file://* scheme.. Sounds like a Chrome's CSP bug when accessing resources from local files..

As workaround we can simply proxying all global.fetch() requests to our service-worker (aka background-page in MV2) with chrome.runtime.sendMessage(message, callback) and then return content as a plain/base64 string.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda