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";
}
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.