• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

202
Views
How can I change a website text using chrome extension?

I am trying to change some text on a website. When I try to use innerText, nothing changes. This is the HTML of the text I want to change: <div class="styles__tokenBalanceText___2eYY7-camelCase">742</div>

Here is my manifest:

{
    "manifest_version": 3,
    "name": "test",
    "version": "1.0.0",
    "content_scripts": [
        {
            "matches": ["<all_urls>"],
            "all_frames": true,
            "js": ["Content.js"]

        }
    ],
    "permissions": [
        "activeTab"
    ]
}

And here is my Content.js:

const elements = document.getElementsByClassName('<div class="styles__tokenBalanceText___2eYY7-camelCase">742</div>')
for (let i = 0; i < elements.length; i++) {
    elements[i].innerText = "123";

}
over 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use Tamper Monkey to run custom JavaScript on any specific website or page.

You just need to write the JavaScript code to achieve what you desire.

over 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error