WEBMANIFEST ファイル形式とは?
.webmanifestファイルは「Web Application Manifest」であり、ブラウザがProgressive Web App(PWA)をインストールして表示するために読み取るJSONドキュメントです。アプリを記述する単一のJSONオブジェクトを保持しており、そのメンバにはname、short_name、icons、start_url、scope、display、background_color、theme_colorなどがあります。PWAをスマートフォンのホーム画面やデスクトップに追加すると、これらの値によってアプリのアイコン、タイトル、ウィンドウの開き方が決定されます。
この形式はW3C標準であり、2013年に最初にドラフトが作成され、2015年のChrome 45からブラウザでサポートされました。ページからはHTMLのhead内で次のようにリンクされます。
<link rel="manifest" href="/app.webmanifest">登録されているメディアタイプはapplication/manifest+jsonです。.webmanifest拡張子はIANAに登録されたものですが、多くのサイトでは依然としてファイル名をmanifest.jsonとしています。サーバーがJSONとして有効なコンテンツタイプを送信する限り、どちらも機能します。
セキュリティと安全性
リスク: LOWA .webmanifest file is plain-text JSON with no executable code, so opening it cannot run anything on your machine. The only practical risk is that a manifest can declare protocol_handlers or file_handlers that register a PWA to handle links or file types once the app is installed, which is a browser-mediated permission, not an action of opening the file. Editing an invalid manifest can break PWA installation but poses no security threat.
形式の詳細
概要- Firefox WebExtension manifest - Browser extensions use a manifest file, but it is named manifest.json with a .json extension, not .webmanifest.
- Java JAR/app manifests - Unrelated MANIFEST.MF metadata inside Java archives; different format and purpose.
WEBMANIFEST ファイルを開くプログラム
技術的詳細
詳細仕様| Encoding | UTF-8 text |
| Byte order | Not applicable (text) |
| Container | JSON object with top-level keys called members |
| Compression | None (may be gzip/brotli compressed in transit by the web server) |
| Typical size | Under 5 KB |
| Structure | A single JSON object whose members describe a web application: name, short_name, description, icons (array of image objects with src, sizes, type), start_url, scope, display, orientation, background_color, theme_color, categories, screenshots, shortcuts, share_target, protocol_handlers, and file_handlers. |
| Integrity | None built in; integrity relies on HTTPS transport and same-origin/CORS fetch rules |
| Platforms | Windows, macOS, Linux, Android, iOS, ChromeOS |
| Notes | Referenced from a page's HTML head via <link rel="manifest" href="app.webmanifest">. The browser reads it to install a Progressive Web App, set the home-screen icon and name, and control the launch display mode. Servers should return it with the application/manifest+json media type, though browsers also accept application/json. When the manifest is on a different origin than the page scope it must be fetched with CORS. |
| リリース日 | 2013 (first W3C Working Draft, December 17, 2013) |
| 最新バージョン | W3C Working Draft (ongoing) |
| オープンスタンダード | はい · ロイヤリティフリー |
| 仕様書 | www.w3.org |
WEBMANIFEST の変換
コミュニティ Q&A
ユーザーからの質問まだ質問はありません。WEBMANIFEST ファイルについて最初の質問をしてみましょう。
よくある質問
.webmanifestファイルはどうやって開きますか?
.webmanifestはmanifest.jsonと同じですか?
.webmanifestはIANAに登録された拡張子であり、manifest.jsonは一般的な代替名です。サーバーがJSONとして有効なコンテンツタイプで提供している限り、ブラウザはどちらも受け入れます。.webmanifestファイルは何に使われますか?
PWAがインストールできないのはなぜですか?
特別なMIMEタイプで提供する必要がありますか?
application/manifest+jsonですが、ブラウザはapplication/jsonも受け入れます。正しいタイプで提供することでコンソールの警告を回避でき、ベストプラクティスとされています。