🚀 Newgrounds Open Audio and Copy URL
🎯 What does this script do? / ¿Qué hace este script?
English: This script enhances the Newgrounds audio listening page by adding a button that allows users to simultaneously open the audio file in a new tab and copy its URL to the clipboard. It extracts the audio URL from the `og:audio` meta tag and provides a convenient way to access and share the audio link. The script uses Tampermonkey's `GM_setClipboard` function for copying, with a fallback to the browser's native clipboard API if needed.
Español: Este script mejora la página de escucha de audio de Newgrounds añadiendo un botón que permite a los usuarios abrir simultáneamente el archivo de audio en una nueva pestaña y copiar su URL al portapapeles. Extrae la URL del audio de la etiqueta meta `og:audio` y proporciona una forma conveniente de acceder y compartir el enlace de audio. El script utiliza la función `GM_setClipboard` de Tampermonkey para copiar, con una opción de respaldo a la API nativa del portapapeles del navegador si es necesario.
✨ Features / Características
Audio Link Utility
- 🔧 Audio URL Extraction - Finds the audio link from the `og:audio` meta tag.
- ⚡ Open in New Tab - Opens the extracted audio URL in a new browser tab.
- 🎨 Copy to Clipboard - Copies the audio URL to the clipboard using `GM_setClipboard` or the native API.
- 🚀 Convenient Button - Adds a fixed button on the page for easy access to these actions.
- 💡 Error Handling - Logs errors if the meta tag is not found or if clipboard access fails.
- 🔒 Tampermonkey Integration - Utilizes `GM_setClipboard` for reliable clipboard operations.
Español:
- 🔧 Extracción de URL de Audio - Encuentra el enlace de audio de la etiqueta meta `og:audio`.
- ⚡ Abrir en Nueva Pestaña - Abre la URL de audio extraída en una nueva pestaña del navegador.
- 🎨 Copiar al Portapapeles - Copia la URL de audio al portapapeles usando `GM_setClipboard` o la API nativa.
- 🚀 Botón Conveniente - Añade un botón fijo en la página para un fácil acceso a estas acciones.
- 💡 Manejo de Errores - Registra errores si no se encuentra la etiqueta meta o si falla el acceso al portapapeles.
- 🔒 Integración con Tampermonkey - Utiliza `GM_setClipboard` para operaciones de portapapeles fiables.
📥 Installation / Instalación
| 🇺🇸 English Instructions | 🇪🇸 Instrucciones en Español |
- Install the Tampermonkey extension (or a similar userscript manager) in your browser.
- Create a new userscript and paste the provided code into the editor.
- Save the script.
- Navigate to an audio listening page on Newgrounds.com (e.g.,
https://www.newgrounds.com/audio/listen/ARTICLE_ID). - A button labeled "Open Audio and Copy URL" will appear at the bottom left of the page.
| - Instala la extensión Tampermonkey (o un gestor de userscripts similar) en tu navegador.
- Crea un nuevo userscript y pega el código proporcionado en el editor.
- Guarda el script.
- Navega a una página de escucha de audio en Newgrounds.com (ej.
https://www.newgrounds.com/audio/listen/ID_DEL_ARTICULO). - Aparecerá un botón llamado "Open Audio and Copy URL" en la parte inferior izquierda de la página.
|
🎮 How to Use / Cómo Usar
- 🔵 Step 1: Go to an audio page on Newgrounds.com.
Paso 1: Ve a una página de audio en Newgrounds.com. - 🟢 Step 2: Locate the "Open Audio and Copy URL" button at the bottom left.
Paso 2: Localiza el botón "Open Audio and Copy URL" en la parte inferior izquierda. - 🟣 Step 3: Click the button. The audio will open in a new tab, and its URL will be copied to your clipboard.
Paso 3: Haz clic en el botón. El audio se abrirá en una nueva pestaña y su URL se copiará a tu portapapeles. - 🟠 Step 4: Check your clipboard or the new tab to confirm the action.
Paso 4: Verifica tu portapapeles o la nueva pestaña para confirmar la acción.
🛠️ Technical Details / Detalles Técnicos
| Feature / Característica | Details / Detalles |
| Meta Tag Parsing | Selects the `og:audio` meta tag to retrieve the audio file URL. |
| DOM Manipulation | Creates and appends a button element to the page's body. |
| Clipboard API | Uses `GM_setClipboard` (Tampermonkey) or `navigator.clipboard.writeText` for copying the URL. |
| Window Management | Uses `window.open()` to open the audio URL in a new tab. |
⚠️ Important Warnings / Advertencias Importantes
- 🚨 The script relies on the presence of the `og:audio` meta tag. If Newgrounds changes its page structure, the script may stop working.
- 🚨 Ensure Tampermonkey is enabled and has permissions to set the clipboard if `GM_setClipboard` is not available.
- 🚨 Some browsers might have security restrictions that prevent the fallback clipboard API from working automatically.
- 🚨 The button appears only after the page content is fully loaded.
Español:
- 🚨 El script depende de la presencia de la etiqueta meta `og:audio`. Si Newgrounds cambia la estructura de su página, el script podría dejar de funcionar.
- 🚨 Asegúrate de que Tampermonkey esté habilitado y tenga permisos para establecer el portapapeles si `GM_setClipboard` no está disponible.
- 🚨 Algunos navegadores pueden tener restricciones de seguridad que impidan que la API de portapapeles de respaldo funcione automáticamente.
- 🚨 El botón aparece solo después de que el contenido de la página se ha cargado completamente.
🔧 Troubleshooting / Solución de Problemas
✅ The button appears, the audio opens in a new tab, and the URL is copied to the clipboard.
✅ El botón aparece, el audio se abre en una nueva pestaña y la URL se copia al portapapeles.
⚠️ If the button does not appear, ensure the script is enabled and you are on the correct Newgrounds audio page. Check the browser console for errors.
⚠️ Si el botón no aparece, asegúrate de que Tampermonkey esté habilitado y el script esté instalado correctamente. Revisa la consola del navegador en busca de errores.
❌ If copying to the clipboard fails, it might be a browser security feature. Try manually copying the URL from the address bar.
❌ Si la copia al portapapeles falla, podría ser una característica de seguridad del navegador. Intenta copiar manualmente la URL desde la barra de direcciones.
📊 Compatibility / Compatibilidad
| ✅ Compatible Browsers / Navegadores Compatibles | ✅ Required Extensions / Extensiones Requeridas |
Chrome, Firefox, Edge, Opera (Browsers supporting userscripts, meta tag parsing, and clipboard APIs) | Tampermonkey or similar userscript manager (Required for script execution) |
🔄 How to Disable / Cómo Desactivar
Method 1 - Script Manager:Open your userscript manager (e.g., Tampermonkey), find "Open Audio and Copy URL", and disable or delete it.
Método 1 - Gestor de Scripts: Abre tu gestor de userscripts (ej. Tampermonkey), busca "Open Audio and Copy URL" y desactívalo o elimínalo.
Method 2 - Remove Script Code:You can edit the script and comment out or remove the lines that create and add the button to the page.
Método 2 - Eliminar Código del Script: Puedes editar el script y comentar o eliminar las líneas que crean y añaden el botón a la página.
💡 Pro Tips / Consejos Profesionales
- Add More Copy Options: Include options to copy the audio title or artist information if available in meta tags.
- Alternative Open Methods: Add functionality to download the audio file directly instead of just opening it in a new tab.
- Improve Clipboard Feedback: Provide visual confirmation (e.g., a temporary message) when the URL is successfully copied to the clipboard.
- Error Handling for Meta Tag: Add more specific error handling if the `og:audio` meta tag is missing or malformed.
- Context Menu Integration: Explore options to add this functionality to the browser's context menu for easier access.
Español:
- Añade Más Opciones de Copia: Incluye opciones para copiar el título del audio o la información del artista si están disponibles en las etiquetas meta.
- Métodos de Apertura Alternativos: Agrega funcionalidad para descargar el archivo de audio directamente en lugar de solo abrirlo en una nueva pestaña.
- Mejora la Retroalimentación del Portapapeles: Proporciona confirmación visual (ej. un mensaje temporal) cuando la URL se copia correctamente al portapapeles.
- Manejo de Errores para Etiqueta Meta: Agrega un manejo de errores más específico si la etiqueta meta `og:audio` falta o está mal formada.
- Integración con Menú Contextual: Explora opciones para agregar esta funcionalidad al menú contextual del navegador para un acceso más fácil.
🎉 Ready to Use! / ¡Listo para Usar!
Easily open and copy audio links from Newgrounds with just one click!
¡Abre y copia fácilmente enlaces de audio de Newgrounds con solo un clic!
🎨 🚀 ✨ 💫 🌟
Author: YouTubeDrawaria | Version: 2025-08-25 | License: MIT
Support: Report issues in the comments below | Additional Info: Streamlines access to audio files on Newgrounds by opening and copying links.