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

127
Views
(Amended) ChromeExt (beginner) - why do my <button>s show up only when I hover over the targetNode when using mutation observer?

Very new to chrome ext. development. (&& programming in general) If someone could please help me understand why my appended buttons show up ONLY after the targetNode is hovered.

content_script

let targetNode = document.getElementsByClassName('notranslate')[0];
if (!targetNode){
    setTimeout(setBtns, 500);
    return;
} else {
    let observer = new MutationObserver(record => {
        console.log(record);
        targetNode.insertAdjacentHTML('beforebegin', editFuncs);
        observer.disconnect();
    })
    observer.observe(targetNode, {
        childList: true,
        attributes: true,
        characterData: true,
        subtree: true
    })
}

I am trying to make an extension for ~.notion.site/~ and the class 'notranslate' is a dynamic node within the DOM. What I am trying to do is display my buttons stored in 'editFuncs' as a string without having to hover.

about 4 years ago · Santiago Gelvez
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!