Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!