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

753
Vistas
Simulate / bypass the following: File chooser dialog can only be shown with a user activation

I know this message is telling me the problem... but I'm just messing around with a small fun project and would like to remove the extra click that's required to open a file input when the page loads.

The following (and jsfiddle https://jsfiddle.net/qu52ksef/)

<label id="foo" for="input">Open</label>
<input id="input" name="input" type="file">

<script>
    ready(function() {
        document.querySelector("#foo").click();
    });

    function ready(fn) {
        if (document.readyState != 'loading'){
                fn();
        } else {
            document.addEventListener('DOMContentLoaded', fn);
        }
    }
</script>

This will fire the following in Chrome: File chooser dialog can only be shown with a user activation.

Is there anyway to by pass this check as a sort of 'hack'?. This won't be going into production just a little pet project I'm playing with.

Thanks,

about 4 years ago · Juan Pablo Isaza
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