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

133
Vistas
Javascript async functions doesn't work in android chrome from js in url bar

I made a simple script to run in my android chrome. It comes that there are 2 scenarios working differently:

first one javascript:(alert("try")) works with no problems

second one javascript:(async function test(){alert("try")};test()) does NOT work

obv it's not what i am trying to do but in my desired script i need an await or a generic sleep. What can i do?

edit: the curious thing is that setInterval works fine... but javascript:(let prova = "try";alert(prova)) doesn't work

edit2: i did it, it took a very bad headache but now works. There are things that doesn't work for some reason but a workaround can always be found

here's what's the final working version

javascript:(setInterval(() =>{setTimeout(() => {document.querySelector('.nameofthetextareaselector').value="value i wanted to put here";document.querySelector('.nameofthebuttontosend').click();new Promise(resolve => setTimeout(() => {document.querySelector('.nameofthesecondbutton').click()},2000));resolve},2000)},5000))

It edits the textarea, send it, click another button after some seconds and repeat

things that not worked: assign anything with let, const or directly the name of the variable, nesting promises, using async-await, using try-catch, etc...

Now i am happy that all works but i want to know why all these things doesn't seem to work (only on android chrome, on windows chrome all these things worked)

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

0

What you are doing right now is just declaring a function without calling it, you can add () at the end of javascript function to execute it right away.

javascript:(async function test(){alert("try")}())

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