Last active
August 7, 2025 05:12
-
-
Save Davis-3450/804f8622e0f71a307edabfe60e64a257 to your computer and use it in GitHub Desktop.
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
| // 1) Abre el diálogo de compartir | |
| const openBtn = document.querySelector('div[role="button"][aria-label="Send this to friends or post it on your profile."]'); | |
| if (openBtn) { | |
| const e1 = new MouseEvent('click', {bubbles: true, cancelable: true, view: window}); | |
| openBtn.dispatchEvent(e1); | |
| // 2) Espera un momento a que aparezca el botón “Share now” | |
| setTimeout(() => { | |
| const shareBtn = document.querySelector('div[role="button"][aria-label="Share now"]'); | |
| if (shareBtn) { | |
| const e2 = new MouseEvent('click', {bubbles: true, cancelable: true, view: window}); | |
| shareBtn.dispatchEvent(e2); | |
| } else { | |
| console.warn('Share now no encontrado'); | |
| } | |
| }, 500); | |
| } else { | |
| console.warn('Botón de abrir diálogo no encontrado'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment