Created
July 2, 2025 14:25
-
-
Save Tcip/3a12f1e71a0c8b29e4ef34c8cdda6081 to your computer and use it in GitHub Desktop.
Copy Player Name and Twitch Channel to Clipboard for Embervale
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
| javascript:(function()%7B(async%20function()%20%7Bconst%20playerNameElement%20%3D%20document.querySelector(%22.character-menu-background%20span%5Bstyle%5E%3D'font-size'%5D%22)%3Bconst%20playerTwitchChannelElement%20%3D%20document.querySelector(%22.character-menu-background%20.popper%22)%3Bif%20(playerNameElement%20%26%26%20playerTwitchChannelElement)%20%7Btry%20%7Bawait%20navigator.clipboard.writeText(%60%24%7BplayerNameElement.textContent.trim()%7D%20-%20%24%7BplayerTwitchChannelElement.textContent.trim()%7D%60)%3B%7D%20catch%20(error)%20%7Bconsole.error(%22Error%20copying%20text%20to%20clipboard%3A%22%2C%20error)%3B%7D%7D%20else%20%7Bconsole.error(%22One%20or%20more%20required%20elements%20not%20found%22)%3B%7D%7D())%7D)() |
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
| (async function() { | |
| const playerNameElement = document.querySelector(".character-menu-background span[style^='font-size']"); | |
| const playerTwitchChannelElement = document.querySelector(".character-menu-background .popper"); | |
| if (playerNameElement && playerTwitchChannelElement) { | |
| try { | |
| await navigator.clipboard.writeText(`${playerNameElement.textContent.trim()} - ${playerTwitchChannelElement.textContent.trim()}`); | |
| } catch (error) { | |
| console.error("Error copying text to clipboard:", error); | |
| } | |
| } else { | |
| console.error("One or more required elements not found"); | |
| } | |
| }()) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy Name and Twitch Channel to Clipboard
Copies the player name and Twitch channel to the clipboard for the game Embervale
Usage
Note
can also be used on Character page if you want to copy your own name and Twitch channel