Created
February 26, 2026 22:12
-
-
Save horaciod/08be31906c68c6d4261258ee370b0f08 to your computer and use it in GitHub Desktop.
bookmarklet para descargar en un archivo .txt el contenido del primer textarea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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