PWA Manifest and Service Worker Generator

Turn a website into an installable Progressive Web App: manifest fields, generated icons, per-route caching strategies, offline page and install button code.

ทำงานในเบราว์เซอร์ของคุณ ไฟล์ไม่ออกจากอุปกรณ์ ดูวิธีตรวจสอบ

…

วิธีทำ

  1. 1
    Describe the app

    In App details fill name, short name, start URL, display and colours.

  2. 2
    Create icons

    In Icons upload a logo or use a letter and check the maskable previews.

  3. 3
    Plan caching

    In Caching list precache files and set a strategy for each route.

  4. 4
    Design the offline page

    Write the title and message in Offline page and check the preview.

  5. 5
    Review the code

    Read sw.js, register.js, head tags and the install button in Code.

  6. 6
    Download

    Fix blockers in Checklist, then press Download ZIP and copy the files to your site.

เกี่ยวกับเครื่องมือนี้

A Progressive Web App can be installed from the browser, opens in its own window and keeps working when the connection drops. Two files make that possible: a web app manifest that describes the app, and a service worker that decides what to cache. Both are easy to get subtly wrong, for example a start_url outside the scope, icons without a maskable version that look cropped on Android, or a cache-first rule on HTML that keeps users on an old version forever. This generator builds the manifest from a form with an install-dialog preview, draws a full icon set from your logo including maskable icons inside the safe zone, and writes a readable service worker without libraries. You pick a caching strategy per route: cache first, network first with a timeout, stale while revalidate, network only or cache only, with entry limits and maximum ages. Versioned caches, navigation preload, an offline page and an update prompt are switches.

Who this is for

Web developers adding offline support to a site or web app, agencies delivering installable dashboards, and learners who want to understand service workers by reading generated code.

App details

Name and short name (12 characters or fewer show fully on home screens), start URL, scope, app id, display mode with display_override options such as window-controls-overlay and tabbed, orientation, language, text direction, theme and background colours, categories, shortcuts for the long-press menu, and screenshots for the richer install dialog. A preview shows the install card and splash screen.

Icons

Upload a logo (transparent PNG or SVG works best) or use a letter. The ZIP contains 10 standard sizes from 48 to 512 pixels on the theme colour, and maskable 192 and 512 pixel icons with the logo scaled into the central 80 % safe zone. Circle and squircle previews show how Android masks them.

Caching

Precache lists the files stored at install. Runtime routes match by request type (image, font, script, style, document and more), path prefix, other origin or regular expression, and each route chooses a strategy, a cache name, maximum entries, maximum age in days and, for network first, a timeout in seconds. The first matching route wins; reorder with the arrow. Cache names include a version, and old caches are deleted when a new worker activates. Navigation preload speeds up page loads with network-first navigation. Choose between activating updates immediately or asking users to reload.

Offline page and code

The offline page uses your colours and reloads itself when the connection returns. The Code tab shows manifest.webmanifest, sw.js, register.js, head tags (including Apple touch icon tags) and an install button that uses the beforeinstallprompt event, each ready to copy.

Checklist

Blockers and advice: missing name, display modes that prevent installation, start_url outside scope, missing id or offline page, cache-first on documents, and the HTTPS requirement.

Worked example

Field Notes precaches 4 files, caches images cache-first for 30 days with 60 entries, fonts for a year, scripts and styles stale-while-revalidate, and /api/ network-first with a 4-second timeout. Offline, a visit to /api/notes returns the last cached response and an uncached page shows offline.html; after deploying, changing VERSION from v1 to v2 removes the v1 caches.

Limits

The generated worker covers common needs without Workbox; background sync, push notifications and periodic sync need extra code. Max age uses the response Date header, so responses without one are kept until the entry limit removes them. iOS Safari supports installation through Share and Add to Home Screen but has no beforeinstallprompt event.

ตัวอย่างพร้อมวิธีทำ

Images cache-first 30 days, /api/ network-first with 4 s timeout, offline.html fallback; bumping VERSION v1 → v2 clears old caches.

สรุปสั้น ๆ

คำถามที่พบบ่อย

Where do I put sw.js?

At the root of your site so its scope covers every page; a worker in /js/ only controls URLs under /js/.

Which strategy should I use for HTML pages?

Network first, so visitors get fresh pages online and the cached copy or offline page when the connection fails.

What is a maskable icon?

An icon whose important part sits inside a central circle of 80 % so Android can crop it to circles or squircles without cutting the logo.

How do users get updates?

Change VERSION when you deploy. With the update prompt the page asks the waiting worker to take over; with skipWaiting it activates at once.

Why does Chrome not show the install button?

Check the checklist: HTTPS, a linked manifest with name and icons, display standalone or similar, and a registered service worker.

Are my logo and settings uploaded?

No. Icons are drawn with canvas in your browser and the ZIP is created locally.

ฟรีทั้งหมดไม่มีค่าใช้จ่าย ไม่ต้องสมัคร
ไฟล์เป็นส่วนตัวทุกอย่างทำงานในเบราว์เซอร์ของคุณ
ใช้ง่ายในภาษาของคุณมีหลายภาษา