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

289
Visualizações
Re-enabling right-click on web page: "Void document oncontextmenu null" trick not working

For testing purposes, I have disabled the right click function on a web page by adding the following JavaScript snippet code:

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

So far, so good.

Now, to re-enable the option using a code method, it is supposed to be enough to just type javascript:void(document.oncontextmenu=null); in the address bar of your Browser and press Enter. But this method seems not be working anymore. I do not know what is wrong with it and wonder if there is any similar alternative way, except toggling off JavaScript in Chrome?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

addEventListener() method can be removed with removeEventListener() method only

If you need your code working you need to assign the event with the oncontextmenu property

I mean that

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

It will work.

about 4 years ago · Santiago Trujillo Relatório
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