Feature summary (what you would like to be able to do and where):
In T312315, this functionality was removed, because the implementation would sometimes trigger when leaving the page before the medaiinfo interface was finished loading. Additionally it was breaking forward/backward cache in some browsers.
Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
It is still good to have an "are you sure you want to leave" functionality, but it has to be implemented in a way that it is only active when an edit is actually in progress. The functionality should not be able to trigger and not occupy the onbeforeunload eventhandler, when people are NOT having an in-progress edit.
Benefits (why should this be implemented?):
See also: T55478: Add a confirmation dialog before closing the window when editing Wikidata