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

434
Vistas
Super simple script runs on some pages, not others. Why?

I have a super simple script (running in a Userscript manager for Safari) that works on some pages but not all.

Here is the script:

// ==UserScript==
// @name           Close tab on double click
// @include        https://*
// ==/UserScript==

                                  
document.addEventListener("dblclick",function (event) {
    window.close();
            });

For some reason, it works on Stack Overflow, Reddit post pages, etc., but does NOT work on Reddit homepage, Google (homepage or search results), etc.

Why?

Thanks for any insight. I'm still a newbie about javascript.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

In a chrome browser, when I add the JS function in the console and then double click on the page I get this notification (I tried the stack overflow site): Console Image

My guess is your userscript manager may add the script you write differently depending on the website, and the websites that don't work are because of this warning. Try opening your console after you add the script and see if you get this warning when double clicking does not work.

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