Skip to content

Instantly share code, notes, and snippets.

@drskullster
Created March 29, 2024 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drskullster/141a178c4947a28e2c5d6df30e12f5ac to your computer and use it in GitHub Desktop.
Save drskullster/141a178c4947a28e2c5d6df30e12f5ac to your computer and use it in GitHub Desktop.
Open any balenaCloud device UUID found in the currently selected text
javascript: (() => {
const selectedText = getSelection().toString();
if (selectedText) {
const UUIDs = selectedText
.split(/[\s,]+/)
.filter((UUID) => UUID.match(/[a-zA-Z0-9]{32}/));
if (UUIDs.length) {
UUIDs.map((UUID) => open(`https://dashboard.balena-cloud.com/devices/${UUID}`, '_blank'));
} else {
alert('No device UUID found');
}
} else {
alert('Select at least one device UUID');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment