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

282
Views
Volver a habilitar el clic derecho en la página web: el truco "Void document oncontextmenu null" no funciona

Para propósitos de prueba, he deshabilitado la función de clic derecho en una página web agregando el siguiente fragmento de código de JavaScript:

document.addEventListener('contextmenu', event => event.preventDefault());

Hasta aquí todo bien.

Ahora, para volver a habilitar la opción usando un método de código, se supone que basta con escribir javascript:void(document.oncontextmenu=null); en la barra de direcciones de su Navegador y presione Entrar. Pero parece que este método ya no funciona. No sé qué tiene de malo y me pregunto si hay alguna forma alternativa similar, excepto desactivar JavaScript en Chrome.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El método addEventListener() se puede eliminar solo con el método removeEventListener()

Si necesita que su código funcione, debe asignar el evento con la propiedad oncontextmenu

quiero decir que

 document.oncontextmenu = (event) => { event.preventDefault(); }

Funcionará.

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