Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
is it possible to recognized the select and unselect event about the web element

I am listening the user select event in google chrome extension content script like this:

document.addEventListener(TransGlobal.MOUSE_UP, firstMouseUp);

export async function firstMouseUp(e: MouseEvent) {
  if (selection && selection.toString().trim().length > 0) {
    // do some select logic
  }
}

Now I am facing a problem that the firstMouseUp will trigger when select element and unselect element. when double click the webpage event then trigger the select event, it works fine. But I did not want to trigger the select when click the free area of the web, when click the free area of the web page, the selected element will be unselected, also trigger the firstMouseUp, that make me crazy, what should I do to recognize the select or unselect? I found some text the unselect will trigger, for example, this page https://stackoverflow.com/help/badges/2278/custodian?userid=16801334. when I select the Custodian and unselected, both will trigger. other text unselect did not trigger:

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda