あなたの https://canape2020.stars.ne.jp/index.html をこれを index.html の <head> と <body>末尾 に入れてください。
<!-- PWA設定 -->
<link rel="manifest" href="/manifest.webmanifest">
<meta name="theme-color" content="#111827">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="Canape">
<!-- Android用アイコン -->
<link rel="icon" sizes="192x192" href="/pwa-icons/icon-192.png">
<link rel="icon" sizes="512x512" href="/pwa-icons/icon-512.png">
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker.register("/sw.js")
.then(function (reg) {
console.log("SW registered:", reg.scope);
})
.catch(function (err) {
console.log("SW registration failed:", err);
});
});
}
</script>
<base href="https://canape2020.stars.ne.jp/" target="_self">#は 削除しないでください (今回は start_url: /index.html にしているので問題なし)
| 追加したもの | 役割 |
|---|---|
| manifest | アプリとしての定義 |
| theme-color | 起動時の色 |
| icon | ホーム画面アイコン |
| serviceWorker | インストール条件クリア |
```plain text 設定 → アプリ → Chrome → ストレージ → ストレージを消去
Chromeで開く:
👉 https://canape2020.stars.ne.jp/index.html?v=9
右上︙ 👉 ホーム画面に追加 → インストール ```
#🎉 これで indexページ自体がアプリ本体 になります。