Visualforce is pretty much in maintenance mode, and has been since Spring 14, with the only real updates being published either security updates or Lightning compatibility. This includes the ability to have a way to resize a page dynamically within any container. It doesn't work in Classic view (this was broken when Visualforce moved to its own sub-domain, and subsequently reinforced when pages stopped automatically loading custom scripts in custom buttons), and it doesn't work in Lightning (again, by design for security purposes). There is an idea you should go vote on to be notified when/if such a feature is ever released. Its current status is "UNDER CONSIDERATION," which means that there's at least a slim possibility that this will see the light of day at some point.
Of all of the really nifty hacks that were created, including custom JS buttons, sidebar hacks, script injections, etc, the only viable option that remains is probably using a custom Visualforce page and using apex:detail (this should continue to work for the foreseeable future, as this is not a cross-domain request). The UI is fairly well locked down compared to prior iterations, so using a full Visualforce page would probably be the most reliable method.