Firefox double disconnect liveview

It seems like on my machine (OSX) using firefox, whenever I navigate away from a liveview page to a plain old link, the browser disconnect the liveSocket and connect again immediately, then finally disconnect for good. This double disconnect behavior is not observed on Chrome or Safari on the same machine. It seems like the liveview has an overly eager reconnect mechanism that will misfire on Firefox. Has anyone seen anything like this? I want to debug further but I don’t know how.

On firefox, if I enable debug on liveview, there will be messages like:

phx-FrpdJOzQInOxDgJk error: view crashed - undefined [phoenix_live_view.v0.16.4.js:143:13]

On the console when I click a regular link. No such message in Safari or Chrome. It seems to me that on Firefox, the websocket is cut earlier by the browser, when the liveview client is still running. And the client would try to reconnect, only to be blown away again when the navigation finally happen.

I want to add a small delay on the liveview reconnect logic special cased on Firefox, however, I still have not find such a place.