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

184
Visualizações
How to call function defined in a Chrome Extension content script from the page's console?

content.js

function foo(){
  console.log('bar');
}
foo();

Manifest

"content_scripts": [{"matches": ["<all_urls>"],"js": ["content.js"]}]

Everything works fine and the function executes when the page is loaded but is it possible to call this function through the console by myself?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

As Ivàn already pointed out, you need to change the context of execution from the Developers Tools' console. In the top left corner there is a dropdown menu, from there you can change the context. I attached a screenshot to help you find it.

enter image description here

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