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

309
Views
Cannot insert/inject a button into a HTML element using Google Extensions

So, I am trying to insert a button into a site that I do not own using Google Extensions.

I was able to make it work on the body, but not using getelementid

But the button does not show up where it was suppose to.

It is because it is inside an iframe? What can I do to insert a button?

Thanks!

This image shows the error https://i.stack.imgur.com/TvUfG.png

manifest.json

{
    "manifest_version": 3,
    "name": "Button Injection",
    "version": "1.0",

    "description": "This extension injects a button into a web page.",

    "permissions": ["tabs"],

    "content_scripts": [
        {
            "matches": ["https://*/*"],
            "js": ["script.js"],
            "run_at": "document_end"
        }
    ]
}

script.js

let button = document.createElement("button");
let button2 = document.createElement("button");
button.innerHTML = "Click Me";
button2.innerHTML = "Click Me2";
document.body.appendChild(button);
document.getElementById("gwt-debug-MainMessageView").appendChild(button2);
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!