Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9212811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:36:37+00:00 2026-06-18T01:36:37+00:00

Okay, here’s what I want my Chrome Extension to do: It’s just a button

  • 0

Okay, here’s what I want my Chrome Extension to do:

It’s just a button in the corner, and when you click on it :O it adds a tag(don’t want to give the idea away)right after the body tag. I don’t want it so like the user gets to edit the html, I just want it so when you click the button it adds a tag, and I was wondering how I could achieve this. JavaScript, or is there something else I could use to get this done. Or is this even possible. Anyone have any idea?

So basically, if this is the html:

<DOCTYPE! html>
<html>
<head>
    <title>Some title</title>
</head>
<body>
    <p>Some content</p>
</body>
</html>

Than when you click the button, this happens:

<DOCTYPE! html>
<html>
<head>
    <title>Some title</title>
</head>
<body>
    <center> //or some other tag
    <p>Some content</p>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:36:38+00:00Added an answer on June 18, 2026 at 1:36 am

    I, you should do a content script extension. Content script code will run in the page, and can add a button wherever you like in the page. You hang a click listener to it with .addEventListener (all DOM stuff, nothing Chrome extension specific), and so on. Read about Chrome extensions Content Scripts here.

    Your manifest.json should be like this:

    {
      "name": "My Extension",
      "version": "0.1",
      "manifest_version": 2,
      "description": "A plain text description",
      "default_locale": "en",
      "content_scripts": [{
        "matches": ["http://*/*", "https://*/*"],
        "js": ["yourScript.js"]
      }],
    }
    

    It will inject yourScript.js in every page. Depends on what are you trying to do, know that yourScript.js has some Content Security Policy limitations you can change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so here is what I want to do. I want to add a
Okay here is what I'm, trying to do I want to escape the period
Okay so here is my issue. My work uses SVN. I want to use
Okay here's my situation. I have the following branches development development-kirby (270 commits ahead
Okay here is what I'm trying to do: I have a model object that
Okay so here's, the scenario I have a thumbnail that contains an artists profile
Okay so here's what I'm doing. I'm making a request to a server to
Okay so here is the deal. As the question states, I'm trying to POST
Okay basically here's where I'm at. I have a list of PropertyDescriptor objects. These
Okay so here's my algorithm for finding a Cut in a graph (I'm not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.