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

287
Visualizações
Double slashes at the beginning of a URL?

I'm currently working on a chrome extension that allows me to to download the fonts files that have been used on a webpage.

As I was parsing the fonts for this site I ran into a strange edge case for one of the font URLs.

For the font Freddy the @font-face rule looks like this:

@font-face {
font-family: 'Freddy';
src: url("//cdn.shopify.com/s/files/1/0548/8708/8184/t/24/assets/freddy_regular_2-webfont.woff?v=147712666987587936441646682936") format("woff") , 
  url("//cdn.shopify.com/s/files/1/0548/8708/8184/t/24/assets/Freddy_Regular_2.ttf?v=64870238297763773461646682938") format("truetype") , 
  url("//cdn.shopify.com/s/files/1/0548/8708/8184/t/24/assets/freddy_regular_2-webfont.woff2?v=66678714148373221751646682937") format("woff2"); /* Safari, Android, iOS */}

This broke my script because the double backslash makes it an invalid URL (i.e. if I type it into the browser as is it will give me an error).

So I was wondering — what's the purpose of the double slashes at the beginning of this URL? How does this actually retrieve the font if it seems to be an invalid URL?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

When referencing content on another domain, starting a URL with two slashes instead of the http or https protocol tells the browser to request the URL's content using the same protocol as the source page (to prevent mixed content).

These URLs are not meant to be typed into an address bar, which is why they appear to be an invalid URL when you try navigating directly to it.

about 4 years ago · Juan Pablo Isaza Relatório
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