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

106
Visualizações
Chrome extension local file overwriting

How to (If possible) make a function inside a chrome extension that rewrites a file?

Files in directory : manifest.json background.js ls.txt (background.js obviously always running when chrome is open, in the background)

Example: a function that writes text to a file when the user makes any request

chrome.webRequest.onBeforeRequest.addListener(details => {
   const anytext = "anytext"
   const filedir = "ls.txt"
   //how do I delete everything from ls.txt and write "anytext" to ls.txt, simply, how do I overwrite ls.txt?
},{ urls: ["<all_urls>"] },['requestBody']);

Boring backstory: I've tried looking for this online, but every result either shows me how to download a file or how to read it, maybe there is no way to modify a file? But then how do I save personal configurations between computer reboots if I can't save them to local files? And for anyone asking, this is definitely not why I'm making the plugin, I used this code as an example and not to make a plugin that writes text to a file every time a user makes a request.

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