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

220
Visualizações
why the selectionchange called twice in google chrome extension

I am using selectionchange to capture the user select in google chrome extension content script like this:

document.addEventListener(TransGlobal.SELECTION_CHANGE, fireSelection);

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

I found when double click the web element and do some selection, the fireSelection triggered twice, two of the trigger both have selection content but the selection content be the same. why did this happen? what should I do to make it only triggered once?

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