Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
CSS externo no funciona desde otras fuentes en PWA

Estoy creando una PWA. En offline.html quiero agregar un estilo External CSS en lugar de Internal CSS . Me vinculo con él, pero aunque muestra el código de estado de 200 en el modo offline , no funciona.

  • serviceWorker.js
 const CACHE_NAME = 'pwa-version-1'; const urlsToCache = ['index.html', 'offline.html', 'style.offline.css', '../src/style/style.offline.css']; const self = this; // Installation service worker self.addEventListener('install', (e) => { e.waitUntil( caches.open(CACHE_NAME) .then(cache => { console.log('Cache Opened') return cache.addAll(urlsToCache) }) .catch() ) }) // Listen for request self.addEventListener('fetch', (e) => { e.respondWith( caches.match(e.request) .then(() => { return fetch(e.request) .catch(() => { return caches.match('offline.html') }) }) .catch() ) })

Nota: si 'style.offline.css', '../src/style/style.offline.css' entonces la fetch de retorno falló .

  • sin conexión.html
 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="../src/style/offline.css"> <title>Weather App</title> </head> <body> <div class="city"> <h2 class="city-name"> <span>Please go online to check the current weather.</span> </h2> </div> </body> </html>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!