Skip to content

Instantly share code, notes, and snippets.

@horaciod
Created February 26, 2026 22:12
Show Gist options
  • Select an option

  • Save horaciod/08be31906c68c6d4261258ee370b0f08 to your computer and use it in GitHub Desktop.

Select an option

Save horaciod/08be31906c68c6d4261258ee370b0f08 to your computer and use it in GitHub Desktop.
bookmarklet para descargar en un archivo .txt el contenido del primer textarea
/*
Cómo instalarlo
Crea un nuevo marcador (Ctrl+D o Cmd+D) en la barra de favoritos de tu navegador.
En el campo Nombre, ponle algo como "Descargar TXT".
En el campo URL (o Dirección), pega el siguiente código en una sola línea (es el mismo de arriba, pero minificado para que el navegador lo acepte correctamente):
*/
javascript:(function(){const t=document.querySelector('textarea');if(!t||!t.value){alert('No hay textarea con contenido');return}const b=new Blob([t.value],{type:'text/plain'}),e=document.createElement('a');e.href=URL.createObjectURL(b);e.download='archivo.txt';document.body.appendChild(e);e.click();document.body.removeChild(e);URL.revokeObjectURL(e.href);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment