(On behalf of AmitayDobo) Storing a weak reference to the current frame to
be able to restore it without switching to the top in the case of "lost
DOM". Fixes issue 4876