Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

60
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";

}
7 months 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.

7 months 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 job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.