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

124
Visualizações
How to create a chrome extension that can manipulate a specific page?

I am just starting into developing a chrome extension, where i would want to manipulate the DOM on a specific website, i have read a few tutorials, but there are not that many that are up to date regarding this topic and with manifest v3. What i want to achive now, is just a simple console log from the foreground, or even changing the background color for google would be fine.

Manifest.json

{
  "name": "Extension",
  "description": "Extension description",
  "version": "0.0.1",
  "manifest_version": 3,
  "background": {
    "service_worker": "./background.js"
  },
  "action": {
    "default_popup": "./popup.html"
  },
  "permissions": ["tabs", "https://google.com", "scripting"]
}

background.js

chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
  if (tab.url.indexOf("opensea.io") > -1) {
    chrome.scripting.executeScript({
      target: {tabId: tab.id, allFrames: true},
      files: ["./foreground.js"],
    });
  }
});

foreground.js

console.log('active');

I'am kinda confused how to do this properly, one tutorial says this, the other says an other way, but both of them doesn't seem to work so far. The error is that it cannot access the contents of the url.

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