Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

285
Visualizações
Custom font won't be used on chromebook but works fine in (mac) chrome

Got this little project where I inject a weather widget into google calendar. I wish to use a google font with the widget. My attempt with an npm package (previous commits) worked fine in chrome (on a mac), but not on the chromebook tablet that I want to use it on.

I then changed tactic to inject a link tag like this

console.log('Weather widget extension for google calendar executing')

document.addEventListener('DOMContentLoaded', function(event) {
  console.log({ event })

  const linkElement = document.createElement('link')
  linkElement.rel = 'stylesheet'
  linkElement.href = 'https://fonts.googleapis.com/css?family=Gemunu+Libre'
  document.head.appendChild(linkElement)
  console.log({ linkElement })

  const mainDiv = document.createElement('div')
  mainDiv.className = 'weather-widget__main'
  mainDiv.setAttribute(
    'style',
    `position: absolute;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  background: linear-gradient(145deg, #024acf0a, #0721d74f);
  opacity: 70%;
  padding: 10px;
  border: 1px solid #0721d74f;
  box-shadow: 0px 0px 10px #0721d74f;
  border-radius: 10px;
  font-family: Gemunu Libre, Roboto;
`
  )
  document.body.appendChild(mainDiv)
...

this also works in chrome but not on the chromebook?


Not that it is relevant but I'm writing it in typescript and using vite with a plugin to build it. If you want to use it you have make a .env file

.env

VITE_API_KEY=<your openweathermap api key>
VITE_LAT=<your lattitude>
VITE_LON=<your longitude>

run yarn build and load the dist folder as a local extension in chrome.

Solution

Setting the custom font by inline styling in each block seem to do the trick 👍

(Doing font-family: inherit; did not work)

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda