
Creating a manifest file is a straightforward process. You can do this by adding a link to the manifest file in your HTML file.
The manifest file should be in JSON format. This is a requirement for the browser to recognize it as a manifest file.
A manifest file can be used to declare the scope of a web application, including the URL of the application's home page and the URL of the application's web app manifest.
If this caught your attention, see: Python Read Html from Url
HTML Manifest Basics
To add an HTML manifest to your web application, you need to create a cache manifest file, which is a text file located on your server. This file must be served with a content type of text/cache-manifest.
The cache manifest file contains a list of resources needed for your web page to work offline, such as JavaScript and CSS files. You can reference this file in your HTML document using the manifest attribute on the html element.
For another approach, see: What Is Manifest V3
The manifest attribute is used to point to the cache manifest file, and its argument is a relative or absolute path to the file. For example, if your cache manifest file is named cache.appcache, you would use the manifest attribute like this: manifest="cache.appcache".
The scope member of the manifest file tells the browser which documents are part of your web application. This is an important consideration, as it determines which pages will be affected by the manifest. You can set the scope to a specific path, such as "/racer/", or to the root of your origin, which is represented by "/".
You might enjoy: Relative File Path Html
Scope and Start URL
The scope of your app is a crucial part of the HTML manifest, as it determines which URLs are considered part of your app. This includes all entry and exit points.
The scope attribute can be a relative path (../) or any higher level path (/) that allows for an increase in coverage of navigations in your web app. A start_url must be in the scope.
For another approach, see: Html and Css Are Both Part of a Websites
If you don't include a scope in your manifest, the default implied scope is the start URL, but with its filename, query, and fragment removed. This can lead to unexpected navigation behavior.
Here are some key facts about scope:
- Relative paths (../) can increase coverage of navigations in your web app.
- A start_url must be in the scope.
- Default implied scope is the start URL without its filename, query, and fragment if no scope is provided.
- A scope of "/" means the manifest applies to every document in an origin.
- A scope of "/racer/" means only documents within the path "/racer/" are within scope.
The start_url is a required property that tells the browser where your app should start when it launches. It should direct the user straight into your app, not a product landing page.
The start_url is relative to the path defined in the scope attribute. A start_url starting with / will always be the root of the origin.
A fresh viewpoint: How to Preview Html in Visual Studio Code
Cache and Network
The CACHE section of the HTML manifest file is where you list resources that will be cached immediately after their first download. This means they can be used even in offline mode without requiring a connection to the server.
These resources can include webpages, CSS stylesheets, JavaScript files, and images. By adding a file to the CACHE section, it will load in offline mode.
Discover more: Html No Cache
To illustrate this, let's consider an example. Create a file named cache.html and add it to the CACHE section of the demo.appcache file. This file will load in offline mode.
Here are the three section headers in the cache manifest file:
- Explicit section with the header CACHE.
- Online whitelist section with the header NETWORK.
- Fallback section with the header FALLBACK.
The NETWORK section, on the other hand, lists resources that will never be cached. This means they can't be used in offline mode and always require a connection to the server.
Cache
The CACHE section is where you list all the resources you want to cache immediately after their first download. This includes webpages, CSS stylesheets, JavaScript files, and images.
These resources can be used even in offline mode after their first download and don't require a connection to the server. For example, if you create a file named cache.html and add it to the CACHE section of the demo.appcache file, it will be cached and load in offline mode.
Discover more: How to Link Nav to Section of Page Html

The CACHE section is one of three section headers in a cache manifest file. The others are the online whitelist section with the header NETWORK and the fallback section with the header FALLBACK. Note that if no section headers are specified, the section is considered explicit by default.
Here's a quick rundown of the three section headers:
- CACHE: for caching resources
- NETWORK: for online resources
- FALLBACK: for fallback resources
The CACHE section is processed by the user agent when instructed to ignore, and it acts as if the manifest, member, or value causing the condition is absent. This helps avoid issues related to monkey patching.
Network
The Network section of the cache manifest file is where you list resources that will never be cached. These resources require a connection to the server and can't be used offline.
To ensure a file is only available in online mode, add it to the NETWORK section of the demo.appcache file. This file will not load in offline mode.
Consider reading: What Is a Section Element in Html
The NETWORK section is also known as the online whitelist section. It starts with the header NETWORK and lists resources that are never cached.
The NETWORK section has a distinct header that marks the start of this section. The resources listed under this section are not available offline, resulting in an error when an attempt is made to load the resource offline.
Here are the three section headers found in a cache manifest file:
- CACHE: - Explicit section
- NEXTWORK: - Online whitelist section
- FALLBACK: - Fallback section
Note that Example 1 and Example 2 do not have a section header and are therefore considered an explicit section by default.
Web Application
A web application is essentially a web page or site that has been transformed into a native-like app experience. This is achieved through the use of a web application manifest, a JSON document that contains startup parameters and application defaults.
The manifest has an associated manifest URL, which is the URL from which the manifest was fetched. It can have various optional members at its root, including background_color, dir, display, icons, id, lang, name, orientation, scope, short_name, shortcuts, start_url, and theme_color.
A processed manifest is applied to a top-level browsing context, affecting the presentation and/or behavior of the browsing context. If an application context is created as a result of navigating to a deep link, the user agent MUST immediately navigate to the deep link with historyHandling set to "replace".
You might like: How to Get Url of Image for Html
Shortcuts
Shortcuts are a way to provide quick access to key tasks within your web application. A shortcuts property is an array of app shortcut objects that can be used to achieve this.
Each member of the shortcuts array is a dictionary that contains at least a name and a URL. This allows users to access specific tasks or features of your web application with ease.
For example, you could create a shortcut that takes users directly to a login page or a specific feature of your application. This can be especially useful for web applications that have multiple features or tasks to perform.
The shortcuts array can be used to customize the user experience and make your web application more user-friendly.
For your interest: Is Html Used to Create Web Pages
Display and Layout
Display and layout are crucial aspects of a web application, and the HTML manifest plays a significant role in determining how your app is presented to the user.
A display mode represents how the web application is being presented within the context of an OS, such as in fullscreen or minimal-ui. The specification defines four display modes: fullscreen, standalone, minimal-ui, and browser.
For another approach, see: Ui Core Html
The fullscreen display mode is orthogonal to the Fullscreen API Standard and affects the fullscreen state of the browser window. This means a web application can have its display mode set to fullscreen while the Fullscreen API operates on an element contained within the viewport.
A user agent will expose the actual display mode being applied, not necessarily the one declared in the manifest, via the display-mode media feature. This media feature will reflect other display modes for a web page when a manifest is not being applied, such as when the end-user puts the page into fullscreen.
The display modes list is the list « "fullscreen", "standalone", "minimal-ui", "browser" ».
Suggestion: Html Social Media Buttons
Icons
Icons are a crucial part of making your Progressive Web App (PWA) look great on mobile devices. You can define a set of icons for the browser to use on the home screen, app launcher, task switcher, splash screen, and in other places.
Recommended read: How to Add Icons in Html

To create these icons, you'll need to provide an array of image objects in your PWA's manifest. Each object must include the src, a sizes property, and the type of image. To use maskable icons, also known as adaptive icons on Android, add "purpose": "any maskable" to the icon property.
For Chromium, you must provide at least a 192x192 pixel icon and a 512x512 pixel icon. Chrome will automatically scale the icons to fit the device, but if you want more control over the scaling, you can provide icons in increments of 48dp.
Providing additional icons can help create a better match for different device resolutions. For example, providing 192px and 512px icons is sufficient for most cases, but you can provide more icons for a better match.
A fresh viewpoint: Html Class Property
Display Modes
Display modes are a key aspect of how a web application is presented within an operating system. A display mode represents how the web application is being presented, such as in fullscreen or with a minimal UI.
Worth a look: Html Application
There are several display modes defined in this specification, including fullscreen, standalone, minimal-ui, and browser. Each display mode has a fallback chain, which is a list of display modes that can be used if the first choice is not supported.
The fallback chain for each display mode is as follows:
- browser: «»
- minimal-ui: « "browser" »
- standalone: « "minimal-ui", "browser" »
- fullscreen: « "standalone", "minimal-ui", "browser" »
The user agent will use the browser display mode as the default display mode if the display member is missing or if there is no valid display member.
See what others are reading: B Tag Html
Security and Privacy
The HTML manifest file can be used to specify the cacheability of resources, which can help improve security by preventing malicious scripts from accessing sensitive data.
This is done by setting the cache mode to "no-cache" or "no-store" in the manifest file, which prevents resources from being cached.
By doing so, you can prevent attackers from accessing sensitive data by exploiting vulnerabilities in cached resources.
The manifest file can also be used to specify the origin of resources, which can help improve privacy by preventing third-party scripts from accessing sensitive data.
Intriguing read: Html Cache Control
This is done by setting the "origin" attribute in the manifest file, which specifies the domain from which resources can be loaded.
By doing so, you can prevent third-party scripts from accessing sensitive data and improve the overall security and privacy of your application.
The manifest file can also be used to specify the cache expiration time, which can help improve security by preventing stale resources from being cached.
This is done by setting the "cache-expiration" attribute in the manifest file, which specifies the time after which cached resources expire.
By doing so, you can prevent stale resources from being cached and improve the overall security and privacy of your application.
You might enjoy: Html Prevent Copy Paste
Advanced Topics
The HTML manifest file is a powerful tool for controlling how your web app behaves offline. It's essentially a list of files that your app needs to function properly.
You can specify the manifest file in the HTML document's head section using the link element. This is done by adding the rel attribute with the value "manifest" and the href attribute with the path to the manifest file.
The manifest file can be used to specify the network state, such as whether the app is online or offline. This is done by adding a network section to the manifest file with the online and offline attributes.
The manifest file can also be used to specify the scope of the app, which is the directory where the app files are located. This is done by adding a scope attribute to the manifest file with the path to the app directory.
The applicationCache section of the manifest file can be used to specify the files that should be cached by the browser. This allows the app to function offline even when the network is not available.
The manifest file can be used to specify the default language of the app, which is useful for internationalization. This is done by adding a lang attribute to the manifest file with the language code.
The manifest file can also be used to specify the start URL of the app, which is the URL that the app should load when it's launched. This is done by adding a start_url attribute to the manifest file with the URL of the start page.
You might like: How to Start Coding in Html
Use Cases and Requirements
The HTML manifest is a powerful tool for creating installable web apps. It helps developers define the scope of their app, including the files and pages that make up the app.
This document attempts to address the Use Cases and Requirements for Installable Web Apps. The HTML manifest is designed to provide a clear and concise way to define the app's requirements.
The manifest file is a simple text file that contains metadata about the app, such as its name, description, and icons. The manifest file is used to define the app's requirements, including the files and pages that make up the app.
The HTML manifest is particularly useful for web apps that need to be installed on a user's device, such as progressive web apps.
Curious to learn more? Check out: How to Create Multiple Web Pages in Html
Application Information
The Web Application Manifest provides additional metadata related to how the web application may be presented in the context of a digital storefront, installation dialog, or other surfaces where the web application may be marketed or distributed.
Several members of the Web Application Manifest have been moved into Web App Manifest - Application Information, including categories, description, iarc_rating_id, and screenshots. These members are designed to support the presentation of web applications in digital storefronts and other marketing surfaces.
The categories member allows you to specify the categories that your web application belongs to, which can help users find and discover your application.
The description member provides a short summary of your web application, which can be displayed in digital storefronts and other marketing surfaces.
The iarc_rating_id member is used to specify the International Age Rating Coalition (IARC) rating ID for your web application, which can be displayed in digital storefronts and other marketing surfaces.
The screenshots member allows you to specify the screenshots of your web application, which can be displayed in digital storefronts and other marketing surfaces.
Here are the members of Web App Manifest - Application Information:
- categories
- description
- iarc_rating_id
- screenshots
Fallback and Error Handling
The fallback section in a cache manifest file is a powerful tool for handling online resources that can't be cached or were not cached successfully.
This section allows you to substitute online resources with a local fallback, ensuring your application remains usable even when the network is down.
In fact, a single line in the fallback section can match any URL pattern on your site, making it a versatile solution for error handling.
For example, a fallback section like / /offline.html will display the offline.html page if the browser can't find the page in the appcache.
This approach can help prevent frustrating errors and keep your users engaged, even in offline mode.
Discover more: Html Fallback Images
Featured Images: pexels.com

