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

179
Vistas
How to recursively fetch nested relative style sheets using JavaScript

If I am on a web page, we can get entire html source code by

document.querySelector('html')

I can also download the necessary styles by iterating over styleSheets Object like

for (var sheet= 0; sheet<document.styleSheets.length; sheet++) {

But the issue I am facing is they have recursively nested links in them , like

url("../fonts/fa-regular.woff2") format("woff2")

How can I access them and download them locally so that I can serve from my local using JavaScript?

I want to download all the css and js dependencies and serve from my server/local Can it be done? Please guide

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think the best (and right) solution would be to use Node.js

  • make fetch to get html data from the sorce
  • create regx to retriev all needed paths. collect all of them into array
  • make function to get data from paths and chek, if responce has some path inside (to fonts e.g.), call function again (recursively)
  • store data ;)

Best regards!

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