Packaged Web Applications: Manifest, Lifecycle, CSP, and Migration
How legacy packaged desktop web apps are built, secured offline, and replaced after platform deprecation—with manifest, event page, and CSP rules.
This page summarises Chrome Apps documentation from Chrome for Developers. Chrome Apps (packaged apps) used Chrome-specific APIs on top of HTML, CSS, and JavaScript to deliver experiences closer to native desktop software. They are deprecated: support was removed on most platforms, with a limited exception on ChromeOS that ended in January 2025. Chrome browser and the Chrome Web Store continue to support extensions. Anyone maintaining, auditing, or migrating an old packaged app needs the manifest model, the invisible event page, stricter Content Security Policy (CSP), and the official paths to web applications or Chrome Extensions.
Packaged web apps: what they were and who still asks
Section titled “Packaged web apps: what they were and who still asks”Chrome Apps let teams ship installable desktop software with web skills. The overview positions them as using HTML5, CSS, and JavaScript to deliver an experience comparable to a native application, without maintaining separate Windows, macOS, and Linux binaries. They ran outside a normal browser tab, could target offline use, and could request permissions such as sockets, USB, or the filesystem through the Chrome Apps reference.
Today the practical questions are different: whether an old .crx or enterprise policy still references a packaged app, how its security model differs from a normal site or PWA, and how to migrate users without data loss.
manifest.json and event page: how a packaged app starts
Section titled “manifest.json and event page: how a packaged app starts”A Chrome App is structured like an extension: a manifest (manifest version 2 only), packaged assets, and a background script that implements the event page.
A Chrome App contains these components: The manifest tells Chrome about your app, what it is, how to launch it and the extra permissions that it requires. The background script is used to create the event page responsible for managing the app life cycle.
— Chrome, Create Your First App
All apps must have an event page. This page contains the top-level logic of the application with none of its own UI and is responsible for creating the windows for all other app pages.
— Chrome, Chrome App Lifecycle
The manifest registers the background scripts under app.background.scripts. The event page must handle launch:
{ "name": "Hello World!", "description": "My first Chrome App.", "version": "0.1", "manifest_version": 2, "app": { "background": { "scripts": ["background.js"] } }, "icons": { "16": "calculator-16.png", "128": "calculator-128.png" }}chrome.app.runtime.onLaunched.addListener(function () { chrome.app.window.create('window.html', { outerBounds: { width: 400, height: 500 } });});Use chrome.app.runtime for installation, event-page control, and shutdown; use chrome.app.window to open UI windows that are not tied to browser tabs. Assign a stable window id if you need size and position restored after restart (Chrome App Lifecycle).
Local load and debug during development
Section titled “Local load and debug during development”For iteration, Chrome accepts command-line flags documented in Create Your First App: --load-and-launch-app=/path/to/app/ installs an unpacked app and launches it, reloading if already running; --app-id=… launches an already-loaded app with updated content.
The codelab basics step shows loading as an unpacked extension, using Launch, Reload App, Inspect Element on the window, and Inspect Background Page for the event page—where alarms and notifications run.
App container and lifecycle: startup, windows, and termination
Section titled “App container and lifecycle: startup, windows, and termination”The architecture guide separates the app container (no omnibox, main document from a local package—forcing minimal offline capability) from the programming model (lifecycle independent of browser tabs).
| Stage | Summary |
|---|---|
| Installation | User installs and accepts permissions |
| Startup | Event page loads, launch fires, windows open |
| Termination | User or runtime can stop the app; persist state to avoid loss |
| Update | Code cannot change mid startup/termination cycle |
| Uninstallation | No executing code or private data left behind |
The app runtime and event page are responsible for managing the app lifecycle. The app runtime manages app installation, controls the event page, and can shutdown the app at anytime. The event page listens out for events from the app runtime and manages what gets launched and how.
— Chrome, Chrome App Lifecycle
Background work such as chrome.alarms can run when the UI window is closed; on non-ChromeOS platforms, alarms stop if all Chrome instances exit (Step 3: Add Alarms and Notifications).
Content Security Policy: why local scripts and blob URLs matter
Section titled “Content Security Policy: why local scripts and blob URLs matter”Chrome App CSP is stricter than typical site CSP (Content Security Policy).
All JavaScript and all resources should be local (everything gets packaged in your Chrome App).
— Chrome, Content Security Policy
You can fetch remote resources via XMLHttpRequest and serve them via blob:, data:, or filesystem: URLs (see Referencing external resources). Video and audio can be loaded from remote services because they have good fallback behavior when offline or under spotty connectivity.
— Chrome, Content Security Policy
Common CSP fixes when porting a normal web app
Section titled “Common CSP fixes when porting a normal web app”The import web app codelab treats inline script (including onclick attributes) as the usual failure mode: move logic into separate .js files.
Remote images in the DOM trigger CSP errors; the AngularJS sample and Step 5: Add Images From the Web fetch with XMLHttpRequest, use responseType: 'blob', then assign URL.createObjectURL() to img.src. Cache on the HTML5 Filesystem or revoke object URLs when discarding thumbnails to limit memory growth.
For untrusted live HTML, use the webview tag (ChromeOS-focused in the reference) or a sandbox page: sandboxed pages are exempt from the Chrome App CSP but cannot call Chrome App APIs directly (Build Apps with Sencha Ext JS).
Disabled web platform features: storage and navigation work-arounds
Section titled “Disabled web platform features: storage and navigation work-arounds”Disabled Web Features lists APIs removed or restricted in the app container. Highlights for migrations:
| Disabled | Work-around |
|---|---|
localStorage |
IndexedDB, Storage API, or chrome.storage |
document.cookie |
Not needed for packaged pages |
window.location / in-app navigation |
Links open the system browser |
Inline javascript: URLs |
Click handlers in script files |
| Synchronous XHR | Async XHR only |
| External resources in DOM | webview, or XHR + blob/data/filesystem URLs |
alert / confirm |
Custom UI |
Chrome Apps do not support localStorage as localStorage is synchronous. Synchronous access to blocking resources (I/O) in a single-threaded runtime could make your app unresponsive.
— Chrome, Step 2: Import an Existing Web App
Replace localStorage with asynchronous chrome.storage.local (set, get, callbacks, and .bind(this) on callbacks). UI code must tolerate async reads—wrap counts and filters in callbacks to avoid stale UI.
Sandbox pages in manifest.json isolate third-party framework code while the event page keeps privileged APIs (for example socket permissions).
Offline-first behavior and offline_enabled
Section titled “Offline-first behavior and offline_enabled”Offline First recommends designing as if there is no network, then adding online features. Packaged assets are already local; apps should save fetched network data locally (Storage, IndexedDB, Filesystem), separate UI from data (often via MVC Architecture), and assume the runtime can close the app at any time.
The offline_enabled manifest field signals whether the app should work offline (default true unless webview permission is requested). On ChromeOS kiosk launch, non–offline-enabled apps may wait for connectivity before starting.
Storage APIs overview: small key-value data via Chrome Storage; structured data via IndexedDB; binary and large files via Filesystem and Sync File System (app-specific sync to Google Drive—not arbitrary Drive documents).
Kiosk packaged apps on managed ChromeOS devices
Section titled “Kiosk packaged apps on managed ChromeOS devices”Kiosk Apps are Chrome Apps for Single App Kiosk Mode: fullscreen, no escape to other tasks unless the app provides logout/exit. Set kiosk_enabled and optionally kiosk_only in the manifest; inspect launchData.isKioskSession from onLaunched. Kiosk apps cannot use Chrome Web Store payments—payment logic must be in-app.
Store policies and migration paths
Section titled “Store policies and migration paths”Program Policies for packaged apps require real platform value (not a thin website wrapper), clear offline messaging, and automatic recovery when connectivity returns. They must not require a local executable beyond Chrome, embed others’ sites in a WebView without ownership, or download executable script outside a sandbox.
Transition from Chrome Apps states the primary replacement paths:
There are two primary options to migrate from Chrome Apps: web applications and Chrome Extensions: Web applications are the preferred path in most cases.
— Chrome, Transition from Chrome Apps
Web apps gain portability, standard APIs (Web Bluetooth, File System Access, Background Sync, Persistent Storage, etc.), and instant updates. Extensions fit background work or browser-integrated UI. Google documents installReplacementWebApp() (Chrome 75+) and enterprise policy moves from ExtensionInstallForcelist to WebAppInstallForceList.
Native Client in apps is also deprecated; WebAssembly is the documented successor.
Common mistakes when reading old Chrome Apps docs
Section titled “Common mistakes when reading old Chrome Apps docs”- Treating codelab steps as current platform guidance without reading the deprecation banner on every page.
- Using
localStorageor inline handlers and misdiagnosing failures as “Chrome bugs” instead of CSP or disabled APIs. - Pointing
img srcat HTTPS URLs instead of XHR + blob/filesystem patterns. - Assuming alarms or background logic survive full browser quit on desktop (ChromeOS behavior differs).
- Building new kiosk or enterprise flows on Chrome Apps instead of planning migration and admin policy updates.
How to check this on your site
Section titled “How to check this on your site”-
Confirm platform status: read Apps and Transition from Chrome Apps so you know whether the packaged app still has a supported runtime in your environment (consumer desktop vs managed ChromeOS).
-
Validate structure: open
manifest.jsonagainst Create Your First App—manifest_version: 2,app.background.scripts, and anonLaunchedhandler that callschrome.app.window.createas in Chrome App Lifecycle. -
Run CSP and API compliance: load the unpacked app, open DevTools on the window and Inspect Background Page, and fix inline-script and
localStorageerrors per Step 2: Import an Existing Web App and Disabled Web Features. -
Exercise offline behavior: follow the scenarios in Offline First (first launch offline, reinstall, intermittent connectivity) and set
offline_enabledappropriately per Manifest - Offline Enabled. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you want checked or corrected.