Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

358
Visualizações
"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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda