0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

EmbyのPWA不具合修正

Last updated at Posted at 2020-01-15

自宅メディアを活用するためにEmbyを始動したが、設定に不具合があってPWAとして使えなかったので、修正メモ。@ CentOS 7
とりあえず動くようにしただけなので、仕様とか原理とかはまた今度詰める。

配信ファイルの場所

/opt/emby-server/system/dashboard-ui

manifest.json

Chromeの開発者ツールのエラーメッセージによると、related_applicationsの要素にはurlまたはidが必須らしい。

/opt/emby-server/system/dashboard-ui/manifest.json
  "related_applications": [
    {
      "platform": "android",
-     "location": "https://play.google.com/store/apps/details?id=com.mb.android"
+     "url": "https://play.google.com/store/apps/details?id=com.mb.android"
    },
    {
      "platform": "ios",
-     "location": "https://itunes.apple.com/us/app/emby/id992180193?ls=1&mt=8"
+     "url": "https://itunes.apple.com/us/app/emby/id992180193?ls=1&mt=8"
    },
    {
      "platform": "web",
+     "id": "emby"
    }
  ],

serviceworker

サービスワーカーの箇所でdoes not work offlineとエラーメッセージが出ていた。
インストール時の処理としてself.addEventListener('fetch', function(event) {});と書いてやればいいっぽい。
参考:【PWA】「ホーム画面に追加」の「Site cannot be installed: the page does not work offline」エラー対策

serviceworker.jsを見ると、bower_components/emby-webcomponents/serviceworker/にあるnotifications.jssync.jsを読み込んでいるよう。
notifications.jsはいろいろ書いてあって面倒そうだったから、sync.jsに追記しよう。

/opt/emby-server/system/dashboard-ui/bower_components/emby-webcomponents/serviceworker/sync.js
  self.addEventListener("sync",function(event){"use strict";event.tag});
+ self.addEventListener('fetch', function(event) {});

以上の修正でエラーが消え、無事PWAとして端末にインストールできた。
めでたしめでたし。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?