Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

288
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda