Skip to content

Instantly share code, notes, and snippets.

@ruisilva450
Last active July 28, 2025 11:55
Show Gist options
  • Select an option

  • Save ruisilva450/de0329ea7ea62c1684d2e887d4093b79 to your computer and use it in GitHub Desktop.

Select an option

Save ruisilva450/de0329ea7ea62c1684d2e887d4093b79 to your computer and use it in GitHub Desktop.
Arc Boost Github Shortcuts
// This is a script that will load shortcuts into the top right corner of the screen
// To use it you need to add this code on the js panel of the Arc Boost
const loadShortcuts = () => {
// Edit this to include your own shortcuts replacing {org} and {repo}
const shortcuts = ["https://github.com/{org}/{repo}"];
const divContents = (shortcuts) => `
<div
tabindex="0"
aria-label="Shortcuts"
style="
background-color: var(--bgColor-inset);
font-family: var(
--fontStack-sansSerif,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
'Noto Sans',
Helvetica,
Arial,
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji'
);
margin-bottom: -8px;
z-index: 1;
position: relative;
"
>
<style>
.shortcut-link {
display: flex;
align-items: center;
text-decoration: none;
cursor: pointer;
border-radius: 4px;
color: #d1d7e0;
padding: 0 8px;
transition: background-color 0.2s ease;
}
.shortcut-link:hover {
background-color: var(--bgColor-default, var(--color-canvas-default));
}
.shortcut-link span {
font-size: var(--body-font-size, 14px);
}
</style>
<div style="display: flex; flex-direction: row; align-items: center;">
${shortcuts.map((shortcut) => {
const name = shortcut
.split("/")
.pop()
.split("-")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ");
return `
<a
href="${shortcut}"
tabindex="0"
aria-label="Go to ${name}"
title="Go to ${name}"
class="shortcut-link"
>
<div style="flex: 1">
<span>${name}</span>
</div>
</a>
`;
}).join(`
<div style="width: 8px">•</div>
`)}
</div>
</div>
`;
const createAndInsertDiv = () => {
const newDiv = document.createElement("div");
newDiv.innerHTML = divContents(shortcuts);
newDiv.id = "miro-shortcuts-container";
newDiv.setAttribute("tabindex", "0");
newDiv.setAttribute("aria-label", "Inserted div");
const body = document.body;
if (!body) return;
const firstDiv = body.querySelector("div");
if (firstDiv) {
body.insertBefore(newDiv, firstDiv);
return;
}
body.appendChild(newDiv);
};
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", createAndInsertDiv);
} else {
createAndInsertDiv();
}
};
loadShortcuts();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment