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

278
Visualizações
Manifest V3, background service worker and popup.html

If I use a background.js service worker to inject js into the web page. 

chrome.action.onClicked.addListener(async tab => { try { await chrome.scripting.executeScript({ target: { tabId: tab.id, allFrames: true, }, files: ["script.js"], }); } catch (erri) { console.error(failed to execute script: ${erri}); } });

The javascript is loaded. I can see this working because it adds a class to the document body.  

However,

If I add a popup.html to the manifest, that opens a popup with a checkbox when the extension button is clicked, the background.js service worker no longer injects the script and the class  is not added to the document body. 

I can’t work out why. 

I’d appreciate some guidance how to inject the script into the document (web page) and also be able to have the popup functionality. 

about 4 years ago · Juan Pablo Isaza
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