As discovered by Maja when reviewing https://phabricator.services.mozilla.com/D53827#inline-325101 we should probably not use those events given that they are used for bfcache.
Instead 'unload' and 'load' seem to be the right choices.
But if it turns out that we have to use a webprogress listener as discussed on bug 1597762, the code in question here would require a huge refactoring.
We can fix this now, as explained in https://bugzilla.mozilla.org/show_bug.cgi?id=1612174#c12
In the browser chrome test environment, I see load, pageshow and pagehide reliably, but I only see unload under very narrow circumstances. I'll elaborate further when I dig in more, just want to make note of it for now.