[Browsing history] Remove 'beforeunload' to enable caching and prevent duplicate entries