Skip to content

Instantly share code, notes, and snippets.

@aditya-r-m
Last active July 24, 2025 13:52
Show Gist options
  • Select an option

  • Save aditya-r-m/07fe76b7760017d7c7acfebb8a29fa12 to your computer and use it in GitHub Desktop.

Select an option

Save aditya-r-m/07fe76b7760017d7c7acfebb8a29fa12 to your computer and use it in GitHub Desktop.
Small Chrome extension to add fonts to webpages, useful for Chromebook native browser applications where installing system-wide fonts is not possible.

The sample code can be used to add ligatures to Google colab on ChromeOS using fonts such as JetBrains Mono & Fira Code. The unpacked extension can be loaded by following the official developer guide.

{
"name": "Font Loader",
"description": "Adds CSS fonts to webpage",
"version": "1.0",
"manifest_version": 3,
"content_scripts": [
{
"js": ["script.js"],
"matches": ["https://colab.research.google.com/*"]
}
]
}
document.head.innerHTML += `
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap" rel="stylesheet">
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment