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

180
Visualizações
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 Respostas
Responde à pergunta

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 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