Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

282
Vistas
Javascript on paste: check if pasted content comes from word

Is it possible to check where a pasted content comes from? Because I need to check if a pasted content was copied from a word file...

So, is there something in javascript like:

  example.on('paste', function (event) {
     if (event.source == "Word") {
        // do something
     }
  }

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

I need to remove all Office Codes. These are class-attributes starting with Mso

Why not check for what you need to fix?

const text = (event.clipboardData || window.clipboardData).getData('text')
if (text && text.toUpperCase().match(/"MSO/)) ...
about 4 years ago · Juan Pablo Isaza Denunciar

0

I don't believe so, you need the clipboard API, and you only have access to executing the copy and paste commands. This will allow you to read or write content only.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard

If you look at the clipboard API, you only get a read string or a DataTransfer instance. Which doesn't include any information on the source of the clipboard contents.

https://developer.mozilla.org/en-US/docs/Web/API/Clipboard

about 4 years ago · Juan Pablo Isaza Denunciar

0

No that's not possible in web because if you copy any text from any source it will be same, And you are just copying that text, not source info, So that's impossible

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda