スマートフォンのブラウザから Firebase Realtime DB への接続にやたらと時間がかかる。特に重いデータ等ないはずなのに、10秒くらいかかる。PCだと問題ないのに、スマートフォンだけ遅い。Google Chrome のスマートフォン・エミュレーションでも遅いので、回線やスペックの問題ではなさそう。
よく見てみるとスマートフォンだけ以下のログがコンソール出力されていた。
iframe.js:316 [ 0.483s] [firebase-auth] Info: The current domain is not authorized for OAuth operations. This will prevent signInWithPopup, signInWithRedirect, linkWithPopup and linkWithRedirect from working. Add your domain (******.jp) to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.
Authentication 使っていないので関係ないかなと思ったものの、スマートフォンだけこれが出ているので、もしかして……と思って試しに書かれている通り設定してみたら、PCと同じ速度で接続できるようになった。
なんでやねん。